diff options
author | Miika Hamalainen <blender@miikah.org> | 2011-11-07 20:36:49 +0400 |
---|---|---|
committer | Miika Hamalainen <blender@miikah.org> | 2011-11-07 20:36:49 +0400 |
commit | edec46b0a6aac18f406991b9e16228d4bd848c61 (patch) | |
tree | 1240768d737c63705fdb38c9832d926ed0bcda94 | |
parent | 2ed6f077b3952123d56916980d18a379ecb3e5ac (diff) | |
parent | 4d7a9e5c055fd3903162b61fdd40fb77b2b96793 (diff) |
Merge with trunk r41625
635 files changed, 78580 insertions, 10408 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e06f39e718..43f52eff009 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,6 +202,9 @@ option(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF) option(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON) option(WITH_LZMA "Enable best LZMA compression, (used for pointcache)" ON) +# Camera/motion tracking +option(WITH_LIBMV "Enable libmv structure from motion library" ON) + # Misc 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) @@ -488,6 +491,36 @@ if(UNIX AND NOT APPLE) endif() endif() + if(WITH_BOOST) + set(BOOST "/usr" CACHE PATH "Boost Directory") + + if(NOT BOOST_CUSTOM) + set(BOOST_ROOT ${BOOST}) + set(Boost_USE_MULTITHREADED ON) + find_package(Boost 1.34 REQUIRED COMPONENTS filesystem regex system thread) + endif() + + set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS}) + set(BOOST_LIBRARIES ${Boost_LIBRARIES}) + set(BOOST_LIBPATH ${Boost_LIBRARY_DIRS}) + set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB") + endif() + + if(WITH_OPENIMAGEIO) + set(OPENIMAGEIO "/usr" CACHE PATH "OpenImageIO Directory") + + set(OPENIMAGEIO_ROOT_DIR ${OPENIMAGEIO}) + find_package(OpenImageIO REQUIRED) + + set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES} ${BOOST_LIBRARIES}) + set(OPENIMAGEIO_LIBPATH) # TODO, remove and reference the absolute path everywhere + set(OPENIMAGEIO_DEFINITIONS) + + if(NOT OPENIMAGEIO_FOUND) + set(WITH_OPENIMAGEIO OFF) + endif() + endif() + # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++") @@ -774,6 +807,28 @@ elseif(WIN32) set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}") endif() + if(WITH_BOOST) + set(BOOST ${LIBDIR}/boost) + set(BOOST_INCLUDE_DIR ${BOOST}/include) + set(BOOST_POSTFIX "vc90-mt-s-1_47.lib") + set(BOOST_DEBUG_POSTFIX "vc90-mt-sgd-1_47.lib") + set(BOOST_LIBRARIES + optimized libboost_date_time-${BOOST_POSTFIX} libboost_filesystem-${BOOST_POSTFIX} + libboost_regex-${BOOST_POSTFIX} libboost_system-${BOOST_POSTFIX} libboost_thread-${BOOST_POSTFIX} + debug libboost_date_time-${BOOST_DEBUG_POSTFIX} libboost_filesystem-${BOOST_DEBUG_POSTFIX} + libboost_regex-${BOOST_DEBUG_POSTFIX} libboost_system-${BOOST_DEBUG_POSTFIX} libboost_thread-${BOOST_DEBUG_POSTFIX}) + set(BOOST_LIBPATH ${BOOST}/lib) + set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB") + endif() + + if(WITH_OPENIMAGEIO) + set(OPENIMAGEIO ${LIBDIR}/openimageio) + set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include) + set(OPENIMAGEIO_LIBRARIES OpenImageIO) + set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib) + set(OPENIMAGEIO_DEFINITIONS) + endif() + set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib") # MSVC only, Mingw doesnt need @@ -884,6 +939,28 @@ elseif(WIN32) set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}") endif() + if(WITH_BOOST) + set(BOOST ${LIBDIR}/boost) + set(BOOST_INCLUDE_DIR ${BOOST}/include) + set(BOOST_POSTFIX "vc90-mt-s-1_46_1") + set(BOOST_DEBUG_POSTFIX "vc90-mt-sgd-1_46_1") + set(BOOST_LIBRARIES + optimized libboost_date_time-${BOOST_POSTFIX} libboost_filesystem-${BOOST_POSTFIX} + libboost_regex-${BOOST_POSTFIX} libboost_system-${BOOST_POSTFIX} libboost_thread-${BOOST_POSTFIX} + debug libboost_date_time-${BOOST_DEBUG_POSTFIX} libboost_filesystem-${BOOST_DEBUG_POSTFIX} + libboost_regex-${BOOST_DEBUG_POSTFIX} libboost_system-${BOOST_DEBUG_POSTFIX} libboost_thread-${BOOST_DEBUG_POSTFIX}) + set(BOOST_LIBPATH ${BOOST}/lib) + set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB") + endif() + + if(WITH_OPENIMAGEIO) + set(OPENIMAGEIO ${LIBDIR}/openimageio) + set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include) + set(OPENIMAGEIO_LIBRARIES OpenImageIO) + set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib) + set(OPENIMAGEIO_DEFINITIONS) + endif() + set(PLATFORM_LINKFLAGS "--stack,2097152") endif() @@ -1087,6 +1164,22 @@ elseif(APPLE) # linker needs "-weak_framework 3DconnexionClient" endif() + if(WITH_BOOST) + set(BOOST ${LIBDIR}/boost) + set(BOOST_INCLUDE_DIR ${BOOST}/include) + set(BOOST_LIBRARIES boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt) + set(BOOST_LIBPATH ${BOOST}/lib) + set(BOOST_DEFINITIONS) + endif() + + if(WITH_OPENIMAGEIO) + set(OPENIMAGEIO ${LIBDIR}/openimageio) + set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include) + set(OPENIMAGEIO_LIBRARIES OpenImageIO ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES}) + set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib ${JPEG_LIBPATH} ${PNG_LIBPATH} ${TIFF_LIBPATH} ${OPENEXR_LIBPATH} ${ZLIB_LIBPATH}) + set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD") + endif() + set(EXETYPE MACOSX_BUNDLE) set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g") diff --git a/GNUmakefile b/GNUmakefile index f6a6ee91f31..640e90de74b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -135,9 +135,6 @@ help: @echo " * package_pacman - build an arch linux pacmanpackage" @echo " * package_archive - build an archive package" @echo "" - @echo "Other Targets (not assosiated with building blender)" - @echo " * translations - update blenders translation files in po/" - @echo "" @echo "Testing Targets (not assosiated with building blender)" @echo " * test - run ctest, currently tests import/export, operator execution and that python modules load" @echo " * test_cmake - runs our own cmake file checker which detects errors in the cmake file list definitions" @@ -171,16 +168,6 @@ package_archive: # ----------------------------------------------------------------------------- -# Other Targets -# -translations: - $(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python po/update_msg.py - python3 po/update_pot.py - python3 po/update_po.py - python3 po/update_mo.py - - -# ----------------------------------------------------------------------------- # Tests # test: diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake index 6791028a888..0da28a943eb 100644 --- a/build_files/cmake/config/blender_lite.cmake +++ b/build_files/cmake/config/blender_lite.cmake @@ -13,6 +13,7 @@ set(WITH_BULLET OFF CACHE FORCE BOOL) set(WITH_CODEC_FFMPEG OFF CACHE FORCE BOOL) set(WITH_CODEC_SNDFILE OFF CACHE FORCE BOOL) set(WITH_FFTW3 OFF CACHE FORCE BOOL) +set(WITH_LIBMV OFF CACHE FORCE BOOL) set(WITH_GAMEENGINE OFF CACHE FORCE BOOL) set(WITH_IK_ITASC OFF CACHE FORCE BOOL) set(WITH_IMAGE_CINEON OFF CACHE FORCE BOOL) diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 10f89797754..c9a04f87148 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -165,6 +165,12 @@ macro(SETUP_LIBDIRS) if(WITH_IMAGE_TIFF) link_directories(${TIFF_LIBPATH}) endif() + if(WITH_BOOST) + link_directories(${BOOST_LIBPATH}) + endif() + if(WITH_OPENIMAGEIO) + link_directories(${OPENIMAGEIO_LIBPATH}) + endif() if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE) link_directories(${OPENJPEG_LIBPATH}) endif() @@ -259,6 +265,12 @@ macro(setup_liblinks if(WITH_IMAGE_TIFF) target_link_libraries(${target} ${TIFF_LIBRARY}) endif() + if(WITH_OPENIMAGEIO) + target_link_libraries(${target} ${OPENIMAGEIO_LIBRARIES}) + endif() + if(WITH_BOOST) + target_link_libraries(${target} ${BOOST_LIBRARIES}) + endif() if(WITH_IMAGE_OPENEXR) if(WIN32 AND NOT UNIX) file_list_suffix(OPENEXR_LIBRARIES_DEBUG "${OPENEXR_LIBRARIES}" "_d") @@ -618,3 +630,38 @@ macro(blender_project_hack_post) endif() endmacro() + +# pair of macros to allow libraries to be specify files to install, but to +# only install them at the end so the directories don't get cleared with +# the files in them. used by cycles to install addon. +macro(delayed_install + base + files + destination) + + foreach(f ${files}) + set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_FILES ${base}/${f}) + set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_DESTINATIONS ${destination}) + endforeach() +endmacro() + +# note this is a function instead of a macro so that ${BUILD_TYPE} in targetdir +# does not get expanded in calling but is preserved +function(delayed_do_install + targetdir) + + get_property(files GLOBAL PROPERTY DELAYED_INSTALL_FILES) + get_property(destinations GLOBAL PROPERTY DELAYED_INSTALL_DESTINATIONS) + + if(files) + list(LENGTH files n) + math(EXPR n "${n}-1") + + foreach(i RANGE ${n}) + list(GET files ${i} f) + list(GET destinations ${i} d) + install(FILES ${f} DESTINATION ${targetdir}/${d}) + endforeach() + endif() +endfunction() + diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index 44f9a4c8062..ba15f1c1c09 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -329,6 +329,10 @@ def creator(env): if env['WITH_BF_SDL']: defs.append('WITH_SDL') + if env['WITH_BF_LIBMV']: + incs.append('#/extern/libmv') + defs.append('WITH_LIBMV') + if env['WITH_BF_PYTHON']: incs.append('#/source/blender/python') defs.append('WITH_PYTHON') diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index 68054fe485e..5c78dc646bb 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -515,6 +515,8 @@ def read_opts(env, cfg, args): (BoolVariable('WITH_BF_LZO', 'Enable fast LZO pointcache compression', True)), (BoolVariable('WITH_BF_LZMA', 'Enable best LZMA pointcache compression', True)), + (BoolVariable('WITH_BF_LIBMV', 'Enable libmv structure from motion library', True)), + ('BF_X264_CONFIG', 'configuration flags for x264', ''), ('BF_XVIDCORE_CONFIG', 'configuration flags for xvidcore', ''), # (BoolVariable('WITH_BF_DOCS', 'Generate API documentation', False)), diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile index dd112ed6a48..e8fb065e7a4 100644 --- a/doc/doxygen/Doxyfile +++ b/doc/doxygen/Doxyfile @@ -44,7 +44,7 @@ PROJECT_BRIEF = # exceed 55 pixels and the maximum width should not exceed 200 pixels. # Doxygen will copy the logo to the output directory. -PROJECT_LOGO = ../../release/freedesktop/icons/48x48/blender.png +PROJECT_LOGO = ../../release/freedesktop/icons/48x48/apps/blender.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 321ebc11985..a5dd3b16860 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -63,3 +63,7 @@ endif() if(WITH_LZMA) add_subdirectory(lzma) endif() + +if(WITH_LIBMV) + add_subdirectory(libmv) +endif() diff --git a/extern/SConscript b/extern/SConscript index f363d75d068..031471a8a01 100644 --- a/extern/SConscript +++ b/extern/SConscript @@ -28,3 +28,6 @@ if env['WITH_BF_LZO']: if env['WITH_BF_LZMA']: SConscript(['lzma/SConscript']) + +if env['WITH_BF_LIBMV']: + SConscript(['libmv/SConscript']) diff --git a/extern/libmv/CMakeLists.txt b/extern/libmv/CMakeLists.txt new file mode 100644 index 00000000000..41fc39c97ac --- /dev/null +++ b/extern/libmv/CMakeLists.txt @@ -0,0 +1,210 @@ +# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# The Original Code is Copyright (C) 2011, Blender Foundation +# All rights reserved. +# +# Contributor(s): Blender Foundation, +# Sergey Sharybin +# +# ***** END GPL LICENSE BLOCK ***** + +set(INC + . + ../Eigen3 + ./third_party/ssba + ./third_party/ldl/Include + ../colamd/Include +) + +set(INC_SYS + ${PNG_INCLUDE_DIR} + ${ZLIB_INCLUDE_DIRS} +) + +set(SRC + libmv-capi.cpp + libmv/numeric/numeric.cc + libmv/numeric/poly.cc + libmv/simple_pipeline/reconstruction.cc + libmv/simple_pipeline/resect.cc + libmv/simple_pipeline/intersect.cc + libmv/simple_pipeline/initialize_reconstruction.cc + libmv/simple_pipeline/camera_intrinsics.cc + libmv/simple_pipeline/pipeline.cc + libmv/simple_pipeline/detect.cc + libmv/simple_pipeline/tracks.cc + libmv/simple_pipeline/bundle.cc + libmv/image/convolve.cc + libmv/image/array_nd.cc + libmv/tracking/pyramid_region_tracker.cc + libmv/tracking/sad.cc + libmv/tracking/trklt_region_tracker.cc + libmv/tracking/klt_region_tracker.cc + libmv/tracking/retrack_region_tracker.cc + libmv/multiview/projection.cc + libmv/multiview/conditioning.cc + libmv/multiview/fundamental.cc + libmv/multiview/euclidean_resection.cc + libmv/multiview/triangulation.cc + + third_party/ssba/Geometry/v3d_metricbundle.cpp + third_party/ssba/Math/v3d_optimization.cpp + third_party/gflags/gflags.cc + third_party/gflags/gflags_reporting.cc + third_party/gflags/gflags_completions.cc + third_party/fast/fast_9.c + third_party/fast/fast_10.c + third_party/fast/fast_11.c + third_party/fast/fast_12.c + third_party/fast/fast.c + third_party/fast/nonmax.c + third_party/ldl/Source/ldl.c + + libmv-capi.h + libmv/logging/logging.h + libmv/numeric/dogleg.h + libmv/numeric/levenberg_marquardt.h + libmv/numeric/poly.h + libmv/numeric/function_derivative.h + libmv/numeric/numeric.h + libmv/simple_pipeline/resect.h + libmv/simple_pipeline/reconstruction.h + libmv/simple_pipeline/camera_intrinsics.h + libmv/simple_pipeline/tracks.h + libmv/simple_pipeline/detect.h + libmv/simple_pipeline/pipeline.h + libmv/simple_pipeline/intersect.h + libmv/simple_pipeline/bundle.h + libmv/simple_pipeline/initialize_reconstruction.h + libmv/image/convolve.h + libmv/image/tuple.h + libmv/image/array_nd.h + libmv/image/sample.h + libmv/image/image.h + libmv/tracking/region_tracker.h + libmv/tracking/retrack_region_tracker.h + libmv/tracking/sad.h + libmv/tracking/pyramid_region_tracker.h + libmv/tracking/trklt_region_tracker.h + libmv/tracking/klt_region_tracker.h + libmv/base/id_generator.h + libmv/base/vector.h + libmv/base/scoped_ptr.h + libmv/base/vector_utils.h + libmv/multiview/nviewtriangulation.h + libmv/multiview/resection.h + libmv/multiview/euclidean_resection.h + libmv/multiview/triangulation.h + libmv/multiview/projection.h + libmv/multiview/fundamental.h + libmv/multiview/conditioning.h + + third_party/ssba/Geometry/v3d_metricbundle.h + third_party/ssba/Geometry/v3d_cameramatrix.h + third_party/ssba/Geometry/v3d_distortion.h + third_party/ssba/Math/v3d_linear_utils.h + third_party/ssba/Math/v3d_optimization.h + third_party/ssba/Math/v3d_mathutilities.h + third_party/ssba/Math/v3d_linear.h + third_party/gflags/gflags_completions.h + third_party/gflags/mutex.h + third_party/gflags/config.h + third_party/gflags/gflags.h + third_party/fast/fast.h + third_party/ldl/Include/ldl.h + third_party/msinttypes/stdint.h + third_party/msinttypes/inttypes.h +) + +IF(WIN32) + list(APPEND 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 + third_party/glog/src/windows/port.cc + + third_party/glog/src/utilities.h + third_party/glog/src/stacktrace_generic-inl.h + third_party/glog/src/stacktrace.h + third_party/glog/src/stacktrace_x86_64-inl.h + third_party/glog/src/base/googleinit.h + third_party/glog/src/base/mutex.h + third_party/glog/src/base/commandlineflags.h + third_party/glog/src/stacktrace_powerpc-inl.h + third_party/glog/src/stacktrace_x86-inl.h + third_party/glog/src/config.h + third_party/glog/src/stacktrace_libunwind-inl.h + third_party/glog/src/windows/glog/raw_logging.h + third_party/glog/src/windows/glog/vlog_is_on.h + third_party/glog/src/windows/glog/logging.h + third_party/glog/src/windows/glog/log_severity.h + third_party/glog/src/windows/port.h + third_party/glog/src/windows/config.h + ) + + list(APPEND INC + ./third_party/glog/src/windows + ./third_party/msinttypes + ) + + IF(MSVC) + set(MSVC_OFLAGS O1 O2 Ox) + foreach(FLAG ) + string(REPLACE "" "Od" CMAKE_CXX_FLAGS_RELEASE "") + string(REPLACE "" "Od" CMAKE_C_FLAGS_RELWITHDEBINFO "") + endforeach() + ENDIF(MSVC) +ELSE(WIN32) + list(APPEND SRC + third_party/glog/src/utilities.cc + third_party/glog/src/symbolize.cc + third_party/glog/src/vlog_is_on.cc + third_party/glog/src/signalhandler.cc + third_party/glog/src/logging.cc + third_party/glog/src/demangle.cc + third_party/glog/src/raw_logging.cc + + third_party/glog/src/utilities.h + third_party/glog/src/stacktrace_generic-inl.h + third_party/glog/src/config_mac.h + third_party/glog/src/stacktrace.h + third_party/glog/src/stacktrace_x86_64-inl.h + third_party/glog/src/symbolize.h + third_party/glog/src/base/googleinit.h + third_party/glog/src/base/mutex.h + third_party/glog/src/base/commandlineflags.h + third_party/glog/src/stacktrace_powerpc-inl.h + third_party/glog/src/stacktrace_x86-inl.h + third_party/glog/src/config.h + third_party/glog/src/demangle.h + third_party/glog/src/stacktrace_libunwind-inl.h + third_party/glog/src/glog/raw_logging.h + third_party/glog/src/glog/vlog_is_on.h + third_party/glog/src/glog/logging.h + third_party/glog/src/glog/log_severity.h + third_party/glog/src/config_linux.h + ) + + list(APPEND INC + ./third_party/glog/src + ) +ENDIF(WIN32) + +add_definitions(-DV3DLIB_ENABLE_SUITESPARSE -DGOOGLE_GLOG_DLL_DECL=) + +blender_add_lib(extern_libmv "${SRC}" "${INC}" "${INC_SYS}") diff --git a/extern/libmv/ChangeLog b/extern/libmv/ChangeLog new file mode 100644 index 00000000000..7e10abfead6 --- /dev/null +++ b/extern/libmv/ChangeLog @@ -0,0 +1,312 @@ +commit 531c79bf95fddaaa70707d1abcd4fdafda16bbf0 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Sat Aug 20 00:00:42 2011 +0200 + + Display warped pattern in marker preview. + +commit bb5c27e671b6f8eb56ddf490f0795d59bede591b +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Aug 19 18:37:48 2011 +0200 + + Fix CMake build. + +commit 2ac7281ff6b9545b425dd84fb03bf9c5c98b4de2 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Aug 19 17:34:45 2011 +0200 + + Avoid symbol shadowing. + +commit 2a7c3de4acc60e0433b4952f69e30528dbafe0d2 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Aug 19 17:22:47 2011 +0200 + + Better dragging behavior when hitting borders. + +commit a14eb3953c9521b2e08ff9ddd45b33ff1f8aeafb +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Aug 19 17:12:12 2011 +0200 + + Update marker preview to new affine tracking. + +commit 5299ea67043459eda147950e589c2d327a8fbced +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Aug 19 16:05:54 2011 +0200 + + sqrt takes double precision. + +commit 9f9221ce151d788c49b48f6f293ab2e2f8813978 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Aug 19 16:04:37 2011 +0200 + + MSVC compatibility: heap allocate pattern, explicit float cast. + +commit 702658d2f8616964a6eeb3743fd85e97ac7ff09d +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Aug 19 14:59:24 2011 +0200 + + Expose regularization parameters (areaPenalty and conditionPenalty) in API. + +commit 3e84ae5fbac10451d4935418f6281a90cedace11 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Aug 19 14:19:27 2011 +0200 + + Add LaplaceFilter. + Add regularization in affine SAD Tracker (keep constant area and good condition number). + UI: Better track display (+enable line antialiasing). + +commit 6d26d9a8ccc4ce009fbf253898fea8864dd5001a +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Aug 19 10:25:26 2011 +0200 + + Add optimization for integer pixel search. + Allows more agressive settings for affine coordinate descent. + +commit 70ceae81c0ab561b07e640ecb9933f0a902b57cd +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Aug 19 00:02:12 2011 +0200 + + Document coordinate descent method in affine SAD matcher. + Add heuristic to prevent high distortions. + +commit 75520f4bc4ccbb272a1b4149d3b8d05a90f7f896 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Thu Aug 18 23:14:17 2011 +0200 + + Fix affine iteration. + +commit 4e8e0aa6018e3eb2fbebdad7f1cbd6c909d26e79 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Thu Aug 18 23:03:26 2011 +0200 + + Handle rotations. + +commit 3ce41cf3c1b5c136a61d8f4c63ccae3cafbdb8da +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Thu Aug 18 22:24:47 2011 +0200 + + Slow brute-force affine diamond search implementation. + +commit 1c4acd03e030c1c50dc6fc36c419c72ea69a0713 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Thu Aug 18 20:51:43 2011 +0200 + + Fix detect.cc. + +commit ec18cc5ea9ae2e641075a847e82d0aacb8415ad8 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Thu Aug 18 17:45:37 2011 +0200 + + Compute and return Pearson product-moment correlation coefficient between reference and matched pattern. + +commit 21d4245c63a01bfc736192d55baf10983e7c9ec7 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Thu Aug 18 16:18:44 2011 +0200 + + UI and API support for affine tracking. + +commit a4876d8c40dcde615b44009c38c49e9a1b1d4698 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Wed Aug 17 20:26:01 2011 +0200 + + Hack to make sad.cc compile with MSVC on system without support for the SSE instruction set. + +commit 0de723dfce5bbe44dbd19be8cd6dd6e9b03b7924 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Wed Aug 17 20:10:46 2011 +0200 + + Fix slow path (for computers without SSE2). + Heap allocate scores in detect.cc + +commit 65a9d496f81e8b37eae39a4063957b8be9a4e6f0 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Wed Aug 17 19:25:17 2011 +0200 + + Fix compilation on OSX. + +commit d22720e618456329388d2c107422c3b371657cba +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Wed Aug 17 14:14:45 2011 +0200 + + Improve Detect and SAD Tracker API and documentation. + +commit 5d6cd4ad365b061901bad40695b51d568487a0cf +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Wed Aug 17 11:57:29 2011 +0200 + + MSVC support fixes. + +commit 50f0323173c6deebd6aaf9c126f0b51b2a79c3c1 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 16 23:21:37 2011 +0200 + + Detector can detect features similar to a given pattern. + +commit 5734cc27bbf84c2b6edcfcc1ea736798e12d5820 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 16 22:53:54 2011 +0200 + + Ensure SAD Tracker is C compatible. + Update Detect API documentation. + +commit 701c42842574064fea992f8822e3899cb9066108 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 16 21:56:42 2011 +0200 + + Remove FAST detector. + Add Moravec detector. + This detector is more suited to tracking since it try to choose patterns which are unlikely to drift by computing SAD with neighbouring patches. + It could be improved to better avoid edges. + +commit 9bdf93e13fc880c78b6f34397da673388c16040e +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 16 21:55:08 2011 +0200 + + Fix Qt Tracker GL to work with AMD drivers. + +commit 81613ee0cc94b315f333c9632b18b95d426aad05 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 16 21:54:12 2011 +0200 + + Make CameraIntrinsics (and thus Qt tracker) compilable without linking libmv. + +commit a1d9a8fa8b01ef7cf2a79b3b891633fc333fc9cf +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 16 21:24:51 2011 +0200 + + Fix SAD tracker. Pattern was transposed by affine pattern sampler. + +commit c3b794da2e7fd23f2fbdf90dbd71de0e6b3bc811 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 16 21:19:02 2011 +0200 + + Fix SAD tracker. Pattern was transposed by affine pattern sampler. + +commit a9b61bf3356f27174cdd983f562f99c3a6a2cc35 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Sun Aug 14 09:56:51 2011 +0200 + + Clarify CameraIntrinsics documentation. + Edit CameraInstrinsics test to fail. + +commit 10bdad9ad2cea2603896263cde5a5339169a9af0 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Aug 12 21:05:32 2011 +0200 + + Fix out of bound access in warp bilinear sampling. + +commit dd9a418db021a28af2c1198d5e5b9e68fe048a03 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Aug 12 19:14:36 2011 +0200 + + Fix compilation with -funsigned-char. + +commit bd1a268ede39b67f2ba4b360f6fc693419e7cd7f +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Aug 12 18:39:27 2011 +0200 + + CameraIntrinsics fixes. + +commit ae513b39fb779632f96ceff7c1e014fb8e68702a +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 9 19:38:58 2011 +0200 + + Remove stray QDebug include. + +commit 1e58f55078ce6009a885be30ae0316aec6ed8239 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 9 14:16:31 2011 +0200 + + Make API future-proof (for an eventual affine or planar tracker). + +commit c2af303e7bf0dddcb02937323ac5846b1801e6cc +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 9 11:13:29 2011 +0200 + + Remove reconstruction breaking debug code. + +commit 8792a633e5c5f1c1f12e164b9e8897ca0790ac59 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 9 10:49:18 2011 +0200 + + Remove getchar()s. + +commit 63a9bdee0cbd1197e0315d01c27bfc2361bd5656 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 9 10:35:07 2011 +0200 + + Adapt patch to new PipelineRoutines code generation strategy. + +commit 096ff1a4070f7212c50fb0a4b2feec7ca9d97158 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 9 09:54:12 2011 +0200 + + Merge max_image and max_track fix from tomato. + +commit d8450cd3c37278a397482cd36b1e2419f154cfb9 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Tue Aug 9 09:38:49 2011 +0200 + + Synchronize tree with Tomato: Merge patch for better resection, keep deprecated KLT tracker. + +commit e9b2dca920cf9575c15150a4988634b00e343a41 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Mon Aug 8 17:07:08 2011 +0200 + + Fixes, Documentation. + +commit 4fc1c57a2d92442808ac4a3676e6d9a25a51e310 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Sun Aug 7 14:35:08 2011 +0200 + + Improve tracker resilience by penalizing large motion vectors. + +commit cc8e7e8e08cd91f75c080a0091461ca9fe969664 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Sun Aug 7 09:28:09 2011 +0200 + + Leverage SSE2 SAD instruction for 16x speed improvement in integer pixel search resulting in ~1ms per marker for 16x16 pattern on 128x128 region. + +commit f362ab4999a768370fca57552464b459eb9fbddc +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Sun Aug 7 09:06:04 2011 +0200 + + Improve SAD Tracker subpixel precision (avoid drift even when adapting at each frame). + +commit fce7a214c561b5f5f0e17115c31fb48814bde2db +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Sat Aug 6 21:57:06 2011 +0200 + + Track using simple Sum of Absolute Differences matching. + This method is simpler, more robust, faster and accurate. + +commit 620a7a35d9a2818bf6e9dbf5d11debda4be6bc26 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Fri Jul 29 12:35:57 2011 +0200 + + Add Intersect unit test. + +commit a2bf58fa57be11215eb17ff7f7de58f97d480ec3 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Thu Jul 28 11:08:06 2011 +0200 + + Remove tests depending on dead code. + Fix CameraIntrinsics test. + Add Intersect and Resect tests. + +commit 19bddee10b4879c8cd2238ccdf5b8f7620cf8384 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Wed Jul 27 12:07:21 2011 +0200 + + Image Distortion: Fixes and more testing. + +commit 0454d97da328fb0eda8c6c50511ac31864a6d3d6 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Wed Jul 27 10:32:37 2011 +0200 + + Test float image distortion. + +commit 8db01595a8721f766d85931a8d92b780461d8741 +Author: Matthias Fauconneau <matthias.fauconneau@gmail.com> +Date: Wed Jul 27 10:27:07 2011 +0200 + + Image Distortion: Bilinear sampling, Optimization, Instantiate all variants (Distort/Undistort, float/ubyte, 1-4 channels). diff --git a/extern/libmv/SConscript b/extern/libmv/SConscript new file mode 100644 index 00000000000..1ffc6233c1d --- /dev/null +++ b/extern/libmv/SConscript @@ -0,0 +1,60 @@ +#!/usr/bin/python +import sys +import os + +Import('env') + +defs = [] + +cflags_libmv = Split(env['CFLAGS']) +ccflags_libmv = Split(env['CCFLAGS']) +cxxflags_libmv = Split(env['CXXFLAGS']) + +defs.append('V3DLIB_ENABLE_SUITESPARSE') +defs.append('GOOGLE_GLOG_DLL_DECL=') + +src = env.Glob("*.cpp") +src += env.Glob('libmv/image/*.cc') +src += env.Glob('libmv/multiview/*.cc') +src += env.Glob('libmv/numeric/*.cc') +src += env.Glob('libmv/simple_pipeline/*.cc') +src += env.Glob('libmv/tracking/*.cc') +src += env.Glob('third_party/fast/*.c') +src += env.Glob('third_party/gflags/*.cc') +src += env.Glob('third_party/ldl/Source/*.c') +src += env.Glob('third_party/ssba/Geometry/*.cpp') +src += env.Glob('third_party/ssba/Math/*.cpp') + +incs = '. ../Eigen3' +incs += ' ' + env['BF_PNG_INC'] +incs += ' ' + env['BF_ZLIB_INC'] + +if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): + incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog ./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'] + + if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): + cflags_libmv.append('/Od') + ccflags_libmv.append('/Od') + cxxflags_libmv.append('/Od') + + if not env['BF_DEBUG']: + defs.append('NDEBUG') + else: + if not env['BF_DEBUG']: + cflags_libmv = Split(env['REL_CFLAGS']) + ccflags_libmv = Split(env['REL_CCFLAGS']) + cxxflags_libmv = Split(env['REL_CXXFLAGS']) +else: + src += env.Glob("third_party/glog/src/*.cc") + incs += ' ./third_party/glog/src' + if not env['BF_DEBUG']: + cflags_libmv = Split(env['REL_CFLAGS']) + ccflags_libmv = Split(env['REL_CCFLAGS']) + cxxflags_libmv = Split(env['REL_CXXFLAGS']) + +incs += ' ./third_party/ssba ./third_party/ldl/Include ../colamd/Include' + +env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137], compileflags=cflags_libmv, cc_compileflags=ccflags_libmv, cxx_compileflags=cxxflags_libmv ) diff --git a/extern/libmv/bundle.sh b/extern/libmv/bundle.sh new file mode 100755 index 00000000000..c8df8ae7341 --- /dev/null +++ b/extern/libmv/bundle.sh @@ -0,0 +1,250 @@ +#!/bin/sh + +#BRANCH="keir" +BRANCH="Matthias-Fauconneau" + +if [ -d ./.svn ]; then + echo "This script is supposed to work only when using git-svn" + exit 1 +fi + +repo="git://github.com/${BRANCH}/libmv.git" +tmp=`mktemp -d` + +git clone $repo $tmp/libmv + +#git --git-dir $tmp/libmv/.git --work-tree $tmp/libmv log --since="1 month ago" > ChangeLog +git --git-dir $tmp/libmv/.git --work-tree $tmp/libmv log -n 50 > ChangeLog + +for p in `cat ./patches/series`; do + echo "Applying patch $p..." + cat ./patches/$p | patch -d $tmp/libmv -p1 +done + +rm -rf libmv +rm -rf third_party + +cat "files.txt" | while f=`line`; do + mkdir -p `dirname $f` + cp $tmp/libmv/src/$f $f +done + +rm -rf $tmp + +chmod 664 ./third_party/glog/src/windows/*.cc ./third_party/glog/src/windows/*.h ./third_party/glog/src/windows/glog/*.h + +sources=`find ./libmv -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | sed -r 's/^\.\//\t/'` +headers=`find ./libmv -type f -iname '*.h' | sed -r 's/^\.\//\t/'` + +third_sources=`find ./third_party -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | grep -v glog | sed -r 's/^\.\//\t/'` +third_headers=`find ./third_party -type f -iname '*.h' | grep -v glog | sed -r 's/^\.\//\t/'` + +third_glog_sources=`find ./third_party -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | grep glog | grep -v windows | sed -r 's/^\.\//\t\t/'` +third_glog_headers=`find ./third_party -type f -iname '*.h' | grep glog | grep -v windows | sed -r 's/^\.\//\t\t/'` + +src_dir=`find ./libmv -type f -iname '*.cc' -exec dirname {} \; -or -iname '*.cpp' -exec dirname {} \; -or -iname '*.c' -exec dirname {} \; | sed -r 's/^\.\//\t/' | sort | uniq` +src_third_dir=`find ./third_party -type f -iname '*.cc' -exec dirname {} \; -or -iname '*.cpp' -exec dirname {} \; -or -iname '*.c' -exec dirname {} \; | sed -r 's/^\.\//\t/' | sort | uniq` +src="" +win_src="" +for x in $src_dir $src_third_dir; do + t="" + + if test `echo "$x" | grep -c glog ` -eq 1; then + continue; + fi + + if stat $x/*.cpp > /dev/null 2>&1; then + t="src += env.Glob('`echo $x'/*.cpp'`')" + fi + + if stat $x/*.c > /dev/null 2>&1; then + if [ -z "$t" ]; then + t="src += env.Glob('`echo $x'/*.c'`')" + else + t="$t + env.Glob('`echo $x'/*.c'`')" + fi + fi + + if stat $x/*.cc > /dev/null 2>&1; then + if [ -z "$t" ]; then + t="src += env.Glob('`echo $x'/*.cc'`')" + else + t="$t + env.Glob('`echo $x'/*.cc'`')" + fi + fi + + if test `echo $x | grep -c windows ` -eq 0; then + if [ -z "$src" ]; then + src=$t + else + src=`echo "$src\n$t"` + fi + else + if [ -z "$win_src" ]; then + win_src=`echo " $t"` + else + win_src=`echo "$win_src\n $t"` + fi + fi +done + +cat > CMakeLists.txt << EOF +# \$Id\$ +# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# The Original Code is Copyright (C) 2011, Blender Foundation +# All rights reserved. +# +# Contributor(s): Blender Foundation, +# Sergey Sharybin +# +# ***** END GPL LICENSE BLOCK ***** + +set(INC + . + ../Eigen3 + ./third_party/ssba + ./third_party/ldl/Include + ../colamd/Include +) + +set(INC_SYS + ${PNG_INCLUDE_DIR} + ${ZLIB_INCLUDE_DIRS} +) + +set(SRC + libmv-capi.cpp +${sources} + +${third_sources} + + libmv-capi.h +${headers} + +${third_headers} +) + +IF(WIN32) + list(APPEND 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 + third_party/glog/src/windows/port.cc + + third_party/glog/src/utilities.h + third_party/glog/src/stacktrace_generic-inl.h + third_party/glog/src/stacktrace.h + third_party/glog/src/stacktrace_x86_64-inl.h + third_party/glog/src/base/googleinit.h + third_party/glog/src/base/mutex.h + third_party/glog/src/base/commandlineflags.h + third_party/glog/src/stacktrace_powerpc-inl.h + third_party/glog/src/stacktrace_x86-inl.h + third_party/glog/src/config.h + third_party/glog/src/stacktrace_libunwind-inl.h + third_party/glog/src/windows/glog/raw_logging.h + third_party/glog/src/windows/glog/vlog_is_on.h + third_party/glog/src/windows/glog/logging.h + third_party/glog/src/windows/glog/log_severity.h + third_party/glog/src/windows/port.h + third_party/glog/src/windows/config.h + ) + + list(APPEND INC + ./third_party/glog/src/windows + ./third_party/msinttypes + ) + + IF(MSVC) + set(MSVC_OFLAGS O1 O2 Ox) + foreach(FLAG ${MSVC_OFLAGS}) + string(REPLACE "${FLAG}" "Od" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "${FLAG}" "Od" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") + endforeach() + ENDIF(MSVC) +ELSE(WIN32) + list(APPEND SRC +${third_glog_sources} + +${third_glog_headers} + ) + + list(APPEND INC + ./third_party/glog/src + ) +ENDIF(WIN32) + +add_definitions(-DV3DLIB_ENABLE_SUITESPARSE -DGOOGLE_GLOG_DLL_DECL=) + +blender_add_lib(extern_libmv "\${SRC}" "\${INC}" "\${INC_SYS}") +EOF + +cat > SConscript << EOF +#!/usr/bin/python +import sys +import os + +Import('env') + +defs = [] + +cflags_libmv = Split(env['CFLAGS']) +ccflags_libmv = Split(env['CCFLAGS']) +cxxflags_libmv = Split(env['CXXFLAGS']) + +defs.append('V3DLIB_ENABLE_SUITESPARSE') +defs.append('GOOGLE_GLOG_DLL_DECL=') + +src = env.Glob("*.cpp") +$src + +incs = '. ../Eigen3' +incs += ' ' + env['BF_PNG_INC'] +incs += ' ' + env['BF_ZLIB_INC'] + +if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): + incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog ./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'] + + if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): + cflags_libmv.append('/Od') + ccflags_libmv.append('/Od') + cxxflags_libmv.append('/Od') + + if not env['BF_DEBUG']: + defs.append('NDEBUG') + else: + if not env['BF_DEBUG']: + cflags_libmv = Split(env['REL_CFLAGS']) + ccflags_libmv = Split(env['REL_CCFLAGS']) + cxxflags_libmv = Split(env['REL_CXXFLAGS']) +else: + src += env.Glob("third_party/glog/src/*.cc") + incs += ' ./third_party/glog/src' + if not env['BF_DEBUG']: + cflags_libmv = Split(env['REL_CFLAGS']) + ccflags_libmv = Split(env['REL_CCFLAGS']) + cxxflags_libmv = Split(env['REL_CXXFLAGS']) + +incs += ' ./third_party/ssba ./third_party/ldl/Include ../colamd/Include' + +env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137], compileflags=cflags_libmv, cc_compileflags=ccflags_libmv, cxx_compileflags=cxxflags_libmv ) +EOF diff --git a/extern/libmv/files.txt b/extern/libmv/files.txt new file mode 100644 index 00000000000..fe6be5d0b20 --- /dev/null +++ b/extern/libmv/files.txt @@ -0,0 +1,141 @@ +libmv/logging/logging.h +libmv/numeric/dogleg.h +libmv/numeric/levenberg_marquardt.h +libmv/numeric/poly.h +libmv/numeric/numeric.cc +libmv/numeric/function_derivative.h +libmv/numeric/poly.cc +libmv/numeric/tinyvector.cc +libmv/numeric/numeric.h +libmv/simple_pipeline/reconstruction.cc +libmv/simple_pipeline/resect.h +libmv/simple_pipeline/resect.cc +libmv/simple_pipeline/reconstruction.h +libmv/simple_pipeline/camera_intrinsics.h +libmv/simple_pipeline/intersect.cc +libmv/simple_pipeline/initialize_reconstruction.cc +libmv/simple_pipeline/camera_intrinsics.cc +libmv/simple_pipeline/pipeline.cc +libmv/simple_pipeline/tracks.h +libmv/simple_pipeline/detect.h +libmv/simple_pipeline/detect.cc +libmv/simple_pipeline/pipeline.h +libmv/simple_pipeline/tracks.cc +libmv/simple_pipeline/bundle.cc +libmv/simple_pipeline/intersect.h +libmv/simple_pipeline/bundle.h +libmv/simple_pipeline/initialize_reconstruction.h +libmv/image/convolve.h +libmv/image/tuple.h +libmv/image/array_nd.h +libmv/image/convolve.cc +libmv/image/array_nd.cc +libmv/image/sample.h +libmv/image/image.h +libmv/tracking/pyramid_region_tracker.cc +libmv/tracking/region_tracker.h +libmv/tracking/sad.cc +libmv/tracking/trklt_region_tracker.cc +libmv/tracking/klt_region_tracker.cc +libmv/tracking/retrack_region_tracker.h +libmv/tracking/sad.h +libmv/tracking/pyramid_region_tracker.h +libmv/tracking/trklt_region_tracker.h +libmv/tracking/retrack_region_tracker.cc +libmv/tracking/klt_region_tracker.h +libmv/base/id_generator.h +libmv/base/vector.h +libmv/base/scoped_ptr.h +libmv/base/vector_utils.h +libmv/multiview/projection.cc +libmv/multiview/conditioning.cc +libmv/multiview/nviewtriangulation.h +libmv/multiview/resection.h +libmv/multiview/fundamental.cc +libmv/multiview/euclidean_resection.cc +libmv/multiview/euclidean_resection.h +libmv/multiview/triangulation.h +libmv/multiview/projection.h +libmv/multiview/triangulation.cc +libmv/multiview/fundamental.h +libmv/multiview/conditioning.h +third_party/ssba/README.TXT +third_party/ssba/COPYING.TXT +third_party/ssba/Geometry/v3d_metricbundle.h +third_party/ssba/Geometry/v3d_metricbundle.cpp +third_party/ssba/Geometry/v3d_cameramatrix.h +third_party/ssba/Geometry/v3d_distortion.h +third_party/ssba/README.libmv +third_party/ssba/Math/v3d_linear_utils.h +third_party/ssba/Math/v3d_optimization.h +third_party/ssba/Math/v3d_mathutilities.h +third_party/ssba/Math/v3d_linear.h +third_party/ssba/Math/v3d_optimization.cpp +third_party/gflags/gflags_completions.h +third_party/gflags/mutex.h +third_party/gflags/gflags.cc +third_party/gflags/gflags_reporting.cc +third_party/gflags/README.libmv +third_party/gflags/config.h +third_party/gflags/gflags_completions.cc +third_party/gflags/gflags.h +third_party/fast/fast_9.c +third_party/fast/fast_10.c +third_party/fast/fast_11.c +third_party/fast/fast.h +third_party/fast/LICENSE +third_party/fast/fast_12.c +third_party/fast/fast.c +third_party/fast/README +third_party/fast/README.libmv +third_party/fast/nonmax.c +third_party/ldl/Include/ldl.h +third_party/ldl/CMakeLists.txt +third_party/ldl/README.libmv +third_party/ldl/Doc/ChangeLog +third_party/ldl/Doc/lesser.txt +third_party/ldl/README.txt +third_party/ldl/Source/ldl.c +third_party/glog/ChangeLog +third_party/glog/COPYING +third_party/glog/src/utilities.cc +third_party/glog/src/utilities.h +third_party/glog/src/symbolize.cc +third_party/glog/src/stacktrace_generic-inl.h +third_party/glog/src/config_mac.h +third_party/glog/src/vlog_is_on.cc +third_party/glog/src/signalhandler.cc +third_party/glog/src/stacktrace.h +third_party/glog/src/stacktrace_x86_64-inl.h +third_party/glog/src/symbolize.h +third_party/glog/src/base/googleinit.h +third_party/glog/src/base/mutex.h +third_party/glog/src/base/commandlineflags.h +third_party/glog/src/windows/preprocess.sh +third_party/glog/src/windows/port.h +third_party/glog/src/windows/config.h +third_party/glog/src/windows/glog/raw_logging.h +third_party/glog/src/windows/glog/vlog_is_on.h +third_party/glog/src/windows/glog/logging.h +third_party/glog/src/windows/glog/log_severity.h +third_party/glog/src/windows/port.cc +third_party/glog/src/logging.cc +third_party/glog/src/stacktrace_powerpc-inl.h +third_party/glog/src/stacktrace_x86-inl.h +third_party/glog/src/demangle.cc +third_party/glog/src/config.h +third_party/glog/src/demangle.h +third_party/glog/src/stacktrace_libunwind-inl.h +third_party/glog/src/glog/raw_logging.h +third_party/glog/src/glog/vlog_is_on.h +third_party/glog/src/glog/logging.h +third_party/glog/src/glog/log_severity.h +third_party/glog/src/raw_logging.cc +third_party/glog/src/config_linux.h +third_party/glog/NEWS +third_party/glog/README +third_party/glog/README.libmv +third_party/glog/AUTHORS +third_party/msinttypes/stdint.h +third_party/msinttypes/inttypes.h +third_party/msinttypes/README.libmv diff --git a/extern/libmv/libmv-capi.cpp b/extern/libmv/libmv-capi.cpp new file mode 100644 index 00000000000..2e007bb47b2 --- /dev/null +++ b/extern/libmv/libmv-capi.cpp @@ -0,0 +1,770 @@ +/* + * ***** 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 ***** + */ + +/* define this to generate PNG images with content of search areas + tracking between which failed */ +#undef DUMP_FAILURE + +#include "libmv-capi.h" + +#include "glog/logging.h" +#include "Math/v3d_optimization.h" + +#include "libmv/tracking/klt_region_tracker.h" +#include "libmv/tracking/trklt_region_tracker.h" +#include "libmv/tracking/pyramid_region_tracker.h" + +#include "libmv/tracking/sad.h" + +#include "libmv/simple_pipeline/tracks.h" +#include "libmv/simple_pipeline/initialize_reconstruction.h" +#include "libmv/simple_pipeline/bundle.h" +#include "libmv/simple_pipeline/detect.h" +#include "libmv/simple_pipeline/pipeline.h" +#include "libmv/simple_pipeline/camera_intrinsics.h" + +#include <stdlib.h> + +#ifdef DUMP_FAILURE +# include <png.h> +#endif + +#ifdef _MSC_VER +# define snprintf _snprintf +#endif + +#define DEFAULT_WINDOW_HALFSIZE 5 + +typedef struct libmv_RegionTracker { + libmv::TrkltRegionTracker *trklt_region_tracker; + libmv::RegionTracker *region_tracker; +} libmv_RegionTracker; + +typedef struct libmv_Reconstruction { + libmv::EuclideanReconstruction reconstruction; + + /* used for per-track average error calculation after reconstruction */ + libmv::Tracks tracks; + libmv::CameraIntrinsics intrinsics; + + double error; +} libmv_Reconstruction; + +typedef struct libmv_Features { + int count, margin; + libmv::Feature *features; +} libmv_Features; + +/* ************ Logging ************ */ + +void libmv_initLogging(const char *argv0) +{ + google::InitGoogleLogging(argv0); + google::SetCommandLineOption("logtostderr", "1"); + google::SetCommandLineOption("v", "0"); + google::SetCommandLineOption("stderrthreshold", "7"); + google::SetCommandLineOption("minloglevel", "7"); + V3D::optimizerVerbosenessLevel = 0; +} + +void libmv_startDebugLogging(void) +{ + google::SetCommandLineOption("logtostderr", "1"); + google::SetCommandLineOption("v", "0"); + google::SetCommandLineOption("stderrthreshold", "1"); + google::SetCommandLineOption("minloglevel", "0"); + V3D::optimizerVerbosenessLevel = 1; +} + +void libmv_setLoggingVerbosity(int verbosity) +{ + char val[10]; + snprintf(val, sizeof(val), "%d", verbosity); + + google::SetCommandLineOption("v", val); + V3D::optimizerVerbosenessLevel = verbosity; +} + +/* ************ RegionTracker ************ */ + +libmv_RegionTracker *libmv_regionTrackerNew(int max_iterations, int pyramid_level) +{ + libmv::TrkltRegionTracker *trklt_region_tracker = new libmv::TrkltRegionTracker; + + trklt_region_tracker->half_window_size = DEFAULT_WINDOW_HALFSIZE; + trklt_region_tracker->max_iterations = max_iterations; + trklt_region_tracker->min_determinant = 1e-4; + + libmv::PyramidRegionTracker *region_tracker = + new libmv::PyramidRegionTracker(trklt_region_tracker, pyramid_level); + + libmv_RegionTracker *configured_region_tracker = new libmv_RegionTracker; + configured_region_tracker->trklt_region_tracker = trklt_region_tracker; + configured_region_tracker->region_tracker = region_tracker; + + return configured_region_tracker; +} + +static void floatBufToImage(const float *buf, int width, int height, libmv::FloatImage *image) +{ + int x, y, a = 0; + + image->resize(height, width); + + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + (*image)(y, x, 0) = buf[a++]; + } + } +} + +#ifdef DUMP_FAILURE +void savePNGImage(png_bytep *row_pointers, int width, int height, int depth, int color_type, char *file_name) +{ + png_infop info_ptr; + png_structp png_ptr; + FILE *fp = fopen(file_name, "wb"); + + if (!fp) + return; + + /* Initialize stuff */ + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + info_ptr = png_create_info_struct(png_ptr); + + if (setjmp(png_jmpbuf(png_ptr))) { + fclose(fp); + return; + } + + png_init_io(png_ptr, fp); + + /* write header */ + if (setjmp(png_jmpbuf(png_ptr))) { + fclose(fp); + return; + } + + png_set_IHDR(png_ptr, info_ptr, width, height, + depth, color_type, PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + + png_write_info(png_ptr, info_ptr); + + /* write bytes */ + if (setjmp(png_jmpbuf(png_ptr))) { + fclose(fp); + return; + } + + png_write_image(png_ptr, row_pointers); + + /* end write */ + if (setjmp(png_jmpbuf(png_ptr))) { + fclose(fp); + return; + } + + png_write_end(png_ptr, NULL); + + fclose(fp); +} + +static void saveImage(char *prefix, libmv::FloatImage image, int x0, int y0) +{ + int x, y; + png_bytep *row_pointers; + + row_pointers= (png_bytep*)malloc(sizeof(png_bytep)*image.Height()); + + for (y = 0; y < image.Height(); y++) { + row_pointers[y]= (png_bytep)malloc(sizeof(png_byte)*4*image.Width()); + + for (x = 0; x < image.Width(); x++) { + if (x0 == x && y0 == y) { + row_pointers[y][x*4+0]= 255; + row_pointers[y][x*4+1]= 0; + row_pointers[y][x*4+2]= 0; + row_pointers[y][x*4+3]= 255; + } + else { + float pixel = image(y, x, 0); + row_pointers[y][x*4+0]= pixel*255; + row_pointers[y][x*4+1]= pixel*255; + row_pointers[y][x*4+2]= pixel*255; + row_pointers[y][x*4+3]= 255; + } + } + } + + { + static int a= 0; + char buf[128]; + snprintf(buf, sizeof(buf), "%s_%02d.png", prefix, ++a); + savePNGImage(row_pointers, image.Width(), image.Height(), 8, PNG_COLOR_TYPE_RGBA, buf); + } + + for (y = 0; y < image.Height(); y++) { + free(row_pointers[y]); + } + free(row_pointers); +} + +static void saveBytesImage(char *prefix, unsigned char *data, int width, int height) +{ + int x, y; + png_bytep *row_pointers; + + row_pointers= (png_bytep*)malloc(sizeof(png_bytep)*height); + + for (y = 0; y < height; y++) { + row_pointers[y]= (png_bytep)malloc(sizeof(png_byte)*4*width); + + for (x = 0; x < width; x++) { + char pixel = data[width*y+x]; + row_pointers[y][x*4+0]= pixel; + row_pointers[y][x*4+1]= pixel; + row_pointers[y][x*4+2]= pixel; + row_pointers[y][x*4+3]= 255; + } + } + + { + static int a= 0; + char buf[128]; + snprintf(buf, sizeof(buf), "%s_%02d.png", prefix, ++a); + savePNGImage(row_pointers, width, height, 8, PNG_COLOR_TYPE_RGBA, buf); + } + + for (y = 0; y < height; y++) { + free(row_pointers[y]); + } + free(row_pointers); +} +#endif + +int libmv_regionTrackerTrack(libmv_RegionTracker *libmv_tracker, const float *ima1, const float *ima2, + int width, int height, int half_window_size, + double x1, double y1, double *x2, double *y2) +{ + libmv::RegionTracker *region_tracker; + libmv::TrkltRegionTracker *trklt_region_tracker; + libmv::FloatImage old_patch, new_patch; + + trklt_region_tracker = libmv_tracker->trklt_region_tracker; + region_tracker = libmv_tracker->region_tracker; + + trklt_region_tracker->half_window_size = half_window_size; + + floatBufToImage(ima1, width, height, &old_patch); + floatBufToImage(ima2, width, height, &new_patch); + +#ifndef DUMP_FAILURE + return region_tracker->Track(old_patch, new_patch, x1, y1, x2, y2); +#else + { + double sx2 = *x2, sy2 = *y2; + int result = region_tracker->Track(old_patch, new_patch, x1, y1, x2, y2); + + if (!result) { + saveImage("old_patch", old_patch, x1, y1); + saveImage("new_patch", new_patch, sx2, sy2); + } + + return result; + } +#endif +} + +void libmv_regionTrackerDestroy(libmv_RegionTracker *libmv_tracker) +{ + delete libmv_tracker->region_tracker; + delete libmv_tracker; +} + +/* ************ Tracks ************ */ + +void libmv_SADSamplePattern(unsigned char *image, int stride, + float warp[3][2], unsigned char *pattern) +{ + libmv::mat32 mat32; + + memcpy(mat32.data, warp, sizeof(float)*3*2); + + libmv::SamplePattern(image, stride, mat32, pattern, 16); +} + +float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, unsigned char *image, int stride, + int width, int height, float warp[3][2]) +{ + float result; + libmv::mat32 mat32; + + memcpy(mat32.data, warp, sizeof(float)*3*2); + + result = libmv::Track(pattern, warped, 16, image, stride, width, height, &mat32, 16, 16); + + memcpy(warp, mat32.data, sizeof(float)*3*2); + + return result; +} + +/* ************ Tracks ************ */ + +libmv_Tracks *libmv_tracksNew(void) +{ + libmv::Tracks *libmv_tracks = new libmv::Tracks(); + + return (libmv_Tracks *)libmv_tracks; +} + +void libmv_tracksInsert(struct libmv_Tracks *libmv_tracks, int image, int track, double x, double y) +{ + ((libmv::Tracks*)libmv_tracks)->Insert(image, track, x, y); +} + +void libmv_tracksDestroy(libmv_Tracks *libmv_tracks) +{ + delete (libmv::Tracks*)libmv_tracks; +} + +/* ************ Reconstruction solver ************ */ + +libmv_Reconstruction *libmv_solveReconstruction(libmv_Tracks *tracks, int keyframe1, int keyframe2, + double focal_length, double principal_x, double principal_y, double k1, double k2, double k3) +{ + /* Invert the camera intrinsics. */ + libmv::vector<libmv::Marker> markers = ((libmv::Tracks*)tracks)->AllMarkers(); + libmv_Reconstruction *libmv_reconstruction = new libmv_Reconstruction(); + libmv::EuclideanReconstruction *reconstruction = &libmv_reconstruction->reconstruction; + libmv::CameraIntrinsics *intrinsics = &libmv_reconstruction->intrinsics; + + intrinsics->SetFocalLength(focal_length, focal_length); + intrinsics->SetPrincipalPoint(principal_x, principal_y); + intrinsics->SetRadialDistortion(k1, k2, k3); + + if(focal_length) { + /* do a lens undistortion if focal length is non-zero only */ + for (int i = 0; i < markers.size(); ++i) { + intrinsics->InvertIntrinsics(markers[i].x, + markers[i].y, + &(markers[i].x), + &(markers[i].y)); + } + } + + libmv::Tracks normalized_tracks(markers); + + libmv::vector<libmv::Marker> keyframe_markers = + normalized_tracks.MarkersForTracksInBothImages(keyframe1, keyframe2); + + libmv::EuclideanReconstructTwoFrames(keyframe_markers, reconstruction); + libmv::EuclideanBundle(normalized_tracks, reconstruction); + libmv::EuclideanCompleteReconstruction(normalized_tracks, reconstruction); + + libmv_reconstruction->tracks = *(libmv::Tracks *)tracks; + libmv_reconstruction->error = libmv::EuclideanReprojectionError(*(libmv::Tracks *)tracks, *reconstruction, *intrinsics); + + return (libmv_Reconstruction *)libmv_reconstruction; +} + +int libmv_reporojectionPointForTrack(libmv_Reconstruction *libmv_reconstruction, int track, double pos[3]) +{ + libmv::EuclideanReconstruction *reconstruction = &libmv_reconstruction->reconstruction; + libmv::EuclideanPoint *point = reconstruction->PointForTrack(track); + + if(point) { + pos[0] = point->X[0]; + pos[1] = point->X[2]; + pos[2] = point->X[1]; + + return 1; + } + + return 0; +} + +static libmv::Marker ProjectMarker(const libmv::EuclideanPoint &point, const libmv::EuclideanCamera &camera, + const libmv::CameraIntrinsics &intrinsics) { + libmv::Vec3 projected = camera.R * point.X + camera.t; + projected /= projected(2); + + libmv::Marker reprojected_marker; + intrinsics.ApplyIntrinsics(projected(0), projected(1), &reprojected_marker.x, &reprojected_marker.y); + + reprojected_marker.image = camera.image; + reprojected_marker.track = point.track; + + return reprojected_marker; +} + +double libmv_reporojectionErrorForTrack(libmv_Reconstruction *libmv_reconstruction, int track) +{ + libmv::EuclideanReconstruction *reconstruction = &libmv_reconstruction->reconstruction; + libmv::CameraIntrinsics *intrinsics = &libmv_reconstruction->intrinsics; + libmv::vector<libmv::Marker> markers = libmv_reconstruction->tracks.MarkersForTrack(track); + + int num_reprojected = 0; + double total_error = 0.0; + + for (int i = 0; i < markers.size(); ++i) { + const libmv::EuclideanCamera *camera = reconstruction->CameraForImage(markers[i].image); + const libmv::EuclideanPoint *point = reconstruction->PointForTrack(markers[i].track); + + if (!camera || !point) { + continue; + } + + num_reprojected++; + + libmv::Marker reprojected_marker = ProjectMarker(*point, *camera, *intrinsics); + double ex = reprojected_marker.x - markers[i].x; + double ey = reprojected_marker.y - markers[i].y; + + total_error += sqrt(ex*ex + ey*ey); + } + + return total_error / num_reprojected; +} + +double libmv_reporojectionErrorForImage(libmv_Reconstruction *libmv_reconstruction, int image) +{ + libmv::EuclideanReconstruction *reconstruction = &libmv_reconstruction->reconstruction; + libmv::CameraIntrinsics *intrinsics = &libmv_reconstruction->intrinsics; + libmv::vector<libmv::Marker> markers = libmv_reconstruction->tracks.MarkersInImage(image); + const libmv::EuclideanCamera *camera = reconstruction->CameraForImage(image); + int num_reprojected = 0; + double total_error = 0.0; + + if (!camera) + return 0; + + for (int i = 0; i < markers.size(); ++i) { + const libmv::EuclideanPoint *point = reconstruction->PointForTrack(markers[i].track); + + if (!point) { + continue; + } + + num_reprojected++; + + libmv::Marker reprojected_marker = ProjectMarker(*point, *camera, *intrinsics); + double ex = reprojected_marker.x - markers[i].x; + double ey = reprojected_marker.y - markers[i].y; + + total_error += sqrt(ex*ex + ey*ey); + } + + return total_error / num_reprojected; +} + +int libmv_reporojectionCameraForImage(libmv_Reconstruction *libmv_reconstruction, int image, double mat[4][4]) +{ + libmv::EuclideanReconstruction *reconstruction = &libmv_reconstruction->reconstruction; + libmv::EuclideanCamera *camera = reconstruction->CameraForImage(image); + + if(camera) { + for (int j = 0; j < 3; ++j) { + for (int k = 0; k < 3; ++k) { + int l = k; + + if (k == 1) l = 2; + else if (k == 2) l = 1; + + if (j == 2) mat[j][l] = -camera->R(j,k); + else mat[j][l] = camera->R(j,k); + } + mat[j][3]= 0.0; + } + + libmv::Vec3 optical_center = -camera->R.transpose() * camera->t; + + mat[3][0] = optical_center(0); + mat[3][1] = optical_center(2); + mat[3][2] = optical_center(1); + + mat[3][3]= 1.0; + + return 1; + } + + return 0; +} + +double libmv_reprojectionError(libmv_Reconstruction *libmv_reconstruction) +{ + return libmv_reconstruction->error; +} + +void libmv_destroyReconstruction(libmv_Reconstruction *libmv_reconstruction) +{ + delete libmv_reconstruction; +} + +/* ************ feature detector ************ */ + +struct libmv_Features *libmv_detectFeaturesFAST(unsigned char *data, int width, int height, int stride, + int margin, int min_trackness, int min_distance) +{ + libmv::Feature *features = NULL; + std::vector<libmv::Feature> v; + libmv_Features *libmv_features = new libmv_Features(); + int i= 0, count; + + if(margin) { + data += margin*stride+margin; + width -= 2*margin; + height -= 2*margin; + } + + v = libmv::DetectFAST(data, width, height, stride, min_trackness, min_distance); + + count = v.size(); + + if(count) { + features= new libmv::Feature[count]; + + for(std::vector<libmv::Feature>::iterator it = v.begin(); it != v.end(); it++) { + features[i++]= *it; + } + } + + libmv_features->features = features; + libmv_features->count = count; + libmv_features->margin = margin; + + return (libmv_Features *)libmv_features; +} + +struct libmv_Features *libmv_detectFeaturesMORAVEC(unsigned char *data, int width, int height, int stride, + int margin, int count, int min_distance) +{ + libmv::Feature *features = NULL; + libmv_Features *libmv_features = new libmv_Features; + + if(count) { + if(margin) { + data += margin*stride+margin; + width -= 2*margin; + height -= 2*margin; + } + + features = new libmv::Feature[count]; + libmv::DetectMORAVEC(data, stride, width, height, features, &count, min_distance, NULL); + } + + libmv_features->count = count; + libmv_features->margin = margin; + libmv_features->features = features; + + return libmv_features; +} + +int libmv_countFeatures(struct libmv_Features *libmv_features) +{ + return libmv_features->count; +} + +void libmv_getFeature(struct libmv_Features *libmv_features, int number, double *x, double *y, double *score, double *size) +{ + libmv::Feature feature= libmv_features->features[number]; + + *x = feature.x + libmv_features->margin; + *y = feature.y + libmv_features->margin; + *score = feature.score; + *size = feature.size; +} + +void libmv_destroyFeatures(struct libmv_Features *libmv_features) +{ + if(libmv_features->features) + delete [] libmv_features->features; + + delete libmv_features; +} + +/* ************ camera intrinsics ************ */ + +struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsNew(double focal_length, double principal_x, double principal_y, + double k1, double k2, double k3, int width, int height) +{ + libmv::CameraIntrinsics *intrinsics= new libmv::CameraIntrinsics(); + + intrinsics->SetFocalLength(focal_length, focal_length); + intrinsics->SetPrincipalPoint(principal_x, principal_y); + intrinsics->SetRadialDistortion(k1, k2, k3); + intrinsics->SetImageSize(width, height); + + return (struct libmv_CameraIntrinsics *) intrinsics; +} + +struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsCopy(struct libmv_CameraIntrinsics *libmvIntrinsics) +{ + libmv::CameraIntrinsics *orig_intrinsics = (libmv::CameraIntrinsics *) libmvIntrinsics; + libmv::CameraIntrinsics *new_intrinsics= new libmv::CameraIntrinsics(*orig_intrinsics); + + return (struct libmv_CameraIntrinsics *) new_intrinsics; +} + +void libmv_CameraIntrinsicsDestroy(struct libmv_CameraIntrinsics *libmvIntrinsics) +{ + libmv::CameraIntrinsics *intrinsics = (libmv::CameraIntrinsics *) libmvIntrinsics; + + delete intrinsics; +} + +void libmv_CameraIntrinsicsUpdate(struct libmv_CameraIntrinsics *libmvIntrinsics, double focal_length, + double principal_x, double principal_y, double k1, double k2, double k3, int width, int height) +{ + libmv::CameraIntrinsics *intrinsics = (libmv::CameraIntrinsics *) libmvIntrinsics; + + if (intrinsics->focal_length() != focal_length) + intrinsics->SetFocalLength(focal_length, focal_length); + + if (intrinsics->principal_point_x() != principal_x || intrinsics->principal_point_y() != principal_y) + intrinsics->SetFocalLength(focal_length, focal_length); + + if (intrinsics->k1() != k1 || intrinsics->k2() != k2 || intrinsics->k3() != k3) + intrinsics->SetRadialDistortion(k1, k2, k3); + + if (intrinsics->image_width() != width || intrinsics->image_height() != height) + intrinsics->SetImageSize(width, height); +} + +void libmv_CameraIntrinsicsUndistortByte(struct libmv_CameraIntrinsics *libmvIntrinsics, + unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels) +{ + libmv::CameraIntrinsics *intrinsics = (libmv::CameraIntrinsics *) libmvIntrinsics; + + intrinsics->Undistort(src, dst, width, height, overscan, channels); +} + +void libmv_CameraIntrinsicsUndistortFloat(struct libmv_CameraIntrinsics *libmvIntrinsics, + float *src, float *dst, int width, int height, float overscan, int channels) +{ + libmv::CameraIntrinsics *intrinsics = (libmv::CameraIntrinsics *) libmvIntrinsics; + + intrinsics->Undistort(src, dst, width, height, overscan, channels); +} + +void libmv_CameraIntrinsicsDistortByte(struct libmv_CameraIntrinsics *libmvIntrinsics, + unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels) +{ + libmv::CameraIntrinsics *intrinsics = (libmv::CameraIntrinsics *) libmvIntrinsics; + intrinsics->Distort(src, dst, width, height, overscan, channels); +} + +void libmv_CameraIntrinsicsDistortFloat(struct libmv_CameraIntrinsics *libmvIntrinsics, + float *src, float *dst, int width, int height, float overscan, int channels) +{ + libmv::CameraIntrinsics *intrinsics = (libmv::CameraIntrinsics *) libmvIntrinsics; + + intrinsics->Distort(src, dst, width, height, overscan, channels); +} + +/* ************ distortion ************ */ + +void libmv_undistortByte(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels) +{ + libmv::CameraIntrinsics intrinsics; + + intrinsics.SetFocalLength(focal_length, focal_length); + intrinsics.SetPrincipalPoint(principal_x, principal_y); + intrinsics.SetRadialDistortion(k1, k2, k3); + + intrinsics.Undistort(src, dst, width, height, overscan, channels); +} + +void libmv_undistortFloat(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + float *src, float *dst, int width, int height, float overscan, int channels) +{ + libmv::CameraIntrinsics intrinsics; + + intrinsics.SetFocalLength(focal_length, focal_length); + intrinsics.SetPrincipalPoint(principal_x, principal_y); + intrinsics.SetRadialDistortion(k1, k2, k3); + + intrinsics.Undistort(src, dst, width, height, overscan, channels); +} + +void libmv_distortByte(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels) +{ + libmv::CameraIntrinsics intrinsics; + + intrinsics.SetFocalLength(focal_length, focal_length); + intrinsics.SetPrincipalPoint(principal_x, principal_y); + intrinsics.SetRadialDistortion(k1, k2, k3); + + intrinsics.Distort(src, dst, width, height, overscan, channels); +} + +void libmv_distortFloat(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + float *src, float *dst, int width, int height, float overscan, int channels) +{ + libmv::CameraIntrinsics intrinsics; + + intrinsics.SetFocalLength(focal_length, focal_length); + intrinsics.SetPrincipalPoint(principal_x, principal_y); + intrinsics.SetRadialDistortion(k1, k2, k3); + + intrinsics.Distort(src, dst, width, height, overscan, channels); +} + +/* ************ utils ************ */ + +void libmv_applyCameraIntrinsics(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + double x, double y, double *x1, double *y1) +{ + libmv::CameraIntrinsics intrinsics; + + intrinsics.SetFocalLength(focal_length, focal_length); + intrinsics.SetPrincipalPoint(principal_x, principal_y); + intrinsics.SetRadialDistortion(k1, k2, k3); + + if(focal_length) { + /* do a lens undistortion if focal length is non-zero only */ + + intrinsics.ApplyIntrinsics(x, y, x1, y1); + } +} + +void libmv_InvertIntrinsics(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + double x, double y, double *x1, double *y1) +{ + libmv::CameraIntrinsics intrinsics; + + intrinsics.SetFocalLength(focal_length, focal_length); + intrinsics.SetPrincipalPoint(principal_x, principal_y); + intrinsics.SetRadialDistortion(k1, k2, k3); + + if(focal_length) { + /* do a lens distortion if focal length is non-zero only */ + + intrinsics.InvertIntrinsics(x, y, x1, y1); + } +} diff --git a/extern/libmv/libmv-capi.h b/extern/libmv/libmv-capi.h new file mode 100644 index 00000000000..b71a66b73a6 --- /dev/null +++ b/extern/libmv/libmv-capi.h @@ -0,0 +1,128 @@ +/* + * ***** 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 ***** + */ + +#ifndef LIBMV_C_API_H +#define LIBMV_C_API_H + +#ifdef __cplusplus +extern "C" { +#endif + +struct libmv_RegionTracker; +struct libmv_Tracks; +struct libmv_Reconstruction; +struct libmv_Features; +struct libmv_CameraIntrinsics; + +/* Logging */ +void libmv_initLogging(const char *argv0); +void libmv_startDebugLogging(void); +void libmv_setLoggingVerbosity(int verbosity); + +/* RegionTracker */ +struct libmv_RegionTracker *libmv_regionTrackerNew(int max_iterations, int pyramid_level); +int libmv_regionTrackerTrack(struct libmv_RegionTracker *libmv_tracker, const float *ima1, const float *ima2, + int width, int height, int half_window_size, + double x1, double y1, double *x2, double *y2); +void libmv_regionTrackerDestroy(struct libmv_RegionTracker *libmv_tracker); + +/* SAD Tracker */ +void libmv_SADSamplePattern(unsigned char *image, int stride, + float warp[3][2], unsigned char *pattern); +float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, unsigned char *image, + int stride, int width, int height, float warp[3][2]); + +/* Tracks */ +struct libmv_Tracks *libmv_tracksNew(void); +void libmv_tracksInsert(struct libmv_Tracks *libmv_tracks, int image, int track, double x, double y); +void libmv_tracksDestroy(struct libmv_Tracks *libmv_tracks); + +/* Reconstruction solver */ +struct libmv_Reconstruction *libmv_solveReconstruction(struct libmv_Tracks *tracks, int keyframe1, int keyframe2, + double focal_length, double principal_x, double principal_y, double k1, double k2, double k3); +int libmv_reporojectionPointForTrack(struct libmv_Reconstruction *libmv_reconstruction, int track, double pos[3]); +double libmv_reporojectionErrorForTrack(struct libmv_Reconstruction *libmv_reconstruction, int track); +double libmv_reporojectionErrorForImage(struct libmv_Reconstruction *libmv_reconstruction, int image); +int libmv_reporojectionCameraForImage(struct libmv_Reconstruction *libmv_reconstruction, int image, double mat[4][4]); +double libmv_reprojectionError(struct libmv_Reconstruction *libmv_reconstruction); +void libmv_destroyReconstruction(struct libmv_Reconstruction *libmv_reconstruction); + +/* feature detector */ +struct libmv_Features *libmv_detectFeaturesFAST(unsigned char *data, int width, int height, int stride, + int margin, int min_trackness, int min_distance); +struct libmv_Features *libmv_detectFeaturesMORAVEC(unsigned char *data, int width, int height, int stride, + int margin, int count, int min_distance); +int libmv_countFeatures(struct libmv_Features *libmv_features); +void libmv_getFeature(struct libmv_Features *libmv_features, int number, double *x, double *y, double *score, double *size); +void libmv_destroyFeatures(struct libmv_Features *libmv_features); + +/* camera intrinsics */ +struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsNew(double focal_length, double principal_x, double principal_y, + double k1, double k2, double k3, int width, int height); + +struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsCopy(struct libmv_CameraIntrinsics *libmvIntrinsics); + +struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsCopy(struct libmv_CameraIntrinsics *libmvIntrinsics); + +void libmv_CameraIntrinsicsDestroy(struct libmv_CameraIntrinsics *libmvIntrinsics); + +void libmv_CameraIntrinsicsUpdate(struct libmv_CameraIntrinsics *libmvIntrinsics, double focal_length, + double principal_x, double principal_y, double k1, double k2, double k3, int width, int height); + +void libmv_CameraIntrinsicsUndistortByte(struct libmv_CameraIntrinsics *libmvIntrinsics, + unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels); + +void libmv_CameraIntrinsicsUndistortFloat(struct libmv_CameraIntrinsics *libmvIntrinsics, + float *src, float *dst, int width, int height, float overscan, int channels); + +void libmv_CameraIntrinsicsDistortByte(struct libmv_CameraIntrinsics *libmvIntrinsics, + unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels); + +void libmv_CameraIntrinsicsDistortFloat(struct libmv_CameraIntrinsics *libmvIntrinsics, + float *src, float *dst, int width, int height, float overscan, int channels); + +/* dsitortion */ +void libmv_undistortByte(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + unsigned char *src, unsigned char *dst, int width, int height, int channels); +void libmv_undistortFloat(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + float *src, float *dst, int width, int height, int channels); + +void libmv_distortByte(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + unsigned char *src, unsigned char *dst, int width, int height, int channels); +void libmv_distortFloat(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + float *src, float *dst, int width, int height, int channels); + +/* utils */ +void libmv_applyCameraIntrinsics(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + double x, double y, double *x1, double *y1); +void libmv_InvertIntrinsics(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + double x, double y, double *x1, double *y1); + +#ifdef __cplusplus +} +#endif + +#endif // LIBMV_C_API_H diff --git a/extern/libmv/libmv/base/id_generator.h b/extern/libmv/libmv/base/id_generator.h new file mode 100644 index 00000000000..bf1eafd218e --- /dev/null +++ b/extern/libmv/libmv/base/id_generator.h @@ -0,0 +1,37 @@ +// Copyright (c) 2007, 2008 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_ID_GENERATOR_H +#define LIBMV_ID_GENERATOR_H + +namespace libmv { + +template <typename ID> +class IdGenerator { + public: + IdGenerator() : next_(0) {} + ID Generate() { return next_++; } + private: + ID next_; +}; + +} // namespace libmv + +#endif // LIBMV_ID_GENERATOR_H diff --git a/extern/libmv/libmv/base/scoped_ptr.h b/extern/libmv/libmv/base/scoped_ptr.h new file mode 100644 index 00000000000..f1e89eb5625 --- /dev/null +++ b/extern/libmv/libmv/base/scoped_ptr.h @@ -0,0 +1,60 @@ +// Copyright (c) 2009 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_BASE_SCOPED_PTR_H +#define LIBMV_BASE_SCOPED_PTR_H + +namespace libmv { + +/** + * A handle for a heap-allocated resource that should be freed when it goes out + * of scope. This looks similar to the one found in TR1. + */ +template<typename T> +class scoped_ptr { + public: + scoped_ptr(T *resource) : resource_(resource) {} + ~scoped_ptr() { reset(0); } + + T *get() const { return resource_; } + T *operator->() const { return resource_; } + T &operator*() const { return *resource_; } + + void reset(T *new_resource) { + if (sizeof(T)) { + delete resource_; + } + resource_ = new_resource; + } + + T *release() { + T *released_resource = resource_; + resource_ = 0; + return released_resource; + } + + private: + // No copying allowed. + T *resource_; +}; + +} // namespace libmv + +#endif // LIBMV_BASE_SCOPED_PTR_H diff --git a/extern/libmv/libmv/base/vector.h b/extern/libmv/libmv/base/vector.h new file mode 100644 index 00000000000..9dc48676629 --- /dev/null +++ b/extern/libmv/libmv/base/vector.h @@ -0,0 +1,172 @@ +// Copyright (c) 2007, 2008 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. +// +// Get an aligned vector implementation. Must be included before <vector>. The +// Eigen guys went through some trouble to make a portable override for the +// fixed size vector types. + +#ifndef LIBMV_BASE_VECTOR_H +#define LIBMV_BASE_VECTOR_H + +#include <cstring> +#include <new> + +#include <Eigen/Core> + +namespace libmv { + +// A simple container class, which guarantees 16 byte alignment needed for most +// vectorization. Don't use this container for classes that cannot be copied +// via memcpy. +// FIXME: this class has some issues: +// - doesn't support iterators. +// - impede compatibility with code using STL. +// - the STL already provide support for custom allocators +// it could be replaced with a simple +// template <T> class vector : std::vector<T, aligned_allocator> {} declaration +// provided it doesn't break code relying on libmv::vector specific behavior +template <typename T, + typename Allocator = Eigen::aligned_allocator<T> > +class vector { + public: + ~vector() { clear(); } + + vector() { init(); } + vector(int size) { init(); resize(size); } + vector(int size, const T & val) { + init(); + resize(size); + std::fill(data_, data_+size_, val); } + + // Copy constructor and assignment. + vector(const vector<T, Allocator> &rhs) { + init(); + copy(rhs); + } + vector<T, Allocator> &operator=(const vector<T, Allocator> &rhs) { + if (&rhs != this) { + copy(rhs); + } + return *this; + } + + /// Swaps the contents of two vectors in constant time. + void swap(vector<T, Allocator> &other) { + std::swap(allocator_, other.allocator_); + std::swap(size_, other.size_); + std::swap(capacity_, other.capacity_); + std::swap(data_, other.data_); + } + + T *data() const { return data_; } + int size() const { return size_; } + int capacity() const { return capacity_; } + const T& back() const { return data_[size_ - 1]; } + T& back() { return data_[size_ - 1]; } + const T& front() const { return data_[0]; } + T& front() { return data_[0]; } + const T& operator[](int n) const { return data_[n]; } + T& operator[](int n) { return data_[n]; } + const T * begin() const { return data_; } + const T * end() const { return data_+size_; } + T * begin() { return data_; } + T * end() { return data_+size_; } + + void resize(size_t size) { + reserve(size); + if (size > size_) { + construct(size_, size); + } else if (size < size_) { + destruct(size, size_); + } + size_ = size; + } + + + + void push_back(const T &value) { + if (size_ == capacity_) { + reserve(size_ ? 2 * size_ : 1); + } + new (&data_[size_++]) T(value); + } + + void pop_back() { + resize(size_ - 1); + } + + void clear() { + destruct(0, size_); + deallocate(); + init(); + } + + void reserve(unsigned int size) { + if (size > size_) { + T *data = static_cast<T *>(allocate(size)); + memcpy(data, data_, sizeof(*data)*size_); + allocator_.deallocate(data_, capacity_); + data_ = data; + capacity_ = size; + } + } + + private: + void construct(int start, int end) { + for (int i = start; i < end; ++i) { + new (&data_[i]) T; + } + } + void destruct(int start, int end) { + for (int i = start; i < end; ++i) { + data_[i].~T(); + } + } + void init() { + size_ = 0; + data_ = 0; + capacity_ = 0; + } + + void *allocate(int size) { + return size ? allocator_.allocate(size) : 0; + } + + void deallocate() { + allocator_.deallocate(data_, size_); + data_ = 0; + } + + void copy(const vector<T, Allocator> &rhs) { + resize(rhs.size()); + for (int i = 0; i < rhs.size(); ++i) { + (*this)[i] = rhs[i]; + } + } + + Allocator allocator_; + size_t size_; + size_t capacity_; + T *data_; +}; + +} // namespace libmv + +#endif // LIBMV_BASE_VECTOR_H diff --git a/extern/libmv/libmv/base/vector_utils.h b/extern/libmv/libmv/base/vector_utils.h new file mode 100644 index 00000000000..7a0c3ba24f5 --- /dev/null +++ b/extern/libmv/libmv/base/vector_utils.h @@ -0,0 +1,34 @@ +// Copyright (c) 2009 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_BASE_VECTOR_UTILS_H_ +#define LIBMV_BASE_VECTOR_UTILS_H_ + +/// Delete the contents of a container. +template <class Array> +void DeleteElements(Array *array) { + for (int i = 0; i < array->size(); ++i) { + delete (*array)[i]; + } + array->clear(); +} + +#endif // LIBMV_BASE_VECTOR_UTILS_H_ diff --git a/extern/libmv/libmv/image/array_nd.cc b/extern/libmv/libmv/image/array_nd.cc new file mode 100644 index 00000000000..3a77e3e4881 --- /dev/null +++ b/extern/libmv/libmv/image/array_nd.cc @@ -0,0 +1,108 @@ +// Copyright (c) 2007, 2008 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. + +#include "libmv/image/image.h" +#include <iostream> +#include <cmath> + +namespace libmv { + +void FloatArrayToScaledByteArray(const Array3Df &float_array, + Array3Du *byte_array, + bool automatic_range_detection + ) { + byte_array->ResizeLike(float_array); + float minval = HUGE_VAL; + float maxval = -HUGE_VAL; + if (automatic_range_detection) { + for (int i = 0; i < float_array.Height(); ++i) { + for (int j = 0; j < float_array.Width(); ++j) { + for (int k = 0; k < float_array.Depth(); ++k) { + minval = std::min(minval, float_array(i,j,k)); + maxval = std::max(maxval, float_array(i,j,k)); + } + } + } + } else { + minval = 0; + maxval = 1; + } + for (int i = 0; i < float_array.Height(); ++i) { + for (int j = 0; j < float_array.Width(); ++j) { + for (int k = 0; k < float_array.Depth(); ++k) { + float unscaled = (float_array(i,j,k) - minval) / (maxval - minval); + (*byte_array)(i,j,k) = (unsigned char)(255 * unscaled); + } + } + } +} + +void ByteArrayToScaledFloatArray(const Array3Du &byte_array, + Array3Df *float_array) { + float_array->ResizeLike(byte_array); + for (int i = 0; i < byte_array.Height(); ++i) { + for (int j = 0; j < byte_array.Width(); ++j) { + for (int k = 0; k < byte_array.Depth(); ++k) { + (*float_array)(i,j,k) = float(byte_array(i,j,k)) / 255.0f; + } + } + } +} + +void SplitChannels(const Array3Df &input, + Array3Df *channel0, + Array3Df *channel1, + Array3Df *channel2) { + assert(input.Depth() >= 3); + channel0->Resize(input.Height(), input.Width()); + channel1->Resize(input.Height(), input.Width()); + channel2->Resize(input.Height(), input.Width()); + for (int row = 0; row < input.Height(); ++row) { + for (int column = 0; column < input.Width(); ++column) { + (*channel0)(row, column) = input(row, column, 0); + (*channel1)(row, column) = input(row, column, 1); + (*channel2)(row, column) = input(row, column, 2); + } + } +} + +void PrintArray(const Array3Df &array) { + using namespace std; + + printf("[\n"); + for (int r = 0; r < array.Height(); ++r) { + printf("["); + for (int c = 0; c < array.Width(); ++c) { + if (array.Depth() == 1) { + printf("%11f, ", array(r, c)); + } else { + printf("["); + for (int k = 0; k < array.Depth(); ++k) { + printf("%11f, ", array(r, c, k)); + } + printf("],"); + } + } + printf("],\n"); + } + printf("]\n"); +} + +} // namespace libmv diff --git a/extern/libmv/libmv/image/array_nd.h b/extern/libmv/libmv/image/array_nd.h new file mode 100644 index 00000000000..6d7570cda9b --- /dev/null +++ b/extern/libmv/libmv/image/array_nd.h @@ -0,0 +1,473 @@ +// Copyright (c) 2007, 2008 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_IMAGE_ARRAY_ND_H +#define LIBMV_IMAGE_ARRAY_ND_H + +#include <cassert> +#include <cstdio> +#include <cstring> + +#include "libmv/image/tuple.h" + +namespace libmv { + +class BaseArray {}; + +/// A multidimensional array class. +template <typename T, int N> +class ArrayND : public BaseArray { + public: + typedef T Scalar; + + /// Type for the multidimensional indices. + typedef Tuple<int, N> Index; + + /// Create an empty array. + 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); } + + /// Create an array with the specified shape. + ArrayND(int *shape) : data_(NULL), own_data(true) { Resize(shape); } + + /// Copy constructor. + 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) { Resize(s0, s1, s2); } + + ArrayND(T* data, int s0, int s1, int s2) : data_(data), own_data(false) { Resize(s0, s1, s2); } + + /// Destructor deletes pixel data. + ~ArrayND() { + delete [] data_; + } + + /// Assignation copies pixel data. + ArrayND &operator=(const ArrayND<T, N> &b) { + assert(this != &b); + ResizeLike(b); + std::memcpy(Data(), b.Data(), sizeof(T) * Size()); + return *this; + } + + const Index &Shapes() const { + return shape_; + } + + const Index &Strides() const { + return strides_; + } + + /// Create an array of shape s. + void Resize(const Index &new_shape) { + if (data_ != NULL && shape_ == new_shape) { + // Don't bother realloacting if the shapes match. + return; + } + shape_.Reset(new_shape); + strides_(N - 1) = 1; + for (int i = N - 1; i > 0; --i) { + strides_(i - 1) = strides_(i) * shape_(i); + } + if(own_data) { + delete [] data_; + data_ = NULL; + if (Size() > 0) { + data_ = new T[Size()]; + } + } + } + + template<typename D> + void ResizeLike(const ArrayND<D,N> &other) { + Resize(other.Shape()); + } + + /// Resizes the array to shape s. All data is lost. + void Resize(const int *new_shape_array) { + Resize(Index(new_shape_array)); + } + + /// Resize a 1D array to length s0. + void Resize(int s0) { + assert(N == 1); + int shape[] = {s0}; + Resize(shape); + } + + /// Resize a 2D array to shape (s0,s1). + void Resize(int s0, int s1) { + int shape[N] = {s0, s1}; + for (int i = 2; i < N; ++i) { + shape[i] = 1; + } + Resize(shape); + } + + // Match Eigen2's API. + void resize(int rows, int cols) { + Resize(rows, cols); + } + + /// Resize a 3D array to shape (s0,s1,s2). + void Resize(int s0, int s1, int s2) { + assert(N == 3); + int shape[] = {s0,s1,s2}; + Resize(shape); + } + + template<typename D> + void CopyFrom(const ArrayND<D,N> &other) { + ResizeLike(other); + T *data = Data(); + const D *other_data = other.Data(); + for (int i = 0; i < Size(); ++i) { + data[i] = T(other_data[i]); + } + } + + void Fill(T value) { + for (int i = 0; i < Size(); ++i) { + Data()[i] = value; + } + } + + // Match Eigen's API. + void fill(T value) { + for (int i = 0; i < Size(); ++i) { + Data()[i] = value; + } + } + + /// Return a tuple containing the length of each axis. + const Index &Shape() const { + return shape_; + } + + /// Return the length of an axis. + int Shape(int axis) const { + return shape_(axis); + } + + /// Return the distance between neighboring elements along axis. + int Stride(int axis) const { + return strides_(axis); + } + + /// Return the number of elements of the array. + int Size() const { + int size = 1; + for (int i = 0; i < N; ++i) + size *= Shape(i); + return size; + } + + /// Return the total amount of memory used by the array. + int MemorySizeInBytes() const { + return sizeof(*this) + Size() * sizeof(T); + } + + /// Pointer to the first element of the array. + T *Data() { return data_; } + + /// Constant pointer to the first element of the array. + const T *Data() const { return data_; } + + /// Distance between the first element and the element at position index. + int Offset(const Index &index) const { + int offset = 0; + for (int i = 0; i < N; ++i) + offset += index(i) * Stride(i); + return offset; + } + + /// 1D specialization. + int Offset(int i0) const { + assert(N == 1); + return i0 * Stride(0); + } + + /// 2D specialization. + int Offset(int i0, int i1) const { + assert(N == 2); + return i0 * Stride(0) + i1 * Stride(1); + } + + /// 3D specialization. + int Offset(int i0, int i1, int i2) const { + assert(N == 3); + return i0 * Stride(0) + i1 * Stride(1) + i2 * Stride(2); + } + + /// Return a reference to the element at position index. + T &operator()(const Index &index) { + // TODO(pau) Boundary checking in debug mode. + return *( Data() + Offset(index) ); + } + + /// 1D specialization. + T &operator()(int i0) { + return *( Data() + Offset(i0) ); + } + + /// 2D specialization. + T &operator()(int i0, int i1) { + assert(0 <= i0 && i0 < Shape(0)); + assert(0 <= i1 && i1 < Shape(1)); + return *( Data() + Offset(i0,i1) ); + } + + /// 3D specialization. + T &operator()(int i0, int i1, int i2) { + assert(0 <= i0 && i0 < Shape(0)); + assert(0 <= i1 && i1 < Shape(1)); + assert(0 <= i2 && i2 < Shape(2)); + return *( Data() + Offset(i0,i1,i2) ); + } + + /// Return a constant reference to the element at position index. + const T &operator()(const Index &index) const { + return *( Data() + Offset(index) ); + } + + /// 1D specialization. + const T &operator()(int i0) const { + return *( Data() + Offset(i0) ); + } + + /// 2D specialization. + const T &operator()(int i0, int i1) const { + assert(0 <= i0 && i0 < Shape(0)); + assert(0 <= i1 && i1 < Shape(1)); + return *( Data() + Offset(i0,i1) ); + } + + /// 3D specialization. + const T &operator()(int i0, int i1, int i2) const { + return *( Data() + Offset(i0,i1,i2) ); + } + + /// True if index is inside array. + bool Contains(const Index &index) const { + for (int i = 0; i < N; ++i) + if (index(i) < 0 || index(i) >= Shape(i)) + return false; + return true; + } + + /// 1D specialization. + bool Contains(int i0) const { + return 0 <= i0 && i0 < Shape(0); + } + + /// 2D specialization. + bool Contains(int i0, int i1) const { + return 0 <= i0 && i0 < Shape(0) + && 0 <= i1 && i1 < Shape(1); + } + + /// 3D specialization. + bool Contains(int i0, int i1, int i2) const { + return 0 <= i0 && i0 < Shape(0) + && 0 <= i1 && i1 < Shape(1) + && 0 <= i2 && i2 < Shape(2); + } + + bool operator==(const ArrayND<T, N> &other) const { + if (shape_ != other.shape_) return false; + if (strides_ != other.strides_) return false; + for (int i = 0; i < Size(); ++i) { + if (this->Data()[i] != other.Data()[i]) + return false; + } + return true; + } + + bool operator!=(const ArrayND<T, N> &other) const { + return !(*this == other); + } + + ArrayND<T, N> operator*(const ArrayND<T, N> &other) const { + assert(Shape() = other.Shape()); + ArrayND<T, N> res; + res.ResizeLike(*this); + for (int i = 0; i < res.Size(); ++i) { + res.Data()[i] = Data()[i] * other.Data()[i]; + } + return res; + } + + protected: + /// The number of element in each dimension. + Index shape_; + + /// How to jump to neighbors in each dimension. + Index strides_; + + /// Pointer to the first element of the array. + T *data_; + + /// Flag if this Array either own or reference the data + bool own_data; +}; + +/// 3D array (row, column, channel). +template <typename T> +class Array3D : public ArrayND<T, 3> { + typedef ArrayND<T, 3> Base; + public: + Array3D() + : Base() { + } + Array3D(int height, int width, int depth=1) + : Base(height, width, depth) { + } + Array3D(T* data, int height, int width, int depth=1) + : Base(data, height, width, depth) { + } + + void Resize(int height, int width, int depth=1) { + Base::Resize(height, width, depth); + } + + int Height() const { + return Base::Shape(0); + } + int Width() const { + return Base::Shape(1); + } + int Depth() const { + return Base::Shape(2); + } + + // Match Eigen2's API so that Array3D's and Mat*'s can work together via + // template magic. + int rows() const { return Height(); } + int cols() const { return Width(); } + int depth() const { return Depth(); } + + int Get_Step() const { return Width()*Depth(); } + + /// Enable accessing with 2 indices for grayscale images. + T &operator()(int i0, int i1, int i2 = 0) { + assert(0 <= i0 && i0 < Height()); + assert(0 <= i1 && i1 < Width()); + return Base::operator()(i0,i1,i2); + } + const T &operator()(int i0, int i1, int i2 = 0) const { + assert(0 <= i0 && i0 < Height()); + assert(0 <= i1 && i1 < Width()); + return Base::operator()(i0,i1,i2); + } +}; + +typedef Array3D<unsigned char> Array3Du; +typedef Array3D<unsigned int> Array3Dui; +typedef Array3D<int> Array3Di; +typedef Array3D<float> Array3Df; +typedef Array3D<short> Array3Ds; + +void SplitChannels(const Array3Df &input, + Array3Df *channel0, + Array3Df *channel1, + Array3Df *channel2); + +void PrintArray(const Array3Df &array); + +/** Convert a float array into a byte array by scaling values by 255* (max-min). + * where max and min are automatically detected + * (if automatic_range_detection = true) + * \note and TODO this automatic detection only works when the image contains + * at least one pixel of both bounds. + **/ +void FloatArrayToScaledByteArray(const Array3Df &float_array, + Array3Du *byte_array, + bool automatic_range_detection = false); + +//! Convert a byte array into a float array by dividing values by 255. +void ByteArrayToScaledFloatArray(const Array3Du &byte_array, + Array3Df *float_array); + +template <typename AArrayType, typename BArrayType, typename CArrayType> +void MultiplyElements( const AArrayType &a, + const BArrayType &b, + CArrayType *c ) { + // This function does an element-wise multiply between + // the two Arrays A and B, and stores the result in C. + // A and B must have the same dimensions. + assert( a.Shape() == b.Shape() ); + c->ResizeLike(a); + + // To perform the multiplcation, a "current" index into the N-dimensions of + // the A and B matrix specifies which elements are being multiplied. + typename CArrayType::Index index; + + // The index starts at the maximum value for each dimension + const typename CArrayType::Index& cShape = c->Shape(); + for ( int i = 0; i < CArrayType::Index::SIZE; ++i ) + index(i) = cShape(i) - 1; + + // After each multiplication, the highest-dimensional index is reduced. + // if this reduces it less than zero, it resets to its maximum value + // and decrements the index of the next lower dimension. + // This ripple-action continues until the entire new array has been + // calculated, indicated by dimension zero having a negative index. + while ( index(0) >= 0 ) { + (*c)(index) = a(index) * b(index); + + int dimension = CArrayType::Index::SIZE - 1; + index(dimension) = index(dimension) - 1; + while ( dimension > 0 && index(dimension) < 0 ) { + index(dimension) = cShape(dimension) - 1; + index(dimension - 1) = index(dimension - 1) - 1; + --dimension; + } + } +} + +template <typename TA, typename TB, typename TC> +void MultiplyElements(const ArrayND<TA, 3> &a, + const ArrayND<TB, 3> &b, + ArrayND<TC, 3> *c) { + // Specialization for N==3 + c->ResizeLike(a); + assert(a.Shape(0) == b.Shape(0)); + assert(a.Shape(1) == b.Shape(1)); + assert(a.Shape(2) == b.Shape(2)); + for (int i = 0; i < a.Shape(0); ++i) { + for (int j = 0; j < a.Shape(1); ++j) { + for (int k = 0; k < a.Shape(2); ++k) { + (*c)(i, j, k) = TC(a(i, j, k) * b(i, j, k)); + } + } + } +} + + +} // namespace libmv + +#endif // LIBMV_IMAGE_ARRAY_ND_H diff --git a/extern/libmv/libmv/image/convolve.cc b/extern/libmv/libmv/image/convolve.cc new file mode 100644 index 00000000000..be73a1a3263 --- /dev/null +++ b/extern/libmv/libmv/image/convolve.cc @@ -0,0 +1,305 @@ +// Copyright (c) 2007, 2008 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. + +#include <cmath> + +#include "libmv/image/image.h" +#include "libmv/image/convolve.h" + +namespace libmv { + +// Compute a Gaussian kernel and derivative, such that you can take the +// derivative of an image by convolving with the kernel horizontally then the +// derivative vertically to get (eg) the y derivative. +void ComputeGaussianKernel(double sigma, Vec *kernel, Vec *derivative) { + assert(sigma >= 0.0); + + // 0.004 implies a 3 pixel kernel with 1 pixel sigma. + const float truncation_factor = 0.004f; + + // Calculate the kernel size based on sigma such that it is odd. + float precisehalfwidth = GaussianInversePositive(truncation_factor, sigma); + int width = lround(2*precisehalfwidth); + if (width % 2 == 0) { + width++; + } + // Calculate the gaussian kernel and its derivative. + kernel->resize(width); + derivative->resize(width); + kernel->setZero(); + derivative->setZero(); + int halfwidth = width / 2; + for (int i = -halfwidth; i <= halfwidth; ++i) { + (*kernel)(i + halfwidth) = Gaussian(i, sigma); + (*derivative)(i + halfwidth) = GaussianDerivative(i, sigma); + } + // Since images should not get brighter or darker, normalize. + NormalizeL1(kernel); + + // Normalize the derivative differently. See + // www.cs.duke.edu/courses/spring03/cps296.1/handouts/Image%20Processing.pdf + double factor = 0.; + for (int i = -halfwidth; i <= halfwidth; ++i) { + factor -= i*(*derivative)(i+halfwidth); + } + *derivative /= factor; +} + +template <int size, bool vertical> +void FastConvolve(const Vec &kernel, int width, int height, + const float* src, int src_stride, int src_line_stride, + float* dst, int dst_stride) { + double coefficients[2 * size + 1]; + for (int k = 0; k < 2 * size + 1; ++k) { + coefficients[k] = kernel(2 * size - k); + } + // Fast path: if the kernel has a certain size, use the constant sized loops. + for (int y = 0; y < height; ++y) { + for (int x = 0; x < width; ++x) { + double sum = 0; + for (int k = -size; k <= size; ++k) { + if (vertical) { + if (y + k >= 0 && y + k < height) { + sum += src[k * src_line_stride] * coefficients[k + size]; + } + } else { + if (x + k >= 0 && x + k < width) { + sum += src[k * src_stride] * coefficients[k + size]; + } + } + } + dst[0] = static_cast<float>(sum); + src += src_stride; + dst += dst_stride; + } + } +} + +template<bool vertical> +void Convolve(const Array3Df &in, + const Vec &kernel, + Array3Df *out_pointer, + int plane) { + int width = in.Width(); + int height = in.Height(); + Array3Df &out = *out_pointer; + if (plane == -1) { + out.ResizeLike(in); + plane = 0; + } + + assert(kernel.size() % 2 == 1); + assert(&in != out_pointer); + + int src_line_stride = in.Stride(0); + int src_stride = in.Stride(1); + int dst_stride = out.Stride(1); + const float* src = in.Data(); + float* dst = out.Data() + plane; + + // Use a dispatch table to make most convolutions used in practice use the + // fast path. + int half_width = kernel.size() / 2; + switch (half_width) { +#define static_convolution( size ) case size: \ + FastConvolve<size, vertical>(kernel, width, height, src, src_stride, \ + src_line_stride, dst, dst_stride); break; + static_convolution(1) + static_convolution(2) + static_convolution(3) + static_convolution(4) + static_convolution(5) + static_convolution(6) + static_convolution(7) +#undef static_convolution + default: + int dynamic_size = kernel.size() / 2; + for (int y = 0; y < height; ++y) { + for (int x = 0; x < width; ++x) { + double sum = 0; + // Slow path: this loop cannot be unrolled. + for (int k = -dynamic_size; k <= dynamic_size; ++k) { + if(vertical) { + if (y + k >= 0 && y + k < height) { + sum += src[k * src_line_stride] * kernel(2 * dynamic_size - (k + dynamic_size)); + } + } else { + if (x + k >= 0 && x + k < width) { + sum += src[k * src_stride] * kernel(2 * dynamic_size - (k + dynamic_size)); + } + } + } + dst[0] = static_cast<float>(sum); + src += src_stride; + dst += dst_stride; + } + } + } +} + +void ConvolveHorizontal(const Array3Df &in, + const Vec &kernel, + Array3Df *out_pointer, + int plane) { + Convolve<false>(in, kernel, out_pointer, plane); +} + +void ConvolveVertical(const Array3Df &in, + const Vec &kernel, + Array3Df *out_pointer, + int plane) { + Convolve<true>(in, kernel, out_pointer, plane); +} + +void ConvolveGaussian(const Array3Df &in, + double sigma, + Array3Df *out_pointer) { + Vec kernel, derivative; + ComputeGaussianKernel(sigma, &kernel, &derivative); + + Array3Df tmp; + ConvolveVertical(in, kernel, &tmp); + ConvolveHorizontal(tmp, kernel, out_pointer); +} + +void BlurredImageAndDerivatives(const Array3Df &in, + double sigma, + Array3Df *blurred_image, + Array3Df *gradient_x, + Array3Df *gradient_y) { + Vec kernel, derivative; + ComputeGaussianKernel(sigma, &kernel, &derivative); + Array3Df tmp; + + // Compute convolved image. + ConvolveVertical(in, kernel, &tmp); + ConvolveHorizontal(tmp, kernel, blurred_image); + + // Compute first derivative in x (reusing vertical convolution above). + ConvolveHorizontal(tmp, derivative, gradient_x); + + // Compute first derivative in y. + ConvolveHorizontal(in, kernel, &tmp); + ConvolveVertical(tmp, derivative, gradient_y); +} + +// Compute the gaussian blur of an image and the derivatives of the blurred +// image, and store the results in three channels. Since the blurred value and +// gradients are closer in memory, this leads to better performance if all +// three values are needed at the same time. +void BlurredImageAndDerivativesChannels(const Array3Df &in, + double sigma, + Array3Df *blurred_and_gradxy) { + assert(in.Depth() == 1); + + Vec kernel, derivative; + ComputeGaussianKernel(sigma, &kernel, &derivative); + + // Compute convolved image. + Array3Df tmp; + ConvolveVertical(in, kernel, &tmp); + blurred_and_gradxy->Resize(in.Height(), in.Width(), 3); + ConvolveHorizontal(tmp, kernel, blurred_and_gradxy, 0); + + // Compute first derivative in x. + ConvolveHorizontal(tmp, derivative, blurred_and_gradxy, 1); + + // Compute first derivative in y. + ConvolveHorizontal(in, kernel, &tmp); + ConvolveVertical(tmp, derivative, blurred_and_gradxy, 2); +} + +void BoxFilterHorizontal(const Array3Df &in, + int window_size, + Array3Df *out_pointer) { + Array3Df &out = *out_pointer; + out.ResizeLike(in); + int half_width = (window_size - 1) / 2; + + for (int k = 0; k < in.Depth(); ++k) { + for (int i=0; i<in.Height(); ++i) { + float sum = 0; + // Init sum. + for (int j=0; j<half_width; ++j) { + sum += in(i, j, k); + } + // Fill left border. + for (int j=0; j < half_width + 1; ++j) { + sum += in(i, j + half_width, k); + out(i, j, k) = sum; + } + // Fill interior. + for (int j = half_width + 1; j<in.Width()-half_width; ++j) { + sum -= in(i, j - half_width - 1, k); + sum += in(i, j + half_width, k); + out(i, j, k) = sum; + } + // Fill right border. + for (int j = in.Width() - half_width; j<in.Width(); ++j) { + sum -= in(i, j - half_width - 1, k); + out(i, j, k) = sum; + } + } + } +} + +void BoxFilterVertical(const Array3Df &in, + int window_size, + Array3Df *out_pointer) { + Array3Df &out = *out_pointer; + out.ResizeLike(in); + int half_width = (window_size - 1) / 2; + + for (int k = 0; k < in.Depth(); ++k) { + for (int j = 0; j < in.Width(); ++j) { + float sum = 0; + // Init sum. + for (int i=0; i<half_width; ++i) { + sum += in(i, j, k); + } + // Fill left border. + for (int i=0; i < half_width + 1; ++i) { + sum += in(i + half_width, j, k); + out(i, j, k) = sum; + } + // Fill interior. + for (int i = half_width + 1; i<in.Height()-half_width; ++i) { + sum -= in(i - half_width - 1, j, k); + sum += in(i + half_width, j, k); + out(i, j, k) = sum; + } + // Fill right border. + for (int i = in.Height() - half_width; i<in.Height(); ++i) { + sum -= in(i - half_width - 1, j, k); + out(i, j, k) = sum; + } + } + } +} + +void BoxFilter(const Array3Df &in, + int box_width, + Array3Df *out) { + Array3Df tmp; + BoxFilterHorizontal(in, box_width, &tmp); + BoxFilterVertical(tmp, box_width, out); +} + +} // namespace libmv diff --git a/extern/libmv/libmv/image/convolve.h b/extern/libmv/libmv/image/convolve.h new file mode 100644 index 00000000000..c6c995fd674 --- /dev/null +++ b/extern/libmv/libmv/image/convolve.h @@ -0,0 +1,93 @@ +// Copyright (c) 2007, 2008, 2011 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_IMAGE_CONVOLVE_H_ +#define LIBMV_IMAGE_CONVOLVE_H_ + +#include "libmv/image/image.h" +#include "libmv/numeric/numeric.h" + +namespace libmv { + +// TODO(keir): Find a better place for these functions. gaussian.h in numeric? + +// Zero mean Gaussian. +inline double Gaussian(double x, double sigma) { + return 1/sqrt(2*M_PI*sigma*sigma) * exp(-(x*x/2/sigma/sigma)); +} +// 2D gaussian (zero mean) +// (9) in http://mathworld.wolfram.com/GaussianFunction.html +inline double Gaussian2D(double x, double y, double sigma) { + return 1.0/(2.0*M_PI*sigma*sigma) * exp( -(x*x+y*y)/(2.0*sigma*sigma)); +} +inline double GaussianDerivative(double x, double sigma) { + return -x / sigma / sigma * Gaussian(x, sigma); +} +// Solve the inverse of the Gaussian for positive x. +inline double GaussianInversePositive(double y, double sigma) { + return sqrt(-2 * sigma * sigma * log(y * sigma * sqrt(2*M_PI))); +} + +void ComputeGaussianKernel(double sigma, Vec *kernel, Vec *derivative); +void ConvolveHorizontal(const FloatImage &in, + const Vec &kernel, + FloatImage *out_pointer, + int plane = -1); +void ConvolveVertical(const FloatImage &in, + const Vec &kernel, + FloatImage *out_pointer, + int plane = -1); +void ConvolveGaussian(const FloatImage &in, + double sigma, + FloatImage *out_pointer); + +void ImageDerivatives(const FloatImage &in, + double sigma, + FloatImage *gradient_x, + FloatImage *gradient_y); + +void BlurredImageAndDerivatives(const FloatImage &in, + double sigma, + FloatImage *blurred_image, + FloatImage *gradient_x, + FloatImage *gradient_y); + +// Blur and take the gradients of an image, storing the results inside the +// three channels of blurred_and_gradxy. +void BlurredImageAndDerivativesChannels(const FloatImage &in, + double sigma, + FloatImage *blurred_and_gradxy); + +void BoxFilterHorizontal(const FloatImage &in, + int window_size, + FloatImage *out_pointer); + +void BoxFilterVertical(const FloatImage &in, + int window_size, + FloatImage *out_pointer); + +void BoxFilter(const FloatImage &in, + int box_width, + FloatImage *out); + +} // namespace libmv + +#endif // LIBMV_IMAGE_CONVOLVE_H_ + diff --git a/extern/libmv/libmv/image/image.h b/extern/libmv/libmv/image/image.h new file mode 100644 index 00000000000..d158b0e0397 --- /dev/null +++ b/extern/libmv/libmv/image/image.h @@ -0,0 +1,158 @@ +// Copyright (c) 2007, 2008 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_IMAGE_IMAGE_H +#define LIBMV_IMAGE_IMAGE_H + +#include <cmath> + +#include "libmv/image/array_nd.h" + +namespace libmv { + +typedef Array3Du ByteImage; // For backwards compatibility. +typedef Array3Df FloatImage; + +// Type added only to manage special 2D array for feature detection +typedef Array3Di IntImage; +typedef Array3Ds ShortImage; + +// An image class that is a thin wrapper around Array3D's of various types. +// TODO(keir): Decide if we should add reference counting semantics... Maybe it +// is the best solution after all. +class Image { + public: + + // Create an image from an array. The image takes ownership of the array. + Image(Array3Du *array) : array_type_(BYTE), array_(array) {} + Image(Array3Df *array) : array_type_(FLOAT), array_(array) {} + + Image(const Image &img): array_type_(NONE), array_(NULL) { + *this = img; + } + + // Underlying data type. + enum DataType { + NONE, + BYTE, + FLOAT, + INT, + SHORT, + }; + + // Size in bytes that the image takes in memory. + int MemorySizeInBytes() { + int size; + switch (array_type_) + { + case BYTE: + size = reinterpret_cast<Array3Du *>(array_)->MemorySizeInBytes(); + break; + case FLOAT: + size = reinterpret_cast<Array3Df *>(array_)->MemorySizeInBytes(); + break; + case INT: + size = reinterpret_cast<Array3Di *>(array_)->MemorySizeInBytes(); + break; + case SHORT: + size = reinterpret_cast<Array3Ds *>(array_)->MemorySizeInBytes(); + break; + default : + size = 0; + assert(0); + } + size += sizeof(*this); + return size; + } + + ~Image() { + switch (array_type_) + { + case BYTE: + delete reinterpret_cast<Array3Du *>(array_); + + break; + case FLOAT: + delete reinterpret_cast<Array3Df *>(array_); + + break; + case INT: + delete reinterpret_cast<Array3Di *>(array_); + + break; + case SHORT: + delete reinterpret_cast<Array3Ds *>(array_); + + break; + default: + assert(0); + } + } + + Image& operator= (const Image& f) { + if (this != &f) { + array_type_ = f.array_type_; + switch (array_type_) + { + case BYTE: + delete reinterpret_cast<Array3Du *>(array_); + array_ = new Array3Du( *(Array3Du *)f.array_); + break; + case FLOAT: + delete reinterpret_cast<Array3Df *>(array_); + array_ = new Array3Df( *(Array3Df *)f.array_); + break; + case INT: + delete reinterpret_cast<Array3Di *>(array_); + array_ = new Array3Di( *(Array3Di *)f.array_); + break; + case SHORT: + delete reinterpret_cast<Array3Ds *>(array_); + array_ = new Array3Ds( *(Array3Ds *)f.array_); + break; + default: + assert(0); + } + } + return *this; + } + + Array3Du *AsArray3Du() const { + if (array_type_ == BYTE) { + return reinterpret_cast<Array3Du *>(array_); + } + return NULL; + } + + Array3Df *AsArray3Df() const { + if (array_type_ == FLOAT) { + return reinterpret_cast<Array3Df *>(array_); + } + return NULL; + } + + private: + DataType array_type_; + BaseArray *array_; +}; + +} // namespace libmv + +#endif // LIBMV_IMAGE_IMAGE_IMAGE_H diff --git a/extern/libmv/libmv/image/sample.h b/extern/libmv/libmv/image/sample.h new file mode 100644 index 00000000000..cd361231b58 --- /dev/null +++ b/extern/libmv/libmv/image/sample.h @@ -0,0 +1,103 @@ +// Copyright (c) 2007, 2008 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_IMAGE_SAMPLE_H_ +#define LIBMV_IMAGE_SAMPLE_H_ + +#include "libmv/image/image.h" + +namespace libmv { + +/// Nearest neighbor interpolation. +template<typename T> +inline T SampleNearest(const Array3D<T> &image, + float y, float x, int v = 0) { + const int i = int(round(y)); + const int j = int(round(x)); + return image(i, j, v); +} + +static inline void LinearInitAxis(float fx, int width, + int *x1, int *x2, + float *dx1, float *dx2) { + const int ix = int(fx); + if (ix < 0) { + *x1 = 0; + *x2 = 0; + *dx1 = 1; + *dx2 = 0; + } else if (ix > width-2) { + *x1 = width-1; + *x2 = width-1; + *dx1 = 1; + *dx2 = 0; + } else { + *x1 = ix; + *x2 = *x1 + 1; + *dx1 = *x2 - fx; + *dx2 = 1 - *dx1; + } +} + +/// Linear interpolation. +template<typename T> +inline T SampleLinear(const Array3D<T> &image, float y, float x, int v = 0) { + int x1, y1, x2, y2; + float dx1, dy1, dx2, dy2; + + LinearInitAxis(y, image.Height(), &y1, &y2, &dy1, &dy2); + LinearInitAxis(x, image.Width(), &x1, &x2, &dx1, &dx2); + + const T im11 = image(y1, x1, v); + const T im12 = image(y1, x2, v); + const T im21 = image(y2, x1, v); + const T im22 = image(y2, x2, v); + + return T(dy1 * ( dx1 * im11 + dx2 * im12 ) + + dy2 * ( dx1 * im21 + dx2 * im22 )); +} + +// Downsample all channels by 2. If the image has odd width or height, the last +// row or column is ignored. +// FIXME(MatthiasF): this implementation shouldn't be in an interface file +inline void DownsampleChannelsBy2(const Array3Df &in, Array3Df *out) { + int height = in.Height() / 2; + int width = in.Width() / 2; + int depth = in.Depth(); + + out->Resize(height, width, depth); + + // 2x2 box filter downsampling. + for (int r = 0; r < height; ++r) { + for (int c = 0; c < width; ++c) { + for (int k = 0; k < depth; ++k) { + (*out)(r, c, k) = (in(2 * r, 2 * c, k) + + in(2 * r + 1, 2 * c, k) + + in(2 * r, 2 * c + 1, k) + + in(2 * r + 1, 2 * c + 1, k)) / 4.0f; + } + } + } + +} + +} // namespace libmv + +#endif // LIBMV_IMAGE_SAMPLE_H_ diff --git a/extern/libmv/libmv/image/tuple.h b/extern/libmv/libmv/image/tuple.h new file mode 100644 index 00000000000..79acc9579d0 --- /dev/null +++ b/extern/libmv/libmv/image/tuple.h @@ -0,0 +1,90 @@ +// Copyright (c) 2007, 2008 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_IMAGE_TUPLE_H +#define LIBMV_IMAGE_TUPLE_H + +#include <algorithm> + +namespace libmv { + +// A vector of elements with fixed lenght and deep copy semantics. +template <typename T, int N> +class Tuple { + public: + enum { SIZE = N }; + Tuple() {} + Tuple(T initial_value) { Reset(initial_value); } + + template <typename D> + Tuple(D *values) { Reset(values); } + + template <typename D> + Tuple(const Tuple<D,N> &b) { Reset(b); } + + template <typename D> + Tuple& operator=(const Tuple<D,N>& b) { + Reset(b); + return *this; + } + + template <typename D> + void Reset(const Tuple<D, N>& b) { Reset(b.Data()); } + + template <typename D> + void Reset(D *values) { + for(int i=0;i<N;i++) { + data_[i] = T(values[i]); + } + } + + // Set all tuple values to the same thing. + void Reset(T value) { + for(int i=0;i<N;i++) { + data_[i] = value; + } + } + + // Pointer to the first element. + T *Data() { return &data_[0]; } + const T *Data() const { return &data_[0]; } + + T &operator()(int i) { return data_[i]; } + const T &operator()(int i) const { return data_[i]; } + + bool operator==(const Tuple<T, N> &other) const { + for (int i = 0; i < N; ++i) { + if ((*this)(i) != other(i)) { + return false; + } + } + return true; + } + bool operator!=(const Tuple<T, N> &other) const { + return !(*this == other); + } + + private: + T data_[N]; +}; + +} // namespace libmv + +#endif // LIBMV_IMAGE_TUPLE_H diff --git a/extern/libmv/libmv/logging/logging.h b/extern/libmv/libmv/logging/logging.h new file mode 100644 index 00000000000..af86c4baa42 --- /dev/null +++ b/extern/libmv/libmv/logging/logging.h @@ -0,0 +1,31 @@ +// Copyright (c) 2007, 2008, 2009 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_LOGGING_LOGGING_H +#define LIBMV_LOGGING_LOGGING_H + +#include "glog/logging.h" + +#define LG LOG(INFO) +#define V0 LOG(INFO) +#define V1 LOG(INFO) +#define V2 LOG(INFO) + +#endif // LIBMV_LOGGING_LOGGING_H diff --git a/extern/libmv/libmv/multiview/conditioning.cc b/extern/libmv/libmv/multiview/conditioning.cc new file mode 100644 index 00000000000..20e3a88e6cb --- /dev/null +++ b/extern/libmv/libmv/multiview/conditioning.cc @@ -0,0 +1,99 @@ +// Copyright (c) 2010 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. + +#include "libmv/multiview/conditioning.h" +#include "libmv/multiview/projection.h" + +namespace libmv { + +// HZ 4.4.4 pag.109: Point conditioning (non isotropic) +void PreconditionerFromPoints(const Mat &points, Mat3 *T) { + Vec mean, variance; + MeanAndVarianceAlongRows(points, &mean, &variance); + + double xfactor = sqrt(2.0 / variance(0)); + double yfactor = sqrt(2.0 / variance(1)); + + // If variance is equal to 0.0 set scaling factor to identity. + // -> Else it will provide nan value (because division by 0). + if (variance(0) < 1e-8) + xfactor = mean(0) = 1.0; + if (variance(1) < 1e-8) + yfactor = mean(1) = 1.0; + + *T << xfactor, 0, -xfactor * mean(0), + 0, yfactor, -yfactor * mean(1), + 0, 0, 1; +} +// HZ 4.4.4 pag.107: Point conditioning (isotropic) +void IsotropicPreconditionerFromPoints(const Mat &points, Mat3 *T) { + Vec mean, variance; + MeanAndVarianceAlongRows(points, &mean, &variance); + + double var_norm = variance.norm(); + double factor = sqrt(2.0 / var_norm); + + // If variance is equal to 0.0 set scaling factor to identity. + // -> Else it will provide nan value (because division by 0). + if (var_norm < 1e-8) { + factor = 1.0; + mean.setOnes(); + } + + *T << factor, 0, -factor * mean(0), + 0, factor, -factor * mean(1), + 0, 0, 1; +} + +void ApplyTransformationToPoints(const Mat &points, + const Mat3 &T, + Mat *transformed_points) { + int n = points.cols(); + transformed_points->resize(2,n); + Mat3X p(3, n); + EuclideanToHomogeneous(points, &p); + p = T * p; + HomogeneousToEuclidean(p, transformed_points); +} + +void NormalizePoints(const Mat &points, + Mat *normalized_points, + Mat3 *T) { + PreconditionerFromPoints(points, T); + ApplyTransformationToPoints(points, *T, normalized_points); +} + +void NormalizeIsotropicPoints(const Mat &points, + Mat *normalized_points, + Mat3 *T) { + IsotropicPreconditionerFromPoints(points, T); + ApplyTransformationToPoints(points, *T, normalized_points); +} + +// Denormalize the results. See HZ page 109. +void UnnormalizerT::Unnormalize(const Mat3 &T1, const Mat3 &T2, Mat3 *H) { + *H = T2.transpose() * (*H) * T1; +} + +void UnnormalizerI::Unnormalize(const Mat3 &T1, const Mat3 &T2, Mat3 *H) { + *H = T2.inverse() * (*H) * T1; +} + +} // namespace libmv diff --git a/extern/libmv/libmv/multiview/conditioning.h b/extern/libmv/libmv/multiview/conditioning.h new file mode 100644 index 00000000000..181d7485374 --- /dev/null +++ b/extern/libmv/libmv/multiview/conditioning.h @@ -0,0 +1,60 @@ +// Copyright (c) 2010 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_MULTIVIEW_CONDITIONNING_H_ +#define LIBMV_MULTIVIEW_CONDITIONNING_H_ + +#include "libmv/numeric/numeric.h" + +namespace libmv { + +// Point conditioning (non isotropic) +void PreconditionerFromPoints(const Mat &points, Mat3 *T); +// Point conditioning (isotropic) +void IsotropicPreconditionerFromPoints(const Mat &points, Mat3 *T); + +void ApplyTransformationToPoints(const Mat &points, + const Mat3 &T, + Mat *transformed_points); + +void NormalizePoints(const Mat &points, + Mat *normalized_points, + Mat3 *T); + +void NormalizeIsotropicPoints(const Mat &points, + Mat *normalized_points, + Mat3 *T); + +/// Use inverse for unnormalize +struct UnnormalizerI { + // Denormalize the results. See HZ page 109. + static void Unnormalize(const Mat3 &T1, const Mat3 &T2, Mat3 *H); +}; + +/// Use transpose for unnormalize +struct UnnormalizerT { + // Denormalize the results. See HZ page 109. + static void Unnormalize(const Mat3 &T1, const Mat3 &T2, Mat3 *H); +}; + +} //namespace libmv + + +#endif // LIBMV_MULTIVIEW_CONDITIONNING_H_ diff --git a/extern/libmv/libmv/multiview/euclidean_resection.cc b/extern/libmv/libmv/multiview/euclidean_resection.cc new file mode 100644 index 00000000000..6d918a1a8bc --- /dev/null +++ b/extern/libmv/libmv/multiview/euclidean_resection.cc @@ -0,0 +1,661 @@ +// Copyright (c) 2009 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. + +#include <cmath> +#include <limits> + +#include <Eigen/SVD> +#include <Eigen/Geometry> + +#include "libmv/base/vector.h" +#include "libmv/logging/logging.h" +#include "libmv/multiview/euclidean_resection.h" +#include "libmv/multiview/projection.h" + +namespace libmv { +namespace euclidean_resection { + +bool EuclideanResection(const Mat2X &x_camera, + const Mat3X &X_world, + Mat3 *R, Vec3 *t, + ResectionMethod method) { + switch (method) { + case RESECTION_ANSAR_DANIILIDIS: + EuclideanResectionAnsarDaniilidis(x_camera, X_world, R, t); + break; + case RESECTION_EPNP: + return EuclideanResectionEPnP(x_camera, X_world, R, t); + break; + default: + LOG(FATAL) << "Unknown resection method."; + } + return false; +} + +bool EuclideanResection(const Mat &x_image, + const Mat3X &X_world, + const Mat3 &K, + Mat3 *R, Vec3 *t, + ResectionMethod method) { + CHECK(x_image.rows() == 2 || x_image.rows() == 3) + << "Invalid size for x_image: " + << x_image.rows() << "x" << x_image.cols(); + + Mat2X x_camera; + if (x_image.rows() == 2) { + EuclideanToNormalizedCamera(x_image, K, &x_camera); + } else if (x_image.rows() == 3) { + HomogeneousToNormalizedCamera(x_image, K, &x_camera); + } + return EuclideanResection(x_camera, X_world, R, t, method); +} + +void AbsoluteOrientation(const Mat3X &X, + const Mat3X &Xp, + Mat3 *R, + Vec3 *t) { + int num_points = X.cols(); + Vec3 C = X.rowwise().sum() / num_points; // Centroid of X. + Vec3 Cp = Xp.rowwise().sum() / num_points; // Centroid of Xp. + + // Normalize the two point sets. + Mat3X Xn(3, num_points), Xpn(3, num_points); + for( int i = 0; i < num_points; ++i ){ + Xn.col(i) = X.col(i) - C; + Xpn.col(i) = Xp.col(i) - Cp; + } + + // Construct the N matrix (pg. 635). + double Sxx = Xn.row(0).dot(Xpn.row(0)); + double Syy = Xn.row(1).dot(Xpn.row(1)); + double Szz = Xn.row(2).dot(Xpn.row(2)); + double Sxy = Xn.row(0).dot(Xpn.row(1)); + double Syx = Xn.row(1).dot(Xpn.row(0)); + double Sxz = Xn.row(0).dot(Xpn.row(2)); + double Szx = Xn.row(2).dot(Xpn.row(0)); + double Syz = Xn.row(1).dot(Xpn.row(2)); + double Szy = Xn.row(2).dot(Xpn.row(1)); + + Mat4 N; + N << Sxx + Syy + Szz, Syz - Szy, Szx - Sxz, Sxy - Syx, + Syz - Szy, Sxx - Syy - Szz, Sxy + Syx, Szx + Sxz, + Szx - Sxz, Sxy + Syx, -Sxx + Syy - Szz, Syz + Szy, + Sxy - Syx, Szx + Sxz, Syz + Szy, -Sxx - Syy + Szz; + + // Find the unit quaternion q that maximizes qNq. It is the eigenvector + // corresponding to the lagest eigenvalue. + Vec4 q = N.jacobiSvd(Eigen::ComputeFullU).matrixU().col(0); + + // Retrieve the 3x3 rotation matrix. + Vec4 qq = q.array() * q.array(); + double q0q1 = q(0) * q(1); + double q0q2 = q(0) * q(2); + double q0q3 = q(0) * q(3); + double q1q2 = q(1) * q(2); + double q1q3 = q(1) * q(3); + double q2q3 = q(2) * q(3); + + (*R) << qq(0) + qq(1) - qq(2) - qq(3), + 2 * (q1q2 - q0q3), + 2 * (q1q3 + q0q2), + 2 * (q1q2+ q0q3), + qq(0) - qq(1) + qq(2) - qq(3), + 2 * (q2q3 - q0q1), + 2 * (q1q3 - q0q2), + 2 * (q2q3 + q0q1), + qq(0) - qq(1) - qq(2) + qq(3); + + // Fix the handedness of the R matrix. + if (R->determinant() < 0) { + R->row(2) = -R->row(2); + } + // Compute the final translation. + *t = Cp - *R * C; +} + +// Convert i and j indices of the original variables into their quadratic +// permutation single index. It follows that t_ij = t_ji. +static int IJToPointIndex(int i, int j, int num_points) { + // Always make sure that j is bigger than i. This handles t_ij = t_ji. + if (j < i) { + std::swap(i, j); + } + int idx; + int num_permutation_rows = num_points * (num_points - 1) / 2; + + // All t_ii's are located at the end of the t vector after all t_ij's. + if (j == i) { + idx = num_permutation_rows + i; + } else { + int offset = (num_points - i - 1) * (num_points - i) / 2; + idx = (num_permutation_rows - offset + j - i - 1); + } + return idx; +}; + +// Convert i and j indexes of the solution for lambda to their linear indexes. +static int IJToIndex(int i, int j, int num_lambda) { + if (j < i) { + std::swap(i, j); + } + int A = num_lambda * (num_lambda + 1) / 2; + int B = num_lambda - i; + int C = B * (B + 1) / 2; + int idx = A - C + j - i; + return idx; +}; + +static int Sign(double value) { + return (value < 0) ? -1 : 1; +}; + +// Organizes a square matrix into a single row constraint on the elements of +// Lambda to create the constraints in equation (5) in "Linear Pose Estimation +// from Points or Lines", by Ansar, A. and Daniilidis, PAMI 2003. vol. 25, no. +// 5. +static Vec MatrixToConstraint(const Mat &A, + int num_k_columns, + int num_lambda) { + Vec C(num_k_columns); + C.setZero(); + int idx = 0; + for (int i = 0; i < num_lambda; ++i) { + for( int j = i; j < num_lambda; ++j) { + C(idx) = A(i, j); + if (i != j){ + C(idx) += A(j, i); + } + ++ idx; + } + } + return C; +} + +// Normalizes the columns of vectors. +static void NormalizeColumnVectors(Mat3X *vectors) { + int num_columns = vectors->cols(); + for (int i = 0; i < num_columns; ++i){ + vectors->col(i).normalize(); + } +} + +void EuclideanResectionAnsarDaniilidis(const Mat2X &x_camera, + const Mat3X &X_world, + Mat3 *R, + Vec3 *t) { + CHECK(x_camera.cols() == X_world.cols()); + CHECK(x_camera.cols() > 3); + + int num_points = x_camera.cols(); + + // Copy the normalized camera coords into 3 vectors and normalize them so + // that they are unit vectors from the camera center. + Mat3X x_camera_unit(3, num_points); + x_camera_unit.block(0, 0, 2, num_points) = x_camera; + x_camera_unit.row(2).setOnes(); + NormalizeColumnVectors(&x_camera_unit); + + int num_m_rows = num_points * (num_points - 1) / 2; + int num_tt_variables = num_points * (num_points + 1) / 2; + int num_m_columns = num_tt_variables + 1; + Mat M(num_m_columns, num_m_columns); + M.setZero(); + Matu ij_index(num_tt_variables, 2); + + // Create the constraint equations for the t_ij variables (7) and arrange + // them into the M matrix (8). Also store the initial (i, j) indices. + int row=0; + for (int i = 0; i < num_points; ++i) { + for (int j = i+1; j < num_points; ++j) { + M(row, row) = -2 * x_camera_unit.col(i).dot(x_camera_unit.col(j)); + M(row, num_m_rows + i) = x_camera_unit.col(i).dot(x_camera_unit.col(i)); + M(row, num_m_rows + j) = x_camera_unit.col(j).dot(x_camera_unit.col(j)); + Vec3 Xdiff = X_world.col(i) - X_world.col(j); + double center_to_point_distance = Xdiff.norm(); + M(row, num_m_columns - 1) = + - center_to_point_distance * center_to_point_distance; + ij_index(row, 0) = i; + ij_index(row, 1) = j; + ++row; + } + ij_index(i + num_m_rows, 0) = i; + ij_index(i + num_m_rows, 1) = i; + } + + int num_lambda = num_points + 1; // Dimension of the null space of M. + Mat V = M.jacobiSvd(Eigen::ComputeFullV).matrixV().block(0, + num_m_rows, + num_m_columns, + num_lambda); + + // TODO(vess): The number of constraint equations in K (num_k_rows) must be + // (num_points + 1) * (num_points + 2)/2. This creates a performance issue + // for more than 4 points. It is fine for 4 points at the moment with 18 + // instead of 15 equations. + int num_k_rows = num_m_rows + num_points * + (num_points*(num_points-1)/2 - num_points+1); + int num_k_columns = num_lambda * (num_lambda + 1) / 2; + Mat K(num_k_rows, num_k_columns); + K.setZero(); + + // Construct the first part of the K matrix corresponding to (t_ii, t_jk) for + // i != j. + int counter_k_row = 0; + for (int idx1 = num_m_rows; idx1 < num_tt_variables; ++idx1) { + for (int idx2 = 0; idx2 < num_m_rows; ++idx2) { + + unsigned int i = ij_index(idx1, 0); + unsigned int j = ij_index(idx2, 0); + unsigned int k = ij_index(idx2, 1); + + if( i != j && i != k ){ + int idx3 = IJToPointIndex(i, j, num_points); + int idx4 = IJToPointIndex(i, k, num_points); + + K.row(counter_k_row) = + MatrixToConstraint(V.row(idx1).transpose() * V.row(idx2)- + V.row(idx3).transpose() * V.row(idx4), + num_k_columns, + num_lambda); + ++counter_k_row; + } + } + } + + // Construct the second part of the K matrix corresponding to (t_ii,t_jk) for + // j==k. + for (int idx1 = num_m_rows; idx1 < num_tt_variables; ++idx1) { + for (int idx2 = idx1 + 1; idx2 < num_tt_variables; ++idx2) { + unsigned int i = ij_index(idx1, 0); + unsigned int j = ij_index(idx2, 0); + unsigned int k = ij_index(idx2, 1); + + int idx3 = IJToPointIndex(i, j, num_points); + int idx4 = IJToPointIndex(i, k, num_points); + + K.row(counter_k_row) = + MatrixToConstraint(V.row(idx1).transpose() * V.row(idx2)- + V.row(idx3).transpose() * V.row(idx4), + num_k_columns, + num_lambda); + ++counter_k_row; + } + } + Vec L_sq = K.jacobiSvd(Eigen::ComputeFullV).matrixV().col(num_k_columns - 1); + + // Pivot on the largest element for numerical stability. Afterwards recover + // the sign of the lambda solution. + double max_L_sq_value = fabs(L_sq(IJToIndex(0, 0, num_lambda))); + int max_L_sq_index = 1; + for (int i = 1; i < num_lambda; ++i) { + double abs_sq_value = fabs(L_sq(IJToIndex(i, i, num_lambda))); + if (max_L_sq_value < abs_sq_value) { + max_L_sq_value = abs_sq_value; + max_L_sq_index = i; + } + } + // Ensure positiveness of the largest value corresponding to lambda_ii. + L_sq = L_sq * Sign(L_sq(IJToIndex(max_L_sq_index, + max_L_sq_index, + num_lambda))); + + + Vec L(num_lambda); + L(max_L_sq_index) = sqrt(L_sq(IJToIndex(max_L_sq_index, + max_L_sq_index, + num_lambda))); + + for (int i = 0; i < num_lambda; ++i) { + if (i != max_L_sq_index) { + L(i) = L_sq(IJToIndex(max_L_sq_index, i, num_lambda)) / L(max_L_sq_index); + } + } + + // Correct the scale using the fact that the last constraint is equal to 1. + L = L / (V.row(num_m_columns - 1).dot(L)); + Vec X = V * L; + + // Recover the distances from the camera center to the 3D points Q. + Vec d(num_points); + d.setZero(); + for (int c_point = num_m_rows; c_point < num_tt_variables; ++c_point) { + d(c_point - num_m_rows) = sqrt(X(c_point)); + } + + // Create the 3D points in the camera system. + Mat X_cam(3, num_points); + for (int c_point = 0; c_point < num_points; ++c_point ) { + X_cam.col(c_point) = d(c_point) * x_camera_unit.col(c_point); + } + // Recover the camera translation and rotation. + AbsoluteOrientation(X_world, X_cam, R, t); +} + +// Selects 4 virtual control points using mean and PCA. +void SelectControlPoints(const Mat3X &X_world, + Mat *X_centered, + Mat34 *X_control_points) { + size_t num_points = X_world.cols(); + + // The first virtual control point, C0, is the centroid. + Vec mean, variance; + MeanAndVarianceAlongRows(X_world, &mean, &variance); + X_control_points->col(0) = mean; + + // Computes PCA + X_centered->resize (3, num_points); + for (size_t c = 0; c < num_points; c++) { + X_centered->col(c) = X_world.col (c) - mean; + } + Mat3 X_centered_sq = (*X_centered) * X_centered->transpose(); + Eigen::JacobiSVD<Mat3> X_centered_sq_svd(X_centered_sq, Eigen::ComputeFullU); + Vec3 w = X_centered_sq_svd.singularValues(); + Mat3 u = X_centered_sq_svd.matrixU(); + for (size_t c = 0; c < 3; c++) { + double k = sqrt (w (c) / num_points); + X_control_points->col (c + 1) = mean + k * u.col (c); + } +} + +// Computes the barycentric coordinates for all real points +void ComputeBarycentricCoordinates(const Mat3X &X_world_centered, + const Mat34 &X_control_points, + Mat4X *alphas) { + size_t num_points = X_world_centered.cols(); + Mat3 C2 ; + for (size_t c = 1; c < 4; c++) { + C2.col(c-1) = X_control_points.col(c) - X_control_points.col(0); + } + + Mat3 C2inv = C2.inverse(); + Mat3X a = C2inv * X_world_centered; + + alphas->resize(4, num_points); + alphas->setZero(); + alphas->block(1, 0, 3, num_points) = a; + for (size_t c = 0; c < num_points; c++) { + (*alphas)(0, c) = 1.0 - alphas->col(c).sum(); + } +} + +// Estimates the coordinates of all real points in the camera coordinate frame +void ComputePointsCoordinatesInCameraFrame( + const Mat4X &alphas, + const Vec4 &betas, + const Eigen::Matrix<double, 12, 12> &U, + Mat3X *X_camera) { + size_t num_points = alphas.cols(); + + // Estimates the control points in the camera reference frame. + Mat34 C2b; C2b.setZero(); + for (size_t cu = 0; cu < 4; cu++) { + for (size_t c = 0; c < 4; c++) { + C2b.col(c) += betas(cu) * U.block(11 - cu, c * 3, 1, 3).transpose(); + } + } + + // Estimates the 3D points in the camera reference frame + X_camera->resize(3, num_points); + for (size_t c = 0; c < num_points; c++) { + X_camera->col(c) = C2b * alphas.col(c); + } + + // Check the sign of the z coordinate of the points (should be positive) + uint num_z_neg = 0; + for (size_t i = 0; i < X_camera->cols(); ++i) { + if ((*X_camera)(2,i) < 0) { + num_z_neg++; + } + } + + // If more than 50% of z are negative, we change the signs + if (num_z_neg > 0.5 * X_camera->cols()) { + C2b = -C2b; + *X_camera = -(*X_camera); + } +} + +bool EuclideanResectionEPnP(const Mat2X &x_camera, + const Mat3X &X_world, + Mat3 *R, Vec3 *t) { + CHECK(x_camera.cols() == X_world.cols()); + CHECK(x_camera.cols() > 3); + size_t num_points = X_world.cols(); + + // Select the control points. + Mat34 X_control_points; + Mat X_centered; + SelectControlPoints(X_world, &X_centered, &X_control_points); + + // Compute the barycentric coordinates. + Mat4X alphas(4, num_points); + ComputeBarycentricCoordinates(X_centered, X_control_points, &alphas); + + // Estimates the M matrix with the barycentric coordinates + Mat M(2 * num_points, 12); + Eigen::Matrix<double, 2, 12> sub_M; + for (size_t c = 0; c < num_points; c++) { + double a0 = alphas(0, c); + double a1 = alphas(1, c); + double a2 = alphas(2, c); + double a3 = alphas(3, c); + double ui = x_camera(0, c); + double vi = x_camera(1, c); + M.block(2*c, 0, 2, 12) << a0, 0, + a0*(-ui), a1, 0, + a1*(-ui), a2, 0, + a2*(-ui), a3, 0, + a3*(-ui), 0, + a0, a0*(-vi), 0, + a1, a1*(-vi), 0, + a2, a2*(-vi), 0, + a3, a3*(-vi); + } + + // TODO(julien): Avoid the transpose by rewriting the u2.block() calls. + Eigen::JacobiSVD<Mat> MtMsvd(M.transpose()*M, Eigen::ComputeFullU); + Eigen::Matrix<double, 12, 12> u2 = MtMsvd.matrixU().transpose(); + + // Estimate the L matrix. + Eigen::Matrix<double, 6, 3> dv1; + Eigen::Matrix<double, 6, 3> dv2; + Eigen::Matrix<double, 6, 3> dv3; + Eigen::Matrix<double, 6, 3> dv4; + + dv1.row(0) = u2.block(11, 0, 1, 3) - u2.block(11, 3, 1, 3); + dv1.row(1) = u2.block(11, 0, 1, 3) - u2.block(11, 6, 1, 3); + dv1.row(2) = u2.block(11, 0, 1, 3) - u2.block(11, 9, 1, 3); + dv1.row(3) = u2.block(11, 3, 1, 3) - u2.block(11, 6, 1, 3); + dv1.row(4) = u2.block(11, 3, 1, 3) - u2.block(11, 9, 1, 3); + dv1.row(5) = u2.block(11, 6, 1, 3) - u2.block(11, 9, 1, 3); + dv2.row(0) = u2.block(10, 0, 1, 3) - u2.block(10, 3, 1, 3); + dv2.row(1) = u2.block(10, 0, 1, 3) - u2.block(10, 6, 1, 3); + dv2.row(2) = u2.block(10, 0, 1, 3) - u2.block(10, 9, 1, 3); + dv2.row(3) = u2.block(10, 3, 1, 3) - u2.block(10, 6, 1, 3); + dv2.row(4) = u2.block(10, 3, 1, 3) - u2.block(10, 9, 1, 3); + dv2.row(5) = u2.block(10, 6, 1, 3) - u2.block(10, 9, 1, 3); + dv3.row(0) = u2.block( 9, 0, 1, 3) - u2.block( 9, 3, 1, 3); + dv3.row(1) = u2.block( 9, 0, 1, 3) - u2.block( 9, 6, 1, 3); + dv3.row(2) = u2.block( 9, 0, 1, 3) - u2.block( 9, 9, 1, 3); + dv3.row(3) = u2.block( 9, 3, 1, 3) - u2.block( 9, 6, 1, 3); + dv3.row(4) = u2.block( 9, 3, 1, 3) - u2.block( 9, 9, 1, 3); + dv3.row(5) = u2.block( 9, 6, 1, 3) - u2.block( 9, 9, 1, 3); + dv4.row(0) = u2.block( 8, 0, 1, 3) - u2.block( 8, 3, 1, 3); + dv4.row(1) = u2.block( 8, 0, 1, 3) - u2.block( 8, 6, 1, 3); + dv4.row(2) = u2.block( 8, 0, 1, 3) - u2.block( 8, 9, 1, 3); + dv4.row(3) = u2.block( 8, 3, 1, 3) - u2.block( 8, 6, 1, 3); + dv4.row(4) = u2.block( 8, 3, 1, 3) - u2.block( 8, 9, 1, 3); + dv4.row(5) = u2.block( 8, 6, 1, 3) - u2.block( 8, 9, 1, 3); + + Eigen::Matrix<double, 6, 10> L; + for (size_t r = 0; r < 6; r++) { + L.row(r) << dv1.row(r).dot(dv1.row(r)), + 2.0 * dv1.row(r).dot(dv2.row(r)), + dv2.row(r).dot(dv2.row(r)), + 2.0 * dv1.row(r).dot(dv3.row(r)), + 2.0 * dv2.row(r).dot(dv3.row(r)), + dv3.row(r).dot(dv3.row(r)), + 2.0 * dv1.row(r).dot(dv4.row(r)), + 2.0 * dv2.row(r).dot(dv4.row(r)), + 2.0 * dv3.row(r).dot(dv4.row(r)), + dv4.row(r).dot(dv4.row(r)); + } + Vec6 rho; + rho << (X_control_points.col(0) - X_control_points.col(1)).squaredNorm(), + (X_control_points.col(0) - X_control_points.col(2)).squaredNorm(), + (X_control_points.col(0) - X_control_points.col(3)).squaredNorm(), + (X_control_points.col(1) - X_control_points.col(2)).squaredNorm(), + (X_control_points.col(1) - X_control_points.col(3)).squaredNorm(), + (X_control_points.col(2) - X_control_points.col(3)).squaredNorm(); + + // There are three possible solutions based on the three approximations of L + // (betas). Below, each one is solved for then the best one is chosen. + Mat3X X_camera; + Mat3 K; K.setIdentity(); + vector<Mat3> Rs(3); + vector<Vec3> ts(3); + Vec rmse(3); + + // TODO(julien): Document where the "1e-3" magical constant comes from below. + + // Find the first possible solution for R, t corresponding to: + // Betas = [b00 b01 b11 b02 b12 b22 b03 b13 b23 b33] + // Betas_approx_1 = [b00 b01 b02 b03] + Vec4 betas = Vec4::Zero(); + Eigen::Matrix<double, 6, 4> l_6x4; + for (size_t r = 0; r < 6; r++) { + l_6x4.row(r) << L(r, 0), L(r, 1), L(r, 3), L(r, 6); + } + Eigen::JacobiSVD<Mat> svd_of_l4(l_6x4, + Eigen::ComputeFullU | Eigen::ComputeFullV); + Vec4 b4 = svd_of_l4.solve(rho); + if ((l_6x4 * b4).isApprox(rho, 1e-3)) { + if (b4(0) < 0) { + b4 = -b4; + } + b4(0) = std::sqrt(b4(0)); + betas << b4(0), b4(1) / b4(0), b4(2) / b4(0), b4(3) / b4(0); + ComputePointsCoordinatesInCameraFrame(alphas, betas, u2, &X_camera); + AbsoluteOrientation(X_world, X_camera, &Rs[0], &ts[0]); + rmse(0) = RootMeanSquareError(x_camera, X_world, K, Rs[0], ts[0]); + } else { + LOG(ERROR) << "First approximation of beta not good enough."; + ts[0].setZero(); + rmse(0) = std::numeric_limits<double>::max(); + } + + // Find the second possible solution for R, t corresponding to: + // Betas = [b00 b01 b11 b02 b12 b22 b03 b13 b23 b33] + // Betas_approx_2 = [b00 b01 b11] + betas.setZero(); + Eigen::Matrix<double, 6, 3> l_6x3; + l_6x3 = L.block(0, 0, 6, 3); + Eigen::JacobiSVD<Mat> svdOfL3(l_6x3, + Eigen::ComputeFullU | Eigen::ComputeFullV); + Vec3 b3 = svdOfL3.solve(rho); + VLOG(2) << " rho = " << rho; + VLOG(2) << " l_6x3 * b3 = " << l_6x3 * b3; + if ((l_6x3 * b3).isApprox(rho, 1e-3)) { + if (b3(0) < 0) { + betas(0) = std::sqrt(-b3(0)); + betas(1) = (b3(2) < 0) ? std::sqrt(-b3(2)) : 0; + } else { + betas(0) = std::sqrt(b3(0)); + betas(1) = (b3(2) > 0) ? std::sqrt(b3(2)) : 0; + } + if (b3(1) < 0) { + betas(0) = -betas(0); + } + betas(2) = 0; + betas(3) = 0; + ComputePointsCoordinatesInCameraFrame(alphas, betas, u2, &X_camera); + AbsoluteOrientation(X_world, X_camera, &Rs[1], &ts[1]); + rmse(1) = RootMeanSquareError(x_camera, X_world, K, Rs[1], ts[1]); + } else { + LOG(ERROR) << "Second approximation of beta not good enough."; + ts[1].setZero(); + rmse(1) = std::numeric_limits<double>::max(); + } + + // Find the third possible solution for R, t corresponding to: + // Betas = [b00 b01 b11 b02 b12 b22 b03 b13 b23 b33] + // Betas_approx_3 = [b00 b01 b11 b02 b12] + betas.setZero(); + Eigen::Matrix<double, 6, 5> l_6x5; + l_6x5 = L.block(0, 0, 6, 5); + Eigen::JacobiSVD<Mat> svdOfL5(l_6x5, + Eigen::ComputeFullU | Eigen::ComputeFullV); + Vec5 b5 = svdOfL5.solve(rho); + if ((l_6x5 * b5).isApprox(rho, 1e-3)) { + if (b5(0) < 0) { + betas(0) = std::sqrt(-b5(0)); + if (b5(2) < 0) { + betas(1) = std::sqrt(-b5(2)); + } else { + b5(2) = 0; + } + } else { + betas(0) = std::sqrt(b5(0)); + if (b5(2) > 0) { + betas(1) = std::sqrt(b5(2)); + } else { + b5(2) = 0; + } + } + if (b5(1) < 0) { + betas(0) = -betas(0); + } + betas(2) = b5(3) / betas(0); + betas(3) = 0; + ComputePointsCoordinatesInCameraFrame(alphas, betas, u2, &X_camera); + AbsoluteOrientation(X_world, X_camera, &Rs[2], &ts[2]); + rmse(2) = RootMeanSquareError(x_camera, X_world, K, Rs[2], ts[2]); + } else { + LOG(ERROR) << "Third approximation of beta not good enough."; + ts[2].setZero(); + rmse(2) = std::numeric_limits<double>::max(); + } + + // Finally, with all three solutions, select the (R, t) with the best RMSE. + VLOG(2) << "RMSE for solution 0: " << rmse(0); + VLOG(2) << "RMSE for solution 1: " << rmse(0); + VLOG(2) << "RMSE for solution 2: " << rmse(0); + size_t n = 0; + if (rmse(1) < rmse(0)) { + n = 1; + } + if (rmse(2) < rmse(n)) { + n = 2; + } + if (rmse(n) == std::numeric_limits<double>::max()) { + LOG(ERROR) << "All three possibilities failed. Reporting failure."; + return false; + } + + VLOG(1) << "RMSE for best solution #" << n << ": " << rmse(n); + *R = Rs[n]; + *t = ts[n]; + + // TODO(julien): Improve the solutions with non-linear refinement. + return true; +} + +} // namespace resection +} // namespace libmv diff --git a/extern/libmv/libmv/multiview/euclidean_resection.h b/extern/libmv/libmv/multiview/euclidean_resection.h new file mode 100644 index 00000000000..08fa3d90bd3 --- /dev/null +++ b/extern/libmv/libmv/multiview/euclidean_resection.h @@ -0,0 +1,124 @@ +// Copyright (c) 2010 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_MULTIVIEW_EUCLIDEAN_RESECTION_H_ +#define LIBMV_MULTIVIEW_EUCLIDEAN_RESECTION_H_ + +#include "libmv/numeric/numeric.h" +#include "libmv/multiview/projection.h" + +namespace libmv { +namespace euclidean_resection { + +enum ResectionMethod { + RESECTION_ANSAR_DANIILIDIS, + RESECTION_EPNP, +}; + +/** + * Computes the extrinsic parameters, R and t for a calibrated camera + * from 4 or more 3D points and their normalized images. + * + * \param x_camera Image points in normalized camera coordinates e.g. x_camera + * = inv(K) * x_image. + * \param X_world 3D points in the world coordinate system + * \param R Solution for the camera rotation matrix + * \param t Solution for the camera translation vector + * \param method The resection method to use. + */ +bool EuclideanResection(const Mat2X &x_camera, + const Mat3X &X_world, + Mat3 *R, Vec3 *t, + ResectionMethod method = RESECTION_EPNP); + +/** + * Computes the extrinsic parameters, R and t for a calibrated camera + * from 4 or more 3D points and their images. + * + * \param x_image Image points in non-normalized image coordinates. The + * coordates are laid out one per row. The matrix can be Nx2 + * or Nx3 for euclidean or homogenous 2D coordinates. + * \param X_world 3D points in the world coordinate system + * \param K Intrinsic parameters camera matrix + * \param R Solution for the camera rotation matrix + * \param t Solution for the camera translation vector + * \param method Resection method + */ +bool EuclideanResection(const Mat &x_image, + const Mat3X &X_world, + const Mat3 &K, + Mat3 *R, Vec3 *t, + ResectionMethod method = RESECTION_EPNP); + +/** + * The absolute orientation algorithm recovers the transformation between a set + * of 3D points, X and Xp such that: + * + * Xp = R*X + t + * + * The recovery of the absolute orientation is implemented after this article: + * Horn, Hilden, "Closed-form solution of absolute orientation using + * orthonormal matrices" + */ +void AbsoluteOrientation(const Mat3X &X, + const Mat3X &Xp, + Mat3 *R, + Vec3 *t); + +/** + * Computes the extrinsic parameters, R and t for a calibrated camera from 4 or + * more 3D points and their images. + * + * \param x_camera Image points in normalized camera coordinates, e.g. + * x_camera=inv(K)*x_image + * \param X_world 3D points in the world coordinate system + * \param R Solution for the camera rotation matrix + * \param t Solution for the camera translation vector + * + * This is the algorithm described in: "Linear Pose Estimation from Points or + * Lines", by Ansar, A. and Daniilidis, PAMI 2003. vol. 25, no. 5. + */ +void EuclideanResectionAnsarDaniilidis(const Mat2X &x_camera, + const Mat3X &X_world, + Mat3 *R, Vec3 *t); +/** + * Computes the extrinsic parameters, R and t for a calibrated camera from 4 or + * more 3D points and their images. + * + * \param x_camera Image points in normalized camera coordinates, + * e.g. x_camera = inv(K) * x_image + * \param X_world 3D points in the world coordinate system + * \param R Solution for the camera rotation matrix + * \param t Solution for the camera translation vector + * + * This is the algorithm described in: + * "{EP$n$P: An Accurate $O(n)$ Solution to the P$n$P Problem", by V. Lepetit + * and F. Moreno-Noguer and P. Fua, IJCV 2009. vol. 81, no. 2 + * \note: the non-linear optimization is not implemented here. + */ +bool EuclideanResectionEPnP(const Mat2X &x_camera, + const Mat3X &X_world, + Mat3 *R, Vec3 *t); + +} // namespace euclidean_resection +} // namespace libmv + + +#endif /* LIBMV_MULTIVIEW_EUCLIDEAN_RESECTION_H_ */ diff --git a/extern/libmv/libmv/multiview/fundamental.cc b/extern/libmv/libmv/multiview/fundamental.cc new file mode 100644 index 00000000000..7a6b4a08439 --- /dev/null +++ b/extern/libmv/libmv/multiview/fundamental.cc @@ -0,0 +1,391 @@ +// Copyright (c) 2007, 2008 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. + +#include "libmv/logging/logging.h" +#include "libmv/numeric/numeric.h" +#include "libmv/numeric/poly.h" +#include "libmv/multiview/conditioning.h" +#include "libmv/multiview/projection.h" +#include "libmv/multiview/triangulation.h" +#include "libmv/multiview/fundamental.h" + +namespace libmv { + +void EliminateRow(const Mat34 &P, int row, Mat *X) { + X->resize(2, 4); + + int first_row = (row + 1) % 3; + int second_row = (row + 2) % 3; + + for (int i = 0; i < 4; ++i) { + (*X)(0, i) = P(first_row, i); + (*X)(1, i) = P(second_row, i); + } +} + +void ProjectionsFromFundamental(const Mat3 &F, Mat34 *P1, Mat34 *P2) { + *P1 << Mat3::Identity(), Vec3::Zero(); + Vec3 e2; + Mat3 Ft = F.transpose(); + Nullspace(&Ft, &e2); + *P2 << CrossProductMatrix(e2) * F, e2; +} + +// Addapted from vgg_F_from_P. +void FundamentalFromProjections(const Mat34 &P1, const Mat34 &P2, Mat3 *F) { + Mat X[3]; + Mat Y[3]; + Mat XY; + + for (int i = 0; i < 3; ++i) { + EliminateRow(P1, i, X + i); + EliminateRow(P2, i, Y + i); + } + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + VerticalStack(X[j], Y[i], &XY); + (*F)(i, j) = XY.determinant(); + } + } +} + +// HZ 11.1 pag.279 (x1 = x, x2 = x') +// http://www.cs.unc.edu/~marc/tutorial/node54.html +double EightPointSolver(const Mat &x1, const Mat &x2, Mat3 *F) { + DCHECK_EQ(x1.rows(), 2); + DCHECK_GE(x1.cols(), 8); + DCHECK_EQ(x1.rows(), x2.rows()); + DCHECK_EQ(x1.cols(), x2.cols()); + + int n = x1.cols(); + Mat A(n, 9); + for (int i = 0; i < n; ++i) { + A(i, 0) = x2(0, i) * x1(0, i); + A(i, 1) = x2(0, i) * x1(1, i); + A(i, 2) = x2(0, i); + A(i, 3) = x2(1, i) * x1(0, i); + A(i, 4) = x2(1, i) * x1(1, i); + A(i, 5) = x2(1, i); + A(i, 6) = x1(0, i); + A(i, 7) = x1(1, i); + A(i, 8) = 1; + } + + Vec9 f; + double smaller_singular_value = Nullspace(&A, &f); + *F = Map<RMat3>(f.data()); + return smaller_singular_value; +} + +// HZ 11.1.1 pag.280 +void EnforceFundamentalRank2Constraint(Mat3 *F) { + Eigen::JacobiSVD<Mat3> USV(*F, Eigen::ComputeFullU | Eigen::ComputeFullV); + Vec3 d = USV.singularValues(); + d(2) = 0.0; + *F = USV.matrixU() * d.asDiagonal() * USV.matrixV().transpose(); +} + +// HZ 11.2 pag.281 (x1 = x, x2 = x') +double NormalizedEightPointSolver(const Mat &x1, + const Mat &x2, + Mat3 *F) { + DCHECK_EQ(x1.rows(), 2); + DCHECK_GE(x1.cols(), 8); + DCHECK_EQ(x1.rows(), x2.rows()); + DCHECK_EQ(x1.cols(), x2.cols()); + + // Normalize the data. + Mat3 T1, T2; + PreconditionerFromPoints(x1, &T1); + PreconditionerFromPoints(x2, &T2); + Mat x1_normalized, x2_normalized; + ApplyTransformationToPoints(x1, T1, &x1_normalized); + ApplyTransformationToPoints(x2, T2, &x2_normalized); + + // Estimate the fundamental matrix. + double smaller_singular_value = + EightPointSolver(x1_normalized, x2_normalized, F); + EnforceFundamentalRank2Constraint(F); + + // Denormalize the fundamental matrix. + *F = T2.transpose() * (*F) * T1; + + return smaller_singular_value; +} + +// Seven-point algorithm. +// http://www.cs.unc.edu/~marc/tutorial/node55.html +double FundamentalFrom7CorrespondencesLinear(const Mat &x1, + const Mat &x2, + std::vector<Mat3> *F) { + DCHECK_EQ(x1.rows(), 2); + DCHECK_EQ(x1.cols(), 7); + DCHECK_EQ(x1.rows(), x2.rows()); + DCHECK_EQ(x2.cols(), x2.cols()); + + // Build a 9 x n matrix from point matches, where each row is equivalent to + // the equation x'T*F*x = 0 for a single correspondence pair (x', x). The + // domain of the matrix is a 9 element vector corresponding to F. The + // nullspace should be rank two; the two dimensions correspond to the set of + // F matrices satisfying the epipolar geometry. + Matrix<double, 7, 9> A; + for (int ii = 0; ii < 7; ++ii) { + A(ii, 0) = x1(0, ii) * x2(0, ii); // 0 represents x coords, + A(ii, 1) = x1(1, ii) * x2(0, ii); // 1 represents y coords. + A(ii, 2) = x2(0, ii); + A(ii, 3) = x1(0, ii) * x2(1, ii); + A(ii, 4) = x1(1, ii) * x2(1, ii); + A(ii, 5) = x2(1, ii); + A(ii, 6) = x1(0, ii); + A(ii, 7) = x1(1, ii); + A(ii, 8) = 1.0; + } + + // Find the two F matrices in the nullspace of A. + Vec9 f1, f2; + double s = Nullspace2(&A, &f1, &f2); + Mat3 F1 = Map<RMat3>(f1.data()); + Mat3 F2 = Map<RMat3>(f2.data()); + + // Then, use the condition det(F) = 0 to determine F. In other words, solve + // det(F1 + a*F2) = 0 for a. + double a = F1(0, 0), j = F2(0, 0), + b = F1(0, 1), k = F2(0, 1), + c = F1(0, 2), l = F2(0, 2), + d = F1(1, 0), m = F2(1, 0), + e = F1(1, 1), n = F2(1, 1), + f = F1(1, 2), o = F2(1, 2), + g = F1(2, 0), p = F2(2, 0), + h = F1(2, 1), q = F2(2, 1), + i = F1(2, 2), r = F2(2, 2); + + // Run fundamental_7point_coeffs.py to get the below coefficients. + // The coefficients are in ascending powers of alpha, i.e. P[N]*x^N. + double P[4] = { + a*e*i + b*f*g + c*d*h - a*f*h - b*d*i - c*e*g, + a*e*r + a*i*n + b*f*p + b*g*o + c*d*q + c*h*m + d*h*l + e*i*j + f*g*k - + a*f*q - a*h*o - b*d*r - b*i*m - c*e*p - c*g*n - d*i*k - e*g*l - f*h*j, + a*n*r + b*o*p + c*m*q + d*l*q + e*j*r + f*k*p + g*k*o + h*l*m + i*j*n - + a*o*q - b*m*r - c*n*p - d*k*r - e*l*p - f*j*q - g*l*n - h*j*o - i*k*m, + j*n*r + k*o*p + l*m*q - j*o*q - k*m*r - l*n*p, + }; + + // Solve for the roots of P[3]*x^3 + P[2]*x^2 + P[1]*x + P[0] = 0. + double roots[3]; + int num_roots = SolveCubicPolynomial(P, roots); + + // Build the fundamental matrix for each solution. + for (int kk = 0; kk < num_roots; ++kk) { + F->push_back(F1 + roots[kk] * F2); + } + return s; +} + +double FundamentalFromCorrespondences7Point(const Mat &x1, + const Mat &x2, + std::vector<Mat3> *F) { + DCHECK_EQ(x1.rows(), 2); + DCHECK_GE(x1.cols(), 7); + DCHECK_EQ(x1.rows(), x2.rows()); + DCHECK_EQ(x1.cols(), x2.cols()); + + // Normalize the data. + Mat3 T1, T2; + PreconditionerFromPoints(x1, &T1); + PreconditionerFromPoints(x2, &T2); + Mat x1_normalized, x2_normalized; + ApplyTransformationToPoints(x1, T1, &x1_normalized); + ApplyTransformationToPoints(x2, T2, &x2_normalized); + + // Estimate the fundamental matrix. + double smaller_singular_value = + FundamentalFrom7CorrespondencesLinear(x1_normalized, x2_normalized, &(*F)); + + for (int k = 0; k < F->size(); ++k) { + Mat3 & Fmat = (*F)[k]; + // Denormalize the fundamental matrix. + Fmat = T2.transpose() * Fmat * T1; + } + return smaller_singular_value; +} + +void NormalizeFundamental(const Mat3 &F, Mat3 *F_normalized) { + *F_normalized = F / FrobeniusNorm(F); + if ((*F_normalized)(2, 2) < 0) { + *F_normalized *= -1; + } +} + +double SampsonDistance(const Mat &F, const Vec2 &x1, const Vec2 &x2) { + Vec3 x(x1(0), x1(1), 1.0); + Vec3 y(x2(0), x2(1), 1.0); + + Vec3 F_x = F * x; + Vec3 Ft_y = F.transpose() * y; + double y_F_x = y.dot(F_x); + + return Square(y_F_x) / ( F_x.head<2>().squaredNorm() + + Ft_y.head<2>().squaredNorm()); +} + +double SymmetricEpipolarDistance(const Mat &F, const Vec2 &x1, const Vec2 &x2) { + Vec3 x(x1(0), x1(1), 1.0); + Vec3 y(x2(0), x2(1), 1.0); + + Vec3 F_x = F * x; + Vec3 Ft_y = F.transpose() * y; + double y_F_x = y.dot(F_x); + + return Square(y_F_x) * ( 1 / F_x.head<2>().squaredNorm() + + 1 / Ft_y.head<2>().squaredNorm()); +} + +// HZ 9.6 pag 257 (formula 9.12) +void EssentialFromFundamental(const Mat3 &F, + const Mat3 &K1, + const Mat3 &K2, + Mat3 *E) { + *E = K2.transpose() * F * K1; +} + +// HZ 9.6 pag 257 (formula 9.12) +// Or http://ai.stanford.edu/~birch/projective/node20.html +void FundamentalFromEssential(const Mat3 &E, + const Mat3 &K1, + const Mat3 &K2, + Mat3 *F) { + *F = K2.inverse().transpose() * E * K1.inverse(); +} + +void RelativeCameraMotion(const Mat3 &R1, + const Vec3 &t1, + const Mat3 &R2, + const Vec3 &t2, + Mat3 *R, + Vec3 *t) { + *R = R2 * R1.transpose(); + *t = t2 - (*R) * t1; +} + +// HZ 9.6 pag 257 +void EssentialFromRt(const Mat3 &R1, + const Vec3 &t1, + const Mat3 &R2, + const Vec3 &t2, + Mat3 *E) { + Mat3 R; + Vec3 t; + RelativeCameraMotion(R1, t1, R2, t2, &R, &t); + Mat3 Tx = CrossProductMatrix(t); + *E = Tx * R; +} + +// HZ 9.6 pag 259 (Result 9.19) +void MotionFromEssential(const Mat3 &E, + std::vector<Mat3> *Rs, + std::vector<Vec3> *ts) { + Eigen::JacobiSVD<Mat3> USV(E, Eigen::ComputeFullU | Eigen::ComputeFullV); + Mat3 U = USV.matrixU(); + Vec3 d = USV.singularValues(); + Mat3 Vt = USV.matrixV().transpose(); + + // Last column of U is undetermined since d = (a a 0). + if (U.determinant() < 0) { + U.col(2) *= -1; + } + // Last row of Vt is undetermined since d = (a a 0). + if (Vt.determinant() < 0) { + Vt.row(2) *= -1; + } + + Mat3 W; + W << 0, -1, 0, + 1, 0, 0, + 0, 0, 1; + + Mat3 U_W_Vt = U * W * Vt; + Mat3 U_Wt_Vt = U * W.transpose() * Vt; + + Rs->resize(4); + (*Rs)[0] = U_W_Vt; + (*Rs)[1] = U_W_Vt; + (*Rs)[2] = U_Wt_Vt; + (*Rs)[3] = U_Wt_Vt; + + ts->resize(4); + (*ts)[0] = U.col(2); + (*ts)[1] = -U.col(2); + (*ts)[2] = U.col(2); + (*ts)[3] = -U.col(2); +} + +int MotionFromEssentialChooseSolution(const std::vector<Mat3> &Rs, + const std::vector<Vec3> &ts, + const Mat3 &K1, + const Vec2 &x1, + const Mat3 &K2, + const Vec2 &x2) { + DCHECK_EQ(4, Rs.size()); + DCHECK_EQ(4, ts.size()); + + Mat34 P1, P2; + Mat3 R1; + Vec3 t1; + R1.setIdentity(); + t1.setZero(); + P_From_KRt(K1, R1, t1, &P1); + for (int i = 0; i < 4; ++i) { + const Mat3 &R2 = Rs[i]; + const Vec3 &t2 = ts[i]; + P_From_KRt(K2, R2, t2, &P2); + Vec3 X; + TriangulateDLT(P1, x1, P2, x2, &X); + double d1 = Depth(R1, t1, X); + double d2 = Depth(R2, t2, X); + // Test if point is front to the two cameras. + if (d1 > 0 && d2 > 0) { + return i; + } + } + return -1; +} + +bool MotionFromEssentialAndCorrespondence(const Mat3 &E, + const Mat3 &K1, + const Vec2 &x1, + const Mat3 &K2, + const Vec2 &x2, + Mat3 *R, + Vec3 *t) { + std::vector<Mat3> Rs; + std::vector<Vec3> ts; + MotionFromEssential(E, &Rs, &ts); + int solution = MotionFromEssentialChooseSolution(Rs, ts, K1, x1, K2, x2); + if (solution >= 0) { + *R = Rs[solution]; + *t = ts[solution]; + return true; + } else { + return false; + } +} + +} // namespace libmv diff --git a/extern/libmv/libmv/multiview/fundamental.h b/extern/libmv/libmv/multiview/fundamental.h new file mode 100644 index 00000000000..3f4a3b7b211 --- /dev/null +++ b/extern/libmv/libmv/multiview/fundamental.h @@ -0,0 +1,144 @@ +// Copyright (c) 2007, 2008, 2011 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_MULTIVIEW_FUNDAMENTAL_H_ +#define LIBMV_MULTIVIEW_FUNDAMENTAL_H_ + +#include <vector> + +#include "libmv/numeric/numeric.h" + +namespace libmv { + +void ProjectionsFromFundamental(const Mat3 &F, Mat34 *P1, Mat34 *P2); +void FundamentalFromProjections(const Mat34 &P1, const Mat34 &P2, Mat3 *F); + +/** + * The normalized 8-point fundamental matrix solver. + */ +double NormalizedEightPointSolver(const Mat &x1, + const Mat &x2, + Mat3 *F); + +/** + * 7 points (minimal case, points coordinates must be normalized before): + */ +double FundamentalFrom7CorrespondencesLinear(const Mat &x1, + const Mat &x2, + std::vector<Mat3> *F); + +/** + * 7 points (points coordinates must be in image space): + */ +double FundamentalFromCorrespondences7Point(const Mat &x1, + const Mat &x2, + std::vector<Mat3> *F); + +/** + * 8 points (points coordinates must be in image space): + */ +double NormalizedEightPointSolver(const Mat &x1, + const Mat &x2, + Mat3 *F); + +/** + * Fundamental matrix utility function: + */ +void EnforceFundamentalRank2Constraint(Mat3 *F); + +void NormalizeFundamental(const Mat3 &F, Mat3 *F_normalized); + +/** + * Approximate squared reprojection errror. + * + * See page 287 of HZ equation 11.9. This avoids triangulating the point, + * relying only on the entries in F. + */ +double SampsonDistance(const Mat &F, const Vec2 &x1, const Vec2 &x2); + +/** + * Calculates the sum of the distances from the points to the epipolar lines. + * + * See page 288 of HZ equation 11.10. + */ +double SymmetricEpipolarDistance(const Mat &F, const Vec2 &x1, const Vec2 &x2); + +/** + * Compute the relative camera motion between two cameras. + * + * Given the motion parameters of two cameras, computes the motion parameters + * of the second one assuming the first one to be at the origin. + * If T1 and T2 are the camera motions, the computed relative motion is + * T = T2 T1^{-1} + */ +void RelativeCameraMotion(const Mat3 &R1, + const Vec3 &t1, + const Mat3 &R2, + const Vec3 &t2, + Mat3 *R, + Vec3 *t); + +void EssentialFromFundamental(const Mat3 &F, + const Mat3 &K1, + const Mat3 &K2, + Mat3 *E); + +void FundamentalFromEssential(const Mat3 &E, + const Mat3 &K1, + const Mat3 &K2, + Mat3 *F); + +void EssentialFromRt(const Mat3 &R1, + const Vec3 &t1, + const Mat3 &R2, + const Vec3 &t2, + Mat3 *E); + +void MotionFromEssential(const Mat3 &E, + std::vector<Mat3> *Rs, + std::vector<Vec3> *ts); + +/** + * Choose one of the four possible motion solutions from an essential matrix. + * + * Decides the right solution by checking that the triangulation of a match + * x1--x2 lies in front of the cameras. See HZ 9.6 pag 259 (9.6.3 Geometrical + * interpretation of the 4 solutions) + * + * \return index of the right solution or -1 if no solution. + */ +int MotionFromEssentialChooseSolution(const std::vector<Mat3> &Rs, + const std::vector<Vec3> &ts, + const Mat3 &K1, + const Vec2 &x1, + const Mat3 &K2, + const Vec2 &x2); + +bool MotionFromEssentialAndCorrespondence(const Mat3 &E, + const Mat3 &K1, + const Vec2 &x1, + const Mat3 &K2, + const Vec2 &x2, + Mat3 *R, + Vec3 *t); + +} // namespace libmv + +#endif // LIBMV_MULTIVIEW_FUNDAMENTAL_H_ diff --git a/extern/libmv/libmv/multiview/nviewtriangulation.h b/extern/libmv/libmv/multiview/nviewtriangulation.h new file mode 100644 index 00000000000..b4f521f185d --- /dev/null +++ b/extern/libmv/libmv/multiview/nviewtriangulation.h @@ -0,0 +1,80 @@ +// Copyright (c) 2009 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. +// +// Compute a 3D position of a point from several images of it. In particular, +// compute the projective point X in R^4 such that x = PX. +// +// Algorithm is the standard DLT; for derivation see appendix of Keir's thesis. + +#ifndef LIBMV_MULTIVIEW_NVIEWTRIANGULATION_H +#define LIBMV_MULTIVIEW_NVIEWTRIANGULATION_H + +#include "libmv/base/vector.h" +#include "libmv/logging/logging.h" +#include "libmv/numeric/numeric.h" + +namespace libmv { + +// x's are 2D coordinates (x,y,1) in each image; Ps are projective cameras. The +// output, X, is a homogeneous four vectors. +template<typename T> +void NViewTriangulate(const Matrix<T, 2, Dynamic> &x, + const vector<Matrix<T, 3, 4> > &Ps, + Matrix<T, 4, 1> *X) { + int nviews = x.cols(); + assert(nviews == Ps.size()); + + Matrix<T, Dynamic, Dynamic> design(3*nviews, 4 + nviews); + design.setConstant(0.0); + for (int i = 0; i < nviews; i++) { + design.template block<3, 4>(3*i, 0) = -Ps[i]; + design(3*i + 0, 4 + i) = x(0, i); + design(3*i + 1, 4 + i) = x(1, i); + design(3*i + 2, 4 + i) = 1.0; + } + Matrix<T, Dynamic, 1> X_and_alphas; + Nullspace(&design, &X_and_alphas); + X->resize(4); + *X = X_and_alphas.head(4); +} + +// x's are 2D coordinates (x,y,1) in each image; Ps are projective cameras. The +// output, X, is a homogeneous four vectors. +// This method uses the algebraic distance approximation. +// Note that this method works better when the 2D points are normalized +// with an isotopic normalization. +template<typename T> +void NViewTriangulateAlgebraic(const Matrix<T, 2, Dynamic> &x, + const vector<Matrix<T, 3, 4> > &Ps, + Matrix<T, 4, 1> *X) { + int nviews = x.cols(); + assert(nviews == Ps.size()); + + Matrix<T, Dynamic, 4> design(2*nviews, 4); + for (int i = 0; i < nviews; i++) { + design.template block<2, 4>(2*i, 0) = SkewMatMinimal(x.col(i)) * Ps[i]; + } + X->resize(4); + Nullspace(&design, X); +} + +} // namespace libmv + +#endif // LIBMV_MULTIVIEW_RESECTION_H diff --git a/extern/libmv/libmv/multiview/projection.cc b/extern/libmv/libmv/multiview/projection.cc new file mode 100644 index 00000000000..a7d1a058e9c --- /dev/null +++ b/extern/libmv/libmv/multiview/projection.cc @@ -0,0 +1,221 @@ +// Copyright (c) 2007, 2008 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. + +#include "libmv/multiview/projection.h" +#include "libmv/numeric/numeric.h" + +namespace libmv { + +void P_From_KRt(const Mat3 &K, const Mat3 &R, const Vec3 &t, Mat34 *P) { + P->block<3, 3>(0, 0) = R; + P->col(3) = t; + (*P) = K * (*P); +} + +void KRt_From_P(const Mat34 &P, Mat3 *Kp, Mat3 *Rp, Vec3 *tp) { + // Decompose using the RQ decomposition HZ A4.1.1 pag.579. + Mat3 K = P.block(0, 0, 3, 3); + + Mat3 Q; + Q.setIdentity(); + + // Set K(2,1) to zero. + if (K(2, 1) != 0) { + double c = -K(2,2); + double s = K(2,1); + double l = sqrt(c * c + s * s); + c /= l; s /= l; + Mat3 Qx; + Qx << 1, 0, 0, + 0, c, -s, + 0, s, c; + K = K * Qx; + Q = Qx.transpose() * Q; + } + // Set K(2,0) to zero. + if (K(2, 0) != 0) { + double c = K(2, 2); + double s = K(2, 0); + double l = sqrt(c * c + s * s); + c /= l; s /= l; + Mat3 Qy; + Qy << c, 0, s, + 0, 1, 0, + -s, 0, c; + K = K * Qy; + Q = Qy.transpose() * Q; + } + // Set K(1,0) to zero. + if (K(1, 0) != 0) { + double c = -K(1, 1); + double s = K(1, 0); + double l = sqrt(c * c + s * s); + c /= l; s /= l; + Mat3 Qz; + Qz << c,-s, 0, + s, c, 0, + 0, 0, 1; + K = K * Qz; + Q = Qz.transpose() * Q; + } + + Mat3 R = Q; + + // Ensure that the diagonal is positive. + // TODO(pau) Change this to ensure that: + // - K(0,0) > 0 + // - K(2,2) = 1 + // - det(R) = 1 + if (K(2,2) < 0) { + K = -K; + R = -R; + } + if (K(1,1) < 0) { + Mat3 S; + S << 1, 0, 0, + 0,-1, 0, + 0, 0, 1; + K = K * S; + R = S * R; + } + if (K(0,0) < 0) { + Mat3 S; + S << -1, 0, 0, + 0, 1, 0, + 0, 0, 1; + K = K * S; + R = S * R; + } + + // Compute translation. + Vec p(3); + p << P(0,3), P(1,3), P(2,3); + // TODO(pau) This sould be done by a SolveLinearSystem(A, b, &x) call. + // TODO(keir) use the eigen LU solver syntax... + Vec3 t = K.inverse() * p; + + // scale K so that K(2,2) = 1 + K = K / K(2,2); + + *Kp = K; + *Rp = R; + *tp = t; +} + +void ProjectionShiftPrincipalPoint(const Mat34 &P, + const Vec2 &principal_point, + const Vec2 &principal_point_new, + Mat34 *P_new) { + Mat3 T; + T << 1, 0, principal_point_new(0) - principal_point(0), + 0, 1, principal_point_new(1) - principal_point(1), + 0, 0, 1; + *P_new = T * P; +} + +void ProjectionChangeAspectRatio(const Mat34 &P, + const Vec2 &principal_point, + double aspect_ratio, + double aspect_ratio_new, + Mat34 *P_new) { + Mat3 T; + T << 1, 0, 0, + 0, aspect_ratio_new / aspect_ratio, 0, + 0, 0, 1; + Mat34 P_temp; + + ProjectionShiftPrincipalPoint(P, principal_point, Vec2(0,0), &P_temp); + P_temp = T * P_temp; + ProjectionShiftPrincipalPoint(P_temp, Vec2(0,0), principal_point, P_new); +} + +void HomogeneousToEuclidean(const Mat &H, Mat *X) { + int d = H.rows() - 1; + int n = H.cols(); + X->resize(d, n); + for (size_t i = 0; i < n; ++i) { + double h = H(d, i); + for (int j = 0; j < d; ++j) { + (*X)(j, i) = H(j, i) / h; + } + } +} + +void HomogeneousToEuclidean(const Mat3X &h, Mat2X *e) { + e->resize(2, h.cols()); + e->row(0) = h.row(0).array() / h.row(2).array(); + e->row(1) = h.row(1).array() / h.row(2).array(); +} +void HomogeneousToEuclidean(const Mat4X &h, Mat3X *e) { + e->resize(3, h.cols()); + e->row(0) = h.row(0).array() / h.row(3).array(); + e->row(1) = h.row(1).array() / h.row(3).array(); + e->row(2) = h.row(2).array() / h.row(3).array(); +} + +void HomogeneousToEuclidean(const Vec3 &H, Vec2 *X) { + double w = H(2); + *X << H(0) / w, H(1) / w; +} + +void HomogeneousToEuclidean(const Vec4 &H, Vec3 *X) { + double w = H(3); + *X << H(0) / w, H(1) / w, H(2) / w; +} + +void EuclideanToHomogeneous(const Mat &X, Mat *H) { + int d = X.rows(); + int n = X.cols(); + H->resize(d + 1, n); + H->block(0, 0, d, n) = X; + H->row(d).setOnes(); +} + +void EuclideanToHomogeneous(const Vec2 &X, Vec3 *H) { + *H << X(0), X(1), 1; +} + +void EuclideanToHomogeneous(const Vec3 &X, Vec4 *H) { + *H << X(0), X(1), X(2), 1; +} + +// TODO(julien) Call conditioning.h/ApplyTransformationToPoints ? +void EuclideanToNormalizedCamera(const Mat2X &x, const Mat3 &K, Mat2X *n) { + Mat3X x_image_h; + EuclideanToHomogeneous(x, &x_image_h); + Mat3X x_camera_h = K.inverse() * x_image_h; + HomogeneousToEuclidean(x_camera_h, n); +} + +void HomogeneousToNormalizedCamera(const Mat3X &x, const Mat3 &K, Mat2X *n) { + Mat3X x_camera_h = K.inverse() * x; + HomogeneousToEuclidean(x_camera_h, n); +} + +double Depth(const Mat3 &R, const Vec3 &t, const Vec3 &X) { + return (R*X)(2) + t(2); +} + +double Depth(const Mat3 &R, const Vec3 &t, const Vec4 &X) { + Vec3 Xe = X.head<3>() / X(3); + return Depth(R, t, Xe); +} + +} // namespace libmv diff --git a/extern/libmv/libmv/multiview/projection.h b/extern/libmv/libmv/multiview/projection.h new file mode 100644 index 00000000000..bc353b64c08 --- /dev/null +++ b/extern/libmv/libmv/multiview/projection.h @@ -0,0 +1,231 @@ +// Copyright (c) 2007, 2008 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_MULTIVIEW_PROJECTION_H_ +#define LIBMV_MULTIVIEW_PROJECTION_H_ + +#include "libmv/numeric/numeric.h" + +namespace libmv { + +void P_From_KRt(const Mat3 &K, const Mat3 &R, const Vec3 &t, Mat34 *P); +void KRt_From_P(const Mat34 &P, Mat3 *K, Mat3 *R, Vec3 *t); + +// Applies a change of basis to the image coordinates of the projection matrix +// so that the principal point becomes principal_point_new. +void ProjectionShiftPrincipalPoint(const Mat34 &P, + const Vec2 &principal_point, + const Vec2 &principal_point_new, + Mat34 *P_new); + +// Applies a change of basis to the image coordinates of the projection matrix +// so that the aspect ratio becomes aspect_ratio_new. This is done by +// stretching the y axis. The aspect ratio is defined as the quotient between +// the focal length of the y and the x axis. +void ProjectionChangeAspectRatio(const Mat34 &P, + const Vec2 &principal_point, + double aspect_ratio, + double aspect_ratio_new, + Mat34 *P_new); + +void HomogeneousToEuclidean(const Mat &H, Mat *X); +void HomogeneousToEuclidean(const Mat3X &h, Mat2X *e); +void HomogeneousToEuclidean(const Mat4X &h, Mat3X *e); +void HomogeneousToEuclidean(const Vec3 &H, Vec2 *X); +void HomogeneousToEuclidean(const Vec4 &H, Vec3 *X); +inline Vec2 HomogeneousToEuclidean(const Vec3 &h) { + return h.head<2>() / h(2); +} +inline Vec3 HomogeneousToEuclidean(const Vec4 &h) { + return h.head<3>() / h(3); +} +inline Mat2X HomogeneousToEuclidean(const Mat3X &h) { + Mat2X e(2, h.cols()); + e.row(0) = h.row(0).array() / h.row(2).array(); + e.row(1) = h.row(1).array() / h.row(2).array(); + return e; +} + +void EuclideanToHomogeneous(const Mat &X, Mat *H); +inline Mat3X EuclideanToHomogeneous(const Mat2X &x) { + Mat3X h(3, x.cols()); + h.block(0, 0, 2, x.cols()) = x; + h.row(2).setOnes(); + return h; +} +inline void EuclideanToHomogeneous(const Mat2X &x, Mat3X *h) { + h->resize(3, x.cols()); + h->block(0, 0, 2, x.cols()) = x; + h->row(2).setOnes(); +} +inline Mat4X EuclideanToHomogeneous(const Mat3X &x) { + Mat4X h(4, x.cols()); + h.block(0, 0, 3, x.cols()) = x; + h.row(3).setOnes(); + return h; +} +inline void EuclideanToHomogeneous(const Mat3X &x, Mat4X *h) { + h->resize(4, x.cols()); + h->block(0, 0, 3, x.cols()) = x; + h->row(3).setOnes(); +} +void EuclideanToHomogeneous(const Vec2 &X, Vec3 *H); +void EuclideanToHomogeneous(const Vec3 &X, Vec4 *H); +inline Vec3 EuclideanToHomogeneous(const Vec2 &x) { + return Vec3(x(0), x(1), 1); +} +inline Vec4 EuclideanToHomogeneous(const Vec3 &x) { + return Vec4(x(0), x(1), x(2), 1); +} +// Conversion from image coordinates to normalized camera coordinates +void EuclideanToNormalizedCamera(const Mat2X &x, const Mat3 &K, Mat2X *n); +void HomogeneousToNormalizedCamera(const Mat3X &x, const Mat3 &K, Mat2X *n); + +inline Vec2 Project(const Mat34 &P, const Vec3 &X) { + Vec4 HX; + HX << X, 1.0; + Vec3 hx = P * HX; + return hx.head<2>() / hx(2); +} + +inline void Project(const Mat34 &P, const Vec4 &X, Vec3 *x) { + *x = P * X; +} + +inline void Project(const Mat34 &P, const Vec4 &X, Vec2 *x) { + Vec3 hx = P * X; + *x = hx.head<2>() / hx(2); +} + +inline void Project(const Mat34 &P, const Vec3 &X, Vec3 *x) { + Vec4 HX; + HX << X, 1.0; + Project(P, HX, x); +} + +inline void Project(const Mat34 &P, const Vec3 &X, Vec2 *x) { + Vec3 hx; + Project(P, X, x); + *x = hx.head<2>() / hx(2); +} + +inline void Project(const Mat34 &P, const Mat4X &X, Mat2X *x) { + x->resize(2, X.cols()); + for (int c = 0; c < X.cols(); ++c) { + Vec3 hx = P * X.col(c); + x->col(c) = hx.head<2>() / hx(2); + } +} + +inline Mat2X Project(const Mat34 &P, const Mat4X &X) { + Mat2X x; + Project(P, X, &x); + return x; +} + +inline void Project(const Mat34 &P, const Mat3X &X, Mat2X *x) { + x->resize(2, X.cols()); + for (int c = 0; c < X.cols(); ++c) { + Vec4 HX; + HX << X.col(c), 1.0; + Vec3 hx = P * HX; + x->col(c) = hx.head<2>() / hx(2); + } +} + +inline void Project(const Mat34 &P, const Mat3X &X, const Vecu &ids, Mat2X *x) { + x->resize(2, ids.size()); + Vec4 HX; + Vec3 hx; + for (int c = 0; c < ids.size(); ++c) { + HX << X.col(ids[c]), 1.0; + hx = P * HX; + x->col(c) = hx.head<2>() / hx(2); + } +} + +inline Mat2X Project(const Mat34 &P, const Mat3X &X) { + Mat2X x(2, X.cols()); + Project(P, X, &x); + return x; +} + +inline Mat2X Project(const Mat34 &P, const Mat3X &X, const Vecu &ids) { + Mat2X x(2, ids.size()); + Project(P, X, ids, &x); + return x; +} + +double Depth(const Mat3 &R, const Vec3 &t, const Vec3 &X); +double Depth(const Mat3 &R, const Vec3 &t, const Vec4 &X); + +/** +* Returns true if the homogenious 3D point X is in front of +* the camera P. +*/ +inline bool isInFrontOfCamera(const Mat34 &P, const Vec4 &X){ + double condition_1 = P.row(2).dot(X) * X[3]; + double condition_2 = X[2] * X[3]; + if( condition_1 > 0 && condition_2 > 0 ) + return true; + else + return false; +} + +inline bool isInFrontOfCamera(const Mat34 &P, const Vec3 &X){ + Vec4 X_homo; + X_homo.segment<3>(0) = X; + X_homo(3) = 1; + return isInFrontOfCamera( P, X_homo); +} + +/** +* Transforms a 2D point from pixel image coordinates to a 2D point in +* normalized image coordinates. +*/ +inline Vec2 ImageToNormImageCoordinates(Mat3 &Kinverse, Vec2 &x){ + Vec3 x_h = Kinverse*EuclideanToHomogeneous(x); + return HomogeneousToEuclidean( x_h ); +} + +/// Estimates the root mean square error (2D) +inline double RootMeanSquareError(const Mat2X &x_image, + const Mat4X &X_world, + const Mat34 &P) { + size_t num_points = x_image.cols(); + Mat2X dx = Project(P, X_world) - x_image; + return dx.norm() / num_points; +} + +/// Estimates the root mean square error (2D) +inline double RootMeanSquareError(const Mat2X &x_image, + const Mat3X &X_world, + const Mat3 &K, + const Mat3 &R, + const Vec3 &t) { + Mat34 P; + P_From_KRt(K, R, t, &P); + size_t num_points = x_image.cols(); + Mat2X dx = Project(P, X_world) - x_image; + return dx.norm() / num_points; +} +} // namespace libmv + +#endif // LIBMV_MULTIVIEW_PROJECTION_H_ diff --git a/extern/libmv/libmv/multiview/resection.h b/extern/libmv/libmv/multiview/resection.h new file mode 100644 index 00000000000..e4623899147 --- /dev/null +++ b/extern/libmv/libmv/multiview/resection.h @@ -0,0 +1,62 @@ +// Copyright (c) 2009 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. +// +// Compute the projection matrix from a set of 3D points X and their +// projections x = PX in 2D. This is useful if a point cloud is reconstructed. +// +// Algorithm is the standard DLT as described in Hartley & Zisserman, page 179. + +#ifndef LIBMV_MULTIVIEW_RESECTION_H +#define LIBMV_MULTIVIEW_RESECTION_H + +#include "libmv/logging/logging.h" +#include "libmv/numeric/numeric.h" + +namespace libmv { +namespace resection { + +// x's are 2D image coordinates, (x,y,1), and X's are homogeneous four vectors. +template<typename T> +void Resection(const Matrix<T, 2, Dynamic> &x, + const Matrix<T, 4, Dynamic> &X, + Matrix<T, 3, 4> *P) { + int N = x.cols(); + assert(X.cols() == N); + + Matrix<T, Dynamic, 12> design(2*N, 12); + design.setZero(); + for (int i = 0; i < N; i++) { + T xi = x(0, i); + T yi = x(1, i); + // See equation (7.2) on page 179 of H&Z. + design.template block<1,4>(2*i, 4) = -X.col(i).transpose(); + design.template block<1,4>(2*i, 8) = yi*X.col(i).transpose(); + design.template block<1,4>(2*i + 1, 0) = X.col(i).transpose(); + design.template block<1,4>(2*i + 1, 8) = -xi*X.col(i).transpose(); + } + Matrix<T, 12, 1> p; + Nullspace(&design, &p); + reshape(p, 3, 4, P); +} + +} // namespace resection +} // namespace libmv + +#endif // LIBMV_MULTIVIEW_RESECTION_H diff --git a/extern/libmv/libmv/multiview/triangulation.cc b/extern/libmv/libmv/multiview/triangulation.cc new file mode 100644 index 00000000000..b9d38cef936 --- /dev/null +++ b/extern/libmv/libmv/multiview/triangulation.cc @@ -0,0 +1,49 @@ +// Copyright (c) 2007, 2008 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. + +#include "libmv/numeric/numeric.h" +#include "libmv/multiview/projection.h" +#include "libmv/multiview/triangulation.h" + +namespace libmv { + +// HZ 12.2 pag.312 +void TriangulateDLT(const Mat34 &P1, const Vec2 &x1, + const Mat34 &P2, const Vec2 &x2, + Vec4 *X_homogeneous) { + Mat4 design; + for (int i = 0; i < 4; ++i) { + design(0,i) = x1(0) * P1(2,i) - P1(0,i); + design(1,i) = x1(1) * P1(2,i) - P1(1,i); + design(2,i) = x2(0) * P2(2,i) - P2(0,i); + design(3,i) = x2(1) * P2(2,i) - P2(1,i); + } + Nullspace(&design, X_homogeneous); +} + +void TriangulateDLT(const Mat34 &P1, const Vec2 &x1, + const Mat34 &P2, const Vec2 &x2, + Vec3 *X_euclidean) { + Vec4 X_homogeneous; + TriangulateDLT(P1, x1, P2, x2, &X_homogeneous); + HomogeneousToEuclidean(X_homogeneous, X_euclidean); +} + +} // namespace libmv diff --git a/extern/libmv/libmv/multiview/triangulation.h b/extern/libmv/libmv/multiview/triangulation.h new file mode 100644 index 00000000000..c35774d9e1b --- /dev/null +++ b/extern/libmv/libmv/multiview/triangulation.h @@ -0,0 +1,38 @@ +// Copyright (c) 2007, 2008 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_MULTIVIEW_TRIANGULATION_H_ +#define LIBMV_MULTIVIEW_TRIANGULATION_H_ + +#include "libmv/numeric/numeric.h" + +namespace libmv { + +void TriangulateDLT(const Mat34 &P1, const Vec2 &x1, + const Mat34 &P2, const Vec2 &x2, + Vec4 *X_homogeneous); + +void TriangulateDLT(const Mat34 &P1, const Vec2 &x1, + const Mat34 &P2, const Vec2 &x2, + Vec3 *X_euclidean); + +} // namespace libmv + +#endif // LIBMV_MULTIVIEW_TRIANGULATION_H_ diff --git a/extern/libmv/libmv/numeric/dogleg.h b/extern/libmv/libmv/numeric/dogleg.h new file mode 100644 index 00000000000..f05882c1191 --- /dev/null +++ b/extern/libmv/libmv/numeric/dogleg.h @@ -0,0 +1,261 @@ +// Copyright (c) 2007, 2008, 2009 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. +// +// A simple implementation of Powell's dogleg nonlinear minimization. +// +// [1] K. Madsen, H. Nielsen, O. Tingleoff. Methods for Non-linear Least +// Squares Problems. +// http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/3215/pdf/imm3215.pdf +// +// TODO(keir): Cite the Lourakis' dogleg paper. + +#ifndef LIBMV_NUMERIC_DOGLEG_H +#define LIBMV_NUMERIC_DOGLEG_H + +#include <cmath> +#include <cstdio> + +#include "libmv/numeric/numeric.h" +#include "libmv/numeric/function_derivative.h" +#include "libmv/logging/logging.h" + +namespace libmv { + +template<typename Function, + typename Jacobian = NumericJacobian<Function>, + typename Solver = Eigen::PartialPivLU< + Matrix<typename Function::FMatrixType::RealScalar, + Function::XMatrixType::RowsAtCompileTime, + Function::XMatrixType::RowsAtCompileTime> > > +class Dogleg { + public: + typedef typename Function::XMatrixType::RealScalar Scalar; + typedef typename Function::FMatrixType FVec; + typedef typename Function::XMatrixType Parameters; + typedef Matrix<typename Function::FMatrixType::RealScalar, + Function::FMatrixType::RowsAtCompileTime, + Function::XMatrixType::RowsAtCompileTime> JMatrixType; + typedef Matrix<typename JMatrixType::RealScalar, + JMatrixType::ColsAtCompileTime, + JMatrixType::ColsAtCompileTime> AMatrixType; + + enum Status { + RUNNING, + GRADIENT_TOO_SMALL, // eps > max(J'*f(x)) + RELATIVE_STEP_SIZE_TOO_SMALL, // eps > ||dx|| / ||x|| + TRUST_REGION_TOO_SMALL, // eps > radius / ||x|| + ERROR_TOO_SMALL, // eps > ||f(x)|| + HIT_MAX_ITERATIONS, + }; + + enum Step { + DOGLEG, + GAUSS_NEWTON, + STEEPEST_DESCENT, + }; + + Dogleg(const Function &f) + : f_(f), df_(f) {} + + struct SolverParameters { + SolverParameters() + : gradient_threshold(1e-16), + relative_step_threshold(1e-16), + error_threshold(1e-16), + initial_trust_radius(1e0), + max_iterations(500) {} + Scalar gradient_threshold; // eps > max(J'*f(x)) + Scalar relative_step_threshold; // eps > ||dx|| / ||x|| + Scalar error_threshold; // eps > ||f(x)|| + Scalar initial_trust_radius; // Initial u for solving normal equations. + int max_iterations; // Maximum number of solver iterations. + }; + + struct Results { + Scalar error_magnitude; // ||f(x)|| + Scalar gradient_magnitude; // ||J'f(x)|| + int iterations; + Status status; + }; + + Status Update(const Parameters &x, const SolverParameters ¶ms, + JMatrixType *J, AMatrixType *A, FVec *error, Parameters *g) { + *J = df_(x); + // TODO(keir): In the case of m = n, avoid computing A and just do J^-1 directly. + *A = (*J).transpose() * (*J); + *error = f_(x); + *g = (*J).transpose() * *error; + if (g->array().abs().maxCoeff() < params.gradient_threshold) { + return GRADIENT_TOO_SMALL; + } else if (error->array().abs().maxCoeff() < params.error_threshold) { + return ERROR_TOO_SMALL; + } + return RUNNING; + } + + Step SolveDoglegDirection(const Parameters &dx_sd, + const Parameters &dx_gn, + Scalar radius, + Scalar alpha, + Parameters *dx_dl, + Scalar *beta) { + Parameters a, b_minus_a; + // Solve for Dogleg step dx_dl. + if (dx_gn.norm() < radius) { + *dx_dl = dx_gn; + return GAUSS_NEWTON; + + } else if (alpha * dx_sd.norm() > radius) { + *dx_dl = (radius / dx_sd.norm()) * dx_sd; + return STEEPEST_DESCENT; + + } else { + Parameters a = alpha * dx_sd; + const Parameters &b = dx_gn; + b_minus_a = a - b; + Scalar Mbma2 = b_minus_a.squaredNorm(); + Scalar Ma2 = a.squaredNorm(); + Scalar c = a.dot(b_minus_a); + Scalar radius2 = radius*radius; + if (c <= 0) { + *beta = (-c + sqrt(c*c + Mbma2*(radius2 - Ma2)))/(Mbma2); + } else { + *beta = (radius2 - Ma2) / + (c + sqrt(c*c + Mbma2*(radius2 - Ma2))); + } + *dx_dl = alpha * dx_sd + (*beta) * (dx_gn - alpha*dx_sd); + return DOGLEG; + } + } + + Results minimize(Parameters *x_and_min) { + SolverParameters params; + return minimize(params, x_and_min); + } + + Results minimize(const SolverParameters ¶ms, Parameters *x_and_min) { + Parameters &x = *x_and_min; + JMatrixType J; + AMatrixType A; + FVec error; + Parameters g; + + Results results; + results.status = Update(x, params, &J, &A, &error, &g); + + Scalar radius = params.initial_trust_radius; + bool x_updated = true; + + Parameters x_new; + Parameters dx_sd; // Steepest descent step. + Parameters dx_dl; // Dogleg step. + Parameters dx_gn; // Gauss-Newton step. + printf("iteration ||f(x)|| max(g) radius\n"); + int i = 0; + for (; results.status == RUNNING && i < params.max_iterations; ++i) { + printf("%9d %12g %12g %12g", + i, f_(x).norm(), g.array().abs().maxCoeff(), radius); + + //LG << "iteration: " << i; + //LG << "||f(x)||: " << f_(x).norm(); + //LG << "max(g): " << g.cwise().abs().maxCoeff(); + //LG << "radius: " << radius; + // Eqn 3.19 from [1] + Scalar alpha = g.squaredNorm() / (J*g).squaredNorm(); + + // Solve for steepest descent direction dx_sd. + dx_sd = -g; + + // Solve for Gauss-Newton direction dx_gn. + if (x_updated) { + // TODO(keir): See Appendix B of [1] for discussion of when A is + // singular and there are many solutions. Solving that involves the SVD + // and is slower, but should still work. + Solver solver(A); + dx_gn = solver.solve(-g); + if (!(A * dx_gn).isApprox(-g)) { + LOG(ERROR) << "Failed to solve normal eqns. TODO: Solve via SVD."; + return results; + } + x_updated = false; + } + + // Solve for dogleg direction dx_dl. + Scalar beta = 0; + Step step = SolveDoglegDirection(dx_sd, dx_gn, radius, alpha, + &dx_dl, &beta); + + Scalar e3 = params.relative_step_threshold; + if (dx_dl.norm() < e3*(x.norm() + e3)) { + results.status = RELATIVE_STEP_SIZE_TOO_SMALL; + break; + } + + x_new = x + dx_dl; + Scalar actual = f_(x).squaredNorm() - f_(x_new).squaredNorm(); + Scalar predicted = 0; + if (step == GAUSS_NEWTON) { + predicted = f_(x).squaredNorm(); + } else if (step == STEEPEST_DESCENT) { + predicted = radius * (2*alpha*g.norm() - radius) / 2 / alpha; + } else if (step == DOGLEG) { + predicted = 0.5 * alpha * (1-beta)*(1-beta)*g.squaredNorm() + + beta*(2-beta)*f_(x).squaredNorm(); + } + Scalar rho = actual / predicted; + + if (step == GAUSS_NEWTON) printf(" GAUSS"); + if (step == STEEPEST_DESCENT) printf(" STEE"); + if (step == DOGLEG) printf(" DOGL"); + + printf(" %12g %12g %12g\n", rho, actual, predicted); + + if (rho > 0) { + // Accept update because the linear model is a good fit. + x = x_new; + results.status = Update(x, params, &J, &A, &error, &g); + x_updated = true; + } + if (rho > 0.75) { + radius = std::max(radius, 3*dx_dl.norm()); + } else if (rho < 0.25) { + radius /= 2; + if (radius < e3 * (x.norm() + e3)) { + results.status = TRUST_REGION_TOO_SMALL; + } + } + } + if (results.status == RUNNING) { + results.status = HIT_MAX_ITERATIONS; + } + results.error_magnitude = error.norm(); + results.gradient_magnitude = g.norm(); + results.iterations = i; + return results; + } + + private: + const Function &f_; + Jacobian df_; +}; + +} // namespace mv + +#endif // LIBMV_NUMERIC_DOGLEG_H diff --git a/extern/libmv/libmv/numeric/function_derivative.h b/extern/libmv/libmv/numeric/function_derivative.h new file mode 100644 index 00000000000..d7bc437b2e0 --- /dev/null +++ b/extern/libmv/libmv/numeric/function_derivative.h @@ -0,0 +1,107 @@ +// Copyright (c) 2007, 2008, 2009 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_NUMERIC_DERIVATIVE_H +#define LIBMV_NUMERIC_DERIVATIVE_H + +#include <cmath> + +#include "libmv/numeric/numeric.h" +#include "libmv/logging/logging.h" + +namespace libmv { + +// Numeric derivative of a function. +// TODO(keir): Consider adding a quadratic approximation. + +enum NumericJacobianMode { + CENTRAL, + FORWARD, +}; + +template<typename Function, NumericJacobianMode mode=CENTRAL> +class NumericJacobian { + public: + typedef typename Function::XMatrixType Parameters; + typedef typename Function::XMatrixType::RealScalar XScalar; + typedef typename Function::FMatrixType FMatrixType; + typedef Matrix<typename Function::FMatrixType::RealScalar, + Function::FMatrixType::RowsAtCompileTime, + Function::XMatrixType::RowsAtCompileTime> + JMatrixType; + + NumericJacobian(const Function &f) : f_(f) {} + + // TODO(keir): Perhaps passing the jacobian back by value is not a good idea. + JMatrixType operator()(const Parameters &x) { + // Empirically determined constant. + Parameters eps = x.array().abs() * XScalar(1e-5); + // To handle cases where a paremeter is exactly zero, instead use the mean + // eps for the other dimensions. + XScalar mean_eps = eps.sum() / eps.rows(); + if (mean_eps == XScalar(0)) { + // TODO(keir): Do something better here. + mean_eps = 1e-8; // ~sqrt(machine precision). + } + // TODO(keir): Elimininate this needless function evaluation for the + // central difference case. + FMatrixType fx = f_(x); + const int rows = fx.rows(); + const int cols = x.rows(); + JMatrixType jacobian(rows, cols); + Parameters x_plus_delta = x; + for (int c = 0; c < cols; ++c) { + if (eps(c) == XScalar(0)) { + eps(c) = mean_eps; + } + x_plus_delta(c) = x(c) + eps(c); + jacobian.col(c) = f_(x_plus_delta); + + XScalar one_over_h = 1 / eps(c); + if (mode == CENTRAL) { + x_plus_delta(c) = x(c) - eps(c); + jacobian.col(c) -= f_(x_plus_delta); + one_over_h /= 2; + } else { + jacobian.col(c) -= fx; + } + x_plus_delta(c) = x(c); + jacobian.col(c) = jacobian.col(c) * one_over_h; + } + return jacobian; + } + private: + const Function &f_; +}; + +template<typename Function, typename Jacobian> +bool CheckJacobian(const Function &f, const typename Function::XMatrixType &x) { + Jacobian j_analytic(f); + NumericJacobian<Function> j_numeric(f); + + typename NumericJacobian<Function>::JMatrixType J_numeric = j_numeric(x); + typename NumericJacobian<Function>::JMatrixType J_analytic = j_analytic(x); + LG << J_numeric - J_analytic; + return true; +} + +} // namespace libmv + +#endif // LIBMV_NUMERIC_DERIVATIVE_H diff --git a/extern/libmv/libmv/numeric/levenberg_marquardt.h b/extern/libmv/libmv/numeric/levenberg_marquardt.h new file mode 100644 index 00000000000..4473b72f156 --- /dev/null +++ b/extern/libmv/libmv/numeric/levenberg_marquardt.h @@ -0,0 +1,183 @@ +// Copyright (c) 2007, 2008, 2009 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. +// +// A simple implementation of levenberg marquardt. +// +// [1] K. Madsen, H. Nielsen, O. Tingleoff. Methods for Non-linear Least +// Squares Problems. +// http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/3215/pdf/imm3215.pdf +// +// TODO(keir): Cite the Lourakis' dogleg paper. + +#ifndef LIBMV_NUMERIC_LEVENBERG_MARQUARDT_H +#define LIBMV_NUMERIC_LEVENBERG_MARQUARDT_H + +#include <cmath> + +#include "libmv/numeric/numeric.h" +#include "libmv/numeric/function_derivative.h" +#include "libmv/logging/logging.h" + +namespace libmv { + +template<typename Function, + typename Jacobian = NumericJacobian<Function>, + typename Solver = Eigen::PartialPivLU< + Matrix<typename Function::FMatrixType::RealScalar, + Function::XMatrixType::RowsAtCompileTime, + Function::XMatrixType::RowsAtCompileTime> > > +class LevenbergMarquardt { + public: + typedef typename Function::XMatrixType::RealScalar Scalar; + typedef typename Function::FMatrixType FVec; + typedef typename Function::XMatrixType Parameters; + typedef Matrix<typename Function::FMatrixType::RealScalar, + Function::FMatrixType::RowsAtCompileTime, + Function::XMatrixType::RowsAtCompileTime> JMatrixType; + typedef Matrix<typename JMatrixType::RealScalar, + JMatrixType::ColsAtCompileTime, + JMatrixType::ColsAtCompileTime> AMatrixType; + + // TODO(keir): Some of these knobs can be derived from each other and + // removed, instead of requiring the user to set them. + enum Status { + RUNNING, + GRADIENT_TOO_SMALL, // eps > max(J'*f(x)) + RELATIVE_STEP_SIZE_TOO_SMALL, // eps > ||dx|| / ||x|| + ERROR_TOO_SMALL, // eps > ||f(x)|| + HIT_MAX_ITERATIONS, + }; + + LevenbergMarquardt(const Function &f) + : f_(f), df_(f) {} + + struct SolverParameters { + SolverParameters() + : gradient_threshold(1e-16), + relative_step_threshold(1e-16), + error_threshold(1e-16), + initial_scale_factor(1e-3), + max_iterations(100) {} + Scalar gradient_threshold; // eps > max(J'*f(x)) + Scalar relative_step_threshold; // eps > ||dx|| / ||x|| + Scalar error_threshold; // eps > ||f(x)|| + Scalar initial_scale_factor; // Initial u for solving normal equations. + int max_iterations; // Maximum number of solver iterations. + }; + + struct Results { + Scalar error_magnitude; // ||f(x)|| + Scalar gradient_magnitude; // ||J'f(x)|| + int iterations; + Status status; + }; + + Status Update(const Parameters &x, const SolverParameters ¶ms, + JMatrixType *J, AMatrixType *A, FVec *error, Parameters *g) { + *J = df_(x); + *A = (*J).transpose() * (*J); + *error = -f_(x); + *g = (*J).transpose() * *error; + if (g->array().abs().maxCoeff() < params.gradient_threshold) { + return GRADIENT_TOO_SMALL; + } else if (error->norm() < params.error_threshold) { + return ERROR_TOO_SMALL; + } + return RUNNING; + } + + Results minimize(Parameters *x_and_min) { + SolverParameters params; + minimize(params, x_and_min); + } + + Results minimize(const SolverParameters ¶ms, Parameters *x_and_min) { + Parameters &x = *x_and_min; + JMatrixType J; + AMatrixType A; + FVec error; + Parameters g; + + Results results; + results.status = Update(x, params, &J, &A, &error, &g); + + Scalar u = Scalar(params.initial_scale_factor*A.diagonal().maxCoeff()); + Scalar v = 2; + + Parameters dx, x_new; + int i; + for (i = 0; results.status == RUNNING && i < params.max_iterations; ++i) { + VLOG(1) << "iteration: " << i; + VLOG(1) << "||f(x)||: " << f_(x).norm(); + VLOG(1) << "max(g): " << g.array().abs().maxCoeff(); + VLOG(1) << "u: " << u; + VLOG(1) << "v: " << v; + + AMatrixType A_augmented = A + u*AMatrixType::Identity(J.cols(), J.cols()); + Solver solver(A_augmented); + dx = solver.solve(g); + bool solved = (A_augmented * dx).isApprox(g); + if (!solved) { + LOG(ERROR) << "Failed to solve"; + } + if (solved && dx.norm() <= params.relative_step_threshold * x.norm()) { + results.status = RELATIVE_STEP_SIZE_TOO_SMALL; + break; + } + if (solved) { + x_new = x + dx; + // Rho is the ratio of the actual reduction in error to the reduction + // in error that would be obtained if the problem was linear. + // See [1] for details. + Scalar rho((error.squaredNorm() - f_(x_new).squaredNorm()) + / dx.dot(u*dx + g)); + if (rho > 0) { + // Accept the Gauss-Newton step because the linear model fits well. + x = x_new; + results.status = Update(x, params, &J, &A, &error, &g); + Scalar tmp = Scalar(2*rho-1); + u = u*std::max(1/3., 1 - (tmp*tmp*tmp)); + v = 2; + continue; + } + } + // Reject the update because either the normal equations failed to solve + // or the local linear model was not good (rho < 0). Instead, increase u + // to move closer to gradient descent. + u *= v; + v *= 2; + } + if (results.status == RUNNING) { + results.status = HIT_MAX_ITERATIONS; + } + results.error_magnitude = error.norm(); + results.gradient_magnitude = g.norm(); + results.iterations = i; + return results; + } + + private: + const Function &f_; + Jacobian df_; +}; + +} // namespace mv + +#endif // LIBMV_NUMERIC_LEVENBERG_MARQUARDT_H diff --git a/extern/libmv/libmv/numeric/numeric.cc b/extern/libmv/libmv/numeric/numeric.cc new file mode 100644 index 00000000000..0ca3a64e4f4 --- /dev/null +++ b/extern/libmv/libmv/numeric/numeric.cc @@ -0,0 +1,136 @@ +// Copyright (c) 2007, 2008 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. + + +#include "libmv/numeric/numeric.h" + +namespace libmv { + +Mat3 RotationAroundX(double angle) { + double c, s; + sincos(angle, &s, &c); + Mat3 R; + R << 1, 0, 0, + 0, c, -s, + 0, s, c; + return R; +} + +Mat3 RotationAroundY(double angle) { + double c, s; + sincos(angle, &s, &c); + Mat3 R; + R << c, 0, s, + 0, 1, 0, + -s, 0, c; + return R; +} + +Mat3 RotationAroundZ(double angle) { + double c, s; + sincos(angle, &s, &c); + Mat3 R; + R << c, -s, 0, + s, c, 0, + 0, 0, 1; + return R; +} + + +Mat3 RotationRodrigues(const Vec3 &axis) { + double theta = axis.norm(); + Vec3 w = axis / theta; + Mat3 W = CrossProductMatrix(w); + + return Mat3::Identity() + sin(theta) * W + (1 - cos(theta)) * W * W; +} + + +Mat3 LookAt(Vec3 center) { + Vec3 zc = center.normalized(); + Vec3 xc = Vec3::UnitY().cross(zc).normalized(); + Vec3 yc = zc.cross(xc); + Mat3 R; + R.row(0) = xc; + R.row(1) = yc; + R.row(2) = zc; + return R; +} + +Mat3 CrossProductMatrix(const Vec3 &x) { + Mat3 X; + X << 0, -x(2), x(1), + x(2), 0, -x(0), + -x(1), x(0), 0; + return X; +} + +void MeanAndVarianceAlongRows(const Mat &A, + Vec *mean_pointer, + Vec *variance_pointer) { + Vec &mean = *mean_pointer; + Vec &variance = *variance_pointer; + int n = A.rows(); + int m = A.cols(); + mean.resize(n); + variance.resize(n); + + for (int i = 0; i < n; ++i) { + mean(i) = 0; + variance(i) = 0; + for (int j = 0; j < m; ++j) { + double x = A(i, j); + mean(i) += x; + variance(i) += x * x; + } + } + + mean /= m; + for (int i = 0; i < n; ++i) { + variance(i) = variance(i) / m - Square(mean(i)); + } +} + +void HorizontalStack(const Mat &left, const Mat &right, Mat *stacked) { + assert(left.rows() == left.rows()); + int n = left.rows(); + int m1 = left.cols(); + int m2 = right.cols(); + + stacked->resize(n, m1 + m2); + stacked->block(0, 0, n, m1) = left; + stacked->block(0, m1, n, m2) = right; +} + +void MatrixColumn(const Mat &A, int i, Vec2 *v) { + assert(A.rows() == 2); + *v << A(0,i), A(1,i); +} +void MatrixColumn(const Mat &A, int i, Vec3 *v) { + assert(A.rows() == 3); + *v << A(0,i), A(1,i), A(2,i); +} +void MatrixColumn(const Mat &A, int i, Vec4 *v) { + assert(A.rows() == 4); + *v << A(0,i), A(1,i), A(2,i), A(3,i); +} + +} // namespace libmv + diff --git a/extern/libmv/libmv/numeric/numeric.h b/extern/libmv/libmv/numeric/numeric.h new file mode 100644 index 00000000000..21e0f067446 --- /dev/null +++ b/extern/libmv/libmv/numeric/numeric.h @@ -0,0 +1,479 @@ +// Copyright (c) 2007, 2008 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. +// +// Matrix and vector classes, based on Eigen2. +// +// Avoid using Eigen2 classes directly; instead typedef them here. + +#ifndef LIBMV_NUMERIC_NUMERIC_H +#define LIBMV_NUMERIC_NUMERIC_H + +#include <Eigen/Cholesky> +#include <Eigen/Core> +#include <Eigen/Eigenvalues> +#include <Eigen/Geometry> +#include <Eigen/LU> +#include <Eigen/QR> +#include <Eigen/SVD> + +#if _WIN32 || __APPLE__ + void static sincos (double x, double *sinx, double *cosx) { + *sinx = sin(x); + *cosx = cos(x); + } +#endif //_WIN32 || __APPLE__ + +#if (defined(WIN32) || defined(WIN64)) && !defined(__MINGW32__) + inline long lround(double d) { + return (long)(d>0 ? d+0.5 : ceil(d-0.5)); + } + inline int round(double d) { + return (d>0) ? int(d+0.5) : int(d-0.5); + } + typedef unsigned int uint; +#endif //_WIN32 + +namespace libmv { + +typedef Eigen::MatrixXd Mat; +typedef Eigen::VectorXd Vec; + +typedef Eigen::MatrixXf Matf; +typedef Eigen::VectorXf Vecf; + +typedef Eigen::Matrix<unsigned int, Eigen::Dynamic, Eigen::Dynamic> Matu; +typedef Eigen::Matrix<unsigned int, Eigen::Dynamic, 1> Vecu; +typedef Eigen::Matrix<unsigned int, 2, 1> Vec2u; + +typedef Eigen::Matrix<double, 2, 2> Mat2; +typedef Eigen::Matrix<double, 2, 3> Mat23; +typedef Eigen::Matrix<double, 3, 3> Mat3; +typedef Eigen::Matrix<double, 3, 4> Mat34; +typedef Eigen::Matrix<double, 3, 5> Mat35; +typedef Eigen::Matrix<double, 4, 1> Mat41; +typedef Eigen::Matrix<double, 4, 3> Mat43; +typedef Eigen::Matrix<double, 4, 4> Mat4; +typedef Eigen::Matrix<double, 4, 6> Mat46; +typedef Eigen::Matrix<float, 2, 2> Mat2f; +typedef Eigen::Matrix<float, 2, 3> Mat23f; +typedef Eigen::Matrix<float, 3, 3> Mat3f; +typedef Eigen::Matrix<float, 3, 4> Mat34f; +typedef Eigen::Matrix<float, 3, 5> Mat35f; +typedef Eigen::Matrix<float, 4, 3> Mat43f; +typedef Eigen::Matrix<float, 4, 4> Mat4f; +typedef Eigen::Matrix<float, 4, 6> Mat46f; + +typedef Eigen::Matrix<double, 3, 3, Eigen::RowMajor> RMat3; +typedef Eigen::Matrix<double, 4, 4, Eigen::RowMajor> RMat4; + +typedef Eigen::Matrix<double, 2, Eigen::Dynamic> Mat2X; +typedef Eigen::Matrix<double, 3, Eigen::Dynamic> Mat3X; +typedef Eigen::Matrix<double, 4, Eigen::Dynamic> Mat4X; +typedef Eigen::Matrix<double, Eigen::Dynamic, 2> MatX2; +typedef Eigen::Matrix<double, Eigen::Dynamic, 3> MatX3; +typedef Eigen::Matrix<double, Eigen::Dynamic, 4> MatX4; +typedef Eigen::Matrix<double, Eigen::Dynamic, 5> MatX5; +typedef Eigen::Matrix<double, Eigen::Dynamic, 6> MatX6; +typedef Eigen::Matrix<double, Eigen::Dynamic, 7> MatX7; +typedef Eigen::Matrix<double, Eigen::Dynamic, 8> MatX8; +typedef Eigen::Matrix<double, Eigen::Dynamic, 9> MatX9; +typedef Eigen::Matrix<double, Eigen::Dynamic,15> MatX15; +typedef Eigen::Matrix<double, Eigen::Dynamic,16> MatX16; + +typedef Eigen::Vector2d Vec2; +typedef Eigen::Vector3d Vec3; +typedef Eigen::Vector4d Vec4; +typedef Eigen::Matrix<double, 5, 1> Vec5; +typedef Eigen::Matrix<double, 6, 1> Vec6; +typedef Eigen::Matrix<double, 7, 1> Vec7; +typedef Eigen::Matrix<double, 8, 1> Vec8; +typedef Eigen::Matrix<double, 9, 1> Vec9; +typedef Eigen::Matrix<double, 10, 1> Vec10; +typedef Eigen::Matrix<double, 11, 1> Vec11; +typedef Eigen::Matrix<double, 12, 1> Vec12; +typedef Eigen::Matrix<double, 13, 1> Vec13; +typedef Eigen::Matrix<double, 14, 1> Vec14; +typedef Eigen::Matrix<double, 15, 1> Vec15; +typedef Eigen::Matrix<double, 16, 1> Vec16; +typedef Eigen::Matrix<double, 17, 1> Vec17; +typedef Eigen::Matrix<double, 18, 1> Vec18; +typedef Eigen::Matrix<double, 19, 1> Vec19; +typedef Eigen::Matrix<double, 20, 1> Vec20; + +typedef Eigen::Vector2f Vec2f; +typedef Eigen::Vector3f Vec3f; +typedef Eigen::Vector4f Vec4f; + +typedef Eigen::VectorXi VecXi; + +typedef Eigen::Vector2i Vec2i; +typedef Eigen::Vector3i Vec3i; +typedef Eigen::Vector4i Vec4i; + +typedef Eigen::Matrix<float, + Eigen::Dynamic, + Eigen::Dynamic, + Eigen::RowMajor> RMatf; + +typedef Eigen::NumTraits<double> EigenDouble; + +using Eigen::Map; +using Eigen::Dynamic; +using Eigen::Matrix; + +// Find U, s, and VT such that +// +// A = U * diag(s) * VT +// +template <typename TMat, typename TVec> +inline void SVD(TMat *A, Vec *s, Mat *U, Mat *VT) { + assert(0); +} + +// Solve the linear system Ax = 0 via SVD. Store the solution in x, such that +// ||x|| = 1.0. Return the singluar value corresponding to the solution. +// Destroys A and resizes x if necessary. +// TODO(maclean): Take the SVD of the transpose instead of this zero padding. +template <typename TMat, typename TVec> +double Nullspace(TMat *A, TVec *nullspace) { + Eigen::JacobiSVD<TMat> svd(*A, Eigen::ComputeFullV); + (*nullspace) = svd.matrixV().col(A->cols()-1); + if (A->rows() >= A->cols()) + return svd.singularValues()(A->cols()-1); + else + return 0.0; +} + +// Solve the linear system Ax = 0 via SVD. Finds two solutions, x1 and x2, such +// that x1 is the best solution and x2 is the next best solution (in the L2 +// norm sense). Store the solution in x1 and x2, such that ||x|| = 1.0. Return +// the singluar value corresponding to the solution x1. Destroys A and resizes +// x if necessary. +template <typename TMat, typename TVec1, typename TVec2> +double Nullspace2(TMat *A, TVec1 *x1, TVec2 *x2) { + Eigen::JacobiSVD<TMat> svd(*A, Eigen::ComputeFullV); + *x1 = svd.matrixV().col(A->cols() - 1); + *x2 = svd.matrixV().col(A->cols() - 2); + if (A->rows() >= A->cols()) + return svd.singularValues()(A->cols()-1); + else + return 0.0; +} + +// In place transpose for square matrices. +template<class TA> +inline void TransposeInPlace(TA *A) { + *A = A->transpose().eval(); +} + +template<typename TVec> +inline double NormL1(const TVec &x) { + return x.array().abs().sum(); +} + +template<typename TVec> +inline double NormL2(const TVec &x) { + return x.norm(); +} + +template<typename TVec> +inline double NormLInfinity(const TVec &x) { + return x.array().abs().maxCoeff(); +} + +template<typename TVec> +inline double DistanceL1(const TVec &x, const TVec &y) { + return (x - y).array().abs().sum(); +} + +template<typename TVec> +inline double DistanceL2(const TVec &x, const TVec &y) { + return (x - y).norm(); +} +template<typename TVec> +inline double DistanceLInfinity(const TVec &x, const TVec &y) { + return (x - y).array().abs().maxCoeff(); +} + +// Normalize a vector with the L1 norm, and return the norm before it was +// normalized. +template<typename TVec> +inline double NormalizeL1(TVec *x) { + double norm = NormL1(*x); + *x /= norm; + return norm; +} + +// Normalize a vector with the L2 norm, and return the norm before it was +// normalized. +template<typename TVec> +inline double NormalizeL2(TVec *x) { + double norm = NormL2(*x); + *x /= norm; + return norm; +} + +// Normalize a vector with the L^Infinity norm, and return the norm before it +// was normalized. +template<typename TVec> +inline double NormalizeLInfinity(TVec *x) { + double norm = NormLInfinity(*x); + *x /= norm; + return norm; +} + +// Return the square of a number. +template<typename T> +inline T Square(T x) { + return x * x; +} + +Mat3 RotationAroundX(double angle); +Mat3 RotationAroundY(double angle); +Mat3 RotationAroundZ(double angle); + +// Returns the rotation matrix of a rotation of angle |axis| around axis. +// This is computed using the Rodrigues formula, see: +// http://mathworld.wolfram.com/RodriguesRotationFormula.html +Mat3 RotationRodrigues(const Vec3 &axis); + +// Make a rotation matrix such that center becomes the direction of the +// positive z-axis, and y is oriented close to up. +Mat3 LookAt(Vec3 center); + +// Return a diagonal matrix from a vector containg the diagonal values. +template <typename TVec> +inline Mat Diag(const TVec &x) { + return x.asDiagonal(); +} + +template<typename TMat> +inline double FrobeniusNorm(const TMat &A) { + return sqrt(A.array().abs2().sum()); +} + +template<typename TMat> +inline double FrobeniusDistance(const TMat &A, const TMat &B) { + return FrobeniusNorm(A - B); +} + +inline Vec3 CrossProduct(const Vec3 &x, const Vec3 &y) { + return x.cross(y); +} + +Mat3 CrossProductMatrix(const Vec3 &x); + +void MeanAndVarianceAlongRows(const Mat &A, + Vec *mean_pointer, + Vec *variance_pointer); + +#if _WIN32 + // TODO(bomboze): un-#if this for both platforms once tested under Windows + /* This solution was extensively discussed here http://forum.kde.org/viewtopic.php?f=74&t=61940 */ + #define SUM_OR_DYNAMIC(x,y) (x==Eigen::Dynamic||y==Eigen::Dynamic)?Eigen::Dynamic:(x+y) + + template<typename Derived1, typename Derived2> + struct hstack_return { + typedef typename Derived1::Scalar Scalar; + enum { + RowsAtCompileTime = Derived1::RowsAtCompileTime, + ColsAtCompileTime = SUM_OR_DYNAMIC(Derived1::ColsAtCompileTime, Derived2::ColsAtCompileTime), + Options = Derived1::Flags&Eigen::RowMajorBit ? Eigen::RowMajor : 0, + MaxRowsAtCompileTime = Derived1::MaxRowsAtCompileTime, + MaxColsAtCompileTime = SUM_OR_DYNAMIC(Derived1::MaxColsAtCompileTime, Derived2::MaxColsAtCompileTime) + }; + typedef Eigen::Matrix<Scalar, + RowsAtCompileTime, + ColsAtCompileTime, + Options, + MaxRowsAtCompileTime, + MaxColsAtCompileTime> type; + }; + + template<typename Derived1, typename Derived2> + typename hstack_return<Derived1,Derived2>::type + HStack (const Eigen::MatrixBase<Derived1>& lhs, const Eigen::MatrixBase<Derived2>& rhs) { + typename hstack_return<Derived1,Derived2>::type res; + res.resize(lhs.rows(), lhs.cols()+rhs.cols()); + res << lhs, rhs; + return res; + }; + + + template<typename Derived1, typename Derived2> + struct vstack_return { + typedef typename Derived1::Scalar Scalar; + enum { + RowsAtCompileTime = SUM_OR_DYNAMIC(Derived1::RowsAtCompileTime, Derived2::RowsAtCompileTime), + ColsAtCompileTime = Derived1::ColsAtCompileTime, + Options = Derived1::Flags&Eigen::RowMajorBit ? Eigen::RowMajor : 0, + MaxRowsAtCompileTime = SUM_OR_DYNAMIC(Derived1::MaxRowsAtCompileTime, Derived2::MaxRowsAtCompileTime), + MaxColsAtCompileTime = Derived1::MaxColsAtCompileTime + }; + typedef Eigen::Matrix<Scalar, + RowsAtCompileTime, + ColsAtCompileTime, + Options, + MaxRowsAtCompileTime, + MaxColsAtCompileTime> type; + }; + + template<typename Derived1, typename Derived2> + typename vstack_return<Derived1,Derived2>::type + VStack (const Eigen::MatrixBase<Derived1>& lhs, const Eigen::MatrixBase<Derived2>& rhs) { + typename vstack_return<Derived1,Derived2>::type res; + res.resize(lhs.rows()+rhs.rows(), lhs.cols()); + res << lhs, rhs; + return res; + }; + + +#else //_WIN32 + + // Since it is not possible to typedef privately here, use a macro. + // Always take dynamic columns if either side is dynamic. + #define COLS \ + ((ColsLeft == Eigen::Dynamic || ColsRight == Eigen::Dynamic) \ + ? Eigen::Dynamic : (ColsLeft + ColsRight)) + + // Same as above, except that prefer fixed size if either is fixed. + #define ROWS \ + ((RowsLeft == Eigen::Dynamic && RowsRight == Eigen::Dynamic) \ + ? Eigen::Dynamic \ + : ((RowsLeft == Eigen::Dynamic) \ + ? RowsRight \ + : RowsLeft \ + ) \ + ) + + // TODO(keir): Add a static assert if both rows are at compiletime. + template<typename T, int RowsLeft, int RowsRight, int ColsLeft, int ColsRight> + Eigen::Matrix<T, ROWS, COLS> + HStack(const Eigen::Matrix<T, RowsLeft, ColsLeft> &left, + const Eigen::Matrix<T, RowsRight, ColsRight> &right) { + assert(left.rows() == right.rows()); + int n = left.rows(); + int m1 = left.cols(); + int m2 = right.cols(); + + Eigen::Matrix<T, ROWS, COLS> stacked(n, m1 + m2); + stacked.block(0, 0, n, m1) = left; + stacked.block(0, m1, n, m2) = right; + return stacked; + } + + // Reuse the above macros by swapping the order of Rows and Cols. Nasty, but + // the duplication is worse. + // TODO(keir): Add a static assert if both rows are at compiletime. + // TODO(keir): Mail eigen list about making this work for general expressions + // rather than only matrix types. + template<typename T, int RowsLeft, int RowsRight, int ColsLeft, int ColsRight> + Eigen::Matrix<T, COLS, ROWS> + VStack(const Eigen::Matrix<T, ColsLeft, RowsLeft> &top, + const Eigen::Matrix<T, ColsRight, RowsRight> &bottom) { + assert(top.cols() == bottom.cols()); + int n1 = top.rows(); + int n2 = bottom.rows(); + int m = top.cols(); + + Eigen::Matrix<T, COLS, ROWS> stacked(n1 + n2, m); + stacked.block(0, 0, n1, m) = top; + stacked.block(n1, 0, n2, m) = bottom; + return stacked; + } + #undef COLS + #undef ROWS +#endif //_WIN32 + + + +void HorizontalStack(const Mat &left, const Mat &right, Mat *stacked); + +template<typename TTop, typename TBot, typename TStacked> +void VerticalStack(const TTop &top, const TBot &bottom, TStacked *stacked) { + assert(top.cols() == bottom.cols()); + int n1 = top.rows(); + int n2 = bottom.rows(); + int m = top.cols(); + + stacked->resize(n1 + n2, m); + stacked->block(0, 0, n1, m) = top; + stacked->block(n1, 0, n2, m) = bottom; +} + +void MatrixColumn(const Mat &A, int i, Vec2 *v); +void MatrixColumn(const Mat &A, int i, Vec3 *v); +void MatrixColumn(const Mat &A, int i, Vec4 *v); + +template <typename TMat, typename TCols> +TMat ExtractColumns(const TMat &A, const TCols &columns) { + TMat compressed(A.rows(), columns.size()); + for (int i = 0; i < columns.size(); ++i) { + compressed.col(i) = A.col(columns[i]); + } + return compressed; +} + +template <typename TMat, typename TDest> +void reshape(const TMat &a, int rows, int cols, TDest *b) { + assert(a.rows()*a.cols() == rows*cols); + b->resize(rows, cols); + for (int i = 0; i < rows; i++) { + for (int j = 0; j < cols; j++) { + (*b)(i, j) = a[cols*i + j]; + } + } +} + +inline bool isnan(double i) { +#ifdef WIN32 + return _isnan(i) > 0; +#else + return std::isnan(i); +#endif +} + +/// Ceil function that has the same behaviour for positive +/// and negative values +template <typename FloatType> +FloatType ceil0(const FloatType& value) { + FloatType result = std::ceil( std::fabs( value ) ); + return (value < 0.0) ? -result : result; +} + +/// Returns the skew anti-symmetric matrix of a vector +inline Mat3 SkewMat(const Vec3 &x) { + Mat3 skew; + skew << 0 , -x(2), x(1), + x(2), 0 , -x(0), + -x(1), x(0), 0; + return skew; +} +/// Returns the skew anti-symmetric matrix of a vector with only +/// the first two (independent) lines +inline Mat23 SkewMatMinimal(const Vec2 &x) { + Mat23 skew; + skew << 0,-1, x(1), + 1, 0, -x(0); + return skew; +} +} // namespace libmv + +#endif // LIBMV_NUMERIC_NUMERIC_H diff --git a/extern/libmv/libmv/numeric/poly.cc b/extern/libmv/libmv/numeric/poly.cc new file mode 100644 index 00000000000..d96e3c104c7 --- /dev/null +++ b/extern/libmv/libmv/numeric/poly.cc @@ -0,0 +1,23 @@ +// Copyright (c) 2007, 2008 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. +// +// Routines for solving polynomials. + +// TODO(keir): Add a solver for degree > 3 polynomials. diff --git a/extern/libmv/libmv/numeric/poly.h b/extern/libmv/libmv/numeric/poly.h new file mode 100644 index 00000000000..cb1d65b32c4 --- /dev/null +++ b/extern/libmv/libmv/numeric/poly.h @@ -0,0 +1,123 @@ +// Copyright (c) 2007, 2008 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_NUMERIC_POLY_H_ +#define LIBMV_NUMERIC_POLY_H_ + +#include <cmath> +#include <stdio.h> + +namespace libmv { + +// Solve the cubic polynomial +// +// x^3 + a*x^2 + b*x + c = 0 +// +// The number of roots (from zero to three) is returned. If the number of roots +// is less than three, then higher numbered x's are not changed. For example, +// if there are 2 roots, only x0 and x1 are set. +// +// The GSL cubic solver was used as a reference for this routine. +template<typename Real> +int SolveCubicPolynomial(Real a, Real b, Real c, + Real *x0, Real *x1, Real *x2) { + Real q = a * a - 3 * b; + Real r = 2 * a * a * a - 9 * a * b + 27 * c; + + Real Q = q / 9; + Real R = r / 54; + + Real Q3 = Q * Q * Q; + Real R2 = R * R; + + Real CR2 = 729 * r * r; + Real CQ3 = 2916 * q * q * q; + + if (R == 0 && Q == 0) { + // Tripple root in one place. + *x0 = *x1 = *x2 = -a / 3 ; + return 3; + + } else if (CR2 == CQ3) { + // This test is actually R2 == Q3, written in a form suitable for exact + // computation with integers. + // + // Due to finite precision some double roots may be missed, and considered + // to be a pair of complex roots z = x +/- epsilon i close to the real + // axis. + Real sqrtQ = sqrt (Q); + if (R > 0) { + *x0 = -2 * sqrtQ - a / 3; + *x1 = sqrtQ - a / 3; + *x2 = sqrtQ - a / 3; + } else { + *x0 = -sqrtQ - a / 3; + *x1 = -sqrtQ - a / 3; + *x2 = 2 * sqrtQ - a / 3; + } + return 3; + + } else if (CR2 < CQ3) { + // This case is equivalent to R2 < Q3. + Real sqrtQ = sqrt (Q); + Real sqrtQ3 = sqrtQ * sqrtQ * sqrtQ; + Real theta = acos (R / sqrtQ3); + Real norm = -2 * sqrtQ; + *x0 = norm * cos (theta / 3) - a / 3; + *x1 = norm * cos ((theta + 2.0 * M_PI) / 3) - a / 3; + *x2 = norm * cos ((theta - 2.0 * M_PI) / 3) - a / 3; + + // Put the roots in ascending order. + if (*x0 > *x1) { + std::swap(*x0, *x1); + } + if (*x1 > *x2) { + std::swap(*x1, *x2); + if (*x0 > *x1) { + std::swap(*x0, *x1); + } + } + return 3; + } + Real sgnR = (R >= 0 ? 1 : -1); + Real A = -sgnR * pow (fabs (R) + sqrt (R2 - Q3), 1.0/3.0); + Real B = Q / A ; + *x0 = A + B - a / 3; + return 1; +} + +// The coefficients are in ascending powers, i.e. coeffs[N]*x^N. +template<typename Real> +int SolveCubicPolynomial(const Real *coeffs, Real *solutions) { + if (coeffs[0] == 0.0) { + // TODO(keir): This is a quadratic not a cubic. Implement a quadratic + // solver! + return 0; + } + Real a = coeffs[2] / coeffs[3]; + Real b = coeffs[1] / coeffs[3]; + Real c = coeffs[0] / coeffs[3]; + return SolveCubicPolynomial(a, b, c, + solutions + 0, + solutions + 1, + solutions + 2); +} +} // namespace libmv +#endif // LIBMV_NUMERIC_POLY_H_ diff --git a/extern/libmv/libmv/simple_pipeline/bundle.cc b/extern/libmv/libmv/simple_pipeline/bundle.cc new file mode 100644 index 00000000000..cb8822dcf44 --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/bundle.cc @@ -0,0 +1,184 @@ +// Copyright (c) 2011 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. + +#define V3DLIB_ENABLE_SUITESPARSE 1 + +#include <map> + +#include "libmv/base/vector.h" +#include "libmv/logging/logging.h" +#include "libmv/multiview/fundamental.h" +#include "libmv/multiview/projection.h" +#include "libmv/numeric/numeric.h" +#include "libmv/simple_pipeline/reconstruction.h" +#include "libmv/simple_pipeline/tracks.h" +#include "third_party/ssba/Geometry/v3d_cameramatrix.h" +#include "third_party/ssba/Geometry/v3d_metricbundle.h" +#include "third_party/ssba/Math/v3d_linear.h" +#include "third_party/ssba/Math/v3d_linear_utils.h" + +namespace libmv { + +void EuclideanBundle(const Tracks &tracks, + EuclideanReconstruction *reconstruction) { + vector<Marker> markers = tracks.AllMarkers(); + + // "index" in this context is the index that V3D's optimizer will see. The + // V3D index must be dense in that the cameras are numbered 0...n-1, which is + // not the case for the "image" numbering that arises from the tracks + // structure. The complicated mapping is necessary to convert between the two + // representations. + std::map<EuclideanCamera *, int> camera_to_index; + std::map<EuclideanPoint *, int> point_to_index; + vector<EuclideanCamera *> index_to_camera; + vector<EuclideanPoint *> index_to_point; + int num_cameras = 0; + int num_points = 0; + for (int i = 0; i < markers.size(); ++i) { + const Marker &marker = markers[i]; + EuclideanCamera *camera = reconstruction->CameraForImage(marker.image); + EuclideanPoint *point = reconstruction->PointForTrack(marker.track); + if (camera && point) { + if (camera_to_index.find(camera) == camera_to_index.end()) { + camera_to_index[camera] = num_cameras; + index_to_camera.push_back(camera); + num_cameras++; + } + if (point_to_index.find(point) == point_to_index.end()) { + point_to_index[point] = num_points; + index_to_point.push_back(point); + num_points++; + } + } + } + + // Make a V3D identity matrix, needed in a few places for K, since this + // assumes a calibrated setup. + V3D::Matrix3x3d identity3x3; + identity3x3[0][0] = 1.0; + identity3x3[0][1] = 0.0; + identity3x3[0][2] = 0.0; + identity3x3[1][0] = 0.0; + identity3x3[1][1] = 1.0; + identity3x3[1][2] = 0.0; + identity3x3[2][0] = 0.0; + identity3x3[2][1] = 0.0; + identity3x3[2][2] = 1.0; + + // Convert libmv's cameras to V3D's cameras. + std::vector<V3D::CameraMatrix> v3d_cameras(index_to_camera.size()); + for (int k = 0; k < index_to_camera.size(); ++k) { + V3D::Matrix3x3d R; + V3D::Vector3d t; + + // Libmv's rotation matrix type. + const Mat3 &R_libmv = index_to_camera[k]->R; + const Vec3 &t_libmv = index_to_camera[k]->t; + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + R[i][j] = R_libmv(i, j); + } + t[i] = t_libmv(i); + } + v3d_cameras[k].setIntrinsic(identity3x3); + v3d_cameras[k].setRotation(R); + v3d_cameras[k].setTranslation(t); + } + LG << "Number of cameras: " << index_to_camera.size(); + + // Convert libmv's points to V3D's points. + std::vector<V3D::Vector3d> v3d_points(index_to_point.size()); + for (int i = 0; i < index_to_point.size(); i++) { + v3d_points[i][0] = index_to_point[i]->X(0); + v3d_points[i][1] = index_to_point[i]->X(1); + v3d_points[i][2] = index_to_point[i]->X(2); + } + LG << "Number of points: " << index_to_point.size(); + + // Convert libmv's measurements to v3d measurements. + int num_residuals = 0; + std::vector<V3D::Vector2d> v3d_measurements; + std::vector<int> v3d_camera_for_measurement; + std::vector<int> v3d_point_for_measurement; + for (int i = 0; i < markers.size(); ++i) { + EuclideanCamera *camera = reconstruction->CameraForImage(markers[i].image); + EuclideanPoint *point = reconstruction->PointForTrack(markers[i].track); + if (!camera || !point) { + continue; + } + V3D::Vector2d v3d_point; + v3d_point[0] = markers[i].x; + v3d_point[1] = markers[i].y; + v3d_measurements.push_back(v3d_point); + v3d_camera_for_measurement.push_back(camera_to_index[camera]); + v3d_point_for_measurement.push_back(point_to_index[point]); + num_residuals++; + } + LG << "Number of residuals: " << num_residuals; + + // This is calibrated reconstruction, so use zero distortion. + V3D::StdDistortionFunction v3d_distortion; + v3d_distortion.k1 = 0; + v3d_distortion.k2 = 0; + v3d_distortion.p1 = 0; + v3d_distortion.p2 = 0; + + // Finally, run the bundle adjustment. + double const inlierThreshold = 500000.0; + V3D::CommonInternalsMetricBundleOptimizer opt(V3D::FULL_BUNDLE_METRIC, + inlierThreshold, + identity3x3, + v3d_distortion, + v3d_cameras, + v3d_points, + v3d_measurements, + v3d_camera_for_measurement, + v3d_point_for_measurement); + opt.maxIterations = 50; + opt.minimize(); + LG << "Bundle status: " << opt.status; + + // Convert V3D's cameras back to libmv's cameras. + for (int k = 0; k < num_cameras; k++) { + V3D::Matrix3x4d const Rt = v3d_cameras[k].getOrientation(); + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + index_to_camera[k]->R(i, j) = Rt[i][j]; + } + index_to_camera[k]->t(i) = Rt[i][3]; + } + } + + // Convert V3D's points back to libmv's points. + for (int k = 0; k < num_points; k++) { + for (int i = 0; i < 3; ++i) { + index_to_point[k]->X(i) = v3d_points[k][i]; + } + } +} + +void ProjectiveBundle(const Tracks & /*tracks*/, + ProjectiveReconstruction * /*reconstruction*/) { + // TODO(keir): Implement this! This can't work until we have a better bundler + // than SSBA, since SSBA has no support for projective bundling. +} + +} // namespace libmv diff --git a/extern/libmv/libmv/simple_pipeline/bundle.h b/extern/libmv/libmv/simple_pipeline/bundle.h new file mode 100644 index 00000000000..c7fb2a79607 --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/bundle.h @@ -0,0 +1,72 @@ +// Copyright (c) 2011 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_SIMPLE_PIPELINE_BUNDLE_H +#define LIBMV_SIMPLE_PIPELINE_BUNDLE_H + +namespace libmv { + +class EuclideanReconstruction; +class ProjectiveReconstruction; +class Tracks; + +/*! + Refine camera poses and 3D coordinates using bundle adjustment. + + This routine adjusts all cameras and points in \a *reconstruction. This + assumes a full observation for reconstructed tracks; this implies that if + there is a reconstructed 3D point (a bundle) for a track, then all markers + for that track will be included in the minimization. \a tracks should + contain markers used in the initial reconstruction. + + The cameras and bundles (3D points) are refined in-place. + + \note This assumes an outlier-free set of markers. + \note This assumes a calibrated reconstruction, e.g. the markers are + already corrected for camera intrinsics and radial distortion. + + \sa EuclideanResect, EuclideanIntersect, EuclideanReconstructTwoFrames +*/ +void EuclideanBundle(const Tracks &tracks, + EuclideanReconstruction *reconstruction); + +/*! + Refine camera poses and 3D coordinates using bundle adjustment. + + This routine adjusts all cameras and points in \a *reconstruction. This + assumes a full observation for reconstructed tracks; this implies that if + there is a reconstructed 3D point (a bundle) for a track, then all markers + for that track will be included in the minimization. \a tracks should + contain markers used in the initial reconstruction. + + The cameras and bundles (homogeneous 3D points) are refined in-place. + + \note This assumes an outlier-free set of markers. + \note This assumes that radial distortion is already corrected for, but + does not assume that that other intrinsics are. + + \sa ProjectiveResect, ProjectiveIntersect, ProjectiveReconstructTwoFrames +*/ +void ProjectiveBundle(const Tracks &tracks, + ProjectiveReconstruction *reconstruction); + +} // namespace libmv + +#endif // LIBMV_SIMPLE_PIPELINE_BUNDLE_H diff --git a/extern/libmv/libmv/simple_pipeline/camera_intrinsics.cc b/extern/libmv/libmv/simple_pipeline/camera_intrinsics.cc new file mode 100644 index 00000000000..366129dd3d2 --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/camera_intrinsics.cc @@ -0,0 +1,351 @@ +// Copyright (c) 2011 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. + +#include "libmv/simple_pipeline/camera_intrinsics.h" +#include "libmv/numeric/levenberg_marquardt.h" + +namespace libmv { + +struct Offset { + signed char ix, iy; + unsigned char fx,fy; +}; + +struct Grid { + struct Offset *offset; + int width, height; + double overscan; +}; + +static struct Grid *copyGrid(struct Grid *from) +{ + struct Grid *to = NULL; + + if (from) { + to = new Grid; + + to->width = from->width; + to->height = from->height; + to->overscan = from->overscan; + + to->offset = new Offset[to->width*to->height]; + memcpy(to->offset, from->offset, sizeof(struct Offset)*to->width*to->height); + } + + return to; +} + +CameraIntrinsics::CameraIntrinsics() + : K_(Mat3::Identity()), + image_width_(0), + image_height_(0), + k1_(0), + k2_(0), + k3_(0), + p1_(0), + p2_(0), + distort_(0), + undistort_(0) {} + +CameraIntrinsics::CameraIntrinsics(const CameraIntrinsics &from) + : K_(from.K_), + image_width_(from.image_width_), + image_height_(from.image_height_), + k1_(from.k1_), + k2_(from.k2_), + k3_(from.k3_), + p1_(from.p1_), + p2_(from.p2_) +{ + distort_ = copyGrid(from.distort_); + undistort_ = copyGrid(from.undistort_); +} + +CameraIntrinsics::~CameraIntrinsics() { + FreeLookupGrid(); +} + +/// Set the entire calibration matrix at once. +void CameraIntrinsics::SetK(const Mat3 new_k) { + K_ = new_k; + FreeLookupGrid(); +} + +/// Set both x and y focal length in pixels. +void CameraIntrinsics::SetFocalLength(double focal_x, double focal_y) { + K_(0, 0) = focal_x; + K_(1, 1) = focal_y; + FreeLookupGrid(); +} + +void CameraIntrinsics::SetPrincipalPoint(double cx, double cy) { + K_(0, 2) = cx; + K_(1, 2) = cy; + FreeLookupGrid(); +} + +void CameraIntrinsics::SetImageSize(int width, int height) { + image_width_ = width; + image_height_ = height; + FreeLookupGrid(); +} + +void CameraIntrinsics::SetRadialDistortion(double k1, double k2, double k3) { + k1_ = k1; + k2_ = k2; + k3_ = k3; + FreeLookupGrid(); +} + +void CameraIntrinsics::SetTangentialDistortion(double p1, double p2) { + p1_ = p1; + p2_ = p2; + FreeLookupGrid(); +} + +void CameraIntrinsics::ApplyIntrinsics(double normalized_x, + double normalized_y, + double *image_x, + double *image_y) const { + double x = normalized_x; + double y = normalized_y; + + // Apply distortion to the normalized points to get (xd, yd). + double r2 = x*x + y*y; + double r4 = r2 * r2; + double r6 = r4 * r2; + double r_coeff = (1 + k1_*r2 + k2_*r4 + k3_*r6); + double xd = x * r_coeff + 2*p1_*x*y + p2_*(r2 + 2*x*x); + double yd = y * r_coeff + 2*p2_*x*y + p1_*(r2 + 2*y*y); + + // Apply focal length and principal point to get the final image coordinates. + *image_x = focal_length_x() * xd + principal_point_x(); + *image_y = focal_length_y() * yd + principal_point_y(); +} + +struct InvertIntrinsicsCostFunction { + public: + typedef Vec2 FMatrixType; + typedef Vec2 XMatrixType; + + InvertIntrinsicsCostFunction(const CameraIntrinsics &intrinsics, + double image_x, double image_y) + : intrinsics(intrinsics), x(image_x), y(image_y) {} + + Vec2 operator()(const Vec2 &u) const { + double xx, yy; + intrinsics.ApplyIntrinsics(u(0), u(1), &xx, &yy); + Vec2 fx; + fx << (xx - x), (yy - y); + return fx; + } + const CameraIntrinsics &intrinsics; + double x, y; +}; + +void CameraIntrinsics::InvertIntrinsics(double image_x, + double image_y, + double *normalized_x, + double *normalized_y) const { + // Compute the initial guess. For a camera with no distortion, this will also + // be the final answer; the LM iteration will terminate immediately. + Vec2 normalized; + normalized(0) = (image_x - principal_point_x()) / focal_length_x(); + normalized(1) = (image_y - principal_point_y()) / focal_length_y(); + + typedef LevenbergMarquardt<InvertIntrinsicsCostFunction> Solver; + + InvertIntrinsicsCostFunction intrinsics_cost(*this, image_x, image_y); + Solver::SolverParameters params; + Solver solver(intrinsics_cost); + + /*Solver::Results results =*/ solver.minimize(params, &normalized); + + // TODO(keir): Better error handling. + + *normalized_x = normalized(0); + *normalized_y = normalized(1); +} + +// TODO(MatthiasF): downsample lookup +template<typename WarpFunction> +void CameraIntrinsics::ComputeLookupGrid(Grid* grid, int width, int height, double overscan) { + double w = (double)width / (1 + overscan); + double h = (double)height / (1 + overscan); + double aspx = (double)w / image_width_; + double aspy = (double)h / image_height_; + + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + double src_x = (x - 0.5 * overscan * w) / aspx, src_y = (y - 0.5 * overscan * h) / aspy; + double warp_x, warp_y; + WarpFunction(this,src_x,src_y,&warp_x,&warp_y); + warp_x = warp_x*aspx + 0.5 * overscan * w; + warp_y = warp_y*aspy + 0.5 * overscan * h; + int ix = int(warp_x), iy = int(warp_y); + int fx = round((warp_x-ix)*256), fy = round((warp_y-iy)*256); + if(fx == 256) { fx=0; ix++; } + if(fy == 256) { fy=0; iy++; } + // Use nearest border pixel + if( ix < 0 ) { ix = 0, fx = 0; } + if( iy < 0 ) { iy = 0, fy = 0; } + if( ix >= width-2 ) ix = width-2; + if( iy >= height-2 ) iy = height-2; + if ( ix-x > -128 && ix-x < 128 && iy-y > -128 && iy-y < 128 ) { + Offset offset = { ix-x, iy-y, fx, fy }; + grid->offset[y*width+x] = offset; + } else { + Offset offset = { 0, 0, 0, 0 }; + grid->offset[y*width+x] = offset; + } + } + } +} + +// TODO(MatthiasF): cubic B-Spline image sampling, bilinear lookup +template<typename T,int N> +static void Warp(const Grid* grid, const T* src, T* dst, + int width, int height) { + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + Offset offset = grid->offset[y*width+x]; + const T* s = &src[((y+offset.iy)*width+(x+offset.ix))*N]; + for (int i = 0; i < N; i++) { + dst[(y*width+x)*N+i] = ((s[ i] * (256-offset.fx) + s[ N+i] * offset.fx) * (256-offset.fy) + +(s[width*N+i] * (256-offset.fx) + s[width*N+N+i] * offset.fx) * offset.fy) / (256*256); + } + } + } +} + +void CameraIntrinsics::FreeLookupGrid() { + if(distort_) { + delete distort_->offset; + delete distort_; + distort_ = NULL; + } + + if(undistort_) { + delete undistort_->offset; + delete undistort_; + undistort_ = NULL; + } +} + +// FIXME: C++ templates limitations makes thing complicated, but maybe there is a simpler method. +struct ApplyIntrinsicsFunction { + ApplyIntrinsicsFunction(CameraIntrinsics* intrinsics, double x, double y, + double *warp_x, double *warp_y) { + intrinsics->ApplyIntrinsics( + (x-intrinsics->principal_point_x())/intrinsics->focal_length_x(), + (y-intrinsics->principal_point_y())/intrinsics->focal_length_y(), + warp_x, warp_y); + } +}; +struct InvertIntrinsicsFunction { + InvertIntrinsicsFunction(CameraIntrinsics* intrinsics, double x, double y, + double *warp_x, double *warp_y) { + intrinsics->InvertIntrinsics(x,y,warp_x,warp_y); + *warp_x = *warp_x*intrinsics->focal_length_x()+intrinsics->principal_point_x(); + *warp_y = *warp_y*intrinsics->focal_length_y()+intrinsics->principal_point_y(); + } +}; + +void CameraIntrinsics::CheckDistortLookupGrid(int width, int height, double overscan) +{ + if(distort_) { + if(distort_->width != width || distort_->height != height || distort_->overscan != overscan) { + delete [] distort_->offset; + distort_->offset = NULL; + } + } else { + distort_ = new Grid; + distort_->offset = NULL; + } + + if(!distort_->offset) { + distort_->offset = new Offset[width*height]; + ComputeLookupGrid<InvertIntrinsicsFunction>(distort_,width,height,overscan); + } + + distort_->width = width; + distort_->height = height; + distort_->overscan = overscan; +} + +void CameraIntrinsics::CheckUndistortLookupGrid(int width, int height, double overscan) +{ + if(undistort_) { + if(undistort_->width != width || undistort_->height != height || undistort_->overscan != overscan) { + delete [] undistort_->offset; + undistort_->offset = NULL; + } + } else { + undistort_ = new Grid; + undistort_->offset = NULL; + } + + if(!undistort_->offset) { + undistort_->offset = new Offset[width*height]; + ComputeLookupGrid<ApplyIntrinsicsFunction>(undistort_,width,height,overscan); + } + + undistort_->width = width; + undistort_->height = height; + undistort_->overscan = overscan; +} + +void CameraIntrinsics::Distort(const float* src, float* dst, int width, int height, double overscan, int channels) { + CheckDistortLookupGrid(width, height, overscan); + if(channels==1) Warp<float,1>(distort_,src,dst,width,height); + else if(channels==2) Warp<float,2>(distort_,src,dst,width,height); + else if(channels==3) Warp<float,3>(distort_,src,dst,width,height); + else if(channels==4) Warp<float,4>(distort_,src,dst,width,height); + //else assert("channels must be between 1 and 4"); +} + +void CameraIntrinsics::Distort(const unsigned char* src, unsigned char* dst, int width, int height, double overscan, int channels) { + CheckDistortLookupGrid(width, height, overscan); + if(channels==1) Warp<unsigned char,1>(distort_,src,dst,width,height); + else if(channels==2) Warp<unsigned char,2>(distort_,src,dst,width,height); + else if(channels==3) Warp<unsigned char,3>(distort_,src,dst,width,height); + else if(channels==4) Warp<unsigned char,4>(distort_,src,dst,width,height); + //else assert("channels must be between 1 and 4"); +} + +void CameraIntrinsics::Undistort(const float* src, float* dst, int width, int height, double overscan, int channels) { + CheckUndistortLookupGrid(width, height, overscan); + if(channels==1) Warp<float,1>(undistort_,src,dst,width,height); + else if(channels==2) Warp<float,2>(undistort_,src,dst,width,height); + else if(channels==3) Warp<float,3>(undistort_,src,dst,width,height); + else if(channels==4) Warp<float,4>(undistort_,src,dst,width,height); + //else assert("channels must be between 1 and 4"); +} + +void CameraIntrinsics::Undistort(const unsigned char* src, unsigned char* dst, int width, int height, double overscan, int channels) { + CheckUndistortLookupGrid(width, height, overscan); + if(channels==1) Warp<unsigned char,1>(undistort_,src,dst,width,height); + else if(channels==2) Warp<unsigned char,2>(undistort_,src,dst,width,height); + else if(channels==3) Warp<unsigned char,3>(undistort_,src,dst,width,height); + else if(channels==4) Warp<unsigned char,4>(undistort_,src,dst,width,height); + //else assert("channels must be between 1 and 4"); +} + +} // namespace libmv diff --git a/extern/libmv/libmv/simple_pipeline/camera_intrinsics.h b/extern/libmv/libmv/simple_pipeline/camera_intrinsics.h new file mode 100644 index 00000000000..f4bf903c36c --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/camera_intrinsics.h @@ -0,0 +1,152 @@ +// Copyright (c) 2011 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_SIMPLE_PIPELINE_CAMERA_INTRINSICS_H_ +#define LIBMV_SIMPLE_PIPELINE_CAMERA_INTRINSICS_H_ + +#include <Eigen/Core> +typedef Eigen::Matrix<double, 3, 3> Mat3; + +namespace libmv { + +struct Grid; + +class CameraIntrinsics { + public: + CameraIntrinsics(); + CameraIntrinsics(const CameraIntrinsics &from); + ~CameraIntrinsics(); + + const Mat3 &K() const { return K_; } + // FIXME(MatthiasF): these should be CamelCase methods + double focal_length() const { return K_(0, 0); } + double focal_length_x() const { return K_(0, 0); } + double focal_length_y() const { return K_(1, 1); } + double principal_point_x() const { return K_(0, 2); } + double principal_point_y() const { return K_(1, 2); } + int image_width() const { return image_width_; } + int image_height() const { return image_height_; } + double k1() const { return k1_; } + double k2() const { return k2_; } + double k3() const { return k3_; } + double p1() const { return p1_; } + double p2() const { return p2_; } + + /// Set the entire calibration matrix at once. + void SetK(const Mat3 new_k); + + /// Set both x and y focal length in pixels. + void SetFocalLength(double focal_x, double focal_y); + + void SetPrincipalPoint(double cx, double cy); + + void SetImageSize(int width, int height); + + void SetRadialDistortion(double k1, double k2, double k3 = 0); + + void SetTangentialDistortion(double p1, double p2); + + /*! + Apply camera intrinsics to the normalized point to get image coordinates. + + This applies the lens distortion to a point which is in normalized + camera coordinates (i.e. the principal point is at (0, 0)) to get image + coordinates in pixels. + */ + void ApplyIntrinsics(double normalized_x, double normalized_y, + double *image_x, double *image_y) const; + + /*! + Invert camera intrinsics on the image point to get normalized coordinates. + + This reverses the effect of lens distortion on a point which is in image + coordinates to get normalized camera coordinates. + */ + void InvertIntrinsics(double image_x, double image_y, + double *normalized_x, double *normalized_y) const; + + /*! + Distort an image using the current camera instrinsics + + The distorted image is computed in \a dst using samples from \a src. + both buffers should be \a width x \a height x \a channels sized. + + \note This is the reference implementation using floating point images. + */ + void Distort(const float* src, float* dst, + int width, int height, double overscan, int channels); + /*! + Distort an image using the current camera instrinsics + + The distorted image is computed in \a dst using samples from \a src. + both buffers should be \a width x \a height x \a channels sized. + + \note This version is much faster. + */ + void Distort(const unsigned char* src, unsigned char* dst, + int width, int height, double overscan, int channels); + /*! + Undistort an image using the current camera instrinsics + + The undistorted image is computed in \a dst using samples from \a src. + both buffers should be \a width x \a height x \a channels sized. + + \note This is the reference implementation using floating point images. + */ + void Undistort(const float* src, float* dst, + int width, int height, double overscan, int channels); + /*! + Undistort an image using the current camera instrinsics + + The undistorted image is computed in \a dst using samples from \a src. + both buffers should be \a width x \a height x \a channels sized. + + \note This version is much faster. + */ + void Undistort(const unsigned char* src, unsigned char* dst, + int width, int height, double overscan, int channels); + + private: + template<typename WarpFunction> void ComputeLookupGrid(struct Grid* grid, int width, int height, double overscan); + void CheckUndistortLookupGrid(int width, int height, double overscan); + void CheckDistortLookupGrid(int width, int height, double overscan); + void FreeLookupGrid(); + + // The traditional intrinsics matrix from x = K[R|t]X. + Mat3 K_; + + // This is the size of the image. This is necessary to, for example, handle + // the case of processing a scaled image. + int image_width_; + int image_height_; + + // OpenCV's distortion model with third order polynomial radial distortion + // terms and second order tangential distortion. The distortion is applied to + // the normalized coordinates before the focal length, which makes them + // independent of image size. + double k1_, k2_, k3_, p1_, p2_; + + struct Grid *distort_; + struct Grid *undistort_; +}; + +} // namespace libmv + +#endif // LIBMV_SIMPLE_PIPELINE_CAMERA_INTRINSICS_H_ diff --git a/extern/libmv/libmv/simple_pipeline/detect.cc b/extern/libmv/libmv/simple_pipeline/detect.cc new file mode 100644 index 00000000000..8ac42ab0aba --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/detect.cc @@ -0,0 +1,184 @@ +/**************************************************************************** +** +** Copyright (c) 2011 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. +** +****************************************************************************/ + +#include "libmv/simple_pipeline/detect.h" +#include <third_party/fast/fast.h> +#include <stdlib.h> +#include <memory.h> + +#ifdef __SSE2__ +#include <emmintrin.h> +#endif + +namespace libmv { + +typedef unsigned int uint; + +int featurecmp(const void *a_v, const void *b_v) +{ + Feature *a = (Feature*)a_v; + Feature *b = (Feature*)b_v; + + return b->score - a->score; +} + +std::vector<Feature> DetectFAST(const unsigned char* data, int width, int height, int stride, + int min_trackness, int min_distance) { + std::vector<Feature> features; + // TODO(MatthiasF): Support targetting a feature count (binary search trackness) + int num_features; + xy* all = fast9_detect(data, width, height, + stride, min_trackness, &num_features); + if(num_features == 0) { + free(all); + return features; + } + int* scores = fast9_score(data, stride, all, num_features, min_trackness); + // TODO: merge with close feature suppression + xy* nonmax = nonmax_suppression(all, scores, num_features, &num_features); + free(all); + // Remove too close features + // TODO(MatthiasF): A resolution independent parameter would be better than distance + // e.g. a coefficient going from 0 (no minimal distance) to 1 (optimal circle packing) + // FIXME(MatthiasF): this method will not necessarily give all maximum markers + if(num_features) { + Feature *all_features = new Feature[num_features]; + + for(int i = 0; i < num_features; ++i) { + Feature a = { nonmax[i].x, nonmax[i].y, scores[i], 0 }; + all_features[i] = a; + } + + qsort((void *)all_features, num_features, sizeof(Feature), featurecmp); + + features.reserve(num_features); + + int prev_score = all_features[0].score; + for(int i = 0; i < num_features; ++i) { + bool ok = true; + Feature a = all_features[i]; + if(a.score>prev_score) + abort(); + prev_score = a.score; + + // compare each feature against filtered set + for(int j = 0; j < features.size(); j++) { + Feature& b = features[j]; + if ( (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y) < min_distance*min_distance ) { + // already a nearby feature + ok = false; + break; + } + } + + if(ok) { + // add the new feature + features.push_back(a); + } + } + + delete [] all_features; + } + free(scores); + free(nonmax); + return features; +} + +#ifdef __SSE2__ +static uint SAD(const ubyte* imageA, const ubyte* imageB, int strideA, int strideB) { + __m128i a = _mm_setzero_si128(); + for(int i = 0; i < 16; i++) { + a = _mm_adds_epu16(a, _mm_sad_epu8( _mm_loadu_si128((__m128i*)(imageA+i*strideA)), + _mm_loadu_si128((__m128i*)(imageB+i*strideB)))); + } + return _mm_extract_epi16(a,0) + _mm_extract_epi16(a,4); +} +#else +static uint SAD(const ubyte* imageA, const ubyte* imageB, int strideA, int strideB) { + uint sad=0; + for(int i = 0; i < 16; i++) { + for(int j = 0; j < 16; j++) { + sad += abs((int)imageA[i*strideA+j] - imageB[i*strideB+j]); + } + } + return sad; +} +#endif + +void DetectMORAVEC(ubyte* image, int stride, int width, int height, Feature* detected, int* count, int distance, ubyte* pattern) { + unsigned short histogram[256]; + memset(histogram,0,sizeof(histogram)); + ubyte* scores = new ubyte[width*height]; + memset(scores,0,width*height); + const int r = 1; //radius for self similarity comparison + for(int y=distance; y<height-distance; y++) { + for(int x=distance; x<width-distance; x++) { + ubyte* s = &image[y*stride+x]; + int score = // low self-similarity with overlapping patterns //OPTI: load pattern once + SAD(s, s-r*stride-r, stride, stride)+SAD(s, s-r*stride, stride, stride)+SAD(s, s-r*stride+r, stride, stride)+ + SAD(s, s -r, stride, stride)+ SAD(s, s +r, stride, stride)+ + SAD(s, s+r*stride-r, stride, stride)+SAD(s, s+r*stride, stride, stride)+SAD(s, s+r*stride+r, stride, stride); + score /= 256; // normalize + if(pattern) score -= SAD(s, pattern, stride, 16); // find only features similar to pattern + if(score<=16) continue; // filter very self-similar features + score -= 16; // translate to score/histogram values + if(score>255) score=255; // clip + ubyte* c = &scores[y*width+x]; + for(int i=-distance; i<0; i++) { + for(int j=-distance; j<distance; j++) { + int s = c[i*width+j]; + if(s == 0) continue; + if(s >= score) goto nonmax; + c[i*width+j]=0, histogram[s]--; + } + } + for(int i=0, j=-distance; j<0; j++) { + int s = c[i*width+j]; + if(s == 0) continue; + if(s >= score) goto nonmax; + c[i*width+j]=0, histogram[s]--; + } + c[0] = score, histogram[score]++; + nonmax:; + } + } + int min=255, total=0; + for(; min>0; min--) { + int h = histogram[min]; + if(total+h > *count) break; + total += h; + } + int i=0; + for(int y=16; y<height-16; y++) { + for(int x=16; x<width-16; x++) { + int s = scores[y*width+x]; + Feature f = { x+8, y+8, s, 16 }; + if(s>min) detected[i++] = f; + } + } + *count = i; + delete[] scores; +} + +} diff --git a/extern/libmv/libmv/simple_pipeline/detect.h b/extern/libmv/libmv/simple_pipeline/detect.h new file mode 100644 index 00000000000..bbe7aed784c --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/detect.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (c) 2011 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_SIMPLE_PIPELINE_DETECT_H_ +#define LIBMV_SIMPLE_PIPELINE_DETECT_H_ + +#include <vector> + +namespace libmv { + +typedef unsigned char ubyte; + +/*! + A Feature is the 2D location of a detected feature in an image. + + \a x, \a y is the position of the feature in pixels from the top left corner. + \a score is an estimate of how well the feature will be tracked. + \a size can be used as an initial pattern size to track the feature. + + \sa Detect +*/ +struct Feature { + /// Position in pixels (from top-left corner) + /// \note libmv might eventually support subpixel precision. + float x, y; + /// Trackness of the feature + float score; + /// Size of the feature in pixels + float size; +}; + +/*! + Detect features in an image. + + You need to input a single channel 8-bit image using pointer to image \a data, + \a width, \a height and \a stride (i.e bytes per line). + + You can tweak the count of detected features using \a min_trackness, which is + the minimum score to add a feature, and \a min_distance which is the minimal + distance accepted between two featuress. + + \note You can binary search over \a min_trackness to get a given feature count. + + \note a way to get an uniform distribution of a given feature count is: + \a min_distance = \a width * \a height / desired_feature_count ^ 2 + + \return All detected feartures matching given parameters +*/ +std::vector<Feature> DetectFAST(const unsigned char* data, int width, int height, + int stride, int min_trackness = 128, + int min_distance = 120); + +/*! + Detect features in an image. + + \a image is a single channel 8-bit image of size \a width x \a height + + \a detected is an array with space to hold \a *count features. + \a *count is the maximum count to detect on input and the actual + detected count on output. + + \a distance is the minimal distance between detected features. + + if \a pattern is null all good features will be found. + if \a pattern is not null only features similar to \a pattern will be found. + + \note \a You can crop the image (to avoid detecting markers near the borders) without copying: + image += marginY*stride+marginX, width -= 2*marginX, height -= 2*marginY; +*/ +void DetectMORAVEC(ubyte* image, int stride, int width, int height, Feature* detected, int* count, int distance /*=32*/, ubyte* pattern /*=0*/); + +} + +#endif diff --git a/extern/libmv/libmv/simple_pipeline/initialize_reconstruction.cc b/extern/libmv/libmv/simple_pipeline/initialize_reconstruction.cc new file mode 100644 index 00000000000..0597f09f728 --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/initialize_reconstruction.cc @@ -0,0 +1,218 @@ +// Copyright (c) 2011 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. + +#include "libmv/base/vector.h" +#include "libmv/logging/logging.h" +#include "libmv/multiview/fundamental.h" +#include "libmv/multiview/projection.h" +#include "libmv/numeric/levenberg_marquardt.h" +#include "libmv/numeric/numeric.h" +#include "libmv/simple_pipeline/reconstruction.h" +#include "libmv/simple_pipeline/tracks.h" + +namespace libmv { +namespace { + +void CoordinatesForMarkersInImage(const vector<Marker> &markers, + int image, + Mat *coordinates) { + vector<Vec2> coords; + for (int i = 0; i < markers.size(); ++i) { + const Marker &marker = markers[i]; + if (markers[i].image == image) { + coords.push_back(Vec2(marker.x, marker.y)); + } + } + coordinates->resize(2, coords.size()); + for (int i = 0; i < coords.size(); i++) { + coordinates->col(i) = coords[i]; + } +} + +void GetImagesInMarkers(const vector<Marker> &markers, + int *image1, int *image2) { + if (markers.size() < 2) { + return; + } + *image1 = markers[0].image; + for (int i = 1; i < markers.size(); ++i) { + if (markers[i].image != *image1) { + *image2 = markers[i].image; + return; + } + } + *image2 = -1; + LOG(FATAL) << "Only one image in the markers."; +} + +} // namespace + +bool EuclideanReconstructTwoFrames(const vector<Marker> &markers, + EuclideanReconstruction *reconstruction) { + if (markers.size() < 16) { + return false; + } + + int image1, image2; + GetImagesInMarkers(markers, &image1, &image2); + + Mat x1, x2; + CoordinatesForMarkersInImage(markers, image1, &x1); + CoordinatesForMarkersInImage(markers, image2, &x2); + + Mat3 F; + NormalizedEightPointSolver(x1, x2, &F); + + // The F matrix should be an E matrix, but squash it just to be sure. + Eigen::JacobiSVD<Mat3> svd(F, Eigen::ComputeFullU | Eigen::ComputeFullV); + + // See Hartley & Zisserman page 294, result 11.1, which shows how to get the + // closest essential matrix to a matrix that is "almost" an essential matrix. + double a = svd.singularValues()(0); + double b = svd.singularValues()(1); + double s = (a + b) / 2.0; + LG << "Initial reconstruction's rotation is non-euclidean by " + << (((a - b) / std::max(a, b)) * 100) << "%; singular values:" + << svd.singularValues().transpose(); + + Vec3 diag; + diag << s, s, 0; + Mat3 E = svd.matrixU() * diag.asDiagonal() * svd.matrixV().transpose(); + + // Recover motion between the two images. Since this function assumes a + // calibrated camera, use the identity for K. + Mat3 R; + Vec3 t; + Mat3 K = Mat3::Identity(); + if (!MotionFromEssentialAndCorrespondence(E, + K, x1.col(0), + K, x2.col(0), + &R, &t)) { + return false; + } + + // Image 1 gets the reference frame, image 2 gets the relative motion. + reconstruction->InsertCamera(image1, Mat3::Identity(), Vec3::Zero()); + reconstruction->InsertCamera(image2, R, t); + + LG << "From two frame reconstruction got:\nR:\n" << R + << "\nt:" << t.transpose(); + return true; +} + +namespace { + +Mat3 DecodeF(const Vec9 &encoded_F) { + // Decode F and force it to be rank 2. + Map<const Mat3> full_rank_F(encoded_F.data(), 3, 3); + Eigen::JacobiSVD<Mat3> svd(full_rank_F, Eigen::ComputeFullU | Eigen::ComputeFullV); + Vec3 diagonal = svd.singularValues(); + diagonal(2) = 0; + Mat3 F = svd.matrixU() * diagonal.asDiagonal() * svd.matrixV().transpose(); + return F; +} + +// This is the stupidest way to refine F known to mankind, since it requires +// doing a full SVD of F at each iteration. This uses sampson error. +struct FundamentalSampsonCostFunction { + public: + typedef Vec FMatrixType; + typedef Vec9 XMatrixType; + + // Assumes markers are ordered by track. + FundamentalSampsonCostFunction(const vector<Marker> &markers) + : markers(markers) {} + + Vec operator()(const Vec9 &encoded_F) const { + // Decode F and force it to be rank 2. + Mat3 F = DecodeF(encoded_F); + + Vec residuals(markers.size() / 2); + residuals.setZero(); + for (int i = 0; i < markers.size() / 2; ++i) { + const Marker &marker1 = markers[2*i + 0]; + const Marker &marker2 = markers[2*i + 1]; + CHECK_EQ(marker1.track, marker2.track); + Vec2 x1(marker1.x, marker1.y); + Vec2 x2(marker2.x, marker2.y); + + residuals[i] = SampsonDistance(F, x1, x2); + } + return residuals; + } + const vector<Marker> &markers; +}; + +} // namespace + +bool ProjectiveReconstructTwoFrames(const vector<Marker> &markers, + ProjectiveReconstruction *reconstruction) { + if (markers.size() < 16) { + return false; + } + + int image1, image2; + GetImagesInMarkers(markers, &image1, &image2); + + Mat x1, x2; + CoordinatesForMarkersInImage(markers, image1, &x1); + CoordinatesForMarkersInImage(markers, image2, &x2); + + Mat3 F; + NormalizedEightPointSolver(x1, x2, &F); + + // XXX Verify sampson distance. +#if 0 + // Refine the resulting projection fundamental matrix using Sampson's + // approximation of geometric error. This avoids having to do a full bundle + // at the cost of some accuracy. + // + // TODO(keir): After switching to a better bundling library, use a proper + // full bundle adjust here instead of this lame bundle adjustment. + typedef LevenbergMarquardt<FundamentalSampsonCostFunction> Solver; + + FundamentalSampsonCostFunction fundamental_cost(markers); + + // Pack the initial P matrix into a size-12 vector.. + Vec9 encoded_F = Map<Vec9>(F.data(), 3, 3); + + Solver solver(fundamental_cost); + + Solver::SolverParameters params; + Solver::Results results = solver.minimize(params, &encoded_F); + // TODO(keir): Check results to ensure clean termination. + + // Recover F from the minimization. + F = DecodeF(encoded_F); +#endif + + // Image 1 gets P = [I|0], image 2 gets arbitrary P. + Mat34 P1 = Mat34::Zero(); + P1.block<3, 3>(0, 0) = Mat3::Identity(); + Mat34 P2; + ProjectionsFromFundamental(F, &P1, &P2); + + reconstruction->InsertCamera(image1, P1); + reconstruction->InsertCamera(image2, P2); + + LG << "From two frame reconstruction got P2:\n" << P2; + return true; +} +} // namespace libmv diff --git a/extern/libmv/libmv/simple_pipeline/initialize_reconstruction.h b/extern/libmv/libmv/simple_pipeline/initialize_reconstruction.h new file mode 100644 index 00000000000..f512c9a3439 --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/initialize_reconstruction.h @@ -0,0 +1,74 @@ +// Copyright (c) 2011 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_SIMPLE_PIPELINE_INITIALIZE_RECONSTRUCTION_H +#define LIBMV_SIMPLE_PIPELINE_INITIALIZE_RECONSTRUCTION_H + +#include "libmv/base/vector.h" + +namespace libmv { + +struct Marker; +class EuclideanReconstruction; +class ProjectiveReconstruction; + +/*! + Initialize the \link EuclideanReconstruction reconstruction \endlink using + two frames. + + \a markers should contain all \l Marker markers \endlink belonging to + tracks visible in both frames. The pose estimation of the camera for + these frames will be inserted into \a *reconstruction. + + \note The two frames need to have both enough parallax and enough common tracks + for accurate reconstruction. At least 8 tracks are suggested. + \note The origin of the coordinate system is defined to be the camera of + the first keyframe. + \note This assumes a calibrated reconstruction, e.g. the markers are + already corrected for camera intrinsics and radial distortion. + \note This assumes an outlier-free set of markers. + + \sa EuclideanResect, EuclideanIntersect, EuclideanBundle +*/ +bool EuclideanReconstructTwoFrames(const vector<Marker> &markers, + EuclideanReconstruction *reconstruction); + +/*! + Initialize the \link ProjectiveReconstruction reconstruction \endlink using + two frames. + + \a markers should contain all \l Marker markers \endlink belonging to + tracks visible in both frames. An estimate of the projection matrices for + the two frames will get added to the reconstruction. + + \note The two frames need to have both enough parallax and enough common tracks + for accurate reconstruction. At least 8 tracks are suggested. + \note The origin of the coordinate system is defined to be the camera of + the first keyframe. + \note This assumes the markers are already corrected for radial distortion. + \note This assumes an outlier-free set of markers. + + \sa ProjectiveResect, ProjectiveIntersect, ProjectiveBundle +*/ +bool ProjectiveReconstructTwoFrames(const vector<Marker> &markers, + ProjectiveReconstruction *reconstruction); +} // namespace libmv + +#endif // LIBMV_SIMPLE_PIPELINE_INITIALIZE_RECONSTRUCTION_H diff --git a/extern/libmv/libmv/simple_pipeline/intersect.cc b/extern/libmv/libmv/simple_pipeline/intersect.cc new file mode 100644 index 00000000000..b1518e04651 --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/intersect.cc @@ -0,0 +1,205 @@ +// Copyright (c) 2011 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. + +#include "libmv/base/vector.h" +#include "libmv/logging/logging.h" +#include "libmv/multiview/projection.h" +#include "libmv/multiview/triangulation.h" +#include "libmv/multiview/nviewtriangulation.h" +#include "libmv/multiview/projection.h" +#include "libmv/numeric/numeric.h" +#include "libmv/numeric/levenberg_marquardt.h" +#include "libmv/simple_pipeline/reconstruction.h" +#include "libmv/simple_pipeline/tracks.h" + +namespace libmv { + +namespace { + +struct EuclideanIntersectCostFunction { + public: + typedef Vec FMatrixType; + typedef Vec3 XMatrixType; + + EuclideanIntersectCostFunction(const vector<Marker> &markers, + const EuclideanReconstruction &reconstruction) + : markers(markers), + reconstruction(reconstruction) {} + + Vec operator()(const Vec3 &X) const { + Vec residuals(2 * markers.size()); + residuals.setZero(); + for (int i = 0; i < markers.size(); ++i) { + const EuclideanCamera &camera = + *reconstruction.CameraForImage(markers[i].image); + Vec3 projected = camera.R * X + camera.t; + projected /= projected(2); + residuals[2*i + 0] = projected(0) - markers[i].x; + residuals[2*i + 1] = projected(1) - markers[i].y; + } + return residuals; + } + const vector<Marker> &markers; + const EuclideanReconstruction &reconstruction; +}; + +} // namespace + +bool EuclideanIntersect(const vector<Marker> &markers, + EuclideanReconstruction *reconstruction) { + if (markers.size() < 2) { + return false; + } + + // Compute projective camera matrices for the cameras the intersection is + // going to use. + Mat3 K = Mat3::Identity(); + vector<Mat34> cameras; + Mat34 P; + for (int i = 0; i < markers.size(); ++i) { + EuclideanCamera *camera = reconstruction->CameraForImage(markers[i].image); + P_From_KRt(K, camera->R, camera->t, &P); + cameras.push_back(P); + } + + // Stack the 2D coordinates together as required by NViewTriangulate. + Mat2X points(2, markers.size()); + for (int i = 0; i < markers.size(); ++i) { + points(0, i) = markers[i].x; + points(1, i) = markers[i].y; + } + + Vec4 Xp; + LG << "Intersecting with " << markers.size() << " markers."; + NViewTriangulateAlgebraic(points, cameras, &Xp); + + // Get euclidean version of the homogeneous point. + Xp /= Xp(3); + Vec3 X = Xp.head<3>(); + + typedef LevenbergMarquardt<EuclideanIntersectCostFunction> Solver; + + EuclideanIntersectCostFunction triangulate_cost(markers, *reconstruction); + Solver::SolverParameters params; + Solver solver(triangulate_cost); + + Solver::Results results = solver.minimize(params, &X); + + // Try projecting the point; make sure it's in front of everyone. + for (int i = 0; i < cameras.size(); ++i) { + const EuclideanCamera &camera = + *reconstruction->CameraForImage(markers[i].image); + Vec3 x = camera.R * X + camera.t; + if (x(2) < 0) { + LOG(ERROR) << "POINT BEHIND CAMERA " << markers[i].image + << ": " << x.transpose(); + } + } + + Vec3 point = X.head<3>(); + reconstruction->InsertPoint(markers[0].track, point); + + // TODO(keir): Add proper error checking. + return true; +} + +namespace { + +struct ProjectiveIntersectCostFunction { + public: + typedef Vec FMatrixType; + typedef Vec4 XMatrixType; + + ProjectiveIntersectCostFunction( + const vector<Marker> &markers, + const ProjectiveReconstruction &reconstruction) + : markers(markers), reconstruction(reconstruction) {} + + Vec operator()(const Vec4 &X) const { + Vec residuals(2 * markers.size()); + residuals.setZero(); + for (int i = 0; i < markers.size(); ++i) { + const ProjectiveCamera &camera = + *reconstruction.CameraForImage(markers[i].image); + Vec3 projected = camera.P * X; + projected /= projected(2); + residuals[2*i + 0] = projected(0) - markers[i].x; + residuals[2*i + 1] = projected(1) - markers[i].y; + } + return residuals; + } + const vector<Marker> &markers; + const ProjectiveReconstruction &reconstruction; +}; + +} // namespace + +bool ProjectiveIntersect(const vector<Marker> &markers, + ProjectiveReconstruction *reconstruction) { + if (markers.size() < 2) { + return false; + } + + // Get the cameras to use for the intersection. + vector<Mat34> cameras; + for (int i = 0; i < markers.size(); ++i) { + ProjectiveCamera *camera = reconstruction->CameraForImage(markers[i].image); + cameras.push_back(camera->P); + } + + // Stack the 2D coordinates together as required by NViewTriangulate. + Mat2X points(2, markers.size()); + for (int i = 0; i < markers.size(); ++i) { + points(0, i) = markers[i].x; + points(1, i) = markers[i].y; + } + + Vec4 X; + LG << "Intersecting with " << markers.size() << " markers."; + NViewTriangulateAlgebraic(points, cameras, &X); + X /= X(3); + + typedef LevenbergMarquardt<ProjectiveIntersectCostFunction> Solver; + + ProjectiveIntersectCostFunction triangulate_cost(markers, *reconstruction); + Solver::SolverParameters params; + Solver solver(triangulate_cost); + + Solver::Results results = solver.minimize(params, &X); + (void) results; // TODO(keir): Ensure results are good. + + // Try projecting the point; make sure it's in front of everyone. + for (int i = 0; i < cameras.size(); ++i) { + const ProjectiveCamera &camera = + *reconstruction->CameraForImage(markers[i].image); + Vec3 x = camera.P * X; + if (x(2) < 0) { + LOG(ERROR) << "POINT BEHIND CAMERA " << markers[i].image + << ": " << x.transpose(); + } + } + + reconstruction->InsertPoint(markers[0].track, X); + + // TODO(keir): Add proper error checking. + return true; +} + +} // namespace libmv diff --git a/extern/libmv/libmv/simple_pipeline/intersect.h b/extern/libmv/libmv/simple_pipeline/intersect.h new file mode 100644 index 00000000000..edbf4a0335b --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/intersect.h @@ -0,0 +1,77 @@ +// Copyright (c) 2011 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_SIMPLE_PIPELINE_INTERSECT_H +#define LIBMV_SIMPLE_PIPELINE_INTERSECT_H + +#include "libmv/base/vector.h" +#include "libmv/simple_pipeline/tracks.h" +#include "libmv/simple_pipeline/reconstruction.h" + +namespace libmv { + +/*! + Estimate the 3D coordinates of a track by intersecting rays from images. + + This takes a set of markers, where each marker is for the same track but + different images, and reconstructs the 3D position of that track. Each of + the frames for which there is a marker for that track must have a + corresponding reconstructed camera in \a *reconstruction. + + \a markers should contain all \l Marker markers \endlink belonging to + tracks visible in all frames. + \a reconstruction should contain the cameras for all frames. + The new \l Point points \endlink will be inserted in \a reconstruction. + + \note This assumes a calibrated reconstruction, e.g. the markers are + already corrected for camera intrinsics and radial distortion. + \note This assumes an outlier-free set of markers. + + \sa EuclideanResect +*/ +bool EuclideanIntersect(const vector<Marker> &markers, + EuclideanReconstruction *reconstruction); + +/*! + Estimate the homogeneous coordinates of a track by intersecting rays. + + This takes a set of markers, where each marker is for the same track but + different images, and reconstructs the homogeneous 3D position of that + track. Each of the frames for which there is a marker for that track must + have a corresponding reconstructed camera in \a *reconstruction. + + \a markers should contain all \l Marker markers \endlink belonging to + tracks visible in all frames. + \a reconstruction should contain the cameras for all frames. + The new \l Point points \endlink will be inserted in \a reconstruction. + + \note This assumes that radial distortion is already corrected for, but + does not assume that e.g. focal length and principal point are + accounted for. + \note This assumes an outlier-free set of markers. + + \sa Resect +*/ +bool ProjectiveIntersect(const vector<Marker> &markers, + ProjectiveReconstruction *reconstruction); + +} // namespace libmv + +#endif // LIBMV_SIMPLE_PIPELINE_INTERSECT_H diff --git a/extern/libmv/libmv/simple_pipeline/pipeline.cc b/extern/libmv/libmv/simple_pipeline/pipeline.cc new file mode 100644 index 00000000000..818c24cb5e7 --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/pipeline.cc @@ -0,0 +1,317 @@ +// Copyright (c) 2011 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. + +#include <cstdio> + +#include "libmv/logging/logging.h" +#include "libmv/simple_pipeline/bundle.h" +#include "libmv/simple_pipeline/intersect.h" +#include "libmv/simple_pipeline/resect.h" +#include "libmv/simple_pipeline/reconstruction.h" +#include "libmv/simple_pipeline/tracks.h" +#include "libmv/simple_pipeline/camera_intrinsics.h" + +#ifdef _MSC_VER +# define snprintf _snprintf +#endif + +namespace libmv { +namespace { + +// These are "strategy" classes which make it possible to use the same code for +// both projective and euclidean reconstruction. +// FIXME(MatthiasF): OOP would achieve the same goal while avoiding +// template bloat and making interface changes much easier. +struct EuclideanPipelineRoutines { + typedef EuclideanReconstruction Reconstruction; + typedef EuclideanCamera Camera; + typedef EuclideanPoint Point; + + static void Bundle(const Tracks &tracks, + EuclideanReconstruction *reconstruction) { + EuclideanBundle(tracks, reconstruction); + } + + static bool Resect(const vector<Marker> &markers, + EuclideanReconstruction *reconstruction, bool final_pass) { + return EuclideanResect(markers, reconstruction, final_pass); + } + + static bool Intersect(const vector<Marker> &markers, + EuclideanReconstruction *reconstruction) { + return EuclideanIntersect(markers, reconstruction); + } + + static Marker ProjectMarker(const EuclideanPoint &point, + const EuclideanCamera &camera, + const CameraIntrinsics &intrinsics) { + Vec3 projected = camera.R * point.X + camera.t; + projected /= projected(2); + + Marker reprojected_marker; + intrinsics.ApplyIntrinsics(projected(0), + projected(1), + &reprojected_marker.x, + &reprojected_marker.y); + + reprojected_marker.image = camera.image; + reprojected_marker.track = point.track; + return reprojected_marker; + } +}; + +struct ProjectivePipelineRoutines { + typedef ProjectiveReconstruction Reconstruction; + typedef ProjectiveCamera Camera; + typedef ProjectivePoint Point; + + static void Bundle(const Tracks &tracks, + ProjectiveReconstruction *reconstruction) { + ProjectiveBundle(tracks, reconstruction); + } + + static bool Resect(const vector<Marker> &markers, + ProjectiveReconstruction *reconstruction, bool final_pass) { + return ProjectiveResect(markers, reconstruction); + } + + static bool Intersect(const vector<Marker> &markers, + ProjectiveReconstruction *reconstruction) { + return ProjectiveIntersect(markers, reconstruction); + } + + static Marker ProjectMarker(const ProjectivePoint &point, + const ProjectiveCamera &camera, + const CameraIntrinsics &intrinsics) { + Vec3 projected = camera.P * point.X; + projected /= projected(2); + + Marker reprojected_marker; + intrinsics.ApplyIntrinsics(projected(0), + projected(1), + &reprojected_marker.x, + &reprojected_marker.y); + + reprojected_marker.image = camera.image; + reprojected_marker.track = point.track; + return reprojected_marker; + } +}; + +} // namespace + +template<typename PipelineRoutines> +void InternalCompleteReconstruction( + const Tracks &tracks, + typename PipelineRoutines::Reconstruction *reconstruction) { + int max_track = tracks.MaxTrack(); + int max_image = tracks.MaxImage(); + int num_resects = -1; + int num_intersects = -1; + LG << "Max track: " << max_track; + LG << "Max image: " << max_image; + LG << "Number of markers: " << tracks.NumMarkers(); + while (num_resects != 0 || num_intersects != 0) { + // Do all possible intersections. + num_intersects = 0; + for (int track = 0; track <= max_track; ++track) { + if (reconstruction->PointForTrack(track)) { + LG << "Skipping point: " << track; + continue; + } + vector<Marker> all_markers = tracks.MarkersForTrack(track); + LG << "Got " << all_markers.size() << " markers for track " << track; + + vector<Marker> reconstructed_markers; + for (int i = 0; i < all_markers.size(); ++i) { + if (reconstruction->CameraForImage(all_markers[i].image)) { + reconstructed_markers.push_back(all_markers[i]); + } + } + LG << "Got " << reconstructed_markers.size() + << " reconstructed markers for track " << track; + if (reconstructed_markers.size() >= 2) { + PipelineRoutines::Intersect(reconstructed_markers, reconstruction); + num_intersects++; + LG << "Ran Intersect() for track " << track; + } + } + if (num_intersects) { + PipelineRoutines::Bundle(tracks, reconstruction); + LG << "Ran Bundle() after intersections."; + } + LG << "Did " << num_intersects << " intersects."; + + // Do all possible resections. + num_resects = 0; + for (int image = 0; image <= max_image; ++image) { + if (reconstruction->CameraForImage(image)) { + LG << "Skipping frame: " << image; + continue; + } + vector<Marker> all_markers = tracks.MarkersInImage(image); + LG << "Got " << all_markers.size() << " markers for image " << image; + + vector<Marker> reconstructed_markers; + for (int i = 0; i < all_markers.size(); ++i) { + if (reconstruction->PointForTrack(all_markers[i].track)) { + reconstructed_markers.push_back(all_markers[i]); + } + } + LG << "Got " << reconstructed_markers.size() + << " reconstructed markers for image " << image; + if (reconstructed_markers.size() >= 5) { + if (PipelineRoutines::Resect(reconstructed_markers, reconstruction, false)) { + num_resects++; + LG << "Ran Resect() for image " << image; + } else { + LG << "Failed Resect() for image " << image; + } + } + } + if (num_resects) { + PipelineRoutines::Bundle(tracks, reconstruction); + } + LG << "Did " << num_resects << " resects."; + } + + // One last pass... + num_resects = 0; + for (int image = 0; image <= max_image; ++image) { + if (reconstruction->CameraForImage(image)) { + LG << "Skipping frame: " << image; + continue; + } + vector<Marker> all_markers = tracks.MarkersInImage(image); + + vector<Marker> reconstructed_markers; + for (int i = 0; i < all_markers.size(); ++i) { + if (reconstruction->PointForTrack(all_markers[i].track)) { + reconstructed_markers.push_back(all_markers[i]); + } + } + if (reconstructed_markers.size() >= 5) { + if (PipelineRoutines::Resect(reconstructed_markers, reconstruction, true)) { + num_resects++; + LG << "Ran Resect() for image " << image; + } else { + LG << "Failed Resect() for image " << image; + } + } + } + if (num_resects) { + PipelineRoutines::Bundle(tracks, reconstruction); + } +} + +template<typename PipelineRoutines> +double InternalReprojectionError(const Tracks &image_tracks, + const typename PipelineRoutines::Reconstruction &reconstruction, + const CameraIntrinsics &intrinsics) { + int num_skipped = 0; + int num_reprojected = 0; + double total_error = 0.0; + vector<Marker> markers = image_tracks.AllMarkers(); + for (int i = 0; i < markers.size(); ++i) { + const typename PipelineRoutines::Camera *camera = + reconstruction.CameraForImage(markers[i].image); + const typename PipelineRoutines::Point *point = + reconstruction.PointForTrack(markers[i].track); + if (!camera || !point) { + num_skipped++; + continue; + } + num_reprojected++; + + Marker reprojected_marker = + PipelineRoutines::ProjectMarker(*point, *camera, intrinsics); + double ex = reprojected_marker.x - markers[i].x; + double ey = reprojected_marker.y - markers[i].y; + + const int N = 100; + char line[N]; + snprintf(line, N, + "image %-3d track %-3d " + "x %7.1f y %7.1f " + "rx %7.1f ry %7.1f " + "ex %7.1f ey %7.1f" + " e %7.1f", + markers[i].image, + markers[i].track, + markers[i].x, + markers[i].y, + reprojected_marker.x, + reprojected_marker.y, + ex, + ey, + sqrt(ex*ex + ey*ey)); + //LG << line; + total_error += sqrt(ex*ex + ey*ey); + } + LG << "Skipped " << num_skipped << " markers."; + LG << "Reprojected " << num_reprojected << " markers."; + LG << "Total error: " << total_error; + LG << "Average error: " << (total_error / num_reprojected) << " [pixels]."; + return total_error / num_reprojected; +} + +double EuclideanReprojectionError(const Tracks &image_tracks, + const EuclideanReconstruction &reconstruction, + const CameraIntrinsics &intrinsics) { + return InternalReprojectionError<EuclideanPipelineRoutines>(image_tracks, + reconstruction, + intrinsics); +} + +double ProjectiveReprojectionError( + const Tracks &image_tracks, + const ProjectiveReconstruction &reconstruction, + const CameraIntrinsics &intrinsics) { + return InternalReprojectionError<ProjectivePipelineRoutines>(image_tracks, + reconstruction, + intrinsics); +} + +void EuclideanCompleteReconstruction(const Tracks &tracks, + EuclideanReconstruction *reconstruction) { + InternalCompleteReconstruction<EuclideanPipelineRoutines>(tracks, + reconstruction); +} + +void ProjectiveCompleteReconstruction(const Tracks &tracks, + ProjectiveReconstruction *reconstruction) { + InternalCompleteReconstruction<ProjectivePipelineRoutines>(tracks, + reconstruction); +} + +void InvertIntrinsicsForTracks(const Tracks &raw_tracks, + const CameraIntrinsics &camera_intrinsics, + Tracks *calibrated_tracks) { + vector<Marker> markers = raw_tracks.AllMarkers(); + for (int i = 0; i < markers.size(); ++i) { + camera_intrinsics.InvertIntrinsics(markers[i].x, + markers[i].y, + &(markers[i].x), + &(markers[i].y)); + } + *calibrated_tracks = Tracks(markers); +} + +} // namespace libmv diff --git a/extern/libmv/libmv/simple_pipeline/pipeline.h b/extern/libmv/libmv/simple_pipeline/pipeline.h new file mode 100644 index 00000000000..b7dfcb7993a --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/pipeline.h @@ -0,0 +1,95 @@ +// Copyright (c) 2011 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_SIMPLE_PIPELINE_PIPELINE_H_ +#define LIBMV_SIMPLE_PIPELINE_PIPELINE_H_ + +#include "libmv/simple_pipeline/tracks.h" +#include "libmv/simple_pipeline/reconstruction.h" + +namespace libmv { + +/*! + Estimate camera poses and scene 3D coordinates for all frames and tracks. + + This method should be used once there is an initial reconstruction in + place, for example by reconstructing from two frames that have a sufficient + baseline and number of tracks in common. This function iteratively + triangulates points that are visible by cameras that have their pose + estimated, then resections (i.e. estimates the pose) of cameras that are + not estimated yet that can see triangulated points. This process is + repeated until all points and cameras are estimated. Periodically, bundle + adjustment is run to ensure a quality reconstruction. + + \a tracks should contain markers used in the reconstruction. + \a reconstruction should contain at least some 3D points or some estimated + cameras. The minimum number of cameras is two (with no 3D points) and the + minimum number of 3D points (with no estimated cameras) is 5. + + \sa EuclideanResect, EuclideanIntersect, EuclideanBundle +*/ +void EuclideanCompleteReconstruction(const Tracks &tracks, + EuclideanReconstruction *reconstruction); + +/*! + Estimate camera matrices and homogeneous 3D coordinates for all frames and + tracks. + + This method should be used once there is an initial reconstruction in + place, for example by reconstructing from two frames that have a sufficient + baseline and number of tracks in common. This function iteratively + triangulates points that are visible by cameras that have their pose + estimated, then resections (i.e. estimates the pose) of cameras that are + not estimated yet that can see triangulated points. This process is + repeated until all points and cameras are estimated. Periodically, bundle + adjustment is run to ensure a quality reconstruction. + + \a tracks should contain markers used in the reconstruction. + \a reconstruction should contain at least some 3D points or some estimated + cameras. The minimum number of cameras is two (with no 3D points) and the + minimum number of 3D points (with no estimated cameras) is 5. + + \sa ProjectiveResect, ProjectiveIntersect, ProjectiveBundle +*/ +void ProjectiveCompleteReconstruction(const Tracks &tracks, + ProjectiveReconstruction *reconstruction); + + +class CameraIntrinsics; + +// TODO(keir): Decide if we want these in the public API, and if so, what the +// appropriate include file is. + +double EuclideanReprojectionError(const Tracks &image_tracks, + const EuclideanReconstruction &reconstruction, + const CameraIntrinsics &intrinsics); + +double ProjectiveReprojectionError( + const Tracks &image_tracks, + const ProjectiveReconstruction &reconstruction, + const CameraIntrinsics &intrinsics); + +void InvertIntrinsicsForTracks(const Tracks &raw_tracks, + const CameraIntrinsics &camera_intrinsics, + Tracks *calibrated_tracks); + +} // namespace libmv + +#endif // LIBMV_SIMPLE_PIPELINE_PIPELINE_H_ diff --git a/extern/libmv/libmv/simple_pipeline/reconstruction.cc b/extern/libmv/libmv/simple_pipeline/reconstruction.cc new file mode 100644 index 00000000000..65e5dd27d5d --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/reconstruction.cc @@ -0,0 +1,191 @@ +// Copyright (c) 2011 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. + +#include "libmv/simple_pipeline/reconstruction.h" +#include "libmv/numeric/numeric.h" +#include "libmv/logging/logging.h" + +namespace libmv { + +EuclideanReconstruction::EuclideanReconstruction() {} +EuclideanReconstruction::EuclideanReconstruction( + const EuclideanReconstruction &other) { + cameras_ = other.cameras_; + points_ = other.points_; +} + +EuclideanReconstruction &EuclideanReconstruction::operator=( + const EuclideanReconstruction &other) { + if (&other != this) { + cameras_ = other.cameras_; + points_ = other.points_; + } + return *this; +} + +void EuclideanReconstruction::InsertCamera(int image, + const Mat3 &R, + const Vec3 &t) { + LG << "InsertCamera " << image << ":\nR:\n"<< R << "\nt:\n" << t; + if (image >= cameras_.size()) { + cameras_.resize(image + 1); + } + cameras_[image].image = image; + cameras_[image].R = R; + cameras_[image].t = t; +} + +void EuclideanReconstruction::InsertPoint(int track, const Vec3 &X) { + LG << "InsertPoint " << track << ":\n" << X; + if (track >= points_.size()) { + points_.resize(track + 1); + } + points_[track].track = track; + points_[track].X = X; +} + +EuclideanCamera *EuclideanReconstruction::CameraForImage(int image) { + return const_cast<EuclideanCamera *>( + static_cast<const EuclideanReconstruction *>( + this)->CameraForImage(image)); +} + +const EuclideanCamera *EuclideanReconstruction::CameraForImage( + int image) const { + if (image < 0 || image >= cameras_.size()) { + return NULL; + } + const EuclideanCamera *camera = &cameras_[image]; + if (camera->image == -1) { + return NULL; + } + return camera; +} + +vector<EuclideanCamera> EuclideanReconstruction::AllCameras() const { + vector<EuclideanCamera> cameras; + for (int i = 0; i < cameras_.size(); ++i) { + if (cameras_[i].image != -1) { + cameras.push_back(cameras_[i]); + } + } + return cameras; +} + +EuclideanPoint *EuclideanReconstruction::PointForTrack(int track) { + return const_cast<EuclideanPoint *>( + static_cast<const EuclideanReconstruction *>(this)->PointForTrack(track)); +} + +const EuclideanPoint *EuclideanReconstruction::PointForTrack(int track) const { + if (track < 0 || track >= points_.size()) { + return NULL; + } + const EuclideanPoint *point = &points_[track]; + if (point->track == -1) { + return NULL; + } + return point; +} + +vector<EuclideanPoint> EuclideanReconstruction::AllPoints() const { + vector<EuclideanPoint> points; + for (int i = 0; i < points_.size(); ++i) { + if (points_[i].track != -1) { + points.push_back(points_[i]); + } + } + return points; +} + +void ProjectiveReconstruction::InsertCamera(int image, + const Mat34 &P) { + LG << "InsertCamera " << image << ":\nP:\n"<< P; + if (image >= cameras_.size()) { + cameras_.resize(image + 1); + } + cameras_[image].image = image; + cameras_[image].P = P; +} + +void ProjectiveReconstruction::InsertPoint(int track, const Vec4 &X) { + LG << "InsertPoint " << track << ":\n" << X; + if (track >= points_.size()) { + points_.resize(track + 1); + } + points_[track].track = track; + points_[track].X = X; +} + +ProjectiveCamera *ProjectiveReconstruction::CameraForImage(int image) { + return const_cast<ProjectiveCamera *>( + static_cast<const ProjectiveReconstruction *>( + this)->CameraForImage(image)); +} + +const ProjectiveCamera *ProjectiveReconstruction::CameraForImage( + int image) const { + if (image < 0 || image >= cameras_.size()) { + return NULL; + } + const ProjectiveCamera *camera = &cameras_[image]; + if (camera->image == -1) { + return NULL; + } + return camera; +} + +vector<ProjectiveCamera> ProjectiveReconstruction::AllCameras() const { + vector<ProjectiveCamera> cameras; + for (int i = 0; i < cameras_.size(); ++i) { + if (cameras_[i].image != -1) { + cameras.push_back(cameras_[i]); + } + } + return cameras; +} + +ProjectivePoint *ProjectiveReconstruction::PointForTrack(int track) { + return const_cast<ProjectivePoint *>( + static_cast<const ProjectiveReconstruction *>(this)->PointForTrack(track)); +} + +const ProjectivePoint *ProjectiveReconstruction::PointForTrack(int track) const { + if (track < 0 || track >= points_.size()) { + return NULL; + } + const ProjectivePoint *point = &points_[track]; + if (point->track == -1) { + return NULL; + } + return point; +} + +vector<ProjectivePoint> ProjectiveReconstruction::AllPoints() const { + vector<ProjectivePoint> points; + for (int i = 0; i < points_.size(); ++i) { + if (points_[i].track != -1) { + points.push_back(points_[i]); + } + } + return points; +} + +} // namespace libmv diff --git a/extern/libmv/libmv/simple_pipeline/reconstruction.h b/extern/libmv/libmv/simple_pipeline/reconstruction.h new file mode 100644 index 00000000000..947a0636476 --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/reconstruction.h @@ -0,0 +1,217 @@ +// Copyright (c) 2011 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_SIMPLE_PIPELINE_RECONSTRUCTION_H_ +#define LIBMV_SIMPLE_PIPELINE_RECONSTRUCTION_H_ + +#include "libmv/base/vector.h" +#include "libmv/numeric/numeric.h" + +namespace libmv { + +/*! + A EuclideanCamera is the location and rotation of the camera viewing \a image. + + \a image identify which image from \l Tracks this camera represents. + \a R is a 3x3 matrix representing the rotation of the camera. + \a t is a translation vector representing its positions. + + \sa Reconstruction +*/ +struct EuclideanCamera { + EuclideanCamera() : image(-1) {} + EuclideanCamera(const EuclideanCamera &c) : image(c.image), R(c.R), t(c.t) {} + + int image; + Mat3 R; + Vec3 t; +}; + +/*! + A Point is the 3D location of a track. + + \a track identify which track from \l Tracks this point corresponds to. + \a X represents the 3D position of the track. + + \sa Reconstruction +*/ +struct EuclideanPoint { + EuclideanPoint() : track(-1) {} + EuclideanPoint(const EuclideanPoint &p) : track(p.track), X(p.X) {} + int track; + Vec3 X; +}; + +/*! + The EuclideanReconstruction class stores \link EuclideanCamera cameras + \endlink and \link EuclideanPoint points \endlink. + + The EuclideanReconstruction container is intended as the store of 3D + reconstruction data to be used with the MultiView API. + + The container has lookups to query a \a EuclideanCamera from an \a image or + a \a EuclideanPoint from a \a track. + + \sa Camera, Point +*/ +class EuclideanReconstruction { + public: + // Default constructor starts with no cameras. + EuclideanReconstruction(); + + /// Copy constructor. + EuclideanReconstruction(const EuclideanReconstruction &other); + + EuclideanReconstruction &operator=(const EuclideanReconstruction &other); + + /*! + Insert a camera into the set. If there is already a camera for the given + \a image, the existing camera is replaced. If there is no camera for the + given \a image, a new one is added. + + \a image is the key used to retrieve the cameras with the other methods + in this class. + + \note You should use the same \a image identifier as in \l Tracks. + */ + void InsertCamera(int image, const Mat3 &R, const Vec3 &t); + + /*! + Insert a point into the reconstruction. If there is already a point for + the given \a track, the existing point is replaced. If there is no point + for the given \a track, a new one is added. + + \a track is the key used to retrieve the points with the + other methods in this class. + + \note You should use the same \a track identifier as in \l Tracks. + */ + void InsertPoint(int track, const Vec3 &X); + + /// Returns a pointer to the camera corresponding to \a image. + EuclideanCamera *CameraForImage(int image); + const EuclideanCamera *CameraForImage(int image) const; + + /// Returns all cameras. + vector<EuclideanCamera> AllCameras() const; + + /// Returns a pointer to the point corresponding to \a track. + EuclideanPoint *PointForTrack(int track); + const EuclideanPoint *PointForTrack(int track) const; + + /// Returns all points. + vector<EuclideanPoint> AllPoints() const; + + private: + vector<EuclideanCamera> cameras_; + vector<EuclideanPoint> points_; +}; + +/*! + A ProjectiveCamera is the projection matrix for the camera of \a image. + + \a image identify which image from \l Tracks this camera represents. + \a P is the 3x4 projection matrix. + + \sa ProjectiveReconstruction +*/ +struct ProjectiveCamera { + ProjectiveCamera() : image(-1) {} + ProjectiveCamera(const ProjectiveCamera &c) : image(c.image), P(c.P) {} + + int image; + Mat34 P; +}; + +/*! + A Point is the 3D location of a track. + + \a track identifies which track from \l Tracks this point corresponds to. + \a X is the homogeneous 3D position of the track. + + \sa Reconstruction +*/ +struct ProjectivePoint { + ProjectivePoint() : track(-1) {} + ProjectivePoint(const ProjectivePoint &p) : track(p.track), X(p.X) {} + int track; + Vec4 X; +}; + +/*! + The ProjectiveReconstruction class stores \link ProjectiveCamera cameras + \endlink and \link ProjectivePoint points \endlink. + + The ProjectiveReconstruction container is intended as the store of 3D + reconstruction data to be used with the MultiView API. + + The container has lookups to query a \a ProjectiveCamera from an \a image or + a \a ProjectivePoint from a \a track. + + \sa Camera, Point +*/ +class ProjectiveReconstruction { + public: + /*! + Insert a camera into the set. If there is already a camera for the given + \a image, the existing camera is replaced. If there is no camera for the + given \a image, a new one is added. + + \a image is the key used to retrieve the cameras with the other methods + in this class. + + \note You should use the same \a image identifier as in \l Tracks. + */ + void InsertCamera(int image, const Mat34 &P); + + /*! + Insert a point into the reconstruction. If there is already a point for + the given \a track, the existing point is replaced. If there is no point + for the given \a track, a new one is added. + + \a track is the key used to retrieve the points with the + other methods in this class. + + \note You should use the same \a track identifier as in \l Tracks. + */ + void InsertPoint(int track, const Vec4 &X); + + /// Returns a pointer to the camera corresponding to \a image. + ProjectiveCamera *CameraForImage(int image); + const ProjectiveCamera *CameraForImage(int image) const; + + /// Returns all cameras. + vector<ProjectiveCamera> AllCameras() const; + + /// Returns a pointer to the point corresponding to \a track. + ProjectivePoint *PointForTrack(int track); + const ProjectivePoint *PointForTrack(int track) const; + + /// Returns all points. + vector<ProjectivePoint> AllPoints() const; + + private: + vector<ProjectiveCamera> cameras_; + vector<ProjectivePoint> points_; +}; + +} // namespace libmv + +#endif // LIBMV_SIMPLE_PIPELINE_RECONSTRUCTION_H_ diff --git a/extern/libmv/libmv/simple_pipeline/resect.cc b/extern/libmv/libmv/simple_pipeline/resect.cc new file mode 100644 index 00000000000..6e71c3c7206 --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/resect.cc @@ -0,0 +1,271 @@ +// Copyright (c) 2011 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. + +#include <cstdio> + +#include "libmv/base/vector.h" +#include "libmv/logging/logging.h" +#include "libmv/multiview/euclidean_resection.h" +#include "libmv/multiview/resection.h" +#include "libmv/multiview/projection.h" +#include "libmv/numeric/numeric.h" +#include "libmv/numeric/levenberg_marquardt.h" +#include "libmv/simple_pipeline/reconstruction.h" +#include "libmv/simple_pipeline/tracks.h" + +namespace libmv { +namespace { + +Mat2X PointMatrixFromMarkers(const vector<Marker> &markers) { + Mat2X points(2, markers.size()); + for (int i = 0; i < markers.size(); ++i) { + points(0, i) = markers[i].x; + points(1, i) = markers[i].y; + } + return points; +} + +Mat3 RotationFromEulerVector(Vec3 euler_vector) { + double theta = euler_vector.norm(); + if (theta == 0.0) { + return Mat3::Identity(); + } + Vec3 w = euler_vector / theta; + Mat3 w_hat = CrossProductMatrix(w); + return Mat3::Identity() + w_hat*sin(theta) + w_hat*w_hat*(1 - cos(theta)); +} + +// Uses an incremental rotation: +// +// x = R' * R * X + t; +// +// to avoid issues with the rotation representation. R' is derived from a +// euler vector encoding the rotation in 3 parameters; the direction is the +// axis to rotate around and the magnitude is the amount of the rotation. +struct EuclideanResectCostFunction { + public: + typedef Vec FMatrixType; + typedef Vec6 XMatrixType; + + EuclideanResectCostFunction(const vector<Marker> &markers, + const EuclideanReconstruction &reconstruction, + const Mat3 initial_R) + : markers(markers), + reconstruction(reconstruction), + initial_R(initial_R) {} + + // dRt has dR (delta R) encoded as a euler vector in the first 3 parameters, + // followed by t in the next 3 parameters. + Vec operator()(const Vec6 &dRt) const { + // Unpack R, t from dRt. + Mat3 R = RotationFromEulerVector(dRt.head<3>()) * initial_R; + Vec3 t = dRt.tail<3>(); + + // Compute the reprojection error for each coordinate. + Vec residuals(2 * markers.size()); + residuals.setZero(); + for (int i = 0; i < markers.size(); ++i) { + const EuclideanPoint &point = + *reconstruction.PointForTrack(markers[i].track); + Vec3 projected = R * point.X + t; + projected /= projected(2); + residuals[2*i + 0] = projected(0) - markers[i].x; + residuals[2*i + 1] = projected(1) - markers[i].y; + } + return residuals; + } + + const vector<Marker> &markers; + const EuclideanReconstruction &reconstruction; + const Mat3 &initial_R; +}; + +} // namespace + +bool EuclideanResect(const vector<Marker> &markers, + EuclideanReconstruction *reconstruction, bool final_pass) { + if (markers.size() < 5) { + return false; + } + Mat2X points_2d = PointMatrixFromMarkers(markers); + Mat3X points_3d(3, markers.size()); + for (int i = 0; i < markers.size(); i++) { + points_3d.col(i) = reconstruction->PointForTrack(markers[i].track)->X; + } + LG << "Points for resect:\n" << points_2d; + + Mat3 R; + Vec3 t; + if (0 || !euclidean_resection::EuclideanResection(points_2d, points_3d, &R, &t)) { + // printf("Resection for image %d failed\n", markers[0].image); + LG << "Resection for image " << markers[0].image << " failed;" + << " trying fallback projective resection."; + if (!final_pass) return false; + // Euclidean resection failed. Fall back to projective resection, which is + // less reliable but better conditioned when there are many points. + Mat34 P; + Mat4X points_3d_homogeneous(4, markers.size()); + for (int i = 0; i < markers.size(); i++) { + points_3d_homogeneous.col(i).head<3>() = points_3d.col(i); + points_3d_homogeneous(3, i) = 1.0; + } + resection::Resection(points_2d, points_3d_homogeneous, &P); + if ((P * points_3d_homogeneous.col(0))(2) < 0) { + LG << "Point behind camera; switch sign."; + P = -P; + } + + Mat3 ignored; + KRt_From_P(P, &ignored, &R, &t); + + // The R matrix should be a rotation, but don't rely on it. + Eigen::JacobiSVD<Mat3> svd(R, Eigen::ComputeFullU | Eigen::ComputeFullV); + + LG << "Resection rotation is: " << svd.singularValues().transpose(); + LG << "Determinant is: " << R.determinant(); + + // Correct to make R a rotation. + R = svd.matrixU() * svd.matrixV().transpose(); + + Vec3 xx = R * points_3d.col(0) + t; + if (xx(2) < 0.0) { + LG << "Final point is still behind camera..."; + } + // XXX Need to check if error is horrible and fail here too in that case. + } + + // Refine the result. + typedef LevenbergMarquardt<EuclideanResectCostFunction> Solver; + + // Give the cost our initial guess for R. + EuclideanResectCostFunction resect_cost(markers, *reconstruction, R); + + // Encode the initial parameters: start with zero delta rotation, and the + // guess for t obtained from resection. + Vec6 dRt = Vec6::Zero(); + dRt.tail<3>() = t; + + Solver solver(resect_cost); + + Solver::SolverParameters params; + Solver::Results results = solver.minimize(params, &dRt); + LG << "LM found incremental rotation: " << dRt.head<3>().transpose(); + // TODO(keir): Check results to ensure clean termination. + + // Unpack the rotation and translation. + R = RotationFromEulerVector(dRt.head<3>()) * R; + t = dRt.tail<3>(); + + LG << "Resection for image " << markers[0].image << " got:\n" + << "R:\n" << R << "\nt:\n" << t; + reconstruction->InsertCamera(markers[0].image, R, t); + return true; +} + +namespace { + +// Directly parameterize the projection matrix, P, which is a 12 parameter +// homogeneous entry. In theory P should be parameterized with only 11 +// parametetrs, but in practice it works fine to let the extra degree of +// freedom drift. +struct ProjectiveResectCostFunction { + public: + typedef Vec FMatrixType; + typedef Vec12 XMatrixType; + + ProjectiveResectCostFunction(const vector<Marker> &markers, + const ProjectiveReconstruction &reconstruction) + : markers(markers), + reconstruction(reconstruction) {} + + Vec operator()(const Vec12 &vector_P) const { + // Unpack P from vector_P. + Map<const Mat34> P(vector_P.data(), 3, 4); + + // Compute the reprojection error for each coordinate. + Vec residuals(2 * markers.size()); + residuals.setZero(); + for (int i = 0; i < markers.size(); ++i) { + const ProjectivePoint &point = + *reconstruction.PointForTrack(markers[i].track); + Vec3 projected = P * point.X; + projected /= projected(2); + residuals[2*i + 0] = projected(0) - markers[i].x; + residuals[2*i + 1] = projected(1) - markers[i].y; + } + return residuals; + } + + const vector<Marker> &markers; + const ProjectiveReconstruction &reconstruction; +}; + +} // namespace + +bool ProjectiveResect(const vector<Marker> &markers, + ProjectiveReconstruction *reconstruction) { + if (markers.size() < 5) { + return false; + } + + // Stack the homogeneous 3D points as the columns of a matrix. + Mat2X points_2d = PointMatrixFromMarkers(markers); + Mat4X points_3d_homogeneous(4, markers.size()); + for (int i = 0; i < markers.size(); i++) { + points_3d_homogeneous.col(i) = + reconstruction->PointForTrack(markers[i].track)->X; + } + LG << "Points for resect:\n" << points_2d; + + // Resection the point. + Mat34 P; + resection::Resection(points_2d, points_3d_homogeneous, &P); + + // Flip the sign of P if necessary to keep the point in front of the camera. + if ((P * points_3d_homogeneous.col(0))(2) < 0) { + LG << "Point behind camera; switch sign."; + P = -P; + } + + // TODO(keir): Check if error is horrible and fail in that case. + + // Refine the resulting projection matrix using geometric error. + typedef LevenbergMarquardt<ProjectiveResectCostFunction> Solver; + + ProjectiveResectCostFunction resect_cost(markers, *reconstruction); + + // Pack the initial P matrix into a size-12 vector.. + Vec12 vector_P = Map<Vec12>(P.data()); + + Solver solver(resect_cost); + + Solver::SolverParameters params; + Solver::Results results = solver.minimize(params, &vector_P); + // TODO(keir): Check results to ensure clean termination. + + // Unpack the projection matrix. + P = Map<Mat34>(vector_P.data(), 3, 4); + + LG << "Resection for image " << markers[0].image << " got:\n" + << "P:\n" << P; + reconstruction->InsertCamera(markers[0].image, P); + return true; +} +} // namespace libmv diff --git a/extern/libmv/libmv/simple_pipeline/resect.h b/extern/libmv/libmv/simple_pipeline/resect.h new file mode 100644 index 00000000000..f8b5b9f68ee --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/resect.h @@ -0,0 +1,86 @@ +// Copyright (c) 2011 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_SIMPLE_PIPELINE_RESECT_H +#define LIBMV_SIMPLE_PIPELINE_RESECT_H + +#include "libmv/base/vector.h" +#include "libmv/simple_pipeline/tracks.h" +#include "libmv/simple_pipeline/reconstruction.h" + +namespace libmv { + +/*! + Estimate the Euclidean pose of a camera from 2D to 3D correspondences. + + This takes a set of markers visible in one frame (which is the one to + resection), such that the markers are also reconstructed in 3D in the + reconstruction object, and solves for the pose and orientation of the + camera for that frame. + + \a markers should contain \l Marker markers \endlink belonging to tracks + visible in the one frame to be resectioned. Each of the tracks associated + with the markers must have a corresponding reconstructed 3D position in the + \a *reconstruction object. + + \a *reconstruction should contain the 3D points associated with the tracks + for the markers present in \a markers. + + \note This assumes a calibrated reconstruction, e.g. the markers are + already corrected for camera intrinsics and radial distortion. + \note This assumes an outlier-free set of markers. + + \return True if the resection was successful, false otherwise. + + \sa EuclideanIntersect, EuclideanReconstructTwoFrames +*/ +bool EuclideanResect(const vector<Marker> &markers, + EuclideanReconstruction *reconstruction, bool final_pass); + +/*! + Estimate the projective pose of a camera from 2D to 3D correspondences. + + This takes a set of markers visible in one frame (which is the one to + resection), such that the markers are also reconstructed in a projective + frame in the reconstruction object, and solves for the projective matrix of + the camera for that frame. + + \a markers should contain \l Marker markers \endlink belonging to tracks + visible in the one frame to be resectioned. Each of the tracks associated + with the markers must have a corresponding reconstructed homogeneous 3D + position in the \a *reconstruction object. + + \a *reconstruction should contain the homogeneous 3D points associated with + the tracks for the markers present in \a markers. + + \note This assumes radial distortion has already been corrected, but + otherwise works for uncalibrated sequences. + \note This assumes an outlier-free set of markers. + + \return True if the resection was successful, false otherwise. + + \sa ProjectiveIntersect, ProjectiveReconstructTwoFrames +*/ +bool ProjectiveResect(const vector<Marker> &markers, + ProjectiveReconstruction *reconstruction); + +} // namespace libmv + +#endif // LIBMV_SIMPLE_PIPELINE_RESECT_H diff --git a/extern/libmv/libmv/simple_pipeline/tracks.cc b/extern/libmv/libmv/simple_pipeline/tracks.cc new file mode 100644 index 00000000000..3fb8ddbe513 --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/tracks.cc @@ -0,0 +1,159 @@ +// Copyright (c) 2011 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. + +#include <algorithm> +#include <vector> +#include <iterator> + +#include "libmv/numeric/numeric.h" +#include "libmv/simple_pipeline/tracks.h" + +namespace libmv { + +Tracks::Tracks(const Tracks &other) { + markers_ = other.markers_; +} + +Tracks::Tracks(const vector<Marker> &markers) : markers_(markers) {} + +void Tracks::Insert(int image, int track, double x, double y) { + // TODO(keir): Wow, 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].image == image && + markers_[i].track == track) { + markers_[i].x = x; + markers_[i].y = y; + return; + } + } + Marker marker = { image, track, x, y }; + markers_.push_back(marker); +} + +vector<Marker> Tracks::AllMarkers() const { + return markers_; +} + +vector<Marker> Tracks::MarkersInImage(int image) const { + vector<Marker> markers; + for (int i = 0; i < markers_.size(); ++i) { + if (image == markers_[i].image) { + markers.push_back(markers_[i]); + } + } + return markers; +} + +vector<Marker> Tracks::MarkersForTrack(int track) const { + vector<Marker> markers; + for (int i = 0; i < markers_.size(); ++i) { + if (track == markers_[i].track) { + markers.push_back(markers_[i]); + } + } + return markers; +} + +vector<Marker> Tracks::MarkersForTracksInBothImages(int image1, int image2) const { + std::vector<int> image1_tracks; + std::vector<int> image2_tracks; + + for (int i = 0; i < markers_.size(); ++i) { + int image = markers_[i].image; + if (image == image1) { + image1_tracks.push_back(markers_[i].track); + } else if (image == image2) { + image2_tracks.push_back(markers_[i].track); + } + } + + 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)); + + vector<Marker> markers; + for (int i = 0; i < markers_.size(); ++i) { + if ((markers_[i].image == image1 || markers_[i].image == image2) && + std::binary_search(intersection.begin(),intersection.end(), + markers_[i].track)) { + markers.push_back(markers_[i]); + } + } + return markers; +} + +Marker Tracks::MarkerInImageForTrack(int image, int track) const { + for (int i = 0; i < markers_.size(); ++i) { + if (markers_[i].image == image && markers_[i].track == track) { + return markers_[i]; + } + } + Marker null = { -1, -1, -1, -1 }; + return null; +} + +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); +} + +void Tracks::RemoveMarker(int image, int track) { + int size = 0; + for (int i = 0; i < markers_.size(); ++i) { + if (markers_[i].image != image || markers_[i].track != track) { + markers_[size++] = markers_[i]; + } + } + markers_.resize(size); +} + +int Tracks::MaxImage() const { + // TODO(MatthiasF): maintain a max_image_ member (updated on Insert) + int max_image = 0; + for (int i = 0; i < markers_.size(); ++i) { + max_image = std::max(markers_[i].image, max_image); + } + return max_image; +} + +int Tracks::MaxTrack() const { + // TODO(MatthiasF): maintain a max_track_ member (updated on Insert) + 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 libmv diff --git a/extern/libmv/libmv/simple_pipeline/tracks.h b/extern/libmv/libmv/simple_pipeline/tracks.h new file mode 100644 index 00000000000..739c3c4f243 --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/tracks.h @@ -0,0 +1,119 @@ +// Copyright (c) 2011 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_SIMPLE_PIPELINE_TRACKS_H_ +#define LIBMV_SIMPLE_PIPELINE_TRACKS_H_ + +#include "libmv/base/vector.h" + +namespace libmv { + +/*! + A Marker is the 2D location of a tracked point in an image. + + \a x, \a y is the position of the marker in pixels from the top left corner + in the image identified by \a image. All markers for to the same target + form a track identified by a common \a track number. + + \note Markers are typically aggregated with the help of the \l Tracks class. + + \sa Tracks +*/ +struct Marker { + int image; + int track; + double x, y; +}; + +/*! + The Tracks class stores \link Marker reconstruction markers \endlink. + + The Tracks container is intended as the store of correspondences between + images, which must get created before any 3D reconstruction can take place. + + The container has several fast lookups for queries typically needed for + structure from motion algorithms, such as \l MarkersForTracksInBothImages(). + + \sa Marker +*/ +class Tracks { + public: + Tracks() {} + + // Copy constructor for a tracks object. + Tracks(const Tracks &other); + + /// Construct a new tracks object using the given markers to start. + Tracks(const vector<Marker> &markers); + + /*! + Inserts a marker into the set. If there is already a marker for the given + \a image and \a track, the existing marker is replaced. If there is no + marker for the given \a image and \a track, a new one is added. + + \a image and \a track are the keys used to retrieve the markers with the + other methods in this class. + + \note To get an identifier for a new track, use \l MaxTrack() + 1. + */ + void Insert(int image, int track, double x, double y); + + /// Returns all the markers. + vector<Marker> AllMarkers() const; + + /// Returns all the markers belonging to a track. + vector<Marker> MarkersForTrack(int track) const; + + /// Returns all the markers visible in \a image. + vector<Marker> MarkersInImage(int image) const; + + /*! + Returns the markers in \a image1 and \a image2 which have a common track. + + This is not the same as the union of the markers in \a image1 and \a + image2; each marker is for a track that appears in both images. + */ + vector<Marker> MarkersForTracksInBothImages(int image1, int image2) const; + + /// Returns the marker in \a image belonging to \a track. + Marker MarkerInImageForTrack(int image, int track) const; + + /// Removes all the markers belonging to \a track. + void RemoveMarkersForTrack(int track); + + /// Removes the marker in \a image belonging to \a track. + void RemoveMarker(int image, int track); + + /// Returns the maximum image identifier used. + int MaxImage() const; + + /// Returns the maximum track identifier used. + int MaxTrack() const; + + /// Returns the number of markers. + int NumMarkers() const; + + private: + vector<Marker> markers_; +}; + +} // namespace libmv + +#endif // LIBMV_SIMPLE_PIPELINE_MARKERS_H_ diff --git a/extern/libmv/libmv/tracking/klt_region_tracker.cc b/extern/libmv/libmv/tracking/klt_region_tracker.cc new file mode 100644 index 00000000000..299077be155 --- /dev/null +++ b/extern/libmv/libmv/tracking/klt_region_tracker.cc @@ -0,0 +1,132 @@ +// Copyright (c) 2007, 2008, 2009, 2011 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. + +#include "libmv/logging/logging.h" +#include "libmv/tracking/klt_region_tracker.h" +#include "libmv/image/image.h" +#include "libmv/image/convolve.h" +#include "libmv/image/sample.h" + +namespace libmv { + +// Compute the gradient matrix noted by Z and the error vector e. See Good +// Features to Track. +// +// TODO(keir): The calls to SampleLinear() do boundary checking that should +// instead happen outside the loop. Since this is the innermost loop, the extra +// bounds checking hurts performance. +static void ComputeTrackingEquation(const Array3Df &image_and_gradient1, + const Array3Df &image_and_gradient2, + double x1, double y1, + double x2, double y2, + int half_width, + float *gxx, + float *gxy, + float *gyy, + float *ex, + float *ey) { + *gxx = *gxy = *gyy = 0; + *ex = *ey = 0; + for (int r = -half_width; r <= half_width; ++r) { + for (int c = -half_width; c <= half_width; ++c) { + float xx1 = x1 + c; + float yy1 = y1 + r; + float xx2 = x2 + c; + float yy2 = y2 + r; + float I = SampleLinear(image_and_gradient1, yy1, xx1, 0); + float J = SampleLinear(image_and_gradient2, yy2, xx2, 0); + float gx = SampleLinear(image_and_gradient2, yy2, xx2, 1); + float gy = SampleLinear(image_and_gradient2, yy2, xx2, 2); + *gxx += gx * gx; + *gxy += gx * gy; + *gyy += gy * gy; + *ex += (I - J) * gx; + *ey += (I - J) * gy; + } + } +} + +// Solve the tracking equation +// +// [gxx gxy] [dx] = [ex] +// [gxy gyy] [dy] = [ey] +// +// for dx and dy. Borrowed from Stan Birchfield's KLT implementation. +static bool SolveTrackingEquation(float gxx, float gxy, float gyy, + float ex, float ey, + float min_determinant, + float *dx, float *dy) { + float det = gxx * gyy - gxy * gxy; + if (det < min_determinant) { + *dx = 0; + *dy = 0; + return false; + } + *dx = (gyy * ex - gxy * ey) / det; + *dy = (gxx * ey - gxy * ex) / det; + return true; +} + +bool KltRegionTracker::Track(const FloatImage &image1, + const FloatImage &image2, + double x1, double y1, + double *x2, double *y2) const { + Array3Df image_and_gradient1; + Array3Df image_and_gradient2; + BlurredImageAndDerivativesChannels(image1, sigma, &image_and_gradient1); + BlurredImageAndDerivativesChannels(image2, sigma, &image_and_gradient2); + + int i; + float dx = 0, dy = 0; + for (i = 0; i < max_iterations; ++i) { + // Compute gradient matrix and error vector. + float gxx, gxy, gyy, ex, ey; + ComputeTrackingEquation(image_and_gradient1, + image_and_gradient2, + x1, y1, + *x2, *y2, + half_window_size, + &gxx, &gxy, &gyy, &ex, &ey); + + // Solve the linear system for the best update to x2 and y2. + if (!SolveTrackingEquation(gxx, gxy, gyy, ex, ey, min_determinant, + &dx, &dy)) { + // The determinant, which indicates the trackiness of the point, is too + // small, so fail out. + LG << "Determinant too small; failing tracking."; + return false; + } + + // Update the position with the solved displacement. + *x2 += dx; + *y2 += dy; + + // If the update is small, then we probably found the target. + if (dx * dx + dy * dy < min_update_squared_distance) { + LG << "Successful track in " << i << " iterations."; + return true; + } + } + // Getting here means we hit max iterations, so tracking failed. + LG << "Too many iterations."; + return false; +} + +} // namespace libmv diff --git a/extern/libmv/libmv/tracking/klt_region_tracker.h b/extern/libmv/libmv/tracking/klt_region_tracker.h new file mode 100644 index 00000000000..2b2d8a9a49d --- /dev/null +++ b/extern/libmv/libmv/tracking/klt_region_tracker.h @@ -0,0 +1,55 @@ +// Copyright (c) 2007, 2008, 2009, 2011 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_REGION_TRACKING_KLT_REGION_TRACKER_H_ +#define LIBMV_REGION_TRACKING_KLT_REGION_TRACKER_H_ + +#include "libmv/image/image.h" +#include "libmv/tracking/region_tracker.h" + +namespace libmv { + +struct KltRegionTracker : public RegionTracker { + KltRegionTracker() + : half_window_size(4), + max_iterations(16), + min_determinant(1e-6), + min_update_squared_distance(1e-6), + sigma(0.9) {} + + virtual ~KltRegionTracker() {} + + // Tracker interface. + virtual bool Track(const FloatImage &image1, + const FloatImage &image2, + double x1, double y1, + double *x2, double *y2) const; + + // No point in creating getters or setters. + int half_window_size; + int max_iterations; + double min_determinant; + double min_update_squared_distance; + double sigma; +}; + +} // namespace libmv + +#endif // LIBMV_REGION_TRACKING_KLT_REGION_TRACKER_H_ diff --git a/extern/libmv/libmv/tracking/pyramid_region_tracker.cc b/extern/libmv/libmv/tracking/pyramid_region_tracker.cc new file mode 100644 index 00000000000..58f42b26d7c --- /dev/null +++ b/extern/libmv/libmv/tracking/pyramid_region_tracker.cc @@ -0,0 +1,80 @@ +// Copyright (c) 2007, 2008, 2009, 2011 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. + +#include <vector> + +#include "libmv/image/convolve.h" +#include "libmv/image/image.h" +#include "libmv/image/sample.h" +#include "libmv/logging/logging.h" +#include "libmv/tracking/pyramid_region_tracker.h" + +namespace libmv { + +static void MakePyramid(const FloatImage &image, int num_levels, + std::vector<FloatImage> *pyramid) { + pyramid->resize(num_levels); + (*pyramid)[0] = image; + for (int i = 1; i < num_levels; ++i) { + DownsampleChannelsBy2((*pyramid)[i - 1], &(*pyramid)[i]); + } +} + +bool PyramidRegionTracker::Track(const FloatImage &image1, + const FloatImage &image2, + double x1, double y1, + double *x2, double *y2) const { + // Shrink the guessed x and y location to match the coarsest level + 1 (which + // when gets corrected in the loop). + *x2 /= pow(2., num_levels_); + *y2 /= pow(2., num_levels_); + + // Create all the levels of the pyramid, since tracking has to happen from + // the coarsest to finest levels, which means holding on to all levels of the + // pyraid at once. + std::vector<FloatImage> pyramid1(num_levels_); + std::vector<FloatImage> pyramid2(num_levels_); + MakePyramid(image1, num_levels_, &pyramid1); + MakePyramid(image2, num_levels_, &pyramid2); + + for (int i = num_levels_ - 1; i >= 0; --i) { + // Position in the first image at pyramid level i. + double xx = x1 / pow(2., i); + double yy = y1 / pow(2., i); + + // Guess the new tracked position is where the last level tracked to. + *x2 *= 2; + *y2 *= 2; + + // Track the point on this level with the base tracker. + bool succeeded = tracker_->Track(pyramid1[i], pyramid2[i], xx, yy, x2, y2); + + if (i == 0 && !succeeded) { + // Only fail on the highest-resolution level, because a failure on a + // coarse level does not mean failure at a lower level (consider + // out-of-bounds conditions). + LG << "Finest level of pyramid tracking failed; failing."; + return false; + } + } + return true; +} + +} // namespace libmv diff --git a/extern/libmv/libmv/tracking/pyramid_region_tracker.h b/extern/libmv/libmv/tracking/pyramid_region_tracker.h new file mode 100644 index 00000000000..1f9675469f4 --- /dev/null +++ b/extern/libmv/libmv/tracking/pyramid_region_tracker.h @@ -0,0 +1,46 @@ +// Copyright (c) 2011 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_CORRESPONDENCE_PYRAMID_TRACKER_H_ +#define LIBMV_CORRESPONDENCE_PYRAMID_TRACKER_H_ + +#include "libmv/image/image.h" +#include "libmv/base/scoped_ptr.h" +#include "libmv/tracking/region_tracker.h" + +namespace libmv { + +class PyramidRegionTracker : public RegionTracker { + public: + PyramidRegionTracker(RegionTracker *tracker, int num_levels) + : tracker_(tracker), num_levels_(num_levels) {} + + virtual bool Track(const FloatImage &image1, + const FloatImage &image2, + double x1, double y1, + double *x2, double *y2) const; + private: + scoped_ptr<RegionTracker> tracker_; + int num_levels_; +}; + +} // namespace libmv + +#endif // LIBMV_CORRESPONDENCE_PYRAMID_TRACKER_H_ diff --git a/extern/libmv/libmv/tracking/region_tracker.h b/extern/libmv/libmv/tracking/region_tracker.h new file mode 100644 index 00000000000..4f7574df1a3 --- /dev/null +++ b/extern/libmv/libmv/tracking/region_tracker.h @@ -0,0 +1,48 @@ +// Copyright (c) 2011 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_TRACKER_H_ +#define LIBMV_TRACKING_TRACKER_H_ + +#include "libmv/image/image.h" + +namespace libmv { + +class RegionTracker { + public: + RegionTracker() {} + virtual ~RegionTracker() {} + + /*! + Track a point from \a image1 to \a image2. + + \a x2, \a y2 should start out as a best guess for the position in \a + image2. If no guess is available, (\a x1, \a y1) is a good start. Returns + true on success, false otherwise + */ + virtual bool Track(const FloatImage &image1, + const FloatImage &image2, + double x1, double y1, + double *x2, double *y2) const = 0; +}; + +} // namespace libmv + +#endif // LIBMV_CORRESPONDENCE_TRACKER_H_ diff --git a/extern/libmv/libmv/tracking/retrack_region_tracker.cc b/extern/libmv/libmv/tracking/retrack_region_tracker.cc new file mode 100644 index 00000000000..b3230b1b173 --- /dev/null +++ b/extern/libmv/libmv/tracking/retrack_region_tracker.cc @@ -0,0 +1,47 @@ +// Copyright (c) 2011 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. + +#include <cmath> +#include <vector> + +#include "libmv/tracking/retrack_region_tracker.h" + +namespace libmv { + +bool RetrackRegionTracker::Track(const FloatImage &image1, + const FloatImage &image2, + double x1, double y1, + double *x2, double *y2) const { + // Track forward, getting x2 and y2. + if (!tracker_->Track(image1, image2, x1, y1, x2, y2)) { + return false; + } + // Now track x2 and y2 backward, to get xx1 and yy1 which, if the track is + // good, should match x1 and y1 (but may not if the track is bad). + double xx1 = *x2, yy1 = *x2; + if (!tracker_->Track(image2, image1, *x2, *y2, &xx1, &yy1)) { + return false; + } + double dx = xx1 - x1; + double dy = yy1 - y1; + return sqrt(dx * dx + dy * dy) < tolerance_; +} + +} // namespace libmv diff --git a/extern/libmv/libmv/tracking/retrack_region_tracker.h b/extern/libmv/libmv/tracking/retrack_region_tracker.h new file mode 100644 index 00000000000..ab05f320834 --- /dev/null +++ b/extern/libmv/libmv/tracking/retrack_region_tracker.h @@ -0,0 +1,48 @@ +// Copyright (c) 2011 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_RETRACK_REGION_TRACKER_H_ +#define LIBMV_TRACKING_RETRACK_REGION_TRACKER_H_ + +#include "libmv/image/image.h" +#include "libmv/base/scoped_ptr.h" +#include "libmv/tracking/region_tracker.h" + +namespace libmv { + +// A region tracker that tries tracking backwards and forwards, rejecting a +// track that doesn't track backwards to the starting point. +class RetrackRegionTracker : public RegionTracker { + public: + RetrackRegionTracker(RegionTracker *tracker, double tolerance) + : tracker_(tracker), tolerance_(tolerance) {} + + virtual bool Track(const FloatImage &image1, + const FloatImage &image2, + double x1, double y1, + double *x2, double *y2) const; + private: + scoped_ptr<RegionTracker> tracker_; + double tolerance_; +}; + +} // namespace libmv + +#endif // LIBMV_TRACKING_RETRACK_REGION_TRACKER_H_ diff --git a/extern/libmv/libmv/tracking/sad.cc b/extern/libmv/libmv/tracking/sad.cc new file mode 100644 index 00000000000..9b446bb4c35 --- /dev/null +++ b/extern/libmv/libmv/tracking/sad.cc @@ -0,0 +1,174 @@ +/**************************************************************************** +** +** Copyright (c) 2011 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. +** +****************************************************************************/ + +#include "libmv/tracking/sad.h" +#include <stdlib.h> +#include <math.h> + +namespace libmv { + +void LaplaceFilter(ubyte* src, ubyte* dst, int width, int height, int strength) { + for(int y=1; y<height-1; y++) for(int x=1; x<width-1; x++) { + const ubyte* s = &src[y*width+x]; + int l = 128 + + s[-width-1] + s[-width] + s[-width+1] + + s[1] - 8*s[0] + s[1] + + s[ width-1] + s[ width] + s[ width+1] ; + int d = ((256-strength)*s[0] + strength*l) / 256; + if(d < 0) d=0; + if(d > 255) d=255; + dst[y*width+x] = d; + } +} + +struct vec2 { + float x,y; + inline vec2(float x, float y):x(x),y(y){} +}; +inline vec2 operator*(mat32 m, vec2 v) { + return vec2(v.x*m(0,0)+v.y*m(0,1)+m(0,2),v.x*m(1,0)+v.y*m(1,1)+m(1,2)); +} + +//! fixed point bilinear sample with precision k +template <int k> inline int sample(const ubyte* image,int stride, int x, int y, int u, int v) { + const ubyte* s = &image[y*stride+x]; + return ((s[ 0] * (k-u) + s[ 1] * u) * (k-v) + + (s[stride] * (k-u) + s[stride+1] * u) * ( v) ) / (k*k); +} + +#ifdef __SSE__ +#include <xmmintrin.h> +int lround(float x) { return _mm_cvtss_si32(_mm_set_ss(x)); } +#elif defined(_MSC_VER) +int lround(float x) { return x+0.5; } +#endif + +//TODO(MatthiasF): SSE optimization +void SamplePattern(ubyte* image, int stride, mat32 warp, ubyte* pattern, int size) { + const int k = 256; + for (int i = 0; i < size; i++) for (int j = 0; j < size; j++) { + vec2 p = warp*vec2(j-size/2,i-size/2); + int fx = lround(p.x*k), fy = lround(p.y*k); + int ix = fx/k, iy = fy/k; + int u = fx%k, v = fy%k; + pattern[i*size+j] = sample<k>(image,stride,ix,iy,u,v); + } +} + +#ifdef __SSE2__ +#include <emmintrin.h> +static uint SAD(const ubyte* pattern, const ubyte* image, int stride, int size) { + __m128i a = _mm_setzero_si128(); + for(int i = 0; i < size; i++) { + for(int j = 0; j < size/16; j++) { + a = _mm_adds_epu16(a, _mm_sad_epu8( _mm_loadu_si128((__m128i*)(pattern+i*size+j*16)), + _mm_loadu_si128((__m128i*)(image+i*stride+j*16)))); + } + } + return _mm_extract_epi16(a,0) + _mm_extract_epi16(a,4); +} +#else +static uint SAD(const ubyte* pattern, const ubyte* image, int stride, int size) { + uint sad=0; + for(int i = 0; i < size; i++) { + for(int j = 0; j < size; j++) { + sad += abs((int)pattern[i*size+j] - image[i*stride+j]); + } + } + return sad; +} +#endif + +float sq(float x) { return x*x; } +float Track(ubyte* reference, ubyte* warped, int size, ubyte* image, int stride, int w, int h, mat32* warp, float areaPenalty, float conditionPenalty) { + mat32 m=*warp; + uint min=-1; + + // exhaustive search integer pixel translation + int ix = m(0,2), iy = m(1,2); + for(int y = size/2; y < h-size/2; y++) { + for(int x = size/2; x < w-size/2; x++) { + m(0,2) = x, m(1,2) = y; + uint sad = SAD(warped,&image[(y-size/2)*stride+(x-size/2)],stride,size); + // TODO: using chroma could help disambiguate some cases + if(sad < min) { + min = sad; + ix = x, iy = y; + } + } + } + m(0,2) = ix, m(1,2) = iy; + min=-1; //reset score since direct warped search match too well (but the wrong pattern). + + // 6D coordinate descent to find affine transform + ubyte* match = new ubyte[size*size]; + float step = 0.5; + for(int p = 0; p < 8; p++) { //foreach precision level + for(int i = 0; i < 2; i++) { // iterate twice per precision level + //TODO: other sweep pattern might converge better + for(int d=0; d < 6; d++) { // iterate dimension sequentially (cyclic descent) + for(float e = -step; e <= step; e+=step) { //solve subproblem (evaluate only along one coordinate) + mat32 t = m; + t.data[d] += e; + //TODO: better performance would also allow a more exhaustive search + SamplePattern(image,stride,t,match,size); + uint sad = SAD(reference,match,size,size); + // regularization: keep constant area and good condition + float area = t(0,0)*t(1,1)-t(0,1)*t(1,0); + float x = sq(t(0,0))+sq(t(0,1)), y = sq(t(1,0))+sq(t(1,1)); + float condition = x>y ? x/y : y/x; + sad += size*size*( areaPenalty*sq(area-1) + conditionPenalty*sq(condition-1) ); + if(sad < min) { + min = sad; + m = t; + } + } + } + } + step /= 2; + } + *warp = m; + + // Compute Pearson product-moment correlation coefficient + uint sX=0,sY=0,sXX=0,sYY=0,sXY=0; + SamplePattern(image,stride,m,match,size); + SAD(reference,match,size,size); + for(int i = 0; i < size; i++) { + for(int j = 0; j < size; j++) { + int x = reference[i*size+j]; + int y = match[i*size+j]; + sX += x; + sY += y; + sXX += x*x; + sYY += y*y; + sXY += x*y; + } + } + delete[] match; + const int N = size*size; + sX /= N, sY /= N, sXX /= N, sYY /= N, sXY /= N; + return (sXY-sX*sY)/sqrt(double((sXX-sX*sX)*(sYY-sY*sY))); +} + +} // namespace libmv diff --git a/extern/libmv/libmv/tracking/sad.h b/extern/libmv/libmv/tracking/sad.h new file mode 100644 index 00000000000..9fe323b74c4 --- /dev/null +++ b/extern/libmv/libmv/tracking/sad.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (c) 2011 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_SAD_H_ +#define LIBMV_TRACKING_SAD_H_ + +#ifdef __cplusplus +namespace libmv { +#endif + +typedef unsigned char ubyte; +typedef unsigned int uint; + +/*! + Convolve \a src into \a dst with the discrete laplacian operator. + + \a src and \a dst should be \a width x \a height images. + \a strength is an interpolation coefficient (0-256) between original image and the laplacian. + + \note Make sure the search region is filtered with the same strength as the pattern. +*/ +void LaplaceFilter(ubyte* src, ubyte* dst, int width, int height, int strength); + +/// Affine transformation matrix in column major order. +struct mat32 { + float data[3*2]; +#ifdef __cplusplus + inline mat32(int d=1) { for(int i=0;i<3*2;i++) data[i]=0; if(d!=0) for(int i=0;i<2;i++) m(i,i)=d; } + inline float m(int i, int j) const { return data[j*2+i]; } + inline float& m(int i, int j) { return data[j*2+i]; } + inline float operator()(int i, int j) const { return m(i,j); } + inline float& operator()(int i, int j) { return m(i,j); } + inline operator bool() const { for (int i=0; i<3*2; i++) if(data[i]!=0) return true; return false; } +#endif +}; + +/*! + Sample \a pattern from \a image. + + \a warp is the transformation to apply to \a image when sampling the \a pattern. +*/ +void SamplePattern(ubyte* image, int stride, mat32 warp, ubyte* pattern, int size); + +/*! + Track \a pattern in \a image. + + This template matcher computes the + \link http://en.wikipedia.org/wiki/Sum_of_absolute_differences Sum of Absolute Differences (SAD) \endlink + for each integer pixel position in the search region and then iteratively + refine subpixel position using a square search. + A similar method is used for motion estimation in video encoders. + + \a reference is the pattern to track. + \a warped is a warped version of reference for fast unsampled integer search. + Best is to directly extract an already warped pattern from previous frame. + The \a size of the patterns should be aligned to 16. + \a image is a reference to the region to search. + \a stride is size of \a image lines. + + On input, \a warp is the predicted affine transformation (e.g from previous frame) + On return, \a warp is the affine transformation which best match the reference \a pattern + + \a areaPenalty and conditionPenalty control the regularization and need to be tweaked depending on the motion. + Setting them to 0 will allow any transformation (including unrealistic distortions and scaling). + Good values are between 0-32. 16 can be used as a realistic default. + areaPenalty control scaling (decrease to allow pull/zoom, increase to allow only 2D rotation). + a large conditionPenalty avoid a large ratio between the largest and smallest axices. + It need to be decreased for non-2D rotation (when pattern appears to scale along an axis). + + \return Pearson product-moment correlation coefficient between reference and matched pattern. + This measure of the linear dependence between the patterns + ranges from −1 (negative correlation) to 1 (positive correlation). + A value of 0 implies that there is no linear correlation between the variables. + + \note To track affine features: + - Sample reference pattern using estimated (e.g previous frame) warp. + - + \note \a stride allow you to reference your search region instead of copying. + \note For a 16x speedup, compile this tracker with SSE2 support. +*/ +float Track(ubyte* reference, ubyte* warped, int size, ubyte* image, int stride, int width, int height, mat32* warp, + float areaPenalty, float conditionPenalty); + +#ifdef __cplusplus +} // namespace libmv +#endif + +#endif // LIBMV_TRACKING_SAD_H_ diff --git a/extern/libmv/libmv/tracking/trklt_region_tracker.cc b/extern/libmv/libmv/tracking/trklt_region_tracker.cc new file mode 100644 index 00000000000..94319fcb7d3 --- /dev/null +++ b/extern/libmv/libmv/tracking/trklt_region_tracker.cc @@ -0,0 +1,135 @@ +// Copyright (c) 2011 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. + +#include "libmv/tracking/trklt_region_tracker.h" + +#include "libmv/logging/logging.h" +#include "libmv/numeric/numeric.h" +#include "libmv/image/image.h" +#include "libmv/image/convolve.h" +#include "libmv/image/sample.h" + +namespace libmv { + +// Computes U and e from the Ud = e equation (number 14) from the paper. +static void ComputeTrackingEquation(const Array3Df &image_and_gradient1, + const Array3Df &image_and_gradient2, + double x1, double y1, + double x2, double y2, + int half_width, + double lambda, + Mat2f *U, + Vec2f *e) { + Mat2f A, B, C, D; + A = B = C = D = Mat2f::Zero(); + + Vec2f R, S, V, W; + R = S = V = W = Vec2f::Zero(); + + for (int r = -half_width; r <= half_width; ++r) { + for (int c = -half_width; c <= half_width; ++c) { + float xx1 = x1 + c; + float yy1 = y1 + r; + float xx2 = x2 + c; + float yy2 = y2 + r; + + float I = SampleLinear(image_and_gradient1, yy1, xx1, 0); + float J = SampleLinear(image_and_gradient2, yy2, xx2, 0); + + Vec2f gI, gJ; + gI << SampleLinear(image_and_gradient1, yy1, xx1, 1), + SampleLinear(image_and_gradient1, yy1, xx1, 2); + gJ << SampleLinear(image_and_gradient2, yy2, xx2, 1), + SampleLinear(image_and_gradient2, yy2, xx2, 2); + + // Equation 15 from the paper. + A += gI * gI.transpose(); + B += gI * gJ.transpose(); + C += gJ * gJ.transpose(); + R += I * gI; + S += J * gI; + V += I * gJ; + W += J * gJ; + } + } + + // In the paper they show a D matrix, but it is just B transpose, so use that + // instead of explicitly computing D. + Mat2f Di = B.transpose().inverse(); + + // Equation 14 from the paper. + *U = A*Di*C + lambda*Di*C - 0.5*B; + *e = (A + lambda*Mat2f::Identity())*Di*(V - W) + 0.5*(S - R); +} + +bool TrkltRegionTracker::Track(const FloatImage &image1, + const FloatImage &image2, + double x1, double y1, + double *x2, double *y2) const { + Array3Df image_and_gradient1; + Array3Df image_and_gradient2; + BlurredImageAndDerivativesChannels(image1, sigma, &image_and_gradient1); + BlurredImageAndDerivativesChannels(image2, sigma, &image_and_gradient2); + + int i; + Vec2f d = Vec2f::Zero(); + for (i = 0; i < max_iterations; ++i) { + // Compute gradient matrix and error vector. + Mat2f U; + Vec2f e; + ComputeTrackingEquation(image_and_gradient1, + image_and_gradient2, + x1, y1, + *x2, *y2, + half_window_size, + lambda, + &U, &e); + + // Solve the linear system for the best update to x2 and y2. + d = U.lu().solve(e); + + // Update the position with the solved displacement. + *x2 += d[0]; + *y2 += d[1]; + + // Check for the quality of the solution, but not until having already + // updated the position with our best estimate. The reason to do the update + // anyway is that the user already knows the position is bad, so we may as + // well try our best. + float determinant = U.determinant(); + if (fabs(determinant) < min_determinant) { + // The determinant, which indicates the trackiness of the point, is too + // small, so fail out. + LG << "Determinant " << determinant << " is too small; failing tracking."; + return false; + } + + // If the update is small, then we probably found the target. + if (d.squaredNorm() < min_update_squared_distance) { + LG << "Successful track in " << i << " iterations."; + return true; + } + } + // Getting here means we hit max iterations, so tracking failed. + LG << "Too many iterations; max is set to " << max_iterations << "."; + return false; +} + +} // namespace libmv diff --git a/extern/libmv/libmv/tracking/trklt_region_tracker.h b/extern/libmv/libmv/tracking/trklt_region_tracker.h new file mode 100644 index 00000000000..5046e0f069d --- /dev/null +++ b/extern/libmv/libmv/tracking/trklt_region_tracker.h @@ -0,0 +1,65 @@ +// Copyright (c) 2011 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_REGION_TRACKING_TRKLT_REGION_TRACKER_H_ +#define LIBMV_REGION_TRACKING_TRKLT_REGION_TRACKER_H_ + +#include "libmv/image/image.h" +#include "libmv/tracking/region_tracker.h" + +namespace libmv { + +// An improved KLT algorithm that enforces that the tracking is time-reversible +// [1]. This is not the same as the "symmetric" KLT that is sometimes used. +// Anecdotally, this tracks much more consistently than vanilla KLT. +// +// [1] H. Wu, R. Chellappa, and A. Sankaranarayanan and S. Kevin Zhou. Robust +// visual tracking using the time-reversibility constraint. International +// Conference on Computer Vision (ICCV), Rio de Janeiro, October 2007. +// +struct TrkltRegionTracker : public RegionTracker { + TrkltRegionTracker() + : half_window_size(4), + max_iterations(100), + min_determinant(1e-6), + min_update_squared_distance(1e-6), + sigma(0.9), + lambda(0.05) {} + + virtual ~TrkltRegionTracker() {} + + // Tracker interface. + virtual bool Track(const FloatImage &image1, + const FloatImage &image2, + double x1, double y1, + double *x2, double *y2) const; + + // No point in creating getters or setters. + int half_window_size; + int max_iterations; + double min_determinant; + double min_update_squared_distance; + double sigma; + double lambda; +}; + +} // namespace libmv + +#endif // LIBMV_REGION_TRACKING_TRKLT_REGION_TRACKER_H_ diff --git a/extern/libmv/mkfiles.sh b/extern/libmv/mkfiles.sh new file mode 100755 index 00000000000..6618f2849ea --- /dev/null +++ b/extern/libmv/mkfiles.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +find ./libmv/ -type f | sed -r 's/^\.\///' > files.txt +find ./third_party/ -type f | sed -r 's/^\.\///' >> files.txt diff --git a/extern/libmv/patches/bundle_tweaks.patch b/extern/libmv/patches/bundle_tweaks.patch new file mode 100644 index 00000000000..f7b06b0a2dd --- /dev/null +++ b/extern/libmv/patches/bundle_tweaks.patch @@ -0,0 +1,122 @@ +diff --git a/src/libmv/logging/logging.h b/src/libmv/logging/logging.h +index 067da52..af86c4b 100644 +--- a/src/libmv/logging/logging.h ++++ b/src/libmv/logging/logging.h +@@ -21,7 +21,7 @@ + #ifndef LIBMV_LOGGING_LOGGING_H + #define LIBMV_LOGGING_LOGGING_H + +-#include "third_party/glog/src/glog/logging.h" ++#include "glog/logging.h" + + #define LG LOG(INFO) + #define V0 LOG(INFO) +diff --git a/src/third_party/glog/src/glog/logging.h b/src/third_party/glog/src/glog/logging.h +index 57615ef..a58d478 100644 +--- a/src/third_party/glog/src/glog/logging.h ++++ b/src/third_party/glog/src/glog/logging.h +@@ -33,6 +33,7 @@ + // Pretty much everybody needs to #include this file so that they can + // log various happenings. + // ++ + #ifndef _LOGGING_H_ + #define _LOGGING_H_ + +diff --git a/src/third_party/glog/src/logging.cc b/src/third_party/glog/src/logging.cc +index 868898f..1bb3867 100644 +--- a/src/third_party/glog/src/logging.cc ++++ b/src/third_party/glog/src/logging.cc +@@ -58,8 +58,8 @@ + #include <errno.h> // for errno + #include <sstream> + #include "base/commandlineflags.h" // to get the program name +-#include "glog/logging.h" +-#include "glog/raw_logging.h" ++#include <glog/logging.h> ++#include <glog/raw_logging.h> + #include "base/googleinit.h" + + #ifdef HAVE_STACKTRACE +@@ -1232,7 +1232,9 @@ void LogMessage::RecordCrashReason( + } + + static void logging_fail() { +-#if defined(_DEBUG) && defined(_MSC_VER) ++// #if defined(_DEBUG) && defined(_MSC_VER) ++// doesn't work for my laptop (sergey) ++#if 0 + // When debugging on windows, avoid the obnoxious dialog and make + // it possible to continue past a LOG(FATAL) in the debugger + _asm int 3 +diff --git a/src/third_party/glog/src/raw_logging.cc b/src/third_party/glog/src/raw_logging.cc +index 50c6a71..b179a1e 100644 +--- a/src/third_party/glog/src/raw_logging.cc ++++ b/src/third_party/glog/src/raw_logging.cc +@@ -42,8 +42,8 @@ + #include <fcntl.h> // for open() + #include <time.h> + #include "config.h" +-#include "glog/logging.h" // To pick up flag settings etc. +-#include "glog/raw_logging.h" ++#include <glog/logging.h> // To pick up flag settings etc. ++#include <glog/raw_logging.h> + #include "base/commandlineflags.h" + + #ifdef HAVE_STACKTRACE +diff --git a/src/third_party/glog/src/utilities.h b/src/third_party/glog/src/utilities.h +index ee54f94..2d4e99e 100644 +--- a/src/third_party/glog/src/utilities.h ++++ b/src/third_party/glog/src/utilities.h +@@ -79,7 +79,7 @@ + #endif + + #include "config.h" +-#include "glog/logging.h" ++#include <glog/logging.h> + + // There are three different ways we can try to get the stack trace: + // +diff --git a/src/third_party/glog/src/vlog_is_on.cc b/src/third_party/glog/src/vlog_is_on.cc +index ee0e412..ed88514 100644 +--- a/src/third_party/glog/src/vlog_is_on.cc ++++ b/src/third_party/glog/src/vlog_is_on.cc +@@ -40,8 +40,8 @@ + #include <cstdio> + #include <string> + #include "base/commandlineflags.h" +-#include "glog/logging.h" +-#include "glog/raw_logging.h" ++#include <glog/logging.h> ++#include <glog/raw_logging.h> + #include "base/googleinit.h" + + // glog doesn't have annotation +diff --git a/src/third_party/glog/src/windows/config.h b/src/third_party/glog/src/windows/config.h +index 114762e..682a1b9 100755 +--- a/src/third_party/glog/src/windows/config.h ++++ b/src/third_party/glog/src/windows/config.h +@@ -19,7 +19,7 @@ + #undef HAVE_LIBUNWIND_H + + /* define if you have google gflags library */ +-#undef HAVE_LIB_GFLAGS ++#define HAVE_LIB_GFLAGS 1 + + /* define if you have libunwind */ + #undef HAVE_LIB_UNWIND +diff --git a/src/third_party/glog/src/windows/glog/logging.h b/src/third_party/glog/src/windows/glog/logging.h +index 7a6df74..de51586 100755 +--- a/src/third_party/glog/src/windows/glog/logging.h ++++ b/src/third_party/glog/src/windows/glog/logging.h +@@ -82,8 +82,8 @@ + #include <inttypes.h> // a third place for uint16_t or u_int16_t + #endif + +-#if 0 +-#include <gflags/gflags.h> ++#if 1 ++#include "third_party/gflags/gflags.h" + #endif + + namespace google { diff --git a/extern/libmv/patches/config_mac.patch b/extern/libmv/patches/config_mac.patch new file mode 100644 index 00000000000..5a880155bfa --- /dev/null +++ b/extern/libmv/patches/config_mac.patch @@ -0,0 +1,13 @@ +diff --git a/src/third_party/glog/src/config_mac.h b/src/third_party/glog/src/config_mac.h +index a45575b..5f953d1 100644 +--- a/src/third_party/glog/src/config_mac.h ++++ b/src/third_party/glog/src/config_mac.h +@@ -131,7 +131,7 @@ + #define PACKAGE_VERSION "0.3.1" + + /* How to access the PC from a struct ucontext */ +-#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip ++#undef PC_FROM_UCONTEXT + + /* Define to necessary symbol if this constant uses a non-standard name on + your system. */ diff --git a/extern/libmv/patches/detect.patch b/extern/libmv/patches/detect.patch new file mode 100644 index 00000000000..36fea8427db --- /dev/null +++ b/extern/libmv/patches/detect.patch @@ -0,0 +1,181 @@ +diff --git a/src/libmv/simple_pipeline/detect.cc b/src/libmv/simple_pipeline/detect.cc +index 6fc0cdd..8ac42ab 100644 +--- a/src/libmv/simple_pipeline/detect.cc ++++ b/src/libmv/simple_pipeline/detect.cc +@@ -23,15 +23,89 @@ + ****************************************************************************/ + + #include "libmv/simple_pipeline/detect.h" ++#include <third_party/fast/fast.h> + #include <stdlib.h> +-#include <string.h> ++#include <memory.h> ++ ++#ifdef __SSE2__ ++#include <emmintrin.h> ++#endif + + namespace libmv { + + typedef unsigned int uint; + ++int featurecmp(const void *a_v, const void *b_v) ++{ ++ Feature *a = (Feature*)a_v; ++ Feature *b = (Feature*)b_v; ++ ++ return b->score - a->score; ++} ++ ++std::vector<Feature> DetectFAST(const unsigned char* data, int width, int height, int stride, ++ int min_trackness, int min_distance) { ++ std::vector<Feature> features; ++ // TODO(MatthiasF): Support targetting a feature count (binary search trackness) ++ int num_features; ++ xy* all = fast9_detect(data, width, height, ++ stride, min_trackness, &num_features); ++ if(num_features == 0) { ++ free(all); ++ return features; ++ } ++ int* scores = fast9_score(data, stride, all, num_features, min_trackness); ++ // TODO: merge with close feature suppression ++ xy* nonmax = nonmax_suppression(all, scores, num_features, &num_features); ++ free(all); ++ // Remove too close features ++ // TODO(MatthiasF): A resolution independent parameter would be better than distance ++ // e.g. a coefficient going from 0 (no minimal distance) to 1 (optimal circle packing) ++ // FIXME(MatthiasF): this method will not necessarily give all maximum markers ++ if(num_features) { ++ Feature *all_features = new Feature[num_features]; ++ ++ for(int i = 0; i < num_features; ++i) { ++ Feature a = { nonmax[i].x, nonmax[i].y, scores[i], 0 }; ++ all_features[i] = a; ++ } ++ ++ qsort((void *)all_features, num_features, sizeof(Feature), featurecmp); ++ ++ features.reserve(num_features); ++ ++ int prev_score = all_features[0].score; ++ for(int i = 0; i < num_features; ++i) { ++ bool ok = true; ++ Feature a = all_features[i]; ++ if(a.score>prev_score) ++ abort(); ++ prev_score = a.score; ++ ++ // compare each feature against filtered set ++ for(int j = 0; j < features.size(); j++) { ++ Feature& b = features[j]; ++ if ( (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y) < min_distance*min_distance ) { ++ // already a nearby feature ++ ok = false; ++ break; ++ } ++ } ++ ++ if(ok) { ++ // add the new feature ++ features.push_back(a); ++ } ++ } ++ ++ delete [] all_features; ++ } ++ free(scores); ++ free(nonmax); ++ return features; ++} ++ + #ifdef __SSE2__ +-#include <emmintrin.h> + static uint SAD(const ubyte* imageA, const ubyte* imageB, int strideA, int strideB) { + __m128i a = _mm_setzero_si128(); + for(int i = 0; i < 16; i++) { +@@ -52,7 +126,7 @@ static uint SAD(const ubyte* imageA, const ubyte* imageB, int strideA, int strid + } + #endif + +-void Detect(ubyte* image, int stride, int width, int height, Feature* detected, int* count, int distance, ubyte* pattern) { ++void DetectMORAVEC(ubyte* image, int stride, int width, int height, Feature* detected, int* count, int distance, ubyte* pattern) { + unsigned short histogram[256]; + memset(histogram,0,sizeof(histogram)); + ubyte* scores = new ubyte[width*height]; +diff --git a/src/libmv/simple_pipeline/detect.h b/src/libmv/simple_pipeline/detect.h +index 23b239b..bbe7aed 100644 +--- a/src/libmv/simple_pipeline/detect.h ++++ b/src/libmv/simple_pipeline/detect.h +@@ -25,27 +25,52 @@ + #ifndef LIBMV_SIMPLE_PIPELINE_DETECT_H_ + #define LIBMV_SIMPLE_PIPELINE_DETECT_H_ + +-#ifdef __cplusplus ++#include <vector> ++ + namespace libmv { +-#endif + + typedef unsigned char ubyte; + + /*! +- \a Feature is the 2D location of a detected feature in an image. ++ A Feature is the 2D location of a detected feature in an image. + +- \a x, \a y is the position of the center in pixels (from image top-left). +- \a score is an estimate of how well the pattern will be tracked. +- \a size can be used as an initial size to track the pattern. ++ \a x, \a y is the position of the feature in pixels from the top left corner. ++ \a score is an estimate of how well the feature will be tracked. ++ \a size can be used as an initial pattern size to track the feature. + + \sa Detect + */ + struct Feature { ++ /// Position in pixels (from top-left corner) ++ /// \note libmv might eventually support subpixel precision. + float x, y; ++ /// Trackness of the feature + float score; ++ /// Size of the feature in pixels + float size; + }; +- //radius for non maximal suppression ++ ++/*! ++ Detect features in an image. ++ ++ You need to input a single channel 8-bit image using pointer to image \a data, ++ \a width, \a height and \a stride (i.e bytes per line). ++ ++ You can tweak the count of detected features using \a min_trackness, which is ++ the minimum score to add a feature, and \a min_distance which is the minimal ++ distance accepted between two featuress. ++ ++ \note You can binary search over \a min_trackness to get a given feature count. ++ ++ \note a way to get an uniform distribution of a given feature count is: ++ \a min_distance = \a width * \a height / desired_feature_count ^ 2 ++ ++ \return All detected feartures matching given parameters ++*/ ++std::vector<Feature> DetectFAST(const unsigned char* data, int width, int height, ++ int stride, int min_trackness = 128, ++ int min_distance = 120); ++ + /*! + Detect features in an image. + +@@ -63,10 +88,8 @@ struct Feature { + \note \a You can crop the image (to avoid detecting markers near the borders) without copying: + image += marginY*stride+marginX, width -= 2*marginX, height -= 2*marginY; + */ +-void Detect(ubyte* image, int stride, int width, int height, Feature* detected, int* count, int distance /*=32*/, ubyte* pattern /*=0*/); ++void DetectMORAVEC(ubyte* image, int stride, int width, int height, Feature* detected, int* count, int distance /*=32*/, ubyte* pattern /*=0*/); + +-#ifdef __cplusplus + } +-#endif + + #endif diff --git a/extern/libmv/patches/fast.patch b/extern/libmv/patches/fast.patch new file mode 100644 index 00000000000..8e0aeb7e721 --- /dev/null +++ b/extern/libmv/patches/fast.patch @@ -0,0 +1,24 @@ +diff --git a/src/third_party/fast/fast.h b/src/third_party/fast/fast.h +index 2b3825a..06fa90e 100644 +--- a/src/third_party/fast/fast.h ++++ b/src/third_party/fast/fast.h +@@ -1,6 +1,10 @@ + #ifndef FAST_H + #define FAST_H + ++#ifdef __cplusplus ++extern "C" { ++#endif ++ + typedef struct { int x, y; } xy; + typedef unsigned char byte; + +@@ -28,4 +32,8 @@ xy* fast12_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b + xy* nonmax_suppression(const xy* corners, const int* scores, int num_corners, int* ret_num_nonmax); + + ++#ifdef __cplusplus ++} ++#endif ++ + #endif diff --git a/extern/libmv/patches/function_derivative.patch b/extern/libmv/patches/function_derivative.patch new file mode 100644 index 00000000000..be7ccfc911a --- /dev/null +++ b/extern/libmv/patches/function_derivative.patch @@ -0,0 +1,21 @@ +diff --git a/src/libmv/numeric/function_derivative.h b/src/libmv/numeric/function_derivative.h +index 0075d23..d7bc437 100644 +--- a/src/libmv/numeric/function_derivative.h ++++ b/src/libmv/numeric/function_derivative.h +@@ -24,6 +24,7 @@ + #include <cmath> + + #include "libmv/numeric/numeric.h" ++#include "libmv/logging/logging.h" + + namespace libmv { + +@@ -97,7 +98,7 @@ bool CheckJacobian(const Function &f, const typename Function::XMatrixType &x) { + + typename NumericJacobian<Function>::JMatrixType J_numeric = j_numeric(x); + typename NumericJacobian<Function>::JMatrixType J_analytic = j_analytic(x); +- //LG << J_numeric - J_analytic; ++ LG << J_numeric - J_analytic; + return true; + } + diff --git a/extern/libmv/patches/high_distortion_crash_fix.patch b/extern/libmv/patches/high_distortion_crash_fix.patch new file mode 100644 index 00000000000..54ab66fa27c --- /dev/null +++ b/extern/libmv/patches/high_distortion_crash_fix.patch @@ -0,0 +1,21 @@ +diff --git a/src/libmv/simple_pipeline/camera_intrinsics.cc b/src/libmv/simple_pipeline/camera_intrinsics.cc +index 4e88e1f..f9888ff 100644 +--- a/src/libmv/simple_pipeline/camera_intrinsics.cc ++++ b/src/libmv/simple_pipeline/camera_intrinsics.cc +@@ -160,9 +160,13 @@ void CameraIntrinsics::ComputeLookupGrid(Offset* grid, int width, int height) { + if( iy < 0 ) { iy = 0, fy = 0; } + if( ix >= width-2 ) ix = width-2; + if( iy >= height-2 ) iy = height-2; +- //assert( ix-x > -128 && ix-x < 128 && iy-y > -128 && iy-y < 128 ); +- Offset offset = { ix-x, iy-y, fx, fy }; +- grid[y*width+x] = offset; ++ if ( ix-x > -128 && ix-x < 128 && iy-y > -128 && iy-y < 128 ) { ++ Offset offset = { ix-x, iy-y, fx, fy }; ++ grid[y*width+x] = offset; ++ } else { ++ Offset offset = { 0, 0, 0, 0 }; ++ grid[y*width+x] = offset; ++ } + } + } + } diff --git a/extern/libmv/patches/levenberg_marquardt.patch b/extern/libmv/patches/levenberg_marquardt.patch new file mode 100644 index 00000000000..49ef82d73d2 --- /dev/null +++ b/extern/libmv/patches/levenberg_marquardt.patch @@ -0,0 +1,71 @@ +diff --git a/src/libmv/numeric/levenberg_marquardt.h b/src/libmv/numeric/levenberg_marquardt.h +index 6a54f66..4473b72 100644 +--- a/src/libmv/numeric/levenberg_marquardt.h ++++ b/src/libmv/numeric/levenberg_marquardt.h +@@ -33,6 +33,7 @@ + + #include "libmv/numeric/numeric.h" + #include "libmv/numeric/function_derivative.h" ++#include "libmv/logging/logging.h" + + namespace libmv { + +@@ -123,26 +124,40 @@ class LevenbergMarquardt { + Parameters dx, x_new; + int i; + for (i = 0; results.status == RUNNING && i < params.max_iterations; ++i) { +- if (dx.norm() <= params.relative_step_threshold * x.norm()) { ++ VLOG(1) << "iteration: " << i; ++ VLOG(1) << "||f(x)||: " << f_(x).norm(); ++ VLOG(1) << "max(g): " << g.array().abs().maxCoeff(); ++ VLOG(1) << "u: " << u; ++ VLOG(1) << "v: " << v; ++ ++ AMatrixType A_augmented = A + u*AMatrixType::Identity(J.cols(), J.cols()); ++ Solver solver(A_augmented); ++ dx = solver.solve(g); ++ bool solved = (A_augmented * dx).isApprox(g); ++ if (!solved) { ++ LOG(ERROR) << "Failed to solve"; ++ } ++ if (solved && dx.norm() <= params.relative_step_threshold * x.norm()) { + results.status = RELATIVE_STEP_SIZE_TOO_SMALL; + break; +- } +- x_new = x + dx; +- // Rho is the ratio of the actual reduction in error to the reduction +- // in error that would be obtained if the problem was linear. +- // See [1] for details. +- Scalar rho((error.squaredNorm() - f_(x_new).squaredNorm()) +- / dx.dot(u*dx + g)); +- if (rho > 0) { +- // Accept the Gauss-Newton step because the linear model fits well. +- x = x_new; +- results.status = Update(x, params, &J, &A, &error, &g); +- Scalar tmp = Scalar(2*rho-1); +- u = u*std::max(1/3., 1 - (tmp*tmp*tmp)); +- v = 2; +- continue; +- } +- ++ } ++ if (solved) { ++ x_new = x + dx; ++ // Rho is the ratio of the actual reduction in error to the reduction ++ // in error that would be obtained if the problem was linear. ++ // See [1] for details. ++ Scalar rho((error.squaredNorm() - f_(x_new).squaredNorm()) ++ / dx.dot(u*dx + g)); ++ if (rho > 0) { ++ // Accept the Gauss-Newton step because the linear model fits well. ++ x = x_new; ++ results.status = Update(x, params, &J, &A, &error, &g); ++ Scalar tmp = Scalar(2*rho-1); ++ u = u*std::max(1/3., 1 - (tmp*tmp*tmp)); ++ v = 2; ++ continue; ++ } ++ } + // Reject the update because either the normal equations failed to solve + // or the local linear model was not good (rho < 0). Instead, increase u + // to move closer to gradient descent. diff --git a/extern/libmv/patches/mingw.patch b/extern/libmv/patches/mingw.patch new file mode 100644 index 00000000000..0b08a483bea --- /dev/null +++ b/extern/libmv/patches/mingw.patch @@ -0,0 +1,13 @@ +diff --git a/src/libmv/numeric/numeric.h b/src/libmv/numeric/numeric.h +index f39d126..21e0f06 100644 +--- a/src/libmv/numeric/numeric.h ++++ b/src/libmv/numeric/numeric.h +@@ -40,7 +40,7 @@ + } + #endif //_WIN32 || __APPLE__ + +-#if _WIN32 ++#if (defined(WIN32) || defined(WIN64)) && !defined(__MINGW32__) + inline long lround(double d) { + return (long)(d>0 ? d+0.5 : ceil(d-0.5)); + } diff --git a/extern/libmv/patches/msvc2010.patch b/extern/libmv/patches/msvc2010.patch new file mode 100644 index 00000000000..c090b070628 --- /dev/null +++ b/extern/libmv/patches/msvc2010.patch @@ -0,0 +1,12 @@ +diff --git a/src/libmv/simple_pipeline/tracks.cc b/src/libmv/simple_pipeline/tracks.cc +index 0e2a1b6..3fb8ddb 100644 +--- a/src/libmv/simple_pipeline/tracks.cc ++++ b/src/libmv/simple_pipeline/tracks.cc +@@ -20,6 +20,7 @@ + + #include <algorithm> + #include <vector> ++#include <iterator> + + #include "libmv/numeric/numeric.h" + #include "libmv/simple_pipeline/tracks.h" diff --git a/extern/libmv/patches/overscan.patch b/extern/libmv/patches/overscan.patch new file mode 100644 index 00000000000..c68f36804ec --- /dev/null +++ b/extern/libmv/patches/overscan.patch @@ -0,0 +1,182 @@ +diff --git a/src/libmv/simple_pipeline/camera_intrinsics.cc b/src/libmv/simple_pipeline/camera_intrinsics.cc +index 110a16d..366129d 100644 +--- a/src/libmv/simple_pipeline/camera_intrinsics.cc ++++ b/src/libmv/simple_pipeline/camera_intrinsics.cc +@@ -31,6 +31,7 @@ struct Offset { + struct Grid { + struct Offset *offset; + int width, height; ++ double overscan; + }; + + static struct Grid *copyGrid(struct Grid *from) +@@ -42,6 +43,7 @@ static struct Grid *copyGrid(struct Grid *from) + + to->width = from->width; + to->height = from->height; ++ to->overscan = from->overscan; + + to->offset = new Offset[to->width*to->height]; + memcpy(to->offset, from->offset, sizeof(struct Offset)*to->width*to->height); +@@ -184,17 +186,19 @@ void CameraIntrinsics::InvertIntrinsics(double image_x, + + // TODO(MatthiasF): downsample lookup + template<typename WarpFunction> +-void CameraIntrinsics::ComputeLookupGrid(Grid* grid, int width, int height) { +- double aspx = (double)width / image_width_; +- double aspy = (double)height / image_height_; ++void CameraIntrinsics::ComputeLookupGrid(Grid* grid, int width, int height, double overscan) { ++ double w = (double)width / (1 + overscan); ++ double h = (double)height / (1 + overscan); ++ double aspx = (double)w / image_width_; ++ double aspy = (double)h / image_height_; + + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { +- double src_x = x / aspx, src_y = y / aspy; ++ double src_x = (x - 0.5 * overscan * w) / aspx, src_y = (y - 0.5 * overscan * h) / aspy; + double warp_x, warp_y; + WarpFunction(this,src_x,src_y,&warp_x,&warp_y); +- warp_x = warp_x*aspx; +- warp_y = warp_y*aspy; ++ warp_x = warp_x*aspx + 0.5 * overscan * w; ++ warp_y = warp_y*aspy + 0.5 * overscan * h; + int ix = int(warp_x), iy = int(warp_y); + int fx = round((warp_x-ix)*256), fy = round((warp_y-iy)*256); + if(fx == 256) { fx=0; ix++; } +@@ -264,10 +268,10 @@ struct InvertIntrinsicsFunction { + } + }; + +-void CameraIntrinsics::CheckDistortLookupGrid(int width, int height) ++void CameraIntrinsics::CheckDistortLookupGrid(int width, int height, double overscan) + { + if(distort_) { +- if(distort_->width != width || distort_->height != height) { ++ if(distort_->width != width || distort_->height != height || distort_->overscan != overscan) { + delete [] distort_->offset; + distort_->offset = NULL; + } +@@ -278,17 +282,18 @@ void CameraIntrinsics::CheckDistortLookupGrid(int width, int height) + + if(!distort_->offset) { + distort_->offset = new Offset[width*height]; +- ComputeLookupGrid<InvertIntrinsicsFunction>(distort_,width,height); ++ ComputeLookupGrid<InvertIntrinsicsFunction>(distort_,width,height,overscan); + } + + distort_->width = width; + distort_->height = height; ++ distort_->overscan = overscan; + } + +-void CameraIntrinsics::CheckUndistortLookupGrid(int width, int height) ++void CameraIntrinsics::CheckUndistortLookupGrid(int width, int height, double overscan) + { + if(undistort_) { +- if(undistort_->width != width || undistort_->height != height) { ++ if(undistort_->width != width || undistort_->height != height || undistort_->overscan != overscan) { + delete [] undistort_->offset; + undistort_->offset = NULL; + } +@@ -299,15 +304,16 @@ void CameraIntrinsics::CheckUndistortLookupGrid(int width, int height) + + if(!undistort_->offset) { + undistort_->offset = new Offset[width*height]; +- ComputeLookupGrid<ApplyIntrinsicsFunction>(undistort_,width,height); ++ ComputeLookupGrid<ApplyIntrinsicsFunction>(undistort_,width,height,overscan); + } + + undistort_->width = width; + undistort_->height = height; ++ undistort_->overscan = overscan; + } + +-void CameraIntrinsics::Distort(const float* src, float* dst, int width, int height, int channels) { +- CheckDistortLookupGrid(width, height); ++void CameraIntrinsics::Distort(const float* src, float* dst, int width, int height, double overscan, int channels) { ++ CheckDistortLookupGrid(width, height, overscan); + if(channels==1) Warp<float,1>(distort_,src,dst,width,height); + else if(channels==2) Warp<float,2>(distort_,src,dst,width,height); + else if(channels==3) Warp<float,3>(distort_,src,dst,width,height); +@@ -315,8 +321,8 @@ void CameraIntrinsics::Distort(const float* src, float* dst, int width, int heig + //else assert("channels must be between 1 and 4"); + } + +-void CameraIntrinsics::Distort(const unsigned char* src, unsigned char* dst, int width, int height, int channels) { +- CheckDistortLookupGrid(width, height); ++void CameraIntrinsics::Distort(const unsigned char* src, unsigned char* dst, int width, int height, double overscan, int channels) { ++ CheckDistortLookupGrid(width, height, overscan); + if(channels==1) Warp<unsigned char,1>(distort_,src,dst,width,height); + else if(channels==2) Warp<unsigned char,2>(distort_,src,dst,width,height); + else if(channels==3) Warp<unsigned char,3>(distort_,src,dst,width,height); +@@ -324,8 +330,8 @@ void CameraIntrinsics::Distort(const unsigned char* src, unsigned char* dst, int + //else assert("channels must be between 1 and 4"); + } + +-void CameraIntrinsics::Undistort(const float* src, float* dst, int width, int height, int channels) { +- CheckUndistortLookupGrid(width, height); ++void CameraIntrinsics::Undistort(const float* src, float* dst, int width, int height, double overscan, int channels) { ++ CheckUndistortLookupGrid(width, height, overscan); + if(channels==1) Warp<float,1>(undistort_,src,dst,width,height); + else if(channels==2) Warp<float,2>(undistort_,src,dst,width,height); + else if(channels==3) Warp<float,3>(undistort_,src,dst,width,height); +@@ -333,8 +339,8 @@ void CameraIntrinsics::Undistort(const float* src, float* dst, int width, int he + //else assert("channels must be between 1 and 4"); + } + +-void CameraIntrinsics::Undistort(const unsigned char* src, unsigned char* dst, int width, int height, int channels) { +- CheckUndistortLookupGrid(width, height); ++void CameraIntrinsics::Undistort(const unsigned char* src, unsigned char* dst, int width, int height, double overscan, int channels) { ++ CheckUndistortLookupGrid(width, height, overscan); + if(channels==1) Warp<unsigned char,1>(undistort_,src,dst,width,height); + else if(channels==2) Warp<unsigned char,2>(undistort_,src,dst,width,height); + else if(channels==3) Warp<unsigned char,3>(undistort_,src,dst,width,height); +diff --git a/src/libmv/simple_pipeline/camera_intrinsics.h b/src/libmv/simple_pipeline/camera_intrinsics.h +index f525571..f4bf903 100644 +--- a/src/libmv/simple_pipeline/camera_intrinsics.h ++++ b/src/libmv/simple_pipeline/camera_intrinsics.h +@@ -91,7 +91,7 @@ class CameraIntrinsics { + \note This is the reference implementation using floating point images. + */ + void Distort(const float* src, float* dst, +- int width, int height, int channels); ++ int width, int height, double overscan, int channels); + /*! + Distort an image using the current camera instrinsics + +@@ -101,7 +101,7 @@ class CameraIntrinsics { + \note This version is much faster. + */ + void Distort(const unsigned char* src, unsigned char* dst, +- int width, int height, int channels); ++ int width, int height, double overscan, int channels); + /*! + Undistort an image using the current camera instrinsics + +@@ -111,7 +111,7 @@ class CameraIntrinsics { + \note This is the reference implementation using floating point images. + */ + void Undistort(const float* src, float* dst, +- int width, int height, int channels); ++ int width, int height, double overscan, int channels); + /*! + Undistort an image using the current camera instrinsics + +@@ -121,12 +121,12 @@ class CameraIntrinsics { + \note This version is much faster. + */ + void Undistort(const unsigned char* src, unsigned char* dst, +- int width, int height, int channels); ++ int width, int height, double overscan, int channels); + + private: +- template<typename WarpFunction> void ComputeLookupGrid(struct Grid* grid, int width, int height); +- void CheckUndistortLookupGrid(int width, int height); +- void CheckDistortLookupGrid(int width, int height); ++ template<typename WarpFunction> void ComputeLookupGrid(struct Grid* grid, int width, int height, double overscan); ++ void CheckUndistortLookupGrid(int width, int height, double overscan); ++ void CheckDistortLookupGrid(int width, int height, double overscan); + void FreeLookupGrid(); + + // The traditional intrinsics matrix from x = K[R|t]X. diff --git a/extern/libmv/patches/scaled_distortion.patch b/extern/libmv/patches/scaled_distortion.patch new file mode 100644 index 00000000000..2da832931d1 --- /dev/null +++ b/extern/libmv/patches/scaled_distortion.patch @@ -0,0 +1,261 @@ +diff --git a/src/libmv/simple_pipeline/camera_intrinsics.cc b/src/libmv/simple_pipeline/camera_intrinsics.cc +index f9888ff..110a16d 100644 +--- a/src/libmv/simple_pipeline/camera_intrinsics.cc ++++ b/src/libmv/simple_pipeline/camera_intrinsics.cc +@@ -23,7 +23,32 @@ + + namespace libmv { + +-struct Offset { signed char ix,iy; unsigned char fx,fy; }; ++struct Offset { ++ signed char ix, iy; ++ unsigned char fx,fy; ++}; ++ ++struct Grid { ++ struct Offset *offset; ++ int width, height; ++}; ++ ++static struct Grid *copyGrid(struct Grid *from) ++{ ++ struct Grid *to = NULL; ++ ++ if (from) { ++ to = new Grid; ++ ++ to->width = from->width; ++ to->height = from->height; ++ ++ to->offset = new Offset[to->width*to->height]; ++ memcpy(to->offset, from->offset, sizeof(struct Offset)*to->width*to->height); ++ } ++ ++ return to; ++} + + CameraIntrinsics::CameraIntrinsics() + : K_(Mat3::Identity()), +@@ -37,9 +62,22 @@ CameraIntrinsics::CameraIntrinsics() + distort_(0), + undistort_(0) {} + ++CameraIntrinsics::CameraIntrinsics(const CameraIntrinsics &from) ++ : K_(from.K_), ++ image_width_(from.image_width_), ++ image_height_(from.image_height_), ++ k1_(from.k1_), ++ k2_(from.k2_), ++ k3_(from.k3_), ++ p1_(from.p1_), ++ p2_(from.p2_) ++{ ++ distort_ = copyGrid(from.distort_); ++ undistort_ = copyGrid(from.undistort_); ++} ++ + CameraIntrinsics::~CameraIntrinsics() { +- if(distort_) delete[] distort_; +- if(undistort_) delete[] undistort_; ++ FreeLookupGrid(); + } + + /// Set the entire calibration matrix at once. +@@ -146,11 +184,17 @@ void CameraIntrinsics::InvertIntrinsics(double image_x, + + // TODO(MatthiasF): downsample lookup + template<typename WarpFunction> +-void CameraIntrinsics::ComputeLookupGrid(Offset* grid, int width, int height) { ++void CameraIntrinsics::ComputeLookupGrid(Grid* grid, int width, int height) { ++ double aspx = (double)width / image_width_; ++ double aspy = (double)height / image_height_; ++ + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { ++ double src_x = x / aspx, src_y = y / aspy; + double warp_x, warp_y; +- WarpFunction(this,x,y,&warp_x,&warp_y); ++ WarpFunction(this,src_x,src_y,&warp_x,&warp_y); ++ warp_x = warp_x*aspx; ++ warp_y = warp_y*aspy; + int ix = int(warp_x), iy = int(warp_y); + int fx = round((warp_x-ix)*256), fy = round((warp_y-iy)*256); + if(fx == 256) { fx=0; ix++; } +@@ -162,10 +206,10 @@ void CameraIntrinsics::ComputeLookupGrid(Offset* grid, int width, int height) { + if( iy >= height-2 ) iy = height-2; + if ( ix-x > -128 && ix-x < 128 && iy-y > -128 && iy-y < 128 ) { + Offset offset = { ix-x, iy-y, fx, fy }; +- grid[y*width+x] = offset; ++ grid->offset[y*width+x] = offset; + } else { + Offset offset = { 0, 0, 0, 0 }; +- grid[y*width+x] = offset; ++ grid->offset[y*width+x] = offset; + } + } + } +@@ -173,11 +217,11 @@ void CameraIntrinsics::ComputeLookupGrid(Offset* grid, int width, int height) { + + // TODO(MatthiasF): cubic B-Spline image sampling, bilinear lookup + template<typename T,int N> +-static void Warp(const Offset* grid, const T* src, T* dst, ++static void Warp(const Grid* grid, const T* src, T* dst, + int width, int height) { + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { +- Offset offset = grid[y*width+x]; ++ Offset offset = grid->offset[y*width+x]; + const T* s = &src[((y+offset.iy)*width+(x+offset.ix))*N]; + for (int i = 0; i < N; i++) { + dst[(y*width+x)*N+i] = ((s[ i] * (256-offset.fx) + s[ N+i] * offset.fx) * (256-offset.fy) +@@ -188,8 +232,17 @@ static void Warp(const Offset* grid, const T* src, T* dst, + } + + void CameraIntrinsics::FreeLookupGrid() { +- if(distort_) delete distort_, distort_=0; +- if(undistort_) delete undistort_, undistort_=0; ++ if(distort_) { ++ delete distort_->offset; ++ delete distort_; ++ distort_ = NULL; ++ } ++ ++ if(undistort_) { ++ delete undistort_->offset; ++ delete undistort_; ++ undistort_ = NULL; ++ } + } + + // FIXME: C++ templates limitations makes thing complicated, but maybe there is a simpler method. +@@ -211,11 +264,50 @@ struct InvertIntrinsicsFunction { + } + }; + +-void CameraIntrinsics::Distort(const float* src, float* dst, int width, int height, int channels) { +- if(!distort_) { +- distort_ = new Offset[width*height]; +- ComputeLookupGrid<InvertIntrinsicsFunction>(distort_,width,height); ++void CameraIntrinsics::CheckDistortLookupGrid(int width, int height) ++{ ++ if(distort_) { ++ if(distort_->width != width || distort_->height != height) { ++ delete [] distort_->offset; ++ distort_->offset = NULL; ++ } ++ } else { ++ distort_ = new Grid; ++ distort_->offset = NULL; ++ } ++ ++ if(!distort_->offset) { ++ distort_->offset = new Offset[width*height]; ++ ComputeLookupGrid<InvertIntrinsicsFunction>(distort_,width,height); + } ++ ++ distort_->width = width; ++ distort_->height = height; ++} ++ ++void CameraIntrinsics::CheckUndistortLookupGrid(int width, int height) ++{ ++ if(undistort_) { ++ if(undistort_->width != width || undistort_->height != height) { ++ delete [] undistort_->offset; ++ undistort_->offset = NULL; ++ } ++ } else { ++ undistort_ = new Grid; ++ undistort_->offset = NULL; ++ } ++ ++ if(!undistort_->offset) { ++ undistort_->offset = new Offset[width*height]; ++ ComputeLookupGrid<ApplyIntrinsicsFunction>(undistort_,width,height); ++ } ++ ++ undistort_->width = width; ++ undistort_->height = height; ++} ++ ++void CameraIntrinsics::Distort(const float* src, float* dst, int width, int height, int channels) { ++ CheckDistortLookupGrid(width, height); + if(channels==1) Warp<float,1>(distort_,src,dst,width,height); + else if(channels==2) Warp<float,2>(distort_,src,dst,width,height); + else if(channels==3) Warp<float,3>(distort_,src,dst,width,height); +@@ -224,10 +316,7 @@ void CameraIntrinsics::Distort(const float* src, float* dst, int width, int heig + } + + void CameraIntrinsics::Distort(const unsigned char* src, unsigned char* dst, int width, int height, int channels) { +- if(!distort_) { +- distort_ = new Offset[width*height]; +- ComputeLookupGrid<InvertIntrinsicsFunction>(distort_,width,height); +- } ++ CheckDistortLookupGrid(width, height); + if(channels==1) Warp<unsigned char,1>(distort_,src,dst,width,height); + else if(channels==2) Warp<unsigned char,2>(distort_,src,dst,width,height); + else if(channels==3) Warp<unsigned char,3>(distort_,src,dst,width,height); +@@ -236,10 +325,7 @@ void CameraIntrinsics::Distort(const unsigned char* src, unsigned char* dst, int + } + + void CameraIntrinsics::Undistort(const float* src, float* dst, int width, int height, int channels) { +- if(!undistort_) { +- undistort_ = new Offset[width*height]; +- ComputeLookupGrid<ApplyIntrinsicsFunction>(undistort_,width,height); +- } ++ CheckUndistortLookupGrid(width, height); + if(channels==1) Warp<float,1>(undistort_,src,dst,width,height); + else if(channels==2) Warp<float,2>(undistort_,src,dst,width,height); + else if(channels==3) Warp<float,3>(undistort_,src,dst,width,height); +@@ -248,10 +334,7 @@ void CameraIntrinsics::Undistort(const float* src, float* dst, int width, int he + } + + void CameraIntrinsics::Undistort(const unsigned char* src, unsigned char* dst, int width, int height, int channels) { +- if(!undistort_) { +- undistort_ = new Offset[width*height]; +- ComputeLookupGrid<ApplyIntrinsicsFunction>(undistort_,width,height); +- } ++ CheckUndistortLookupGrid(width, height); + if(channels==1) Warp<unsigned char,1>(undistort_,src,dst,width,height); + else if(channels==2) Warp<unsigned char,2>(undistort_,src,dst,width,height); + else if(channels==3) Warp<unsigned char,3>(undistort_,src,dst,width,height); +diff --git a/src/libmv/simple_pipeline/camera_intrinsics.h b/src/libmv/simple_pipeline/camera_intrinsics.h +index 29bc8a1..f525571 100644 +--- a/src/libmv/simple_pipeline/camera_intrinsics.h ++++ b/src/libmv/simple_pipeline/camera_intrinsics.h +@@ -26,11 +26,12 @@ typedef Eigen::Matrix<double, 3, 3> Mat3; + + namespace libmv { + +-struct Offset; ++struct Grid; + + class CameraIntrinsics { + public: + CameraIntrinsics(); ++ CameraIntrinsics(const CameraIntrinsics &from); + ~CameraIntrinsics(); + + const Mat3 &K() const { return K_; } +@@ -123,7 +124,9 @@ class CameraIntrinsics { + int width, int height, int channels); + + private: +- template<typename WarpFunction> void ComputeLookupGrid(Offset* grid, int width, int height); ++ template<typename WarpFunction> void ComputeLookupGrid(struct Grid* grid, int width, int height); ++ void CheckUndistortLookupGrid(int width, int height); ++ void CheckDistortLookupGrid(int width, int height); + void FreeLookupGrid(); + + // The traditional intrinsics matrix from x = K[R|t]X. +@@ -140,8 +143,8 @@ class CameraIntrinsics { + // independent of image size. + double k1_, k2_, k3_, p1_, p2_; + +- Offset* distort_; +- Offset* undistort_; ++ struct Grid *distort_; ++ struct Grid *undistort_; + }; + + } // namespace libmv diff --git a/extern/libmv/patches/series b/extern/libmv/patches/series new file mode 100644 index 00000000000..00a52c1cfaa --- /dev/null +++ b/extern/libmv/patches/series @@ -0,0 +1,13 @@ +v3d_verbosity.patch +snrptinf_fix.patch +bundle_tweaks.patch +fast.patch +config_mac.patch +levenberg_marquardt.patch +function_derivative.patch +high_distortion_crash_fix.patch +mingw.patch +msvc2010.patch +scaled_distortion.patch +overscan.patch +detect.patch diff --git a/extern/libmv/patches/snrptinf_fix.patch b/extern/libmv/patches/snrptinf_fix.patch new file mode 100644 index 00000000000..e886a671de0 --- /dev/null +++ b/extern/libmv/patches/snrptinf_fix.patch @@ -0,0 +1,15 @@ +diff --git a/src/libmv/simple_pipeline/pipeline.cc b/src/libmv/simple_pipeline/pipeline.cc +index 652d70c..25cd2c2 100644 +--- a/src/libmv/simple_pipeline/pipeline.cc ++++ b/src/libmv/simple_pipeline/pipeline.cc +@@ -28,6 +28,10 @@ + #include "libmv/simple_pipeline/tracks.h" + #include "libmv/simple_pipeline/camera_intrinsics.h" + ++#ifdef _MSC_VER ++# define snprintf _snprintf ++#endif ++ + namespace libmv { + + void CompleteReconstruction(const Tracks &tracks, diff --git a/extern/libmv/patches/v3d_verbosity.patch b/extern/libmv/patches/v3d_verbosity.patch new file mode 100644 index 00000000000..a54f3dc44be --- /dev/null +++ b/extern/libmv/patches/v3d_verbosity.patch @@ -0,0 +1,12 @@ +diff --git a/src/libmv/simple_pipeline/bundle.cc b/src/libmv/simple_pipeline/bundle.cc +index 310660d..f819603 100644 +--- a/src/libmv/simple_pipeline/bundle.cc ++++ b/src/libmv/simple_pipeline/bundle.cc +@@ -141,7 +141,6 @@ void Bundle(const Tracks &tracks, Reconstruction *reconstruction) { + v3d_distortion.p2 = 0; + + // Finally, run the bundle adjustment. +- V3D::optimizerVerbosenessLevel = 1; + double const inlierThreshold = 500000.0; + V3D::CommonInternalsMetricBundleOptimizer opt(V3D::FULL_BUNDLE_METRIC, + inlierThreshold, diff --git a/extern/libmv/third_party/fast/LICENSE b/extern/libmv/third_party/fast/LICENSE new file mode 100644 index 00000000000..f347008d6ef --- /dev/null +++ b/extern/libmv/third_party/fast/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2006, 2008 Edward Rosten +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + + *Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + *Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + *Neither the name of the University of Cambridge nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/extern/libmv/third_party/fast/README b/extern/libmv/third_party/fast/README new file mode 100644 index 00000000000..77017078d08 --- /dev/null +++ b/extern/libmv/third_party/fast/README @@ -0,0 +1,31 @@ +FAST feature detectors in C Version 2.0 +--------------------------------------- + +The files are valid C and C++ code, and have no special requirements for +compiling, and they do not depend on any libraries. Just compile them along with +the rest of your project. + +To use the functions, #include "fast.h" + +The corner detectors have the following prototype (where X is 9, 10, 11 or 12): + +xy* fastX_detect_nonmax(const unsigned char * data, int xsize, int ysize, int stride, int threshold, int* numcorners) + +Where xy is the following simple struct typedef: + +typedef struct +{ + int x, y; +} xy; + +The image is passed in as a block of data and dimensions, and the list of +corners is returned as an array of xy structs, and an integer (numcorners) +with the number of corners returned. The data can be deallocated with free(). +Nonmaximal suppression is performed on the corners. Note that the stride +is the number of bytes between rows. If your image has no padding, then this +is the same as xsize. + +The detection, scoring and nonmaximal suppression are available as individual +functions. To see how to use the individual functions, see fast.c + + diff --git a/extern/libmv/third_party/fast/README.libmv b/extern/libmv/third_party/fast/README.libmv new file mode 100644 index 00000000000..2110976dd14 --- /dev/null +++ b/extern/libmv/third_party/fast/README.libmv @@ -0,0 +1,9 @@ +Project: FAST (FAST Corner Detection) +URL: http://mi.eng.cam.ac.uk/~er258/work/fast-C-src/ +License: BSD +Upstream version: 2.1, released 12-Jan-2009 + +Local modifications: +- Created CMakeLists.txt for CMake build. +- Update CMakeLists to be sure that the library is a compatible with C++ linkage. +- Update CMakeLists to not include fast.h to compile fast library with VS2005. diff --git a/extern/libmv/third_party/fast/fast.c b/extern/libmv/third_party/fast/fast.c new file mode 100644 index 00000000000..c675f0af883 --- /dev/null +++ b/extern/libmv/third_party/fast/fast.c @@ -0,0 +1,71 @@ +#include <stdlib.h> +#include "fast.h" + + +xy* fast9_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners) +{ + xy* corners; + int num_corners; + int* scores; + xy* nonmax; + + corners = fast9_detect(im, xsize, ysize, stride, b, &num_corners); + scores = fast9_score(im, stride, corners, num_corners, b); + nonmax = nonmax_suppression(corners, scores, num_corners, ret_num_corners); + + free(corners); + free(scores); + + return nonmax; +} + +xy* fast10_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners) +{ + xy* corners; + int num_corners; + int* scores; + xy* nonmax; + + corners = fast10_detect(im, xsize, ysize, stride, b, &num_corners); + scores = fast10_score(im, stride, corners, num_corners, b); + nonmax = nonmax_suppression(corners, scores, num_corners, ret_num_corners); + + free(corners); + free(scores); + + return nonmax; +} + +xy* fast11_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners) +{ + xy* corners; + int num_corners; + int* scores; + xy* nonmax; + + corners = fast11_detect(im, xsize, ysize, stride, b, &num_corners); + scores = fast11_score(im, stride, corners, num_corners, b); + nonmax = nonmax_suppression(corners, scores, num_corners, ret_num_corners); + + free(corners); + free(scores); + + return nonmax; +} + +xy* fast12_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners) +{ + xy* corners; + int num_corners; + int* scores; + xy* nonmax; + + corners = fast12_detect(im, xsize, ysize, stride, b, &num_corners); + scores = fast12_score(im, stride, corners, num_corners, b); + nonmax = nonmax_suppression(corners, scores, num_corners, ret_num_corners); + + free(corners); + free(scores); + + return nonmax; +} diff --git a/extern/libmv/third_party/fast/fast.h b/extern/libmv/third_party/fast/fast.h new file mode 100644 index 00000000000..06fa90ec98c --- /dev/null +++ b/extern/libmv/third_party/fast/fast.h @@ -0,0 +1,39 @@ +#ifndef FAST_H +#define FAST_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { int x, y; } xy; +typedef unsigned char byte; + +int fast9_corner_score(const byte* p, const int pixel[], int bstart); +int fast10_corner_score(const byte* p, const int pixel[], int bstart); +int fast11_corner_score(const byte* p, const int pixel[], int bstart); +int fast12_corner_score(const byte* p, const int pixel[], int bstart); + +xy* fast9_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); +xy* fast10_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); +xy* fast11_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); +xy* fast12_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); + +int* fast9_score(const byte* i, int stride, xy* corners, int num_corners, int b); +int* fast10_score(const byte* i, int stride, xy* corners, int num_corners, int b); +int* fast11_score(const byte* i, int stride, xy* corners, int num_corners, int b); +int* fast12_score(const byte* i, int stride, xy* corners, int num_corners, int b); + + +xy* fast9_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); +xy* fast10_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); +xy* fast11_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); +xy* fast12_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); + +xy* nonmax_suppression(const xy* corners, const int* scores, int num_corners, int* ret_num_nonmax); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/extern/libmv/third_party/fast/fast_10.c b/extern/libmv/third_party/fast/fast_10.c new file mode 100644 index 00000000000..3af63869478 --- /dev/null +++ b/extern/libmv/third_party/fast/fast_10.c @@ -0,0 +1,4666 @@ +/*This is mechanically generated code*/ +#include <stdlib.h> + +typedef struct { int x, y; } xy; +typedef unsigned char byte; + +int fast10_corner_score(const byte* p, const int pixel[], int bstart) +{ + int bmin = bstart; + int bmax = 255; + int b = (bmax + bmin)/2; + + /*Compute the score using binary search*/ + for(;;) + { + int cb = *p + b; + int c_b= *p - b; + + + if( p[pixel[0]] > cb) + if( p[pixel[1]] > cb) + if( p[pixel[2]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + goto is_a_corner; + else + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[6]] < c_b) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[12]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[5]] < c_b) + if( p[pixel[15]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[11]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[11]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[4]] < c_b) + if( p[pixel[14]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[10]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[14]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[5]] < c_b) + goto is_a_corner; + else + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[10]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[5]] < c_b) + goto is_a_corner; + else + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[3]] < c_b) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[9]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + goto is_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[9]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + goto is_a_corner; + else + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[2]] < c_b) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + goto is_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + goto is_a_corner; + else + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[1]] < c_b) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[2]] < c_b) + goto is_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[2]] < c_b) + goto is_a_corner; + else + if( p[pixel[12]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[0]] < c_b) + if( p[pixel[1]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[2]] > cb) + goto is_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[1]] < c_b) + if( p[pixel[2]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + goto is_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[2]] < c_b) + if( p[pixel[3]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + goto is_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[3]] < c_b) + if( p[pixel[4]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[5]] > cb) + goto is_a_corner; + else + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[14]] < c_b) + if( p[pixel[10]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[4]] < c_b) + if( p[pixel[5]] > cb) + if( p[pixel[15]] < c_b) + if( p[pixel[11]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[5]] < c_b) + if( p[pixel[6]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + goto is_a_corner; + else + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[5]] > cb) + goto is_a_corner; + else + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[9]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + goto is_a_corner; + else + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[8]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + goto is_a_corner; + else + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[7]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[2]] > cb) + goto is_a_corner; + else + if( p[pixel[12]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[2]] > cb) + if( p[pixel[1]] > cb) + goto is_a_corner; + else + if( p[pixel[11]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[2]] < c_b) + if( p[pixel[1]] < c_b) + goto is_a_corner; + else + if( p[pixel[11]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + + is_a_corner: + bmin=b; + goto end_if; + + is_not_a_corner: + bmax=b; + goto end_if; + + end_if: + + if(bmin == bmax - 1 || bmin == bmax) + return bmin; + b = (bmin + bmax) / 2; + } +} + +static void make_offsets(int pixel[], int row_stride) +{ + pixel[0] = 0 + row_stride * 3; + pixel[1] = 1 + row_stride * 3; + pixel[2] = 2 + row_stride * 2; + pixel[3] = 3 + row_stride * 1; + pixel[4] = 3 + row_stride * 0; + pixel[5] = 3 + row_stride * -1; + pixel[6] = 2 + row_stride * -2; + pixel[7] = 1 + row_stride * -3; + pixel[8] = 0 + row_stride * -3; + pixel[9] = -1 + row_stride * -3; + pixel[10] = -2 + row_stride * -2; + pixel[11] = -3 + row_stride * -1; + pixel[12] = -3 + row_stride * 0; + pixel[13] = -3 + row_stride * 1; + pixel[14] = -2 + row_stride * 2; + pixel[15] = -1 + row_stride * 3; +} + + + +int* fast10_score(const byte* i, int stride, xy* corners, int num_corners, int b) +{ + int* scores = (int*)malloc(sizeof(int)* num_corners); + int n; + + int pixel[16]; + make_offsets(pixel, stride); + + for(n=0; n < num_corners; n++) + scores[n] = fast10_corner_score(i + corners[n].y*stride + corners[n].x, pixel, b); + + return scores; +} + + +xy* fast10_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners) +{ + int num_corners=0; + xy* ret_corners; + int rsize=512; + int pixel[16]; + int x, y; + + ret_corners = (xy*)malloc(sizeof(xy)*rsize); + make_offsets(pixel, stride); + + for(y=3; y < ysize - 3; y++) + for(x=3; x < xsize - 3; x++) + { + const byte* p = im + y*stride + x; + + int cb = *p + b; + int c_b= *p - b; + if(p[pixel[0]] > cb) + if(p[pixel[1]] > cb) + if(p[pixel[2]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + {} + else + if(p[pixel[15]] > cb) + {} + else + continue; + else + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else if(p[pixel[6]] < c_b) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else if(p[pixel[12]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[5]] < c_b) + if(p[pixel[15]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else if(p[pixel[11]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[11]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[4]] < c_b) + if(p[pixel[14]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[10]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[14]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[5]] < c_b) + {} + else + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[10]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[5]] < c_b) + {} + else + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[3]] < c_b) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[9]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + {} + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[9]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + {} + else + if(p[pixel[14]] < c_b) + {} + else + continue; + else + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[2]] < c_b) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + {} + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + {} + else + if(p[pixel[13]] < c_b) + {} + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[1]] < c_b) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[2]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[2]] < c_b) + {} + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[2]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[2]] < c_b) + {} + else + if(p[pixel[12]] < c_b) + {} + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[0]] < c_b) + if(p[pixel[1]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[2]] > cb) + {} + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[2]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[1]] < c_b) + if(p[pixel[2]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + {} + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[2]] < c_b) + if(p[pixel[3]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + {} + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[3]] < c_b) + if(p[pixel[4]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[5]] > cb) + {} + else + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[14]] < c_b) + if(p[pixel[10]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[4]] < c_b) + if(p[pixel[5]] > cb) + if(p[pixel[15]] < c_b) + if(p[pixel[11]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[5]] < c_b) + if(p[pixel[6]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + {} + else + if(p[pixel[15]] < c_b) + {} + else + continue; + else + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[5]] > cb) + {} + else + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[9]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + {} + else + if(p[pixel[14]] > cb) + {} + else + continue; + else + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[8]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + {} + else + if(p[pixel[13]] > cb) + {} + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[7]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[2]] > cb) + {} + else + if(p[pixel[12]] > cb) + {} + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[2]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[2]] > cb) + if(p[pixel[1]] > cb) + {} + else + if(p[pixel[11]] > cb) + {} + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[2]] < c_b) + if(p[pixel[1]] < c_b) + {} + else + if(p[pixel[11]] < c_b) + {} + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + if(num_corners == rsize) + { + rsize*=2; + ret_corners = (xy*)realloc(ret_corners, sizeof(xy)*rsize); + } + + ret_corners[num_corners].x = x; + ret_corners[num_corners].y = y; + num_corners++; + } + + *ret_num_corners = num_corners; + return ret_corners; + +} + + diff --git a/extern/libmv/third_party/fast/fast_11.c b/extern/libmv/third_party/fast/fast_11.c new file mode 100644 index 00000000000..b4af4309521 --- /dev/null +++ b/extern/libmv/third_party/fast/fast_11.c @@ -0,0 +1,3910 @@ +/*This is mechanically generated code*/ +#include <stdlib.h> + +typedef struct { int x, y; } xy; +typedef unsigned char byte; + +int fast11_corner_score(const byte* p, const int pixel[], int bstart) +{ + int bmin = bstart; + int bmax = 255; + int b = (bmax + bmin)/2; + + /*Compute the score using binary search*/ + for(;;) + { + int cb = *p + b; + int c_b= *p - b; + + + if( p[pixel[0]] > cb) + if( p[pixel[1]] > cb) + if( p[pixel[2]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + goto is_a_corner; + else + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[5]] < c_b) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[10]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[4]] < c_b) + if( p[pixel[15]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[9]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[9]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[3]] < c_b) + if( p[pixel[14]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[14]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[4]] < c_b) + goto is_a_corner; + else + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[4]] < c_b) + goto is_a_corner; + else + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[2]] < c_b) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + goto is_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + goto is_a_corner; + else + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[1]] < c_b) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[6]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[2]] < c_b) + goto is_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[6]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[2]] < c_b) + goto is_a_corner; + else + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[0]] < c_b) + if( p[pixel[1]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[2]] > cb) + goto is_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[1]] < c_b) + if( p[pixel[2]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + goto is_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[2]] < c_b) + if( p[pixel[3]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[4]] > cb) + goto is_a_corner; + else + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[14]] < c_b) + if( p[pixel[8]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[3]] < c_b) + if( p[pixel[4]] > cb) + if( p[pixel[15]] < c_b) + if( p[pixel[9]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[4]] < c_b) + if( p[pixel[5]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + goto is_a_corner; + else + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[9]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[8]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[4]] > cb) + goto is_a_corner; + else + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[7]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + goto is_a_corner; + else + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[2]] > cb) + goto is_a_corner; + else + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[2]] > cb) + if( p[pixel[1]] > cb) + goto is_a_corner; + else + if( p[pixel[12]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[2]] < c_b) + if( p[pixel[1]] < c_b) + goto is_a_corner; + else + if( p[pixel[12]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + + is_a_corner: + bmin=b; + goto end_if; + + is_not_a_corner: + bmax=b; + goto end_if; + + end_if: + + if(bmin == bmax - 1 || bmin == bmax) + return bmin; + b = (bmin + bmax) / 2; + } +} + +static void make_offsets(int pixel[], int row_stride) +{ + pixel[0] = 0 + row_stride * 3; + pixel[1] = 1 + row_stride * 3; + pixel[2] = 2 + row_stride * 2; + pixel[3] = 3 + row_stride * 1; + pixel[4] = 3 + row_stride * 0; + pixel[5] = 3 + row_stride * -1; + pixel[6] = 2 + row_stride * -2; + pixel[7] = 1 + row_stride * -3; + pixel[8] = 0 + row_stride * -3; + pixel[9] = -1 + row_stride * -3; + pixel[10] = -2 + row_stride * -2; + pixel[11] = -3 + row_stride * -1; + pixel[12] = -3 + row_stride * 0; + pixel[13] = -3 + row_stride * 1; + pixel[14] = -2 + row_stride * 2; + pixel[15] = -1 + row_stride * 3; +} + + + +int* fast11_score(const byte* i, int stride, xy* corners, int num_corners, int b) +{ + int* scores = (int*)malloc(sizeof(int)* num_corners); + int n; + + int pixel[16]; + make_offsets(pixel, stride); + + for(n=0; n < num_corners; n++) + scores[n] = fast11_corner_score(i + corners[n].y*stride + corners[n].x, pixel, b); + + return scores; +} + + +xy* fast11_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners) +{ + int num_corners=0; + xy* ret_corners; + int rsize=512; + int pixel[16]; + int x, y; + + ret_corners = (xy*)malloc(sizeof(xy)*rsize); + make_offsets(pixel, stride); + + for(y=3; y < ysize - 3; y++) + for(x=3; x < xsize - 3; x++) + { + const byte* p = im + y*stride + x; + + int cb = *p + b; + int c_b= *p - b; + if(p[pixel[0]] > cb) + if(p[pixel[1]] > cb) + if(p[pixel[2]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + {} + else + if(p[pixel[15]] > cb) + {} + else + continue; + else + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[5]] < c_b) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[10]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[4]] < c_b) + if(p[pixel[15]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[9]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[9]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[3]] < c_b) + if(p[pixel[14]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[14]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[4]] < c_b) + {} + else + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[4]] < c_b) + {} + else + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[2]] < c_b) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + {} + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + {} + else + if(p[pixel[14]] < c_b) + {} + else + continue; + else + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[1]] < c_b) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[2]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[6]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[2]] < c_b) + {} + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[2]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[6]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[2]] < c_b) + {} + else + if(p[pixel[13]] < c_b) + {} + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[0]] < c_b) + if(p[pixel[1]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[2]] > cb) + {} + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[2]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[1]] < c_b) + if(p[pixel[2]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + {} + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[2]] < c_b) + if(p[pixel[3]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[4]] > cb) + {} + else + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[14]] < c_b) + if(p[pixel[8]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[3]] < c_b) + if(p[pixel[4]] > cb) + if(p[pixel[15]] < c_b) + if(p[pixel[9]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[4]] < c_b) + if(p[pixel[5]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + {} + else + if(p[pixel[15]] < c_b) + {} + else + continue; + else + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[9]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[8]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[4]] > cb) + {} + else + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[7]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + {} + else + if(p[pixel[14]] > cb) + {} + else + continue; + else + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[6]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[2]] > cb) + {} + else + if(p[pixel[13]] > cb) + {} + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[2]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[2]] > cb) + if(p[pixel[1]] > cb) + {} + else + if(p[pixel[12]] > cb) + {} + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[2]] < c_b) + if(p[pixel[1]] < c_b) + {} + else + if(p[pixel[12]] < c_b) + {} + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + if(num_corners == rsize) + { + rsize*=2; + ret_corners = (xy*)realloc(ret_corners, sizeof(xy)*rsize); + } + + ret_corners[num_corners].x = x; + ret_corners[num_corners].y = y; + num_corners++; + } + + *ret_num_corners = num_corners; + return ret_corners; + +} + + diff --git a/extern/libmv/third_party/fast/fast_12.c b/extern/libmv/third_party/fast/fast_12.c new file mode 100644 index 00000000000..f73f68dd043 --- /dev/null +++ b/extern/libmv/third_party/fast/fast_12.c @@ -0,0 +1,3134 @@ +/*This is mechanically generated code*/ +#include <stdlib.h> + +typedef struct { int x, y; } xy; +typedef unsigned char byte; + +int fast12_corner_score(const byte* p, const int pixel[], int bstart) +{ + int bmin = bstart; + int bmax = 255; + int b = (bmax + bmin)/2; + + /*Compute the score using binary search*/ + for(;;) + { + int cb = *p + b; + int c_b= *p - b; + + + if( p[pixel[0]] > cb) + if( p[pixel[1]] > cb) + if( p[pixel[2]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + goto is_a_corner; + else + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[4]] < c_b) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[3]] < c_b) + if( p[pixel[15]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[2]] < c_b) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[6]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[3]] < c_b) + goto is_a_corner; + else + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[6]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[3]] < c_b) + goto is_a_corner; + else + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[1]] < c_b) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[2]] < c_b) + goto is_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[2]] < c_b) + goto is_a_corner; + else + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[0]] < c_b) + if( p[pixel[1]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[2]] > cb) + goto is_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[1]] < c_b) + if( p[pixel[2]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[3]] > cb) + goto is_a_corner; + else + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[2]] < c_b) + if( p[pixel[3]] > cb) + if( p[pixel[15]] < c_b) + if( p[pixel[7]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[3]] < c_b) + if( p[pixel[4]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + goto is_a_corner; + else + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[7]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[3]] > cb) + goto is_a_corner; + else + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[2]] > cb) + goto is_a_corner; + else + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[2]] > cb) + if( p[pixel[1]] > cb) + goto is_a_corner; + else + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[2]] < c_b) + if( p[pixel[1]] < c_b) + goto is_a_corner; + else + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + + is_a_corner: + bmin=b; + goto end_if; + + is_not_a_corner: + bmax=b; + goto end_if; + + end_if: + + if(bmin == bmax - 1 || bmin == bmax) + return bmin; + b = (bmin + bmax) / 2; + } +} + +static void make_offsets(int pixel[], int row_stride) +{ + pixel[0] = 0 + row_stride * 3; + pixel[1] = 1 + row_stride * 3; + pixel[2] = 2 + row_stride * 2; + pixel[3] = 3 + row_stride * 1; + pixel[4] = 3 + row_stride * 0; + pixel[5] = 3 + row_stride * -1; + pixel[6] = 2 + row_stride * -2; + pixel[7] = 1 + row_stride * -3; + pixel[8] = 0 + row_stride * -3; + pixel[9] = -1 + row_stride * -3; + pixel[10] = -2 + row_stride * -2; + pixel[11] = -3 + row_stride * -1; + pixel[12] = -3 + row_stride * 0; + pixel[13] = -3 + row_stride * 1; + pixel[14] = -2 + row_stride * 2; + pixel[15] = -1 + row_stride * 3; +} + + + +int* fast12_score(const byte* i, int stride, xy* corners, int num_corners, int b) +{ + int* scores = (int*)malloc(sizeof(int)* num_corners); + int n; + + int pixel[16]; + make_offsets(pixel, stride); + + for(n=0; n < num_corners; n++) + scores[n] = fast12_corner_score(i + corners[n].y*stride + corners[n].x, pixel, b); + + return scores; +} + + +xy* fast12_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners) +{ + int num_corners=0; + xy* ret_corners; + int rsize=512; + int pixel[16]; + int x, y; + + ret_corners = (xy*)malloc(sizeof(xy)*rsize); + make_offsets(pixel, stride); + + for(y=3; y < ysize - 3; y++) + for(x=3; x < xsize - 3; x++) + { + const byte* p = im + y*stride + x; + + int cb = *p + b; + int c_b= *p - b; + if(p[pixel[0]] > cb) + if(p[pixel[1]] > cb) + if(p[pixel[2]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + {} + else + if(p[pixel[15]] > cb) + {} + else + continue; + else + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[4]] < c_b) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[3]] < c_b) + if(p[pixel[15]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[2]] < c_b) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[6]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[3]] < c_b) + {} + else + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[6]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[3]] < c_b) + {} + else + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[1]] < c_b) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[2]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[2]] < c_b) + {} + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[2]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[2]] < c_b) + {} + else + if(p[pixel[14]] < c_b) + {} + else + continue; + else + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[0]] < c_b) + if(p[pixel[1]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[2]] > cb) + {} + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[2]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[1]] < c_b) + if(p[pixel[2]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[3]] > cb) + {} + else + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[2]] < c_b) + if(p[pixel[3]] > cb) + if(p[pixel[15]] < c_b) + if(p[pixel[7]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[3]] < c_b) + if(p[pixel[4]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + {} + else + if(p[pixel[15]] < c_b) + {} + else + continue; + else + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[7]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[6]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[3]] > cb) + {} + else + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[2]] > cb) + {} + else + if(p[pixel[14]] > cb) + {} + else + continue; + else + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[2]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[2]] > cb) + if(p[pixel[1]] > cb) + {} + else + if(p[pixel[13]] > cb) + {} + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[2]] < c_b) + if(p[pixel[1]] < c_b) + {} + else + if(p[pixel[13]] < c_b) + {} + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + if(num_corners == rsize) + { + rsize*=2; + ret_corners = (xy*)realloc(ret_corners, sizeof(xy)*rsize); + } + + ret_corners[num_corners].x = x; + ret_corners[num_corners].y = y; + num_corners++; + } + + *ret_num_corners = num_corners; + return ret_corners; + +} + + diff --git a/extern/libmv/third_party/fast/fast_9.c b/extern/libmv/third_party/fast/fast_9.c new file mode 100644 index 00000000000..6d33daeffbb --- /dev/null +++ b/extern/libmv/third_party/fast/fast_9.c @@ -0,0 +1,5910 @@ +/*This is mechanically generated code*/ +#include <stdlib.h> + +typedef struct { int x, y; } xy; +typedef unsigned char byte; + +int fast9_corner_score(const byte* p, const int pixel[], int bstart) +{ + int bmin = bstart; + int bmax = 255; + int b = (bmax + bmin)/2; + + /*Compute the score using binary search*/ + for(;;) + { + int cb = *p + b; + int c_b= *p - b; + + + if( p[pixel[0]] > cb) + if( p[pixel[1]] > cb) + if( p[pixel[2]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + goto is_a_corner; + else + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[14]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[6]] < c_b) + if( p[pixel[15]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[13]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[13]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[5]] < c_b) + if( p[pixel[14]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[12]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[14]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[12]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[6]] < c_b) + goto is_a_corner; + else + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[4]] < c_b) + if( p[pixel[13]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[11]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[12]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[13]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[5]] < c_b) + goto is_a_corner; + else + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[11]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[5]] < c_b) + goto is_a_corner; + else + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[3]] < c_b) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[10]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + goto is_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[10]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + goto is_a_corner; + else + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[2]] < c_b) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[9]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + goto is_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[9]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + goto is_a_corner; + else + if( p[pixel[12]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[1]] < c_b) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[2]] < c_b) + goto is_a_corner; + else + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[2]] < c_b) + goto is_a_corner; + else + if( p[pixel[11]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[0]] < c_b) + if( p[pixel[1]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[2]] > cb) + goto is_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[1]] < c_b) + if( p[pixel[2]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + goto is_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[2]] < c_b) + if( p[pixel[3]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + goto is_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[3]] < c_b) + if( p[pixel[4]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[5]] > cb) + goto is_a_corner; + else + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[13]] < c_b) + if( p[pixel[11]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[12]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[4]] < c_b) + if( p[pixel[5]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[14]] < c_b) + if( p[pixel[12]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[6]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[5]] < c_b) + if( p[pixel[6]] > cb) + if( p[pixel[15]] < c_b) + if( p[pixel[13]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[6]] < c_b) + if( p[pixel[7]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + goto is_a_corner; + else + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[6]] > cb) + goto is_a_corner; + else + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[5]] > cb) + goto is_a_corner; + else + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + goto is_a_corner; + else + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[9]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + goto is_a_corner; + else + if( p[pixel[12]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[8]] > cb) + if( p[pixel[7]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[10]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[2]] > cb) + goto is_a_corner; + else + if( p[pixel[11]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[2]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[7]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[7]] > cb) + if( p[pixel[8]] > cb) + if( p[pixel[9]] > cb) + if( p[pixel[6]] > cb) + if( p[pixel[5]] > cb) + if( p[pixel[4]] > cb) + if( p[pixel[3]] > cb) + if( p[pixel[2]] > cb) + if( p[pixel[1]] > cb) + goto is_a_corner; + else + if( p[pixel[10]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] > cb) + if( p[pixel[11]] > cb) + if( p[pixel[12]] > cb) + if( p[pixel[13]] > cb) + if( p[pixel[14]] > cb) + if( p[pixel[15]] > cb) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else if( p[pixel[7]] < c_b) + if( p[pixel[8]] < c_b) + if( p[pixel[9]] < c_b) + if( p[pixel[6]] < c_b) + if( p[pixel[5]] < c_b) + if( p[pixel[4]] < c_b) + if( p[pixel[3]] < c_b) + if( p[pixel[2]] < c_b) + if( p[pixel[1]] < c_b) + goto is_a_corner; + else + if( p[pixel[10]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + if( p[pixel[10]] < c_b) + if( p[pixel[11]] < c_b) + if( p[pixel[12]] < c_b) + if( p[pixel[13]] < c_b) + if( p[pixel[14]] < c_b) + if( p[pixel[15]] < c_b) + goto is_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + else + goto is_not_a_corner; + + is_a_corner: + bmin=b; + goto end_if; + + is_not_a_corner: + bmax=b; + goto end_if; + + end_if: + + if(bmin == bmax - 1 || bmin == bmax) + return bmin; + b = (bmin + bmax) / 2; + } +} + +static void make_offsets(int pixel[], int row_stride) +{ + pixel[0] = 0 + row_stride * 3; + pixel[1] = 1 + row_stride * 3; + pixel[2] = 2 + row_stride * 2; + pixel[3] = 3 + row_stride * 1; + pixel[4] = 3 + row_stride * 0; + pixel[5] = 3 + row_stride * -1; + pixel[6] = 2 + row_stride * -2; + pixel[7] = 1 + row_stride * -3; + pixel[8] = 0 + row_stride * -3; + pixel[9] = -1 + row_stride * -3; + pixel[10] = -2 + row_stride * -2; + pixel[11] = -3 + row_stride * -1; + pixel[12] = -3 + row_stride * 0; + pixel[13] = -3 + row_stride * 1; + pixel[14] = -2 + row_stride * 2; + pixel[15] = -1 + row_stride * 3; +} + + + +int* fast9_score(const byte* i, int stride, xy* corners, int num_corners, int b) +{ + int* scores = (int*)malloc(sizeof(int)* num_corners); + int n; + + int pixel[16]; + make_offsets(pixel, stride); + + for(n=0; n < num_corners; n++) + scores[n] = fast9_corner_score(i + corners[n].y*stride + corners[n].x, pixel, b); + + return scores; +} + + +xy* fast9_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners) +{ + int num_corners=0; + xy* ret_corners; + int rsize=512; + int pixel[16]; + int x, y; + + ret_corners = (xy*)malloc(sizeof(xy)*rsize); + make_offsets(pixel, stride); + + for(y=3; y < ysize - 3; y++) + for(x=3; x < xsize - 3; x++) + { + const byte* p = im + y*stride + x; + + int cb = *p + b; + int c_b= *p - b; + if(p[pixel[0]] > cb) + if(p[pixel[1]] > cb) + if(p[pixel[2]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + {} + else + if(p[pixel[15]] > cb) + {} + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else if(p[pixel[14]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else if(p[pixel[6]] < c_b) + if(p[pixel[15]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else if(p[pixel[13]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else if(p[pixel[13]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[5]] < c_b) + if(p[pixel[14]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[12]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[14]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[12]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[6]] < c_b) + {} + else + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[4]] < c_b) + if(p[pixel[13]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[11]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[12]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[13]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[5]] < c_b) + {} + else + if(p[pixel[14]] < c_b) + {} + else + continue; + else + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[11]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[5]] < c_b) + {} + else + if(p[pixel[14]] < c_b) + {} + else + continue; + else + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[3]] < c_b) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[10]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + {} + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[10]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + {} + else + if(p[pixel[13]] < c_b) + {} + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[2]] < c_b) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[9]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + {} + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[9]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + {} + else + if(p[pixel[12]] < c_b) + {} + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[1]] < c_b) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[2]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[2]] < c_b) + {} + else + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[2]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[2]] < c_b) + {} + else + if(p[pixel[11]] < c_b) + {} + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[0]] < c_b) + if(p[pixel[1]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[2]] > cb) + {} + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[2]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[1]] < c_b) + if(p[pixel[2]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + {} + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[2]] < c_b) + if(p[pixel[3]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + {} + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[3]] < c_b) + if(p[pixel[4]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[5]] > cb) + {} + else + if(p[pixel[14]] > cb) + {} + else + continue; + else + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[13]] < c_b) + if(p[pixel[11]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[12]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[4]] < c_b) + if(p[pixel[5]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[6]] > cb) + {} + else + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[14]] < c_b) + if(p[pixel[12]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[6]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[5]] < c_b) + if(p[pixel[6]] > cb) + if(p[pixel[15]] < c_b) + if(p[pixel[13]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[6]] < c_b) + if(p[pixel[7]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + {} + else + if(p[pixel[15]] < c_b) + {} + else + continue; + else + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[6]] > cb) + {} + else + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[5]] > cb) + {} + else + if(p[pixel[14]] > cb) + {} + else + continue; + else + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + {} + else + if(p[pixel[13]] > cb) + {} + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[9]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + {} + else + if(p[pixel[12]] > cb) + {} + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[8]] > cb) + if(p[pixel[7]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[10]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[2]] > cb) + {} + else + if(p[pixel[11]] > cb) + {} + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[2]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[7]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[7]] > cb) + if(p[pixel[8]] > cb) + if(p[pixel[9]] > cb) + if(p[pixel[6]] > cb) + if(p[pixel[5]] > cb) + if(p[pixel[4]] > cb) + if(p[pixel[3]] > cb) + if(p[pixel[2]] > cb) + if(p[pixel[1]] > cb) + {} + else + if(p[pixel[10]] > cb) + {} + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + {} + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] > cb) + if(p[pixel[11]] > cb) + if(p[pixel[12]] > cb) + if(p[pixel[13]] > cb) + if(p[pixel[14]] > cb) + if(p[pixel[15]] > cb) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else if(p[pixel[7]] < c_b) + if(p[pixel[8]] < c_b) + if(p[pixel[9]] < c_b) + if(p[pixel[6]] < c_b) + if(p[pixel[5]] < c_b) + if(p[pixel[4]] < c_b) + if(p[pixel[3]] < c_b) + if(p[pixel[2]] < c_b) + if(p[pixel[1]] < c_b) + {} + else + if(p[pixel[10]] < c_b) + {} + else + continue; + else + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + {} + else + continue; + else + continue; + else + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + if(p[pixel[10]] < c_b) + if(p[pixel[11]] < c_b) + if(p[pixel[12]] < c_b) + if(p[pixel[13]] < c_b) + if(p[pixel[14]] < c_b) + if(p[pixel[15]] < c_b) + {} + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + else + continue; + if(num_corners == rsize) + { + rsize*=2; + ret_corners = (xy*)realloc(ret_corners, sizeof(xy)*rsize); + } + ret_corners[num_corners].x = x; + ret_corners[num_corners].y = y; + num_corners++; + + } + + *ret_num_corners = num_corners; + return ret_corners; + +} + + diff --git a/extern/libmv/third_party/fast/nonmax.c b/extern/libmv/third_party/fast/nonmax.c new file mode 100644 index 00000000000..6ed0f580906 --- /dev/null +++ b/extern/libmv/third_party/fast/nonmax.c @@ -0,0 +1,117 @@ +#include <stdlib.h> +#include "fast.h" + + +#define Compare(X, Y) ((X)>=(Y)) + +xy* nonmax_suppression(const xy* corners, const int* scores, int num_corners, int* ret_num_nonmax) +{ + int num_nonmax=0; + int last_row; + int* row_start; + int i, j; + xy* ret_nonmax; + const int sz = (int)num_corners; + + /*Point above points (roughly) to the pixel above the one of interest, if there + is a feature there.*/ + int point_above = 0; + int point_below = 0; + + + if(num_corners < 1) + { + *ret_num_nonmax = 0; + return 0; + } + + ret_nonmax = (xy*)malloc(num_corners * sizeof(xy)); + + /* Find where each row begins + (the corners are output in raster scan order). A beginning of -1 signifies + that there are no corners on that row. */ + last_row = corners[num_corners-1].y; + row_start = (int*)malloc((last_row+1)*sizeof(int)); + + for(i=0; i < last_row+1; i++) + row_start[i] = -1; + + { + int prev_row = -1; + for(i=0; i< num_corners; i++) + if(corners[i].y != prev_row) + { + row_start[corners[i].y] = i; + prev_row = corners[i].y; + } + } + + + + for(i=0; i < sz; i++) + { + int score = scores[i]; + xy pos = corners[i]; + + /*Check left */ + if(i > 0) + if(corners[i-1].x == pos.x-1 && corners[i-1].y == pos.y && Compare(scores[i-1], score)) + continue; + + /*Check right*/ + if(i < (sz - 1)) + if(corners[i+1].x == pos.x+1 && corners[i+1].y == pos.y && Compare(scores[i+1], score)) + continue; + + /*Check above (if there is a valid row above)*/ + if(pos.y != 0 && row_start[pos.y - 1] != -1) + { + /*Make sure that current point_above is one + row above.*/ + if(corners[point_above].y < pos.y - 1) + point_above = row_start[pos.y-1]; + + /*Make point_above point to the first of the pixels above the current point, + if it exists.*/ + for(; corners[point_above].y < pos.y && corners[point_above].x < pos.x - 1; point_above++) + {} + + + for(j=point_above; corners[j].y < pos.y && corners[j].x <= pos.x + 1; j++) + { + int x = corners[j].x; + if( (x == pos.x - 1 || x ==pos.x || x == pos.x+1) && Compare(scores[j], score)) + goto cont; + } + + } + + /*Check below (if there is anything below)*/ + if(pos.y != last_row && row_start[pos.y + 1] != -1 && point_below < sz) /*Nothing below*/ + { + if(corners[point_below].y < pos.y + 1) + point_below = row_start[pos.y+1]; + + /* Make point below point to one of the pixels belowthe current point, if it + exists.*/ + for(; point_below < sz && corners[point_below].y == pos.y+1 && corners[point_below].x < pos.x - 1; point_below++) + {} + + for(j=point_below; j < sz && corners[j].y == pos.y+1 && corners[j].x <= pos.x + 1; j++) + { + int x = corners[j].x; + if( (x == pos.x - 1 || x ==pos.x || x == pos.x+1) && Compare(scores[j],score)) + goto cont; + } + } + + ret_nonmax[num_nonmax++] = corners[i]; + cont: + ; + } + + free(row_start); + *ret_num_nonmax = num_nonmax; + return ret_nonmax; +} + diff --git a/extern/libmv/third_party/gflags/README.libmv b/extern/libmv/third_party/gflags/README.libmv new file mode 100644 index 00000000000..f2bdef6563e --- /dev/null +++ b/extern/libmv/third_party/gflags/README.libmv @@ -0,0 +1,14 @@ +Project: Google Flags +URL: http://code.google.com/p/google-gflags/ +License: New BSD +Upstream version: 1.5 +Local modifications: + +- Flattened the tree and only included files needed for libmv. This involved + changing some of the includes to point to the current directory instead of a + nested gflags directory. + +- Added a poor-man's version of upstream's port.cc/h to make gflags compile on + windows. This isn't sufficient but is a stopgap for now. + + TODO(keir): Import and use gflags for Windows from upstream. diff --git a/extern/libmv/third_party/gflags/config.h b/extern/libmv/third_party/gflags/config.h new file mode 100644 index 00000000000..ca2c1276c44 --- /dev/null +++ b/extern/libmv/third_party/gflags/config.h @@ -0,0 +1,110 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Always the empty-string on non-windows systems. On windows, should be + "__declspec(dllexport)". This way, when we compile the dll, we export our + functions/classes. It's safe to define this here because config.h is only + used internally, to compile the DLL, and every DLL source file #includes + "config.h" before anything else. */ +#define GFLAGS_DLL_DECL /**/ + +/* Namespace for Google classes */ +#define GOOGLE_NAMESPACE ::google + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the <fnmatch.h> header file. */ +#undef HAVE_FNMATCH_H + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* define if the compiler implements namespaces */ +#define HAVE_NAMESPACES 1 + +/* Define if you have POSIX threads libraries and header files. */ +#define HAVE_PTHREAD 1 + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the `setenv' function. */ +#define HAVE_SETENV 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + +/* Define to 1 if you have the `strtoq' function. */ +#define HAVE_STRTOQ 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* define if your compiler has __attribute__ */ +#define HAVE___ATTRIBUTE__ 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "gflags" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "opensource@google.com" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "gflags" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "gflags 1.5" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "gflags" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.5" + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* the namespace where STL code like vector<> is defined */ +#define STL_NAMESPACE std + +/* Version number of package */ +#define VERSION "1.5" + +/* Stops putting the code inside the Google namespace */ +#define _END_GOOGLE_NAMESPACE_ } + +/* Puts following code inside the Google namespace */ +#define _START_GOOGLE_NAMESPACE_ namespace google { diff --git a/extern/libmv/third_party/gflags/gflags.cc b/extern/libmv/third_party/gflags/gflags.cc new file mode 100644 index 00000000000..34fe95dac59 --- /dev/null +++ b/extern/libmv/third_party/gflags/gflags.cc @@ -0,0 +1,1971 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// --- +// Author: Ray Sidney +// Revamped and reorganized by Craig Silverstein +// +// This file contains the implementation of all our command line flags +// stuff. Here's how everything fits together +// +// * FlagRegistry owns CommandLineFlags owns FlagValue. +// * FlagSaver holds a FlagRegistry (saves it at construct time, +// restores it at destroy time). +// * CommandLineFlagParser lives outside that hierarchy, but works on +// CommandLineFlags (modifying the FlagValues). +// * Free functions like SetCommandLineOption() work via one of the +// above (such as CommandLineFlagParser). +// +// In more detail: +// +// -- The main classes that hold flag data: +// +// FlagValue holds the current value of a flag. It's +// pseudo-templatized: every operation on a FlagValue is typed. It +// also deals with storage-lifetime issues (so flag values don't go +// away in a destructor), which is why we need a whole class to hold a +// variable's value. +// +// CommandLineFlag is all the information about a single command-line +// flag. It has a FlagValue for the flag's current value, but also +// the flag's name, type, etc. +// +// FlagRegistry is a collection of CommandLineFlags. There's the +// global registry, which is where flags defined via DEFINE_foo() +// live. But it's possible to define your own flag, manually, in a +// different registry you create. (In practice, multiple registries +// are used only by FlagSaver). +// +// A given FlagValue is owned by exactly one CommandLineFlag. A given +// CommandLineFlag is owned by exactly one FlagRegistry. FlagRegistry +// has a lock; any operation that writes to a FlagValue or +// CommandLineFlag owned by that registry must acquire the +// FlagRegistry lock before doing so. +// +// --- Some other classes and free functions: +// +// CommandLineFlagInfo is a client-exposed version of CommandLineFlag. +// Once it's instantiated, it has no dependencies or relationships +// with any other part of this file. +// +// FlagRegisterer is the helper class used by the DEFINE_* macros to +// allow work to be done at global initialization time. +// +// CommandLineFlagParser is the class that reads from the commandline +// and instantiates flag values based on that. It needs to poke into +// the innards of the FlagValue->CommandLineFlag->FlagRegistry class +// hierarchy to do that. It's careful to acquire the FlagRegistry +// lock before doing any writing or other non-const actions. +// +// GetCommandLineOption is just a hook into registry routines to +// retrieve a flag based on its name. SetCommandLineOption, on the +// other hand, hooks into CommandLineFlagParser. Other API functions +// are, similarly, mostly hooks into the functionality described above. + +#include "config.h" +// This comes first to ensure we define __STDC_FORMAT_MACROS in time. +#ifdef HAVE_INTTYPES_H +#ifndef __STDC_FORMAT_MACROS +# define __STDC_FORMAT_MACROS 1 // gcc requires this to get PRId64, etc. +#endif +#include <inttypes.h> +#endif // HAVE_INTTYPES_H +#include <stdio.h> // for snprintf +#include <ctype.h> +#include <errno.h> +#include <stdio.h> +#include <stdarg.h> // For va_list and related operations +#include <string.h> +#include <assert.h> +#ifdef HAVE_FNMATCH_H +#include <fnmatch.h> +#endif // HAVE_FNMATCH_H +#include <string> +#include <map> +#include <vector> +#include <utility> // for pair<> +#include <algorithm> +#include "gflags.h" +#include "mutex.h" + +#ifndef PATH_SEPARATOR +#define PATH_SEPARATOR '/' +#endif + +// Work properly if either strtoll or strtoq is on this system +#ifdef HAVE_STRTOLL +# define strtoint64 strtoll +# define strtouint64 strtoull +#elif HAVE_STRTOQ +# define strtoint64 strtoq +# define strtouint64 strtouq +#else +// Neither strtoll nor strtoq are defined. I hope strtol works! +# define strtoint64 strtol +# define strtouint64 strtoul +#endif + +// If we have inttypes.h, it will have defined PRId32/etc for us. If +// not, take our best guess. +#ifndef PRId32 +# define PRId32 "d" +#endif +#ifndef PRId64 +# define PRId64 "lld" +#endif +#ifndef PRIu64 +# define PRIu64 "llu" +#endif + +// Windows is missing random bits like strcasecmp, strtoll, strtoull, and +// snprintf in the usual locations. Put them somewhere sensible. +// +// TODO(keir): Get the upstream Windows port and use that instead. +#ifdef _MSC_VER +# define snprintf _snprintf +# undef strtoint64 +# define strtoint64 _strtoi64 +# undef strtouint64 +# define strtouint64 _strtoui64 +# define strcasecmp _stricmp +#endif + +typedef signed char int8; +typedef unsigned char uint8; + +// Special flags, type 1: the 'recursive' flags. They set another flag's val. +DEFINE_string(flagfile, "", + "load flags from file"); +DEFINE_string(fromenv, "", + "set flags from the environment" + " [use 'export FLAGS_flag1=value']"); +DEFINE_string(tryfromenv, "", + "set flags from the environment if present"); + +// Special flags, type 2: the 'parsing' flags. They modify how we parse. +DEFINE_string(undefok, "", + "comma-separated list of flag names that it is okay to specify " + "on the command line even if the program does not define a flag " + "with that name. IMPORTANT: flags in this list that have " + "arguments MUST use the flag=value format"); + +_START_GOOGLE_NAMESPACE_ + +using std::map; +using std::pair; +using std::sort; +using std::string; +using std::vector; + +// The help message indicating that the commandline flag has been +// 'stripped'. It will not show up when doing "-help" and its +// variants. The flag is stripped if STRIP_FLAG_HELP is set to 1 +// before including gflags/gflags.h. + +// This is used by this file, and also in commandlineflags_reporting.cc +const char kStrippedFlagHelp[] = "\001\002\003\004 (unknown) \004\003\002\001"; + +// This is used by the unittest to test error-exit code +void GFLAGS_DLL_DECL (*commandlineflags_exitfunc)(int) = &exit; // from stdlib.h + +namespace { + +// There are also 'reporting' flags, in commandlineflags_reporting.cc. + +static const char kError[] = "ERROR: "; + +// Indicates that undefined options are to be ignored. +// Enables deferred processing of flags in dynamically loaded libraries. +static bool allow_command_line_reparsing = false; + +static bool logging_is_probably_set_up = false; + +// This is a 'prototype' validate-function. 'Real' validate +// functions, take a flag-value as an argument: ValidateFn(bool) or +// ValidateFn(uint64). However, for easier storage, we strip off this +// argument and then restore it when actually calling the function on +// a flag value. +typedef bool (*ValidateFnProto)(); + +// Whether we should die when reporting an error. +enum DieWhenReporting { DIE, DO_NOT_DIE }; + +// Report Error and exit if requested. +static void ReportError(DieWhenReporting should_die, const char* format, ...) { + va_list ap; + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + if (should_die == DIE) + commandlineflags_exitfunc(1); // almost certainly exit() +} + + +// -------------------------------------------------------------------- +// FlagValue +// This represent the value a single flag might have. The major +// functionality is to convert from a string to an object of a +// given type, and back. Thread-compatible. +// -------------------------------------------------------------------- + +class CommandLineFlag; +class FlagValue { + public: + FlagValue(void* valbuf, const char* type, bool transfer_ownership_of_value); + ~FlagValue(); + + bool ParseFrom(const char* spec); + string ToString() const; + + private: + friend class CommandLineFlag; // for many things, including Validate() + friend class GOOGLE_NAMESPACE::FlagSaverImpl; // calls New() + friend class FlagRegistry; // checks value_buffer_ for flags_by_ptr_ map + template <typename T> friend T GetFromEnv(const char*, const char*, T); + friend bool TryParseLocked(const CommandLineFlag*, FlagValue*, + const char*, string*); // for New(), CopyFrom() + + enum ValueType { + FV_BOOL = 0, + FV_INT32 = 1, + FV_INT64 = 2, + FV_UINT64 = 3, + FV_DOUBLE = 4, + FV_STRING = 5, + FV_MAX_INDEX = 5, + }; + const char* TypeName() const; + bool Equal(const FlagValue& x) const; + FlagValue* New() const; // creates a new one with default value + void CopyFrom(const FlagValue& x); + int ValueSize() const; + + // Calls the given validate-fn on value_buffer_, and returns + // whatever it returns. But first casts validate_fn_proto to a + // function that takes our value as an argument (eg void + // (*validate_fn)(bool) for a bool flag). + bool Validate(const char* flagname, ValidateFnProto validate_fn_proto) const; + + void* value_buffer_; // points to the buffer holding our data + int8 type_; // how to interpret value_ + bool owns_value_; // whether to free value on destruct + + FlagValue(const FlagValue&); // no copying! + void operator=(const FlagValue&); +}; + + +// This could be a templated method of FlagValue, but doing so adds to the +// size of the .o. Since there's no type-safety here anyway, macro is ok. +#define VALUE_AS(type) *reinterpret_cast<type*>(value_buffer_) +#define OTHER_VALUE_AS(fv, type) *reinterpret_cast<type*>(fv.value_buffer_) +#define SET_VALUE_AS(type, value) VALUE_AS(type) = (value) + +FlagValue::FlagValue(void* valbuf, const char* type, + bool transfer_ownership_of_value) + : value_buffer_(valbuf), + owns_value_(transfer_ownership_of_value) { + for (type_ = 0; type_ <= FV_MAX_INDEX; ++type_) { + if (!strcmp(type, TypeName())) { + break; + } + } + assert(type_ <= FV_MAX_INDEX); // Unknown typename +} + +FlagValue::~FlagValue() { + if (!owns_value_) { + return; + } + switch (type_) { + case FV_BOOL: delete reinterpret_cast<bool*>(value_buffer_); break; + case FV_INT32: delete reinterpret_cast<int32*>(value_buffer_); break; + case FV_INT64: delete reinterpret_cast<int64*>(value_buffer_); break; + case FV_UINT64: delete reinterpret_cast<uint64*>(value_buffer_); break; + case FV_DOUBLE: delete reinterpret_cast<double*>(value_buffer_); break; + case FV_STRING: delete reinterpret_cast<string*>(value_buffer_); break; + } +} + +bool FlagValue::ParseFrom(const char* value) { + if (type_ == FV_BOOL) { + const char* kTrue[] = { "1", "t", "true", "y", "yes" }; + const char* kFalse[] = { "0", "f", "false", "n", "no" }; + for (size_t i = 0; i < sizeof(kTrue)/sizeof(*kTrue); ++i) { + if (strcasecmp(value, kTrue[i]) == 0) { + SET_VALUE_AS(bool, true); + return true; + } else if (strcasecmp(value, kFalse[i]) == 0) { + SET_VALUE_AS(bool, false); + return true; + } + } + return false; // didn't match a legal input + + } else if (type_ == FV_STRING) { + SET_VALUE_AS(string, value); + return true; + } + + // OK, it's likely to be numeric, and we'll be using a strtoXXX method. + if (value[0] == '\0') // empty-string is only allowed for string type. + return false; + char* end; + // Leading 0x puts us in base 16. But leading 0 does not put us in base 8! + // It caused too many bugs when we had that behavior. + int base = 10; // by default + if (value[0] == '0' && (value[1] == 'x' || value[1] == 'X')) + base = 16; + errno = 0; + + switch (type_) { + case FV_INT32: { + const int64 r = strtoint64(value, &end, base); + if (errno || end != value + strlen(value)) return false; // bad parse + if (static_cast<int32>(r) != r) // worked, but number out of range + return false; + SET_VALUE_AS(int32, static_cast<int32>(r)); + return true; + } + case FV_INT64: { + const int64 r = strtoint64(value, &end, base); + if (errno || end != value + strlen(value)) return false; // bad parse + SET_VALUE_AS(int64, r); + return true; + } + case FV_UINT64: { + while (*value == ' ') value++; + if (*value == '-') return false; // negative number + const uint64 r = strtouint64(value, &end, base); + if (errno || end != value + strlen(value)) return false; // bad parse + SET_VALUE_AS(uint64, r); + return true; + } + case FV_DOUBLE: { + const double r = strtod(value, &end); + if (errno || end != value + strlen(value)) return false; // bad parse + SET_VALUE_AS(double, r); + return true; + } + default: { + assert(false); // unknown type + return false; + } + } +} + +string FlagValue::ToString() const { + char intbuf[64]; // enough to hold even the biggest number + switch (type_) { + case FV_BOOL: + return VALUE_AS(bool) ? "true" : "false"; + case FV_INT32: + snprintf(intbuf, sizeof(intbuf), "%"PRId32, VALUE_AS(int32)); + return intbuf; + case FV_INT64: + snprintf(intbuf, sizeof(intbuf), "%"PRId64, VALUE_AS(int64)); + return intbuf; + case FV_UINT64: + snprintf(intbuf, sizeof(intbuf), "%"PRIu64, VALUE_AS(uint64)); + return intbuf; + case FV_DOUBLE: + snprintf(intbuf, sizeof(intbuf), "%.17g", VALUE_AS(double)); + return intbuf; + case FV_STRING: + return VALUE_AS(string); + default: + assert(false); + return ""; // unknown type + } +} + +bool FlagValue::Validate(const char* flagname, + ValidateFnProto validate_fn_proto) const { + switch (type_) { + case FV_BOOL: + return reinterpret_cast<bool (*)(const char*, bool)>( + validate_fn_proto)(flagname, VALUE_AS(bool)); + case FV_INT32: + return reinterpret_cast<bool (*)(const char*, int32)>( + validate_fn_proto)(flagname, VALUE_AS(int32)); + case FV_INT64: + return reinterpret_cast<bool (*)(const char*, int64)>( + validate_fn_proto)(flagname, VALUE_AS(int64)); + case FV_UINT64: + return reinterpret_cast<bool (*)(const char*, uint64)>( + validate_fn_proto)(flagname, VALUE_AS(uint64)); + case FV_DOUBLE: + return reinterpret_cast<bool (*)(const char*, double)>( + validate_fn_proto)(flagname, VALUE_AS(double)); + case FV_STRING: + return reinterpret_cast<bool (*)(const char*, const string&)>( + validate_fn_proto)(flagname, VALUE_AS(string)); + default: + assert(false); // unknown type + return false; + } +} + +const char* FlagValue::TypeName() const { + static const char types[] = + "bool\0xx" + "int32\0x" + "int64\0x" + "uint64\0" + "double\0" + "string"; + if (type_ > FV_MAX_INDEX) { + assert(false); + return ""; + } + // Directly indexing the strigns in the 'types' string, each of them + // is 7 bytes long. + return &types[type_ * 7]; +} + +bool FlagValue::Equal(const FlagValue& x) const { + if (type_ != x.type_) + return false; + switch (type_) { + case FV_BOOL: return VALUE_AS(bool) == OTHER_VALUE_AS(x, bool); + case FV_INT32: return VALUE_AS(int32) == OTHER_VALUE_AS(x, int32); + case FV_INT64: return VALUE_AS(int64) == OTHER_VALUE_AS(x, int64); + case FV_UINT64: return VALUE_AS(uint64) == OTHER_VALUE_AS(x, uint64); + case FV_DOUBLE: return VALUE_AS(double) == OTHER_VALUE_AS(x, double); + case FV_STRING: return VALUE_AS(string) == OTHER_VALUE_AS(x, string); + default: assert(false); return false; // unknown type + } +} + +FlagValue* FlagValue::New() const { + const char *type = TypeName(); + switch (type_) { + case FV_BOOL: return new FlagValue(new bool(false), type, true); + case FV_INT32: return new FlagValue(new int32(0), type, true); + case FV_INT64: return new FlagValue(new int64(0), type, true); + case FV_UINT64: return new FlagValue(new uint64(0), type, true); + case FV_DOUBLE: return new FlagValue(new double(0.0), type, true); + case FV_STRING: return new FlagValue(new string, type, true); + default: assert(false); return NULL; // unknown type + } +} + +void FlagValue::CopyFrom(const FlagValue& x) { + assert(type_ == x.type_); + switch (type_) { + case FV_BOOL: SET_VALUE_AS(bool, OTHER_VALUE_AS(x, bool)); break; + case FV_INT32: SET_VALUE_AS(int32, OTHER_VALUE_AS(x, int32)); break; + case FV_INT64: SET_VALUE_AS(int64, OTHER_VALUE_AS(x, int64)); break; + case FV_UINT64: SET_VALUE_AS(uint64, OTHER_VALUE_AS(x, uint64)); break; + case FV_DOUBLE: SET_VALUE_AS(double, OTHER_VALUE_AS(x, double)); break; + case FV_STRING: SET_VALUE_AS(string, OTHER_VALUE_AS(x, string)); break; + default: assert(false); // unknown type + } +} + +int FlagValue::ValueSize() const { + if (type_ > FV_MAX_INDEX) { + assert(false); // unknown type + return 0; + } + static const uint8 valuesize[] = { + sizeof(bool), + sizeof(int32), + sizeof(int64), + sizeof(uint64), + sizeof(double), + sizeof(string), + }; + return valuesize[type_]; +} + +// -------------------------------------------------------------------- +// CommandLineFlag +// This represents a single flag, including its name, description, +// default value, and current value. Mostly this serves as a +// struct, though it also knows how to register itself. +// All CommandLineFlags are owned by a (exactly one) +// FlagRegistry. If you wish to modify fields in this class, you +// should acquire the FlagRegistry lock for the registry that owns +// this flag. +// -------------------------------------------------------------------- + +class CommandLineFlag { + public: + // Note: we take over memory-ownership of current_val and default_val. + CommandLineFlag(const char* name, const char* help, const char* filename, + FlagValue* current_val, FlagValue* default_val); + ~CommandLineFlag(); + + const char* name() const { return name_; } + const char* help() const { return help_; } + const char* filename() const { return file_; } + const char* CleanFileName() const; // nixes irrelevant prefix such as homedir + string current_value() const { return current_->ToString(); } + string default_value() const { return defvalue_->ToString(); } + const char* type_name() const { return defvalue_->TypeName(); } + ValidateFnProto validate_function() const { return validate_fn_proto_; } + + void FillCommandLineFlagInfo(struct CommandLineFlagInfo* result); + + // If validate_fn_proto_ is non-NULL, calls it on value, returns result. + bool Validate(const FlagValue& value) const; + bool ValidateCurrent() const { return Validate(*current_); } + + private: + // for SetFlagLocked() and setting flags_by_ptr_ + friend class FlagRegistry; + friend class GOOGLE_NAMESPACE::FlagSaverImpl; // for cloning the values + // set validate_fn + friend bool AddFlagValidator(const void*, ValidateFnProto); + + // This copies all the non-const members: modified, processed, defvalue, etc. + void CopyFrom(const CommandLineFlag& src); + + void UpdateModifiedBit(); + + const char* const name_; // Flag name + const char* const help_; // Help message + const char* const file_; // Which file did this come from? + bool modified_; // Set after default assignment? + FlagValue* defvalue_; // Default value for flag + FlagValue* current_; // Current value for flag + // This is a casted, 'generic' version of validate_fn, which actually + // takes a flag-value as an arg (void (*validate_fn)(bool), say). + // When we pass this to current_->Validate(), it will cast it back to + // the proper type. This may be NULL to mean we have no validate_fn. + ValidateFnProto validate_fn_proto_; + + CommandLineFlag(const CommandLineFlag&); // no copying! + void operator=(const CommandLineFlag&); +}; + +CommandLineFlag::CommandLineFlag(const char* name, const char* help, + const char* filename, + FlagValue* current_val, FlagValue* default_val) + : name_(name), help_(help), file_(filename), modified_(false), + defvalue_(default_val), current_(current_val), validate_fn_proto_(NULL) { +} + +CommandLineFlag::~CommandLineFlag() { + delete current_; + delete defvalue_; +} + +const char* CommandLineFlag::CleanFileName() const { + // Compute top-level directory & file that this appears in + // search full path backwards. + // Stop going backwards at kRootDir; and skip by the first slash. + static const char kRootDir[] = ""; // can set this to root directory, + // e.g. "myproject" + + if (sizeof(kRootDir)-1 == 0) // no prefix to strip + return filename(); + + const char* clean_name = filename() + strlen(filename()) - 1; + while ( clean_name > filename() ) { + if (*clean_name == PATH_SEPARATOR) { + if (strncmp(clean_name, kRootDir, sizeof(kRootDir)-1) == 0) { + // ".../myproject/base/logging.cc" ==> "base/logging.cc" + clean_name += sizeof(kRootDir)-1; // past "/myproject/" + break; + } + } + --clean_name; + } + while ( *clean_name == PATH_SEPARATOR ) ++clean_name; // Skip any slashes + return clean_name; +} + +void CommandLineFlag::FillCommandLineFlagInfo( + CommandLineFlagInfo* result) { + result->name = name(); + result->type = type_name(); + result->description = help(); + result->current_value = current_value(); + result->default_value = default_value(); + result->filename = CleanFileName(); + UpdateModifiedBit(); + result->is_default = !modified_; + result->has_validator_fn = validate_function() != NULL; +} + +void CommandLineFlag::UpdateModifiedBit() { + // Update the "modified" bit in case somebody bypassed the + // Flags API and wrote directly through the FLAGS_name variable. + if (!modified_ && !current_->Equal(*defvalue_)) { + modified_ = true; + } +} + +void CommandLineFlag::CopyFrom(const CommandLineFlag& src) { + // Note we only copy the non-const members; others are fixed at construct time + if (modified_ != src.modified_) modified_ = src.modified_; + if (!current_->Equal(*src.current_)) current_->CopyFrom(*src.current_); + if (!defvalue_->Equal(*src.defvalue_)) defvalue_->CopyFrom(*src.defvalue_); + if (validate_fn_proto_ != src.validate_fn_proto_) + validate_fn_proto_ = src.validate_fn_proto_; +} + +bool CommandLineFlag::Validate(const FlagValue& value) const { + if (validate_function() == NULL) + return true; + else + return value.Validate(name(), validate_function()); +} + + +// -------------------------------------------------------------------- +// FlagRegistry +// A FlagRegistry singleton object holds all flag objects indexed +// by their names so that if you know a flag's name (as a C +// string), you can access or set it. If the function is named +// FooLocked(), you must own the registry lock before calling +// the function; otherwise, you should *not* hold the lock, and +// the function will acquire it itself if needed. +// -------------------------------------------------------------------- + +struct StringCmp { // Used by the FlagRegistry map class to compare char*'s + bool operator() (const char* s1, const char* s2) const { + return (strcmp(s1, s2) < 0); + } +}; + +class FlagRegistry { + public: + FlagRegistry() { } + ~FlagRegistry() { + for (FlagMap::iterator p = flags_.begin(), e = flags_.end(); p != e; ++p) { + CommandLineFlag* flag = p->second; + delete flag; + } + } + + static void DeleteGlobalRegistry() { + delete global_registry_; + global_registry_ = NULL; + } + + void Lock() { lock_.Lock(); } + void Unlock() { lock_.Unlock(); } + + // Store a flag in this registry. Takes ownership of the given pointer. + void RegisterFlag(CommandLineFlag* flag); + + // Returns the flag object for the specified name, or NULL if not found. + CommandLineFlag* FindFlagLocked(const char* name); + + // Returns the flag object whose current-value is stored at flag_ptr. + // That is, for whom current_->value_buffer_ == flag_ptr + CommandLineFlag* FindFlagViaPtrLocked(const void* flag_ptr); + + // A fancier form of FindFlag that works correctly if name is of the + // form flag=value. In that case, we set key to point to flag, and + // modify v to point to the value (if present), and return the flag + // with the given name. If the flag does not exist, returns NULL + // and sets error_message. + CommandLineFlag* SplitArgumentLocked(const char* argument, + string* key, const char** v, + string* error_message); + + // Set the value of a flag. If the flag was successfully set to + // value, set msg to indicate the new flag-value, and return true. + // Otherwise, set msg to indicate the error, leave flag unchanged, + // and return false. msg can be NULL. + bool SetFlagLocked(CommandLineFlag* flag, const char* value, + FlagSettingMode set_mode, string* msg); + + static FlagRegistry* GlobalRegistry(); // returns a singleton registry + + private: + friend class GOOGLE_NAMESPACE::FlagSaverImpl; // reads all the flags in order to copy them + friend class CommandLineFlagParser; // for ValidateAllFlags + friend void GOOGLE_NAMESPACE::GetAllFlags(vector<CommandLineFlagInfo>*); + + // The map from name to flag, for FindFlagLocked(). + typedef map<const char*, CommandLineFlag*, StringCmp> FlagMap; + typedef FlagMap::iterator FlagIterator; + typedef FlagMap::const_iterator FlagConstIterator; + FlagMap flags_; + + // The map from current-value pointer to flag, fo FindFlagViaPtrLocked(). + typedef map<const void*, CommandLineFlag*> FlagPtrMap; + FlagPtrMap flags_by_ptr_; + + Mutex lock_; + + static FlagRegistry* global_registry_; // a singleton registry + static Mutex global_registry_lock_; // guards creation of global_registry_ + + // Disallow + FlagRegistry(const FlagRegistry&); + FlagRegistry& operator=(const FlagRegistry&); +}; + +FlagRegistry* FlagRegistry::global_registry_ = NULL; +Mutex FlagRegistry::global_registry_lock_(Mutex::LINKER_INITIALIZED); + +FlagRegistry* FlagRegistry::GlobalRegistry() { + MutexLock acquire_lock(&global_registry_lock_); + if (!global_registry_) { + global_registry_ = new FlagRegistry; + } + return global_registry_; +} + +void FlagRegistry::RegisterFlag(CommandLineFlag* flag) { + Lock(); + pair<FlagIterator, bool> ins = + flags_.insert(pair<const char*, CommandLineFlag*>(flag->name(), flag)); + if (ins.second == false) { // means the name was already in the map + if (strcmp(ins.first->second->filename(), flag->filename()) != 0) { + ReportError(DIE, "ERROR: flag '%s' was defined more than once " + "(in files '%s' and '%s').\n", + flag->name(), + ins.first->second->filename(), + flag->filename()); + } else { + ReportError(DIE, "ERROR: something wrong with flag '%s' in file '%s'. " + "One possibility: file '%s' is being linked both statically " + "and dynamically into this executable.\n", + flag->name(), + flag->filename(), flag->filename()); + } + } + // Also add to the flags_by_ptr_ map. + flags_by_ptr_[flag->current_->value_buffer_] = flag; + Unlock(); +} + +CommandLineFlag* FlagRegistry::FindFlagLocked(const char* name) { + FlagConstIterator i = flags_.find(name); + if (i == flags_.end()) { + return NULL; + } else { + return i->second; + } +} + +CommandLineFlag* FlagRegistry::FindFlagViaPtrLocked(const void* flag_ptr) { + FlagPtrMap::const_iterator i = flags_by_ptr_.find(flag_ptr); + if (i == flags_by_ptr_.end()) { + return NULL; + } else { + return i->second; + } +} + +CommandLineFlag* FlagRegistry::SplitArgumentLocked(const char* arg, + string* key, + const char** v, + string* error_message) { + // Find the flag object for this option + const char* flag_name; + const char* value = strchr(arg, '='); + if (value == NULL) { + key->assign(arg); + *v = NULL; + } else { + // Strip out the "=value" portion from arg + key->assign(arg, value-arg); + *v = ++value; // advance past the '=' + } + flag_name = key->c_str(); + + CommandLineFlag* flag = FindFlagLocked(flag_name); + + if (flag == NULL) { + // If we can't find the flag-name, then we should return an error. + // The one exception is if 1) the flag-name is 'nox', 2) there + // exists a flag named 'x', and 3) 'x' is a boolean flag. + // In that case, we want to return flag 'x'. + if (!(flag_name[0] == 'n' && flag_name[1] == 'o')) { + // flag-name is not 'nox', so we're not in the exception case. + *error_message = (string(kError) + + "unknown command line flag '" + *key + "'\n"); + return NULL; + } + flag = FindFlagLocked(flag_name+2); + if (flag == NULL) { + // No flag named 'x' exists, so we're not in the exception case. + *error_message = (string(kError) + + "unknown command line flag '" + *key + "'\n"); + return NULL; + } + if (strcmp(flag->type_name(), "bool") != 0) { + // 'x' exists but is not boolean, so we're not in the exception case. + *error_message = (string(kError) + + "boolean value (" + *key + ") specified for " + + flag->type_name() + " command line flag\n"); + return NULL; + } + // We're in the exception case! + // Make up a fake value to replace the "no" we stripped out + key->assign(flag_name+2); // the name without the "no" + *v = "0"; + } + + // Assign a value if this is a boolean flag + if (*v == NULL && strcmp(flag->type_name(), "bool") == 0) { + *v = "1"; // the --nox case was already handled, so this is the --x case + } + + return flag; +} + +bool TryParseLocked(const CommandLineFlag* flag, FlagValue* flag_value, + const char* value, string* msg) { + // Use tenative_value, not flag_value, until we know value is valid. + FlagValue* tentative_value = flag_value->New(); + if (!tentative_value->ParseFrom(value)) { + if (msg) { + *msg += (string(kError) + "illegal value '" + value + + + "' specified for " + flag->type_name() + " flag '" + + flag->name() + "'\n"); + } + delete tentative_value; + return false; + } else if (!flag->Validate(*tentative_value)) { + if (msg) { + *msg += (string(kError) + "failed validation of new value " + + "'" + tentative_value->ToString() + "' for flag '" + + + flag->name() + "'\n"); + } + delete tentative_value; + return false; + } else { + flag_value->CopyFrom(*tentative_value); + if (msg) { + *msg += (string(flag->name()) + " set to " + flag_value->ToString() + + "\n"); + } + delete tentative_value; + return true; + } +} + +bool FlagRegistry::SetFlagLocked(CommandLineFlag* flag, + const char* value, + FlagSettingMode set_mode, + string* msg) { + flag->UpdateModifiedBit(); + switch (set_mode) { + case SET_FLAGS_VALUE: { + // set or modify the flag's value + if (!TryParseLocked(flag, flag->current_, value, msg)) + return false; + flag->modified_ = true; + break; + } + case SET_FLAG_IF_DEFAULT: { + // set the flag's value, but only if it hasn't been set by someone else + if (!flag->modified_) { + if (!TryParseLocked(flag, flag->current_, value, msg)) + return false; + flag->modified_ = true; + } else { + *msg = string(flag->name()) + " set to " + flag->current_value(); + } + break; + } + case SET_FLAGS_DEFAULT: { + // modify the flag's default-value + if (!TryParseLocked(flag, flag->defvalue_, value, msg)) + return false; + if (!flag->modified_) { + // Need to set both defvalue *and* current, in this case + TryParseLocked(flag, flag->current_, value, NULL); + } + break; + } + default: { + // unknown set_mode + assert(false); + return false; + } + } + + return true; +} + +class FlagRegistryLock { + public: + explicit FlagRegistryLock(FlagRegistry* fr) : fr_(fr) { fr_->Lock(); } + ~FlagRegistryLock() { fr_->Unlock(); } + private: + FlagRegistry *const fr_; +}; + +// -------------------------------------------------------------------- +// CommandLineFlagParser +// Parsing is done in two stages. In the first, we go through +// argv. For every flag-like arg we can make sense of, we parse +// it and set the appropriate FLAGS_* variable. For every flag- +// like arg we can't make sense of, we store it in a vector, +// along with an explanation of the trouble. In stage 2, we +// handle the 'reporting' flags like --help and --mpm_version. +// (This is via a call to HandleCommandLineHelpFlags(), in +// gflags_reporting.cc.) +// An optional stage 3 prints out the error messages. +// This is a bit of a simplification. For instance, --flagfile +// is handled as soon as it's seen in stage 1, not in stage 2. +// -------------------------------------------------------------------- + +class CommandLineFlagParser { + public: + // The argument is the flag-registry to register the parsed flags in + explicit CommandLineFlagParser(FlagRegistry* reg) : registry_(reg) {} + ~CommandLineFlagParser() {} + + // Stage 1: Every time this is called, it reads all flags in argv. + // However, it ignores all flags that have been successfully set + // before. Typically this is only called once, so this 'reparsing' + // behavior isn't important. It can be useful when trying to + // reparse after loading a dll, though. + uint32 ParseNewCommandLineFlags(int* argc, char*** argv, bool remove_flags); + + // Stage 2: print reporting info and exit, if requested. + // In gflags_reporting.cc:HandleCommandLineHelpFlags(). + + // Stage 3: validate all the commandline flags that have validators + // registered. + void ValidateAllFlags(); + + // Stage 4: report any errors and return true if any were found. + bool ReportErrors(); + + // Set a particular command line option. "newval" is a string + // describing the new value that the option has been set to. If + // option_name does not specify a valid option name, or value is not + // a valid value for option_name, newval is empty. Does recursive + // processing for --flagfile and --fromenv. Returns the new value + // if everything went ok, or empty-string if not. (Actually, the + // return-string could hold many flag/value pairs due to --flagfile.) + // NB: Must have called registry_->Lock() before calling this function. + string ProcessSingleOptionLocked(CommandLineFlag* flag, + const char* value, + FlagSettingMode set_mode); + + // Set a whole batch of command line options as specified by contentdata, + // which is in flagfile format (and probably has been read from a flagfile). + // Returns the new value if everything went ok, or empty-string if + // not. (Actually, the return-string could hold many flag/value + // pairs due to --flagfile.) + // NB: Must have called registry_->Lock() before calling this function. + string ProcessOptionsFromStringLocked(const string& contentdata, + FlagSettingMode set_mode); + + // These are the 'recursive' flags, defined at the top of this file. + // Whenever we see these flags on the commandline, we must take action. + // These are called by ProcessSingleOptionLocked and, similarly, return + // new values if everything went ok, or the empty-string if not. + string ProcessFlagfileLocked(const string& flagval, FlagSettingMode set_mode); + // diff fromenv/tryfromenv + string ProcessFromenvLocked(const string& flagval, FlagSettingMode set_mode, + bool errors_are_fatal); + + private: + FlagRegistry* const registry_; + map<string, string> error_flags_; // map from name to error message + // This could be a set<string>, but we reuse the map to minimize the .o size + map<string, string> undefined_names_; // --[flag] name was not registered +}; + + +// Parse a list of (comma-separated) flags. +static void ParseFlagList(const char* value, vector<string>* flags) { + for (const char *p = value; p && *p; value = p) { + p = strchr(value, ','); + int len; + if (p) { + len = static_cast<int>(p - value); + p++; + } else { + len = static_cast<int>(strlen(value)); + } + + if (len == 0) + ReportError(DIE, "ERROR: empty flaglist entry\n"); + if (value[0] == '-') + ReportError(DIE, "ERROR: flag \"%*s\" begins with '-'\n", len, value); + + flags->push_back(string(value, len)); + } +} + +// Snarf an entire file into a C++ string. This is just so that we +// can do all the I/O in one place and not worry about it everywhere. +// Plus, it's convenient to have the whole file contents at hand. +// Adds a newline at the end of the file. +#define PFATAL(s) do { perror(s); commandlineflags_exitfunc(1); } while (0) + +static string ReadFileIntoString(const char* filename) { + const int kBufSize = 8092; + char buffer[kBufSize]; + string s; + FILE* fp = fopen(filename, "r"); + if (!fp) PFATAL(filename); + size_t n; + while ( (n=fread(buffer, 1, kBufSize, fp)) > 0 ) { + if (ferror(fp)) PFATAL(filename); + s.append(buffer, n); + } + fclose(fp); + return s; +} + +uint32 CommandLineFlagParser::ParseNewCommandLineFlags(int* argc, char*** argv, + bool remove_flags) { + const char *program_name = strrchr((*argv)[0], PATH_SEPARATOR); // nix path + program_name = (program_name == NULL ? (*argv)[0] : program_name+1); + + int first_nonopt = *argc; // for non-options moved to the end + + registry_->Lock(); + for (int i = 1; i < first_nonopt; i++) { + char* arg = (*argv)[i]; + + // Like getopt(), we permute non-option flags to be at the end. + if (arg[0] != '-' || // must be a program argument + (arg[0] == '-' && arg[1] == '\0')) { // "-" is an argument, not a flag + memmove((*argv) + i, (*argv) + i+1, (*argc - (i+1)) * sizeof((*argv)[i])); + (*argv)[*argc-1] = arg; // we go last + first_nonopt--; // we've been pushed onto the stack + i--; // to undo the i++ in the loop + continue; + } + + if (arg[0] == '-') arg++; // allow leading '-' + if (arg[0] == '-') arg++; // or leading '--' + + // -- alone means what it does for GNU: stop options parsing + if (*arg == '\0') { + first_nonopt = i+1; + break; + } + + // Find the flag object for this option + string key; + const char* value; + string error_message; + CommandLineFlag* flag = registry_->SplitArgumentLocked(arg, &key, &value, + &error_message); + if (flag == NULL) { + undefined_names_[key] = ""; // value isn't actually used + error_flags_[key] = error_message; + continue; + } + + if (value == NULL) { + // Boolean options are always assigned a value by SplitArgumentLocked() + assert(strcmp(flag->type_name(), "bool") != 0); + if (i+1 >= first_nonopt) { + // This flag needs a value, but there is nothing available + error_flags_[key] = (string(kError) + "flag '" + (*argv)[i] + "'" + + " is missing its argument"); + if (flag->help() && flag->help()[0] > '\001') { + // Be useful in case we have a non-stripped description. + error_flags_[key] += string("; flag description: ") + flag->help(); + } + error_flags_[key] += "\n"; + break; // we treat this as an unrecoverable error + } else { + value = (*argv)[++i]; // read next arg for value + + // Heuristic to detect the case where someone treats a string arg + // like a bool: + // --my_string_var --foo=bar + // We look for a flag of string type, whose value begins with a + // dash, and where the flag-name and value are separated by a + // space rather than an '='. + // To avoid false positives, we also require the word "true" + // or "false" in the help string. Without this, a valid usage + // "-lat -30.5" would trigger the warning. The common cases we + // want to solve talk about true and false as values. + if (value[0] == '-' + && strcmp(flag->type_name(), "string") == 0 + && (strstr(flag->help(), "true") + || strstr(flag->help(), "false"))) { + fprintf(stderr, "Did you really mean to set flag '%s'" + " to the value '%s'?\n", + flag->name(), value); + } + } + } + + // TODO(csilvers): only set a flag if we hadn't set it before here + ProcessSingleOptionLocked(flag, value, SET_FLAGS_VALUE); + } + registry_->Unlock(); + + if (remove_flags) { // Fix up argc and argv by removing command line flags + (*argv)[first_nonopt-1] = (*argv)[0]; + (*argv) += (first_nonopt-1); + (*argc) -= (first_nonopt-1); + first_nonopt = 1; // because we still don't count argv[0] + } + + logging_is_probably_set_up = true; // because we've parsed --logdir, etc. + + return first_nonopt; +} + +string CommandLineFlagParser::ProcessFlagfileLocked(const string& flagval, + FlagSettingMode set_mode) { + if (flagval.empty()) + return ""; + + string msg; + vector<string> filename_list; + ParseFlagList(flagval.c_str(), &filename_list); // take a list of filenames + for (size_t i = 0; i < filename_list.size(); ++i) { + const char* file = filename_list[i].c_str(); + msg += ProcessOptionsFromStringLocked(ReadFileIntoString(file), set_mode); + } + return msg; +} + +string CommandLineFlagParser::ProcessFromenvLocked(const string& flagval, + FlagSettingMode set_mode, + bool errors_are_fatal) { + if (flagval.empty()) + return ""; + + string msg; + vector<string> flaglist; + ParseFlagList(flagval.c_str(), &flaglist); + + for (size_t i = 0; i < flaglist.size(); ++i) { + const char* flagname = flaglist[i].c_str(); + CommandLineFlag* flag = registry_->FindFlagLocked(flagname); + if (flag == NULL) { + error_flags_[flagname] = (string(kError) + "unknown command line flag" + + " '" + flagname + "'" + + " (via --fromenv or --tryfromenv)\n"); + undefined_names_[flagname] = ""; + continue; + } + + const string envname = string("FLAGS_") + string(flagname); + const char* envval = getenv(envname.c_str()); + if (!envval) { + if (errors_are_fatal) { + error_flags_[flagname] = (string(kError) + envname + + " not found in environment\n"); + } + continue; + } + + // Avoid infinite recursion. + if ((strcmp(envval, "fromenv") == 0) || + (strcmp(envval, "tryfromenv") == 0)) { + error_flags_[flagname] = (string(kError) + "infinite recursion on " + + "environment flag '" + envval + "'\n"); + continue; + } + + msg += ProcessSingleOptionLocked(flag, envval, set_mode); + } + return msg; +} + +string CommandLineFlagParser::ProcessSingleOptionLocked( + CommandLineFlag* flag, const char* value, FlagSettingMode set_mode) { + string msg; + if (value && !registry_->SetFlagLocked(flag, value, set_mode, &msg)) { + error_flags_[flag->name()] = msg; + return ""; + } + + // The recursive flags, --flagfile and --fromenv and --tryfromenv, + // must be dealt with as soon as they're seen. They will emit + // messages of their own. + if (strcmp(flag->name(), "flagfile") == 0) { + msg += ProcessFlagfileLocked(FLAGS_flagfile, set_mode); + + } else if (strcmp(flag->name(), "fromenv") == 0) { + // last arg indicates envval-not-found is fatal (unlike in --tryfromenv) + msg += ProcessFromenvLocked(FLAGS_fromenv, set_mode, true); + + } else if (strcmp(flag->name(), "tryfromenv") == 0) { + msg += ProcessFromenvLocked(FLAGS_tryfromenv, set_mode, false); + } + + return msg; +} + +void CommandLineFlagParser::ValidateAllFlags() { + FlagRegistryLock frl(registry_); + for (FlagRegistry::FlagConstIterator i = registry_->flags_.begin(); + i != registry_->flags_.end(); ++i) { + if (!i->second->ValidateCurrent()) { + // only set a message if one isn't already there. (If there's + // an error message, our job is done, even if it's not exactly + // the same error.) + if (error_flags_[i->second->name()].empty()) + error_flags_[i->second->name()] = + string(kError) + "--" + i->second->name() + + " must be set on the commandline" + " (default value fails validation)\n"; + } + } +} + +bool CommandLineFlagParser::ReportErrors() { + // error_flags_ indicates errors we saw while parsing. + // But we ignore undefined-names if ok'ed by --undef_ok + if (!FLAGS_undefok.empty()) { + vector<string> flaglist; + ParseFlagList(FLAGS_undefok.c_str(), &flaglist); + for (size_t i = 0; i < flaglist.size(); ++i) { + // We also deal with --no<flag>, in case the flagname was boolean + const string no_version = string("no") + flaglist[i]; + if (undefined_names_.find(flaglist[i]) != undefined_names_.end()) { + error_flags_[flaglist[i]] = ""; // clear the error message + } else if (undefined_names_.find(no_version) != undefined_names_.end()) { + error_flags_[no_version] = ""; + } + } + } + // Likewise, if they decided to allow reparsing, all undefined-names + // are ok; we just silently ignore them now, and hope that a future + // parse will pick them up somehow. + if (allow_command_line_reparsing) { + for (map<string, string>::const_iterator it = undefined_names_.begin(); + it != undefined_names_.end(); ++it) + error_flags_[it->first] = ""; // clear the error message + } + + bool found_error = false; + string error_message; + for (map<string, string>::const_iterator it = error_flags_.begin(); + it != error_flags_.end(); ++it) { + if (!it->second.empty()) { + error_message.append(it->second.data(), it->second.size()); + found_error = true; + } + } + if (found_error) + ReportError(DO_NOT_DIE, "%s", error_message.c_str()); + return found_error; +} + +string CommandLineFlagParser::ProcessOptionsFromStringLocked( + const string& contentdata, FlagSettingMode set_mode) { + string retval; + const char* flagfile_contents = contentdata.c_str(); + bool flags_are_relevant = true; // set to false when filenames don't match + bool in_filename_section = false; + + const char* line_end = flagfile_contents; + // We read this file a line at a time. + for (; line_end; flagfile_contents = line_end + 1) { + while (*flagfile_contents && isspace(*flagfile_contents)) + ++flagfile_contents; + line_end = strchr(flagfile_contents, '\n'); + size_t len = line_end ? static_cast<size_t>(line_end - flagfile_contents) + : strlen(flagfile_contents); + string line(flagfile_contents, len); + + // Each line can be one of four things: + // 1) A comment line -- we skip it + // 2) An empty line -- we skip it + // 3) A list of filenames -- starts a new filenames+flags section + // 4) A --flag=value line -- apply if previous filenames match + if (line.empty() || line[0] == '#') { + // comment or empty line; just ignore + + } else if (line[0] == '-') { // flag + in_filename_section = false; // instead, it was a flag-line + if (!flags_are_relevant) // skip this flag; applies to someone else + continue; + + const char* name_and_val = line.c_str() + 1; // skip the leading - + if (*name_and_val == '-') + name_and_val++; // skip second - too + string key; + const char* value; + string error_message; + CommandLineFlag* flag = registry_->SplitArgumentLocked(name_and_val, + &key, &value, + &error_message); + // By API, errors parsing flagfile lines are silently ignored. + if (flag == NULL) { + // "WARNING: flagname '" + key + "' not found\n" + } else if (value == NULL) { + // "WARNING: flagname '" + key + "' missing a value\n" + } else { + retval += ProcessSingleOptionLocked(flag, value, set_mode); + } + + } else { // a filename! + if (!in_filename_section) { // start over: assume filenames don't match + in_filename_section = true; + flags_are_relevant = false; + } + + // Split the line up at spaces into glob-patterns + const char* space = line.c_str(); // just has to be non-NULL + for (const char* word = line.c_str(); *space; word = space+1) { + if (flags_are_relevant) // we can stop as soon as we match + break; + space = strchr(word, ' '); + if (space == NULL) + space = word + strlen(word); + const string glob(word, space - word); + // We try matching both against the full argv0 and basename(argv0) +#ifdef HAVE_FNMATCH_H + if (fnmatch(glob.c_str(), + ProgramInvocationName(), + FNM_PATHNAME) == 0 || + fnmatch(glob.c_str(), + ProgramInvocationShortName(), + FNM_PATHNAME) == 0) { +#else // !HAVE_FNMATCH_H + if ((glob == ProgramInvocationName()) || + (glob == ProgramInvocationShortName())) { +#endif // HAVE_FNMATCH_H + flags_are_relevant = true; + } + } + } + } + return retval; +} + +// -------------------------------------------------------------------- +// GetFromEnv() +// AddFlagValidator() +// These are helper functions for routines like BoolFromEnv() and +// RegisterFlagValidator, defined below. They're defined here so +// they can live in the unnamed namespace (which makes friendship +// declarations for these classes possible). +// -------------------------------------------------------------------- + +template<typename T> +T GetFromEnv(const char *varname, const char* type, T dflt) { + const char* const valstr = getenv(varname); + if (!valstr) + return dflt; + FlagValue ifv(new T, type, true); + if (!ifv.ParseFrom(valstr)) + ReportError(DIE, "ERROR: error parsing env variable '%s' with value '%s'\n", + varname, valstr); + return OTHER_VALUE_AS(ifv, T); +} + +bool AddFlagValidator(const void* flag_ptr, ValidateFnProto validate_fn_proto) { + // We want a lock around this routine, in case two threads try to + // add a validator (hopefully the same one!) at once. We could use + // our own thread, but we need to loook at the registry anyway, so + // we just steal that one. + FlagRegistry* const registry = FlagRegistry::GlobalRegistry(); + FlagRegistryLock frl(registry); + // First, find the flag whose current-flag storage is 'flag'. + // This is the CommandLineFlag whose current_->value_buffer_ == flag + CommandLineFlag* flag = registry->FindFlagViaPtrLocked(flag_ptr); + if (!flag) { + // WARNING << "Ignoring RegisterValidateFunction() for flag pointer " + // << flag_ptr << ": no flag found at that address"; + return false; + } else if (validate_fn_proto == flag->validate_function()) { + return true; // ok to register the same function over and over again + } else if (validate_fn_proto != NULL && flag->validate_function() != NULL) { + // WARNING << "Ignoring RegisterValidateFunction() for flag '" + // << flag->name() << "': validate-fn already registered"; + return false; + } else { + flag->validate_fn_proto_ = validate_fn_proto; + return true; + } +} + +} // end unnamed namespaces + + +// Now define the functions that are exported via the .h file + +// -------------------------------------------------------------------- +// FlagRegisterer +// This class exists merely to have a global constructor (the +// kind that runs before main(), that goes an initializes each +// flag that's been declared. Note that it's very important we +// don't have a destructor that deletes flag_, because that would +// cause us to delete current_storage/defvalue_storage as well, +// which can cause a crash if anything tries to access the flag +// values in a global destructor. +// -------------------------------------------------------------------- + +FlagRegisterer::FlagRegisterer(const char* name, const char* type, + const char* help, const char* filename, + void* current_storage, void* defvalue_storage) { + if (help == NULL) + help = ""; + // FlagValue expects the type-name to not include any namespace + // components, so we get rid of those, if any. + if (strchr(type, ':')) + type = strrchr(type, ':') + 1; + FlagValue* current = new FlagValue(current_storage, type, false); + FlagValue* defvalue = new FlagValue(defvalue_storage, type, false); + // Importantly, flag_ will never be deleted, so storage is always good. + CommandLineFlag* flag = new CommandLineFlag(name, help, filename, + current, defvalue); + FlagRegistry::GlobalRegistry()->RegisterFlag(flag); // default registry +} + +// -------------------------------------------------------------------- +// GetAllFlags() +// The main way the FlagRegistry class exposes its data. This +// returns, as strings, all the info about all the flags in +// the main registry, sorted first by filename they are defined +// in, and then by flagname. +// -------------------------------------------------------------------- + +struct FilenameFlagnameCmp { + bool operator()(const CommandLineFlagInfo& a, + const CommandLineFlagInfo& b) const { + int cmp = strcmp(a.filename.c_str(), b.filename.c_str()); + if (cmp == 0) + cmp = strcmp(a.name.c_str(), b.name.c_str()); // secondary sort key + return cmp < 0; + } +}; + +void GetAllFlags(vector<CommandLineFlagInfo>* OUTPUT) { + FlagRegistry* const registry = FlagRegistry::GlobalRegistry(); + registry->Lock(); + for (FlagRegistry::FlagConstIterator i = registry->flags_.begin(); + i != registry->flags_.end(); ++i) { + CommandLineFlagInfo fi; + i->second->FillCommandLineFlagInfo(&fi); + OUTPUT->push_back(fi); + } + registry->Unlock(); + // Now sort the flags, first by filename they occur in, then alphabetically + sort(OUTPUT->begin(), OUTPUT->end(), FilenameFlagnameCmp()); +} + +// -------------------------------------------------------------------- +// SetArgv() +// GetArgvs() +// GetArgv() +// GetArgv0() +// ProgramInvocationName() +// ProgramInvocationShortName() +// SetUsageMessage() +// ProgramUsage() +// Functions to set and get argv. Typically the setter is called +// by ParseCommandLineFlags. Also can get the ProgramUsage string, +// set by SetUsageMessage. +// -------------------------------------------------------------------- + +// These values are not protected by a Mutex because they are normally +// set only once during program startup. +static const char* argv0 = "UNKNOWN"; // just the program name +static const char* cmdline = ""; // the entire command-line +static vector<string> argvs; +static uint32 argv_sum = 0; +static const char* program_usage = NULL; + +void SetArgv(int argc, const char** argv) { + static bool called_set_argv = false; + if (called_set_argv) // we already have an argv for you + return; + + called_set_argv = true; + + assert(argc > 0); // every program has at least a progname + argv0 = strdup(argv[0]); // small memory leak, but fn only called once + assert(argv0); + + string cmdline_string; // easier than doing strcats + for (int i = 0; i < argc; i++) { + if (i != 0) { + cmdline_string += " "; + } + cmdline_string += argv[i]; + argvs.push_back(argv[i]); + } + cmdline = strdup(cmdline_string.c_str()); // another small memory leak + assert(cmdline); + + // Compute a simple sum of all the chars in argv + for (const char* c = cmdline; *c; c++) + argv_sum += *c; +} + +const vector<string>& GetArgvs() { return argvs; } +const char* GetArgv() { return cmdline; } +const char* GetArgv0() { return argv0; } +uint32 GetArgvSum() { return argv_sum; } +const char* ProgramInvocationName() { // like the GNU libc fn + return GetArgv0(); +} +const char* ProgramInvocationShortName() { // like the GNU libc fn + const char* slash = strrchr(argv0, '/'); +#ifdef OS_WINDOWS + if (!slash) slash = strrchr(argv0, '\\'); +#endif + return slash ? slash + 1 : argv0; +} + +void SetUsageMessage(const string& usage) { + if (program_usage != NULL) + ReportError(DIE, "ERROR: SetUsageMessage() called twice\n"); + program_usage = strdup(usage.c_str()); // small memory leak +} + +const char* ProgramUsage() { + if (program_usage) { + return program_usage; + } + return "Warning: SetUsageMessage() never called"; +} + +// -------------------------------------------------------------------- +// GetCommandLineOption() +// GetCommandLineFlagInfo() +// GetCommandLineFlagInfoOrDie() +// SetCommandLineOption() +// SetCommandLineOptionWithMode() +// The programmatic way to set a flag's value, using a string +// for its name rather than the variable itself (that is, +// SetCommandLineOption("foo", x) rather than FLAGS_foo = x). +// There's also a bit more flexibility here due to the various +// set-modes, but typically these are used when you only have +// that flag's name as a string, perhaps at runtime. +// All of these work on the default, global registry. +// For GetCommandLineOption, return false if no such flag +// is known, true otherwise. We clear "value" if a suitable +// flag is found. +// -------------------------------------------------------------------- + + +bool GetCommandLineOption(const char* name, string* value) { + if (NULL == name) + return false; + assert(value); + + FlagRegistry* const registry = FlagRegistry::GlobalRegistry(); + FlagRegistryLock frl(registry); + CommandLineFlag* flag = registry->FindFlagLocked(name); + if (flag == NULL) { + return false; + } else { + *value = flag->current_value(); + return true; + } +} + +bool GetCommandLineFlagInfo(const char* name, CommandLineFlagInfo* OUTPUT) { + if (NULL == name) return false; + FlagRegistry* const registry = FlagRegistry::GlobalRegistry(); + FlagRegistryLock frl(registry); + CommandLineFlag* flag = registry->FindFlagLocked(name); + if (flag == NULL) { + return false; + } else { + assert(OUTPUT); + flag->FillCommandLineFlagInfo(OUTPUT); + return true; + } +} + +CommandLineFlagInfo GetCommandLineFlagInfoOrDie(const char* name) { + CommandLineFlagInfo info; + if (!GetCommandLineFlagInfo(name, &info)) { + fprintf(stderr, "FATAL ERROR: flag name '%s' doesn't exist\n", name); + commandlineflags_exitfunc(1); // almost certainly exit() + } + return info; +} + +string SetCommandLineOptionWithMode(const char* name, const char* value, + FlagSettingMode set_mode) { + string result; + FlagRegistry* const registry = FlagRegistry::GlobalRegistry(); + FlagRegistryLock frl(registry); + CommandLineFlag* flag = registry->FindFlagLocked(name); + if (flag) { + CommandLineFlagParser parser(registry); + result = parser.ProcessSingleOptionLocked(flag, value, set_mode); + if (!result.empty()) { // in the error case, we've already logged + // You could consider logging this change, if you wanted to know it: + //fprintf(stderr, "%sFLAGS_%s\n", + // (set_mode == SET_FLAGS_DEFAULT ? "default value of " : ""), + // result); + } + } + // The API of this function is that we return empty string on error + return result; +} + +string SetCommandLineOption(const char* name, const char* value) { + return SetCommandLineOptionWithMode(name, value, SET_FLAGS_VALUE); +} + +// -------------------------------------------------------------------- +// FlagSaver +// FlagSaverImpl +// This class stores the states of all flags at construct time, +// and restores all flags to that state at destruct time. +// Its major implementation challenge is that it never modifies +// pointers in the 'main' registry, so global FLAG_* vars always +// point to the right place. +// -------------------------------------------------------------------- + +class FlagSaverImpl { + public: + // Constructs an empty FlagSaverImpl object. + explicit FlagSaverImpl(FlagRegistry* main_registry) + : main_registry_(main_registry) { } + ~FlagSaverImpl() { + // reclaim memory from each of our CommandLineFlags + vector<CommandLineFlag*>::const_iterator it; + for (it = backup_registry_.begin(); it != backup_registry_.end(); ++it) + delete *it; + } + + // Saves the flag states from the flag registry into this object. + // It's an error to call this more than once. + // Must be called when the registry mutex is not held. + void SaveFromRegistry() { + FlagRegistryLock frl(main_registry_); + assert(backup_registry_.empty()); // call only once! + for (FlagRegistry::FlagConstIterator it = main_registry_->flags_.begin(); + it != main_registry_->flags_.end(); + ++it) { + const CommandLineFlag* main = it->second; + // Sets up all the const variables in backup correctly + CommandLineFlag* backup = new CommandLineFlag( + main->name(), main->help(), main->filename(), + main->current_->New(), main->defvalue_->New()); + // Sets up all the non-const variables in backup correctly + backup->CopyFrom(*main); + backup_registry_.push_back(backup); // add it to a convenient list + } + } + + // Restores the saved flag states into the flag registry. We + // assume no flags were added or deleted from the registry since + // the SaveFromRegistry; if they were, that's trouble! Must be + // called when the registry mutex is not held. + void RestoreToRegistry() { + FlagRegistryLock frl(main_registry_); + vector<CommandLineFlag*>::const_iterator it; + for (it = backup_registry_.begin(); it != backup_registry_.end(); ++it) { + CommandLineFlag* main = main_registry_->FindFlagLocked((*it)->name()); + if (main != NULL) { // if NULL, flag got deleted from registry(!) + main->CopyFrom(**it); + } + } + } + + private: + FlagRegistry* const main_registry_; + vector<CommandLineFlag*> backup_registry_; + + FlagSaverImpl(const FlagSaverImpl&); // no copying! + void operator=(const FlagSaverImpl&); +}; + +FlagSaver::FlagSaver() + : impl_(new FlagSaverImpl(FlagRegistry::GlobalRegistry())) { + impl_->SaveFromRegistry(); +} + +FlagSaver::~FlagSaver() { + impl_->RestoreToRegistry(); + delete impl_; +} + + +// -------------------------------------------------------------------- +// CommandlineFlagsIntoString() +// ReadFlagsFromString() +// AppendFlagsIntoFile() +// ReadFromFlagsFile() +// These are mostly-deprecated routines that stick the +// commandline flags into a file/string and read them back +// out again. I can see a use for CommandlineFlagsIntoString, +// for creating a flagfile, but the rest don't seem that useful +// -- some, I think, are a poor-man's attempt at FlagSaver -- +// and are included only until we can delete them from callers. +// Note they don't save --flagfile flags (though they do save +// the result of having called the flagfile, of course). +// -------------------------------------------------------------------- + +static string TheseCommandlineFlagsIntoString( + const vector<CommandLineFlagInfo>& flags) { + vector<CommandLineFlagInfo>::const_iterator i; + + size_t retval_space = 0; + for (i = flags.begin(); i != flags.end(); ++i) { + // An (over)estimate of how much space it will take to print this flag + retval_space += i->name.length() + i->current_value.length() + 5; + } + + string retval; + retval.reserve(retval_space); + for (i = flags.begin(); i != flags.end(); ++i) { + retval += "--"; + retval += i->name; + retval += "="; + retval += i->current_value; + retval += "\n"; + } + return retval; +} + +string CommandlineFlagsIntoString() { + vector<CommandLineFlagInfo> sorted_flags; + GetAllFlags(&sorted_flags); + return TheseCommandlineFlagsIntoString(sorted_flags); +} + +bool ReadFlagsFromString(const string& flagfilecontents, + const char* /*prog_name*/, // TODO(csilvers): nix this + bool errors_are_fatal) { + FlagRegistry* const registry = FlagRegistry::GlobalRegistry(); + FlagSaverImpl saved_states(registry); + saved_states.SaveFromRegistry(); + + CommandLineFlagParser parser(registry); + registry->Lock(); + parser.ProcessOptionsFromStringLocked(flagfilecontents, SET_FLAGS_VALUE); + registry->Unlock(); + // Should we handle --help and such when reading flags from a string? Sure. + HandleCommandLineHelpFlags(); + if (parser.ReportErrors()) { + // Error. Restore all global flags to their previous values. + if (errors_are_fatal) + commandlineflags_exitfunc(1); // almost certainly exit() + saved_states.RestoreToRegistry(); + return false; + } + return true; +} + +// TODO(csilvers): nix prog_name in favor of ProgramInvocationShortName() +bool AppendFlagsIntoFile(const string& filename, const char *prog_name) { + FILE *fp = fopen(filename.c_str(), "a"); + if (!fp) { + return false; + } + + if (prog_name) + fprintf(fp, "%s\n", prog_name); + + vector<CommandLineFlagInfo> flags; + GetAllFlags(&flags); + // But we don't want --flagfile, which leads to weird recursion issues + vector<CommandLineFlagInfo>::iterator i; + for (i = flags.begin(); i != flags.end(); ++i) { + if (strcmp(i->name.c_str(), "flagfile") == 0) { + flags.erase(i); + break; + } + } + fprintf(fp, "%s", TheseCommandlineFlagsIntoString(flags).c_str()); + + fclose(fp); + return true; +} + +bool ReadFromFlagsFile(const string& filename, const char* prog_name, + bool errors_are_fatal) { + return ReadFlagsFromString(ReadFileIntoString(filename.c_str()), + prog_name, errors_are_fatal); +} + + +// -------------------------------------------------------------------- +// BoolFromEnv() +// Int32FromEnv() +// Int64FromEnv() +// Uint64FromEnv() +// DoubleFromEnv() +// StringFromEnv() +// Reads the value from the environment and returns it. +// We use an FlagValue to make the parsing easy. +// Example usage: +// DEFINE_bool(myflag, BoolFromEnv("MYFLAG_DEFAULT", false), "whatever"); +// -------------------------------------------------------------------- + +bool BoolFromEnv(const char *v, bool dflt) { + return GetFromEnv(v, "bool", dflt); +} +int32 Int32FromEnv(const char *v, int32 dflt) { + return GetFromEnv(v, "int32", dflt); +} +int64 Int64FromEnv(const char *v, int64 dflt) { + return GetFromEnv(v, "int64", dflt); +} +uint64 Uint64FromEnv(const char *v, uint64 dflt) { + return GetFromEnv(v, "uint64", dflt); +} +double DoubleFromEnv(const char *v, double dflt) { + return GetFromEnv(v, "double", dflt); +} +const char *StringFromEnv(const char *varname, const char *dflt) { + const char* const val = getenv(varname); + return val ? val : dflt; +} + + +// -------------------------------------------------------------------- +// RegisterFlagValidator() +// RegisterFlagValidator() is the function that clients use to +// 'decorate' a flag with a validation function. Once this is +// done, every time the flag is set (including when the flag +// is parsed from argv), the validator-function is called. +// These functions return true if the validator was added +// successfully, or false if not: the flag already has a validator, +// (only one allowed per flag), the 1st arg isn't a flag, etc. +// This function is not thread-safe. +// -------------------------------------------------------------------- + +bool RegisterFlagValidator(const bool* flag, + bool (*validate_fn)(const char*, bool)) { + return AddFlagValidator(flag, reinterpret_cast<ValidateFnProto>(validate_fn)); +} +bool RegisterFlagValidator(const int32* flag, + bool (*validate_fn)(const char*, int32)) { + return AddFlagValidator(flag, reinterpret_cast<ValidateFnProto>(validate_fn)); +} +bool RegisterFlagValidator(const int64* flag, + bool (*validate_fn)(const char*, int64)) { + return AddFlagValidator(flag, reinterpret_cast<ValidateFnProto>(validate_fn)); +} +bool RegisterFlagValidator(const uint64* flag, + bool (*validate_fn)(const char*, uint64)) { + return AddFlagValidator(flag, reinterpret_cast<ValidateFnProto>(validate_fn)); +} +bool RegisterFlagValidator(const double* flag, + bool (*validate_fn)(const char*, double)) { + return AddFlagValidator(flag, reinterpret_cast<ValidateFnProto>(validate_fn)); +} +bool RegisterFlagValidator(const string* flag, + bool (*validate_fn)(const char*, const string&)) { + return AddFlagValidator(flag, reinterpret_cast<ValidateFnProto>(validate_fn)); +} + + +// -------------------------------------------------------------------- +// ParseCommandLineFlags() +// ParseCommandLineNonHelpFlags() +// HandleCommandLineHelpFlags() +// This is the main function called from main(), to actually +// parse the commandline. It modifies argc and argv as described +// at the top of gflags.h. You can also divide this +// function into two parts, if you want to do work between +// the parsing of the flags and the printing of any help output. +// -------------------------------------------------------------------- + +static uint32 ParseCommandLineFlagsInternal(int* argc, char*** argv, + bool remove_flags, bool do_report) { + SetArgv(*argc, const_cast<const char**>(*argv)); // save it for later + + FlagRegistry* const registry = FlagRegistry::GlobalRegistry(); + CommandLineFlagParser parser(registry); + + // When we parse the commandline flags, we'll handle --flagfile, + // --tryfromenv, etc. as we see them (since flag-evaluation order + // may be important). But sometimes apps set FLAGS_tryfromenv/etc. + // manually before calling ParseCommandLineFlags. We want to evaluate + // those too, as if they were the first flags on the commandline. + registry->Lock(); + parser.ProcessFlagfileLocked(FLAGS_flagfile, SET_FLAGS_VALUE); + // Last arg here indicates whether flag-not-found is a fatal error or not + parser.ProcessFromenvLocked(FLAGS_fromenv, SET_FLAGS_VALUE, true); + parser.ProcessFromenvLocked(FLAGS_tryfromenv, SET_FLAGS_VALUE, false); + registry->Unlock(); + + // Now get the flags specified on the commandline + const int r = parser.ParseNewCommandLineFlags(argc, argv, remove_flags); + + if (do_report) + HandleCommandLineHelpFlags(); // may cause us to exit on --help, etc. + + // See if any of the unset flags fail their validation checks + parser.ValidateAllFlags(); + + if (parser.ReportErrors()) // may cause us to exit on illegal flags + commandlineflags_exitfunc(1); // almost certainly exit() + return r; +} + +uint32 ParseCommandLineFlags(int* argc, char*** argv, bool remove_flags) { + return ParseCommandLineFlagsInternal(argc, argv, remove_flags, true); +} + +uint32 ParseCommandLineNonHelpFlags(int* argc, char*** argv, + bool remove_flags) { + return ParseCommandLineFlagsInternal(argc, argv, remove_flags, false); +} + +// -------------------------------------------------------------------- +// AllowCommandLineReparsing() +// ReparseCommandLineNonHelpFlags() +// This is most useful for shared libraries. The idea is if +// a flag is defined in a shared library that is dlopen'ed +// sometime after main(), you can ParseCommandLineFlags before +// the dlopen, then ReparseCommandLineNonHelpFlags() after the +// dlopen, to get the new flags. But you have to explicitly +// Allow() it; otherwise, you get the normal default behavior +// of unrecognized flags calling a fatal error. +// TODO(csilvers): this isn't used. Just delete it? +// -------------------------------------------------------------------- + +void AllowCommandLineReparsing() { + allow_command_line_reparsing = true; +} + +uint32 ReparseCommandLineNonHelpFlags() { + // We make a copy of argc and argv to pass in + const vector<string>& argvs = GetArgvs(); + int tmp_argc = static_cast<int>(argvs.size()); + char** tmp_argv = new char* [tmp_argc + 1]; + for (int i = 0; i < tmp_argc; ++i) + tmp_argv[i] = strdup(argvs[i].c_str()); // TODO(csilvers): don't dup + + const int retval = ParseCommandLineNonHelpFlags(&tmp_argc, &tmp_argv, false); + + for (int i = 0; i < tmp_argc; ++i) + free(tmp_argv[i]); + delete[] tmp_argv; + + return retval; +} + +void ShutDownCommandLineFlags() { + FlagRegistry::DeleteGlobalRegistry(); +} + +_END_GOOGLE_NAMESPACE_ diff --git a/extern/libmv/third_party/gflags/gflags.h b/extern/libmv/third_party/gflags/gflags.h new file mode 100644 index 00000000000..cefbd62ae51 --- /dev/null +++ b/extern/libmv/third_party/gflags/gflags.h @@ -0,0 +1,589 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// --- +// Author: Ray Sidney +// Revamped and reorganized by Craig Silverstein +// +// This is the file that should be included by any file which declares +// or defines a command line flag or wants to parse command line flags +// or print a program usage message (which will include information about +// flags). Executive summary, in the form of an example foo.cc file: +// +// #include "foo.h" // foo.h has a line "DECLARE_int32(start);" +// #include "validators.h" // hypothetical file defining ValidateIsFile() +// +// DEFINE_int32(end, 1000, "The last record to read"); +// +// DEFINE_string(filename, "my_file.txt", "The file to read"); +// // Crash if the specified file does not exist. +// static bool dummy = RegisterFlagValidator(&FLAGS_filename, +// &ValidateIsFile); +// +// DECLARE_bool(verbose); // some other file has a DEFINE_bool(verbose, ...) +// +// void MyFunc() { +// if (FLAGS_verbose) printf("Records %d-%d\n", FLAGS_start, FLAGS_end); +// } +// +// Then, at the command-line: +// ./foo --noverbose --start=5 --end=100 +// +// For more details, see +// doc/gflags.html +// +// --- A note about thread-safety: +// +// We describe many functions in this routine as being thread-hostile, +// thread-compatible, or thread-safe. Here are the meanings we use: +// +// thread-safe: it is safe for multiple threads to call this routine +// (or, when referring to a class, methods of this class) +// concurrently. +// thread-hostile: it is not safe for multiple threads to call this +// routine (or methods of this class) concurrently. In gflags, +// most thread-hostile routines are intended to be called early in, +// or even before, main() -- that is, before threads are spawned. +// thread-compatible: it is safe for multiple threads to read from +// this variable (when applied to variables), or to call const +// methods of this class (when applied to classes), as long as no +// other thread is writing to the variable or calling non-const +// methods of this class. + +#ifndef GOOGLE_GFLAGS_H_ +#define GOOGLE_GFLAGS_H_ + +#include <string> +#include <vector> + +// We care a lot about number of bits things take up. Unfortunately, +// systems define their bit-specific ints in a lot of different ways. +// We use our own way, and have a typedef to get there. +// Note: these commands below may look like "#if 1" or "#if 0", but +// that's because they were constructed that way at ./configure time. +// Look at gflags.h.in to see how they're calculated (based on your config). +#if 1 +#include <stdint.h> // the normal place uint16_t is defined +#endif +#if 1 +#include <sys/types.h> // the normal place u_int16_t is defined +#endif +#if 1 +#include <inttypes.h> // a third place for uint16_t or u_int16_t +#endif + +namespace google { + +#if 1 // the C99 format +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +#elif 1 // the BSD format +typedef int32_t int32; +typedef u_int32_t uint32; +typedef int64_t int64; +typedef u_int64_t uint64; +#elif 0 // the windows (vc7) format +typedef __int32 int32; +typedef unsigned __int32 uint32; +typedef __int64 int64; +typedef unsigned __int64 uint64; +#else +#error Do not know how to define a 32-bit integer quantity on your system +#endif + +// -------------------------------------------------------------------- +// To actually define a flag in a file, use DEFINE_bool, +// DEFINE_string, etc. at the bottom of this file. You may also find +// it useful to register a validator with the flag. This ensures that +// when the flag is parsed from the commandline, or is later set via +// SetCommandLineOption, we call the validation function. It is _not_ +// called when you assign the value to the flag directly using the = operator. +// +// The validation function should return true if the flag value is valid, and +// false otherwise. If the function returns false for the new setting of the +// flag, the flag will retain its current value. If it returns false for the +// default value, ParseCommandLineFlags() will die. +// +// This function is safe to call at global construct time (as in the +// example below). +// +// Example use: +// static bool ValidatePort(const char* flagname, int32 value) { +// if (value > 0 && value < 32768) // value is ok +// return true; +// printf("Invalid value for --%s: %d\n", flagname, (int)value); +// return false; +// } +// DEFINE_int32(port, 0, "What port to listen on"); +// static bool dummy = RegisterFlagValidator(&FLAGS_port, &ValidatePort); + +// Returns true if successfully registered, false if not (because the +// first argument doesn't point to a command-line flag, or because a +// validator is already registered for this flag). +bool RegisterFlagValidator(const bool* flag, + bool (*validate_fn)(const char*, bool)); +bool RegisterFlagValidator(const int32* flag, + bool (*validate_fn)(const char*, int32)); +bool RegisterFlagValidator(const int64* flag, + bool (*validate_fn)(const char*, int64)); +bool RegisterFlagValidator(const uint64* flag, + bool (*validate_fn)(const char*, uint64)); +bool RegisterFlagValidator(const double* flag, + bool (*validate_fn)(const char*, double)); +bool RegisterFlagValidator(const std::string* flag, + bool (*validate_fn)(const char*, const std::string&)); + + +// -------------------------------------------------------------------- +// These methods are the best way to get access to info about the +// list of commandline flags. Note that these routines are pretty slow. +// GetAllFlags: mostly-complete info about the list, sorted by file. +// ShowUsageWithFlags: pretty-prints the list to stdout (what --help does) +// ShowUsageWithFlagsRestrict: limit to filenames with restrict as a substr +// +// In addition to accessing flags, you can also access argv[0] (the program +// name) and argv (the entire commandline), which we sock away a copy of. +// These variables are static, so you should only set them once. + +struct CommandLineFlagInfo { + std::string name; // the name of the flag + std::string type; // the type of the flag: int32, etc + std::string description; // the "help text" associated with the flag + std::string current_value; // the current value, as a string + std::string default_value; // the default value, as a string + std::string filename; // 'cleaned' version of filename holding the flag + bool has_validator_fn; // true if RegisterFlagValidator called on flag + bool is_default; // true if the flag has the default value and + // has not been set explicitly from the cmdline + // or via SetCommandLineOption +}; + +// Using this inside of a validator is a recipe for a deadlock. +// TODO(wojtekm) Fix locking when validators are running, to make it safe to +// call validators during ParseAllFlags. +// Also make sure then to uncomment the corresponding unit test in +// commandlineflags_unittest.sh +extern void GetAllFlags(std::vector<CommandLineFlagInfo>* OUTPUT); +// These two are actually defined in commandlineflags_reporting.cc. +extern void ShowUsageWithFlags(const char *argv0); // what --help does +extern void ShowUsageWithFlagsRestrict(const char *argv0, const char *restrict); + +// Create a descriptive string for a flag. +// Goes to some trouble to make pretty line breaks. +extern std::string DescribeOneFlag(const CommandLineFlagInfo& flag); + +// Thread-hostile; meant to be called before any threads are spawned. +extern void SetArgv(int argc, const char** argv); +// The following functions are thread-safe as long as SetArgv() is +// only called before any threads start. +extern const std::vector<std::string>& GetArgvs(); // all of argv as a vector +extern const char* GetArgv(); // all of argv as a string +extern const char* GetArgv0(); // only argv0 +extern uint32 GetArgvSum(); // simple checksum of argv +extern const char* ProgramInvocationName(); // argv0, or "UNKNOWN" if not set +extern const char* ProgramInvocationShortName(); // basename(argv0) +// ProgramUsage() is thread-safe as long as SetUsageMessage() is only +// called before any threads start. +extern const char* ProgramUsage(); // string set by SetUsageMessage() + + +// -------------------------------------------------------------------- +// Normally you access commandline flags by just saying "if (FLAGS_foo)" +// or whatever, and set them by calling "FLAGS_foo = bar" (or, more +// commonly, via the DEFINE_foo macro). But if you need a bit more +// control, we have programmatic ways to get/set the flags as well. +// These programmatic ways to access flags are thread-safe, but direct +// access is only thread-compatible. + +// Return true iff the flagname was found. +// OUTPUT is set to the flag's value, or unchanged if we return false. +extern bool GetCommandLineOption(const char* name, std::string* OUTPUT); + +// Return true iff the flagname was found. OUTPUT is set to the flag's +// CommandLineFlagInfo or unchanged if we return false. +extern bool GetCommandLineFlagInfo(const char* name, + CommandLineFlagInfo* OUTPUT); + +// Return the CommandLineFlagInfo of the flagname. exit() if name not found. +// Example usage, to check if a flag's value is currently the default value: +// if (GetCommandLineFlagInfoOrDie("foo").is_default) ... +extern CommandLineFlagInfo GetCommandLineFlagInfoOrDie(const char* name); + +enum FlagSettingMode { + // update the flag's value (can call this multiple times). + SET_FLAGS_VALUE, + // update the flag's value, but *only if* it has not yet been updated + // with SET_FLAGS_VALUE, SET_FLAG_IF_DEFAULT, or "FLAGS_xxx = nondef". + SET_FLAG_IF_DEFAULT, + // set the flag's default value to this. If the flag has not yet updated + // yet (via SET_FLAGS_VALUE, SET_FLAG_IF_DEFAULT, or "FLAGS_xxx = nondef") + // change the flag's current value to the new default value as well. + SET_FLAGS_DEFAULT +}; + +// Set a particular flag ("command line option"). Returns a string +// describing the new value that the option has been set to. The +// return value API is not well-specified, so basically just depend on +// it to be empty if the setting failed for some reason -- the name is +// not a valid flag name, or the value is not a valid value -- and +// non-empty else. + +// SetCommandLineOption uses set_mode == SET_FLAGS_VALUE (the common case) +extern std::string SetCommandLineOption(const char* name, const char* value); +extern std::string SetCommandLineOptionWithMode(const char* name, const char* value, + FlagSettingMode set_mode); + + +// -------------------------------------------------------------------- +// Saves the states (value, default value, whether the user has set +// the flag, registered validators, etc) of all flags, and restores +// them when the FlagSaver is destroyed. This is very useful in +// tests, say, when you want to let your tests change the flags, but +// make sure that they get reverted to the original states when your +// test is complete. +// +// Example usage: +// void TestFoo() { +// FlagSaver s1; +// FLAG_foo = false; +// FLAG_bar = "some value"; +// +// // test happens here. You can return at any time +// // without worrying about restoring the FLAG values. +// } +// +// Note: This class is marked with __attribute__((unused)) because all the +// work is done in the constructor and destructor, so in the standard +// usage example above, the compiler would complain that it's an +// unused variable. +// +// This class is thread-safe. + +class FlagSaver { + public: + FlagSaver(); + ~FlagSaver(); + + private: + class FlagSaverImpl* impl_; // we use pimpl here to keep API steady + + FlagSaver(const FlagSaver&); // no copying! + void operator=(const FlagSaver&); +} +#ifndef _MSC_VER +__attribute__ ((unused)) +#endif +; + +// -------------------------------------------------------------------- +// Some deprecated or hopefully-soon-to-be-deprecated functions. + +// This is often used for logging. TODO(csilvers): figure out a better way +extern std::string CommandlineFlagsIntoString(); +// Usually where this is used, a FlagSaver should be used instead. +extern bool ReadFlagsFromString(const std::string& flagfilecontents, + const char* prog_name, + bool errors_are_fatal); // uses SET_FLAGS_VALUE + +// These let you manually implement --flagfile functionality. +// DEPRECATED. +extern bool AppendFlagsIntoFile(const std::string& filename, const char* prog_name); +extern bool SaveCommandFlags(); // actually defined in google.cc ! +extern bool ReadFromFlagsFile(const std::string& filename, const char* prog_name, + bool errors_are_fatal); // uses SET_FLAGS_VALUE + + +// -------------------------------------------------------------------- +// Useful routines for initializing flags from the environment. +// In each case, if 'varname' does not exist in the environment +// return defval. If 'varname' does exist but is not valid +// (e.g., not a number for an int32 flag), abort with an error. +// Otherwise, return the value. NOTE: for booleans, for true use +// 't' or 'T' or 'true' or '1', for false 'f' or 'F' or 'false' or '0'. + +extern bool BoolFromEnv(const char *varname, bool defval); +extern int32 Int32FromEnv(const char *varname, int32 defval); +extern int64 Int64FromEnv(const char *varname, int64 defval); +extern uint64 Uint64FromEnv(const char *varname, uint64 defval); +extern double DoubleFromEnv(const char *varname, double defval); +extern const char *StringFromEnv(const char *varname, const char *defval); + + +// -------------------------------------------------------------------- +// The next two functions parse commandlineflags from main(): + +// Set the "usage" message for this program. For example: +// string usage("This program does nothing. Sample usage:\n"); +// usage += argv[0] + " <uselessarg1> <uselessarg2>"; +// SetUsageMessage(usage); +// Do not include commandline flags in the usage: we do that for you! +// Thread-hostile; meant to be called before any threads are spawned. +extern void SetUsageMessage(const std::string& usage); + +// Looks for flags in argv and parses them. Rearranges argv to put +// flags first, or removes them entirely if remove_flags is true. +// If a flag is defined more than once in the command line or flag +// file, the last definition is used. Returns the index (into argv) +// of the first non-flag argument. +// See top-of-file for more details on this function. +#ifndef SWIG // In swig, use ParseCommandLineFlagsScript() instead. +extern uint32 ParseCommandLineFlags(int *argc, char*** argv, + bool remove_flags); +#endif + + +// Calls to ParseCommandLineNonHelpFlags and then to +// HandleCommandLineHelpFlags can be used instead of a call to +// ParseCommandLineFlags during initialization, in order to allow for +// changing default values for some FLAGS (via +// e.g. SetCommandLineOptionWithMode calls) between the time of +// command line parsing and the time of dumping help information for +// the flags as a result of command line parsing. If a flag is +// defined more than once in the command line or flag file, the last +// definition is used. Returns the index (into argv) of the first +// non-flag argument. (If remove_flags is true, will always return 1.) +extern uint32 ParseCommandLineNonHelpFlags(int *argc, char*** argv, + bool remove_flags); +// This is actually defined in commandlineflags_reporting.cc. +// This function is misnamed (it also handles --version, etc.), but +// it's too late to change that now. :-( +extern void HandleCommandLineHelpFlags(); // in commandlineflags_reporting.cc + +// Allow command line reparsing. Disables the error normally +// generated when an unknown flag is found, since it may be found in a +// later parse. Thread-hostile; meant to be called before any threads +// are spawned. +extern void AllowCommandLineReparsing(); + +// Reparse the flags that have not yet been recognized. Only flags +// registered since the last parse will be recognized. Any flag value +// must be provided as part of the argument using "=", not as a +// separate command line argument that follows the flag argument. +// Intended for handling flags from dynamically loaded libraries, +// since their flags are not registered until they are loaded. +// Returns the index (into the original argv) of the first non-flag +// argument. (If remove_flags is true, will always return 1.) +extern uint32 ReparseCommandLineNonHelpFlags(); + +// Clean up memory allocated by flags. This is only needed to reduce +// the quantity of "potentially leaked" reports emitted by memory +// debugging tools such as valgrind. It is not required for normal +// operation, or for the perftools heap-checker. It must only be called +// when the process is about to exit, and all threads that might +// access flags are quiescent. Referencing flags after this is called +// will have unexpected consequences. This is not safe to run when +// multiple threads might be running: the function is thread-hostile. +extern void ShutDownCommandLineFlags(); + + +// -------------------------------------------------------------------- +// Now come the command line flag declaration/definition macros that +// will actually be used. They're kind of hairy. A major reason +// for this is initialization: we want people to be able to access +// variables in global constructors and have that not crash, even if +// their global constructor runs before the global constructor here. +// (Obviously, we can't guarantee the flags will have the correct +// default value in that case, but at least accessing them is safe.) +// The only way to do that is have flags point to a static buffer. +// So we make one, using a union to ensure proper alignment, and +// then use placement-new to actually set up the flag with the +// correct default value. In the same vein, we have to worry about +// flag access in global destructors, so FlagRegisterer has to be +// careful never to destroy the flag-values it constructs. +// +// Note that when we define a flag variable FLAGS_<name>, we also +// preemptively define a junk variable, FLAGS_no<name>. This is to +// cause a link-time error if someone tries to define 2 flags with +// names like "logging" and "nologging". We do this because a bool +// flag FLAG can be set from the command line to true with a "-FLAG" +// argument, and to false with a "-noFLAG" argument, and so this can +// potentially avert confusion. +// +// We also put flags into their own namespace. It is purposefully +// named in an opaque way that people should have trouble typing +// directly. The idea is that DEFINE puts the flag in the weird +// namespace, and DECLARE imports the flag from there into the current +// namespace. The net result is to force people to use DECLARE to get +// access to a flag, rather than saying "extern bool FLAGS_whatever;" +// or some such instead. We want this so we can put extra +// functionality (like sanity-checking) in DECLARE if we want, and +// make sure it is picked up everywhere. +// +// We also put the type of the variable in the namespace, so that +// people can't DECLARE_int32 something that they DEFINE_bool'd +// elsewhere. + +class FlagRegisterer { + public: + FlagRegisterer(const char* name, const char* type, + const char* help, const char* filename, + void* current_storage, void* defvalue_storage); +}; + +extern bool FlagsTypeWarn(const char *name); + +// If your application #defines STRIP_FLAG_HELP to a non-zero value +// before #including this file, we remove the help message from the +// binary file. This can reduce the size of the resulting binary +// somewhat, and may also be useful for security reasons. + +extern const char kStrippedFlagHelp[]; + +} + +#ifndef SWIG // In swig, ignore the main flag declarations + +#if defined(STRIP_FLAG_HELP) && STRIP_FLAG_HELP > 0 +// Need this construct to avoid the 'defined but not used' warning. +#define MAYBE_STRIPPED_HELP(txt) (false ? (txt) : ::google::kStrippedFlagHelp) +#else +#define MAYBE_STRIPPED_HELP(txt) txt +#endif + +// Each command-line flag has two variables associated with it: one +// with the current value, and one with the default value. However, +// we have a third variable, which is where value is assigned; it's a +// constant. This guarantees that FLAG_##value is initialized at +// static initialization time (e.g. before program-start) rather than +// than global construction time (which is after program-start but +// before main), at least when 'value' is a compile-time constant. We +// use a small trick for the "default value" variable, and call it +// FLAGS_no<name>. This serves the second purpose of assuring a +// compile error if someone tries to define a flag named no<name> +// which is illegal (--foo and --nofoo both affect the "foo" flag). +#define DEFINE_VARIABLE(type, shorttype, name, value, help) \ + namespace fL##shorttype { \ + static const type FLAGS_nono##name = value; \ + type FLAGS_##name = FLAGS_nono##name; \ + type FLAGS_no##name = FLAGS_nono##name; \ + static ::google::FlagRegisterer o_##name( \ + #name, #type, MAYBE_STRIPPED_HELP(help), __FILE__, \ + &FLAGS_##name, &FLAGS_no##name); \ + } \ + using fL##shorttype::FLAGS_##name + +#define DECLARE_VARIABLE(type, shorttype, name) \ + namespace fL##shorttype { \ + extern type FLAGS_##name; \ + } \ + using fL##shorttype::FLAGS_##name + +// For DEFINE_bool, we want to do the extra check that the passed-in +// value is actually a bool, and not a string or something that can be +// coerced to a bool. These declarations (no definition needed!) will +// help us do that, and never evaluate From, which is important. +// We'll use 'sizeof(IsBool(val))' to distinguish. This code requires +// that the compiler have different sizes for bool & double. Since +// this is not guaranteed by the standard, we check it with a +// compile-time assert (msg[-1] will give a compile-time error). +namespace fLB { +struct CompileAssert {}; +typedef CompileAssert expected_sizeof_double_neq_sizeof_bool[ + (sizeof(double) != sizeof(bool)) ? 1 : -1]; +template<typename From> double IsBoolFlag(const From& from); +bool IsBoolFlag(bool from); +} // namespace fLB + +#define DECLARE_bool(name) DECLARE_VARIABLE(bool, B, name) +#define DEFINE_bool(name, val, txt) \ + namespace fLB { \ + typedef ::fLB::CompileAssert FLAG_##name##_value_is_not_a_bool[ \ + (sizeof(::fLB::IsBoolFlag(val)) != sizeof(double)) ? 1 : -1]; \ + } \ + DEFINE_VARIABLE(bool, B, name, val, txt) + +#define DECLARE_int32(name) DECLARE_VARIABLE(::google::int32, I, name) +#define DEFINE_int32(name,val,txt) DEFINE_VARIABLE(::google::int32, I, name, val, txt) + +#define DECLARE_int64(name) DECLARE_VARIABLE(::google::int64, I64, name) +#define DEFINE_int64(name,val,txt) DEFINE_VARIABLE(::google::int64, I64, name, val, txt) + +#define DECLARE_uint64(name) DECLARE_VARIABLE(::google::uint64, U64, name) +#define DEFINE_uint64(name,val,txt) DEFINE_VARIABLE(::google::uint64, U64, name, val, txt) + +#define DECLARE_double(name) DECLARE_VARIABLE(double, D, name) +#define DEFINE_double(name, val, txt) DEFINE_VARIABLE(double, D, name, val, txt) + +// Strings are trickier, because they're not a POD, so we can't +// construct them at static-initialization time (instead they get +// constructed at global-constructor time, which is much later). To +// try to avoid crashes in that case, we use a char buffer to store +// the string, which we can static-initialize, and then placement-new +// into it later. It's not perfect, but the best we can do. + +namespace fLS { +// The meaning of "string" might be different between now and when the +// macros below get invoked (e.g., if someone is experimenting with +// other string implementations that get defined after this file is +// included). Save the current meaning now and use it in the macros. +typedef std::string clstring; + +inline clstring* dont_pass0toDEFINE_string(char *stringspot, + const char *value) { + return new(stringspot) clstring(value); +} +inline clstring* dont_pass0toDEFINE_string(char *stringspot, + const clstring &value) { + return new(stringspot) clstring(value); +} +inline clstring* dont_pass0toDEFINE_string(char *stringspot, + int value); +} // namespace fLS + +#define DECLARE_string(name) namespace fLS { extern ::fLS::clstring& FLAGS_##name; } \ + using fLS::FLAGS_##name + +// We need to define a var named FLAGS_no##name so people don't define +// --string and --nostring. And we need a temporary place to put val +// so we don't have to evaluate it twice. Two great needs that go +// great together! +// The weird 'using' + 'extern' inside the fLS namespace is to work around +// an unknown compiler bug/issue with the gcc 4.2.1 on SUSE 10. See +// http://code.google.com/p/google-gflags/issues/detail?id=20 +#define DEFINE_string(name, val, txt) \ + namespace fLS { \ + using ::fLS::clstring; \ + static union { void* align; char s[sizeof(clstring)]; } s_##name[2]; \ + clstring* const FLAGS_no##name = ::fLS:: \ + dont_pass0toDEFINE_string(s_##name[0].s, \ + val); \ + static ::google::FlagRegisterer o_##name( \ + #name, "string", MAYBE_STRIPPED_HELP(txt), __FILE__, \ + s_##name[0].s, new (s_##name[1].s) clstring(*FLAGS_no##name)); \ + extern clstring& FLAGS_##name; \ + using fLS::FLAGS_##name; \ + clstring& FLAGS_##name = *FLAGS_no##name; \ + } \ + using fLS::FLAGS_##name + +#endif // SWIG + +#endif // GOOGLE_GFLAGS_H_ diff --git a/extern/libmv/third_party/gflags/gflags_completions.cc b/extern/libmv/third_party/gflags/gflags_completions.cc new file mode 100644 index 00000000000..a129611d8a1 --- /dev/null +++ b/extern/libmv/third_party/gflags/gflags_completions.cc @@ -0,0 +1,765 @@ +// Copyright (c) 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --- +// Author: Dave Nicponski +// +// Bash-style command line flag completion for C++ binaries +// +// This module implements bash-style completions. It achieves this +// goal in the following broad chunks: +// +// 1) Take a to-be-completed word, and examine it for search hints +// 2) Identify all potentially matching flags +// 2a) If there are no matching flags, do nothing. +// 2b) If all matching flags share a common prefix longer than the +// completion word, output just that matching prefix +// 3) Categorize those flags to produce a rough ordering of relevence. +// 4) Potentially trim the set of flags returned to a smaller number +// that bash is happier with +// 5) Output the matching flags in groups ordered by relevence. +// 5a) Force bash to place most-relevent groups at the top of the list +// 5b) Trim most flag's descriptions to fit on a single terminal line + + +#include "config.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> // for strlen + +#include <set> +#include <string> +#include <utility> +#include <vector> + +#include "gflags.h" + +#ifndef PATH_SEPARATOR +#define PATH_SEPARATOR '/' +#endif + +DEFINE_string(tab_completion_word, "", + "If non-empty, HandleCommandLineCompletions() will hijack the " + "process and attempt to do bash-style command line flag " + "completion on this value."); +DEFINE_int32(tab_completion_columns, 80, + "Number of columns to use in output for tab completion"); + +_START_GOOGLE_NAMESPACE_ + +namespace { + +using std::set; +using std::string; +using std::vector; + +// Function prototypes and Type forward declarations. Code may be +// more easily understood if it is roughly ordered according to +// control flow, rather than by C's "declare before use" ordering +struct CompletionOptions; +struct NotableFlags; + +// The entry point if flag completion is to be used. +static void PrintFlagCompletionInfo(void); + + +// 1) Examine search word +static void CanonicalizeCursorWordAndSearchOptions( + const string &cursor_word, + string *canonical_search_token, + CompletionOptions *options); + +static bool RemoveTrailingChar(string *str, char c); + + +// 2) Find all matches +static void FindMatchingFlags( + const vector<CommandLineFlagInfo> &all_flags, + const CompletionOptions &options, + const string &match_token, + set<const CommandLineFlagInfo *> *all_matches, + string *longest_common_prefix); + +static bool DoesSingleFlagMatch( + const CommandLineFlagInfo &flag, + const CompletionOptions &options, + const string &match_token); + + +// 3) Categorize matches +static void CategorizeAllMatchingFlags( + const set<const CommandLineFlagInfo *> &all_matches, + const string &search_token, + const string &module, + const string &package_dir, + NotableFlags *notable_flags); + +static void TryFindModuleAndPackageDir( + const vector<CommandLineFlagInfo> all_flags, + string *module, + string *package_dir); + + +// 4) Decide which flags to use +static void FinalizeCompletionOutput( + const set<const CommandLineFlagInfo *> &matching_flags, + CompletionOptions *options, + NotableFlags *notable_flags, + vector<string> *completions); + +static void RetrieveUnusedFlags( + const set<const CommandLineFlagInfo *> &matching_flags, + const NotableFlags ¬able_flags, + set<const CommandLineFlagInfo *> *unused_flags); + + +// 5) Output matches +static void OutputSingleGroupWithLimit( + const set<const CommandLineFlagInfo *> &group, + const string &line_indentation, + const string &header, + const string &footer, + bool long_output_format, + int *remaining_line_limit, + size_t *completion_elements_added, + vector<string> *completions); + +// (helpers for #5) +static string GetShortFlagLine( + const string &line_indentation, + const CommandLineFlagInfo &info); + +static string GetLongFlagLine( + const string &line_indentation, + const CommandLineFlagInfo &info); + + +// +// Useful types + +// Try to deduce the intentions behind this completion attempt. Return the +// canonical search term in 'canonical_search_token'. Binary search options +// are returned in the various booleans, which should all have intuitive +// semantics, possibly except: +// - return_all_matching_flags: Generally, we'll trim the number of +// returned candidates to some small number, showing those that are +// most likely to be useful first. If this is set, however, the user +// really does want us to return every single flag as an option. +// - force_no_update: Any time we output lines, all of which share a +// common prefix, bash will 'helpfully' not even bother to show the +// output, instead changing the current word to be that common prefix. +// If it's clear this shouldn't happen, we'll set this boolean +struct CompletionOptions { + bool flag_name_substring_search; + bool flag_location_substring_search; + bool flag_description_substring_search; + bool return_all_matching_flags; + bool force_no_update; +}; + +// Notable flags are flags that are special or preferred for some +// reason. For example, flags that are defined in the binary's module +// are expected to be much more relevent than flags defined in some +// other random location. These sets are specified roughly in precedence +// order. Once a flag is placed in one of these 'higher' sets, it won't +// be placed in any of the 'lower' sets. +struct NotableFlags { + typedef set<const CommandLineFlagInfo *> FlagSet; + FlagSet perfect_match_flag; + FlagSet module_flags; // Found in module file + FlagSet package_flags; // Found in same directory as module file + FlagSet most_common_flags; // One of the XXX most commonly supplied flags + FlagSet subpackage_flags; // Found in subdirectories of package +}; + + +// +// Tab completion implementation - entry point +static void PrintFlagCompletionInfo(void) { + string cursor_word = FLAGS_tab_completion_word; + string canonical_token; + CompletionOptions options = { }; + CanonicalizeCursorWordAndSearchOptions( + cursor_word, + &canonical_token, + &options); + + //VLOG(1) << "Identified canonical_token: '" << canonical_token << "'"; + + vector<CommandLineFlagInfo> all_flags; + set<const CommandLineFlagInfo *> matching_flags; + GetAllFlags(&all_flags); + //VLOG(2) << "Found " << all_flags.size() << " flags overall"; + + string longest_common_prefix; + FindMatchingFlags( + all_flags, + options, + canonical_token, + &matching_flags, + &longest_common_prefix); + //VLOG(1) << "Identified " << matching_flags.size() << " matching flags"; + //VLOG(1) << "Identified " << longest_common_prefix + // << " as longest common prefix."; + if (longest_common_prefix.size() > canonical_token.size()) { + // There's actually a shared common prefix to all matching flags, + // so may as well output that and quit quickly. + //VLOG(1) << "The common prefix '" << longest_common_prefix + // << "' was longer than the token '" << canonical_token + // << "'. Returning just this prefix for completion."; + fprintf(stdout, "--%s", longest_common_prefix.c_str()); + return; + } + if (matching_flags.empty()) { + //VLOG(1) << "There were no matching flags, returning nothing."; + return; + } + + string module; + string package_dir; + TryFindModuleAndPackageDir(all_flags, &module, &package_dir); + //VLOG(1) << "Identified module: '" << module << "'"; + //VLOG(1) << "Identified package_dir: '" << package_dir << "'"; + + NotableFlags notable_flags; + CategorizeAllMatchingFlags( + matching_flags, + canonical_token, + module, + package_dir, + ¬able_flags); + //VLOG(2) << "Categorized matching flags:"; + //VLOG(2) << " perfect_match: " << notable_flags.perfect_match_flag.size(); + //VLOG(2) << " module: " << notable_flags.module_flags.size(); + //VLOG(2) << " package: " << notable_flags.package_flags.size(); + //VLOG(2) << " most common: " << notable_flags.most_common_flags.size(); + //VLOG(2) << " subpackage: " << notable_flags.subpackage_flags.size(); + + vector<string> completions; + FinalizeCompletionOutput( + matching_flags, + &options, + ¬able_flags, + &completions); + + if (options.force_no_update) + completions.push_back("~"); + + //VLOG(1) << "Finalized with " << completions.size() + // << " chosen completions"; + + for (vector<string>::const_iterator it = completions.begin(); + it != completions.end(); + ++it) { + //VLOG(9) << " Completion entry: '" << *it << "'"; + fprintf(stdout, "%s\n", it->c_str()); + } +} + + +// 1) Examine search word (and helper method) +static void CanonicalizeCursorWordAndSearchOptions( + const string &cursor_word, + string *canonical_search_token, + CompletionOptions *options) { + *canonical_search_token = cursor_word; + if (canonical_search_token->empty()) return; + + // Get rid of leading quotes and dashes in the search term + if ((*canonical_search_token)[0] == '"') + *canonical_search_token = canonical_search_token->substr(1); + while ((*canonical_search_token)[0] == '-') + *canonical_search_token = canonical_search_token->substr(1); + + options->flag_name_substring_search = false; + options->flag_location_substring_search = false; + options->flag_description_substring_search = false; + options->return_all_matching_flags = false; + options->force_no_update = false; + + // Look for all search options we can deduce now. Do this by walking + // backwards through the term, looking for up to three '?' and up to + // one '+' as suffixed characters. Consume them if found, and remove + // them from the canonical search token. + int found_question_marks = 0; + int found_plusses = 0; + while (true) { + if (found_question_marks < 3 && + RemoveTrailingChar(canonical_search_token, '?')) { + ++found_question_marks; + continue; + } + if (found_plusses < 1 && + RemoveTrailingChar(canonical_search_token, '+')) { + ++found_plusses; + continue; + } + break; + } + + switch (found_question_marks) { // all fallthroughs + case 3: options->flag_description_substring_search = true; + case 2: options->flag_location_substring_search = true; + case 1: options->flag_name_substring_search = true; + }; + + options->return_all_matching_flags = (found_plusses > 0); +} + +// Returns true if a char was removed +static bool RemoveTrailingChar(string *str, char c) { + if (str->empty()) return false; + if ((*str)[str->size() - 1] == c) { + *str = str->substr(0, str->size() - 1); + return true; + } + return false; +} + + +// 2) Find all matches (and helper methods) +static void FindMatchingFlags( + const vector<CommandLineFlagInfo> &all_flags, + const CompletionOptions &options, + const string &match_token, + set<const CommandLineFlagInfo *> *all_matches, + string *longest_common_prefix) { + all_matches->clear(); + bool first_match = true; + for (vector<CommandLineFlagInfo>::const_iterator it = all_flags.begin(); + it != all_flags.end(); + ++it) { + if (DoesSingleFlagMatch(*it, options, match_token)) { + all_matches->insert(&*it); + if (first_match) { + first_match = false; + *longest_common_prefix = it->name; + } else { + if (longest_common_prefix->empty() || it->name.empty()) { + longest_common_prefix->clear(); + continue; + } + string::size_type pos = 0; + while (pos < longest_common_prefix->size() && + pos < it->name.size() && + (*longest_common_prefix)[pos] == it->name[pos]) + ++pos; + longest_common_prefix->erase(pos); + } + } + } +} + +// Given the set of all flags, the parsed match options, and the +// canonical search token, produce the set of all candidate matching +// flags for subsequent analysis or filtering. +static bool DoesSingleFlagMatch( + const CommandLineFlagInfo &flag, + const CompletionOptions &options, + const string &match_token) { + // Is there a prefix match? + string::size_type pos = flag.name.find(match_token); + if (pos == 0) return true; + + // Is there a substring match if we want it? + if (options.flag_name_substring_search && + pos != string::npos) + return true; + + // Is there a location match if we want it? + if (options.flag_location_substring_search && + flag.filename.find(match_token) != string::npos) + return true; + + // TODO(daven): All searches should probably be case-insensitive + // (especially this one...) + if (options.flag_description_substring_search && + flag.description.find(match_token) != string::npos) + return true; + + return false; +} + +// 3) Categorize matches (and helper method) + +// Given a set of matching flags, categorize them by +// likely relevence to this specific binary +static void CategorizeAllMatchingFlags( + const set<const CommandLineFlagInfo *> &all_matches, + const string &search_token, + const string &module, // empty if we couldn't find any + const string &package_dir, // empty if we couldn't find any + NotableFlags *notable_flags) { + notable_flags->perfect_match_flag.clear(); + notable_flags->module_flags.clear(); + notable_flags->package_flags.clear(); + notable_flags->most_common_flags.clear(); + notable_flags->subpackage_flags.clear(); + + for (set<const CommandLineFlagInfo *>::const_iterator it = + all_matches.begin(); + it != all_matches.end(); + ++it) { + //VLOG(2) << "Examining match '" << (*it)->name << "'"; + //VLOG(7) << " filename: '" << (*it)->filename << "'"; + string::size_type pos = string::npos; + if (!package_dir.empty()) + pos = (*it)->filename.find(package_dir); + string::size_type slash = string::npos; + if (pos != string::npos) // candidate for package or subpackage match + slash = (*it)->filename.find( + PATH_SEPARATOR, + pos + package_dir.size() + 1); + + if ((*it)->name == search_token) { + // Exact match on some flag's name + notable_flags->perfect_match_flag.insert(*it); + //VLOG(3) << "Result: perfect match"; + } else if (!module.empty() && (*it)->filename == module) { + // Exact match on module filename + notable_flags->module_flags.insert(*it); + //VLOG(3) << "Result: module match"; + } else if (!package_dir.empty() && + pos != string::npos && slash == string::npos) { + // In the package, since there was no slash after the package portion + notable_flags->package_flags.insert(*it); + //VLOG(3) << "Result: package match"; + } else if (false) { + // In the list of the XXX most commonly supplied flags overall + // TODO(daven): Compile this list. + //VLOG(3) << "Result: most-common match"; + } else if (!package_dir.empty() && + pos != string::npos && slash != string::npos) { + // In a subdirectory of the package + notable_flags->subpackage_flags.insert(*it); + //VLOG(3) << "Result: subpackage match"; + } + + //VLOG(3) << "Result: not special match"; + } +} + +static void PushNameWithSuffix(vector<string>* suffixes, const char* suffix) { + string s("/"); + s += ProgramInvocationShortName(); + s += suffix; + suffixes->push_back(s); +} + +static void TryFindModuleAndPackageDir( + const vector<CommandLineFlagInfo> all_flags, + string *module, + string *package_dir) { + module->clear(); + package_dir->clear(); + + vector<string> suffixes; + // TODO(daven): There's some inherant ambiguity here - multiple directories + // could share the same trailing folder and file structure (and even worse, + // same file names), causing us to be unsure as to which of the two is the + // actual package for this binary. In this case, we'll arbitrarily choose. + PushNameWithSuffix(&suffixes, "."); + PushNameWithSuffix(&suffixes, "-main."); + PushNameWithSuffix(&suffixes, "_main."); + // These four are new but probably merited? + PushNameWithSuffix(&suffixes, "-test."); + PushNameWithSuffix(&suffixes, "_test."); + PushNameWithSuffix(&suffixes, "-unittest."); + PushNameWithSuffix(&suffixes, "_unittest."); + + for (vector<CommandLineFlagInfo>::const_iterator it = all_flags.begin(); + it != all_flags.end(); + ++it) { + for (vector<string>::const_iterator suffix = suffixes.begin(); + suffix != suffixes.end(); + ++suffix) { + // TODO(daven): Make sure the match is near the end of the string + if (it->filename.find(*suffix) != string::npos) { + *module = it->filename; + string::size_type sep = it->filename.rfind(PATH_SEPARATOR); + *package_dir = it->filename.substr(0, (sep == string::npos) ? 0 : sep); + return; + } + } + } +} + +// Can't specialize template type on a locally defined type. Silly C++... +struct DisplayInfoGroup { + const char* header; + const char* footer; + set<const CommandLineFlagInfo *> *group; + + int SizeInLines() const { + int size_in_lines = static_cast<int>(group->size()) + 1; + if (strlen(header) > 0) { + size_in_lines++; + } + if (strlen(footer) > 0) { + size_in_lines++; + } + return size_in_lines; + } +}; + +// 4) Finalize and trim output flag set +static void FinalizeCompletionOutput( + const set<const CommandLineFlagInfo *> &matching_flags, + CompletionOptions *options, + NotableFlags *notable_flags, + vector<string> *completions) { + + // We want to output lines in groups. Each group needs to be indented + // the same to keep its lines together. Unless otherwise required, + // only 99 lines should be output to prevent bash from harassing the + // user. + + // First, figure out which output groups we'll actually use. For each + // nonempty group, there will be ~3 lines of header & footer, plus all + // output lines themselves. + int max_desired_lines = // "999999 flags should be enough for anyone. -dave" + (options->return_all_matching_flags ? 999999 : 98); + int lines_so_far = 0; + + vector<DisplayInfoGroup> output_groups; + bool perfect_match_found = false; + if (lines_so_far < max_desired_lines && + !notable_flags->perfect_match_flag.empty()) { + perfect_match_found = true; + DisplayInfoGroup group = + { "", + "==========", + ¬able_flags->perfect_match_flag }; + lines_so_far += group.SizeInLines(); + output_groups.push_back(group); + } + if (lines_so_far < max_desired_lines && + !notable_flags->module_flags.empty()) { + DisplayInfoGroup group = { + "-* Matching module flags *-", + "===========================", + ¬able_flags->module_flags }; + lines_so_far += group.SizeInLines(); + output_groups.push_back(group); + } + if (lines_so_far < max_desired_lines && + !notable_flags->package_flags.empty()) { + DisplayInfoGroup group = { + "-* Matching package flags *-", + "============================", + ¬able_flags->package_flags }; + lines_so_far += group.SizeInLines(); + output_groups.push_back(group); + } + if (lines_so_far < max_desired_lines && + !notable_flags->most_common_flags.empty()) { + DisplayInfoGroup group = { + "-* Commonly used flags *-", + "=========================", + ¬able_flags->most_common_flags }; + lines_so_far += group.SizeInLines(); + output_groups.push_back(group); + } + if (lines_so_far < max_desired_lines && + !notable_flags->subpackage_flags.empty()) { + DisplayInfoGroup group = { + "-* Matching sub-package flags *-", + "================================", + ¬able_flags->subpackage_flags }; + lines_so_far += group.SizeInLines(); + output_groups.push_back(group); + } + + set<const CommandLineFlagInfo *> obscure_flags; // flags not notable + if (lines_so_far < max_desired_lines) { + RetrieveUnusedFlags(matching_flags, *notable_flags, &obscure_flags); + if (!obscure_flags.empty()) { + DisplayInfoGroup group = { + "-* Other flags *-", + "", + &obscure_flags }; + lines_so_far += group.SizeInLines(); + output_groups.push_back(group); + } + } + + // Second, go through each of the chosen output groups and output + // as many of those flags as we can, while remaining below our limit + int remaining_lines = max_desired_lines; + size_t completions_output = 0; + int indent = static_cast<int>(output_groups.size()) - 1; + for (vector<DisplayInfoGroup>::const_iterator it = + output_groups.begin(); + it != output_groups.end(); + ++it, --indent) { + OutputSingleGroupWithLimit( + *it->group, // group + string(indent, ' '), // line indentation + string(it->header), // header + string(it->footer), // footer + perfect_match_found, // long format + &remaining_lines, // line limit - reduces this by number printed + &completions_output, // completions (not lines) added + completions); // produced completions + perfect_match_found = false; + } + + if (completions_output != matching_flags.size()) { + options->force_no_update = false; + completions->push_back("~ (Remaining flags hidden) ~"); + } else { + options->force_no_update = true; + } +} + +static void RetrieveUnusedFlags( + const set<const CommandLineFlagInfo *> &matching_flags, + const NotableFlags ¬able_flags, + set<const CommandLineFlagInfo *> *unused_flags) { + // Remove from 'matching_flags' set all members of the sets of + // flags we've already printed (specifically, those in notable_flags) + for (set<const CommandLineFlagInfo *>::const_iterator it = + matching_flags.begin(); + it != matching_flags.end(); + ++it) { + if (notable_flags.perfect_match_flag.count(*it) || + notable_flags.module_flags.count(*it) || + notable_flags.package_flags.count(*it) || + notable_flags.most_common_flags.count(*it) || + notable_flags.subpackage_flags.count(*it)) + continue; + unused_flags->insert(*it); + } +} + +// 5) Output matches (and helper methods) + +static void OutputSingleGroupWithLimit( + const set<const CommandLineFlagInfo *> &group, + const string &line_indentation, + const string &header, + const string &footer, + bool long_output_format, + int *remaining_line_limit, + size_t *completion_elements_output, + vector<string> *completions) { + if (group.empty()) return; + if (!header.empty()) { + if (*remaining_line_limit < 2) return; + *remaining_line_limit -= 2; + completions->push_back(line_indentation + header); + completions->push_back(line_indentation + string(header.size(), '-')); + } + for (set<const CommandLineFlagInfo *>::const_iterator it = group.begin(); + it != group.end() && *remaining_line_limit > 0; + ++it) { + --*remaining_line_limit; + ++*completion_elements_output; + completions->push_back( + (long_output_format + ? GetLongFlagLine(line_indentation, **it) + : GetShortFlagLine(line_indentation, **it))); + } + if (!footer.empty()) { + if (*remaining_line_limit < 1) return; + --*remaining_line_limit; + completions->push_back(line_indentation + footer); + } +} + +static string GetShortFlagLine( + const string &line_indentation, + const CommandLineFlagInfo &info) { + string prefix = + line_indentation + "--" + info.name + " [" + + (info.type == "string" ? + ("'" + info.default_value + "'") : + info.default_value) + + "] "; + int remainder = + FLAGS_tab_completion_columns - static_cast<int>(prefix.size()); + string suffix; + if (remainder > 0) + suffix = + (static_cast<int>(info.description.size()) > remainder ? + (info.description.substr(0, remainder - 3) + "...").c_str() : + info.description.c_str()); + return prefix + suffix; +} + +static string GetLongFlagLine( + const string &line_indentation, + const CommandLineFlagInfo &info) { + + string output = DescribeOneFlag(info); + + // Replace '-' with '--', and remove trailing newline before appending + // the module definition location. + string old_flagname = "-" + info.name; + output.replace( + output.find(old_flagname), + old_flagname.size(), + "-" + old_flagname); + // Stick a newline and indentation in front of the type and default + // portions of DescribeOneFlag()s description + static const char kNewlineWithIndent[] = "\n "; + output.replace(output.find(" type:"), 1, string(kNewlineWithIndent)); + output.replace(output.find(" default:"), 1, string(kNewlineWithIndent)); + output = line_indentation + " Details for '--" + info.name + "':\n" + + output + " defined: " + info.filename; + + // Eliminate any doubled newlines that crept in. Specifically, if + // DescribeOneFlag() decided to break the line just before "type" + // or "default", we don't want to introduce an extra blank line + static const string line_of_spaces(FLAGS_tab_completion_columns, ' '); + static const char kDoubledNewlines[] = "\n \n"; + for (string::size_type newlines = output.find(kDoubledNewlines); + newlines != string::npos; + newlines = output.find(kDoubledNewlines)) + // Replace each 'doubled newline' with a single newline + output.replace(newlines, sizeof(kDoubledNewlines) - 1, string("\n")); + + for (string::size_type newline = output.find('\n'); + newline != string::npos; + newline = output.find('\n')) { + int newline_pos = static_cast<int>(newline) % FLAGS_tab_completion_columns; + int missing_spaces = FLAGS_tab_completion_columns - newline_pos; + output.replace(newline, 1, line_of_spaces, 1, missing_spaces); + } + return output; +} +} // anonymous + +void HandleCommandLineCompletions(void) { + if (FLAGS_tab_completion_word.empty()) return; + PrintFlagCompletionInfo(); + exit(0); +} + +_END_GOOGLE_NAMESPACE_ diff --git a/extern/libmv/third_party/gflags/gflags_completions.h b/extern/libmv/third_party/gflags/gflags_completions.h new file mode 100644 index 00000000000..9d9ce7a5f75 --- /dev/null +++ b/extern/libmv/third_party/gflags/gflags_completions.h @@ -0,0 +1,121 @@ +// Copyright (c) 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --- +// Author: Dave Nicponski +// +// Implement helpful bash-style command line flag completions +// +// ** Functional API: +// HandleCommandLineCompletions() should be called early during +// program startup, but after command line flag code has been +// initialized, such as the beginning of HandleCommandLineHelpFlags(). +// It checks the value of the flag --tab_completion_word. If this +// flag is empty, nothing happens here. If it contains a string, +// however, then HandleCommandLineCompletions() will hijack the +// process, attempting to identify the intention behind this +// completion. Regardless of the outcome of this deduction, the +// process will be terminated, similar to --helpshort flag +// handling. +// +// ** Overview of Bash completions: +// Bash can be told to programatically determine completions for the +// current 'cursor word'. It does this by (in this case) invoking a +// command with some additional arguments identifying the command +// being executed, the word being completed, and the previous word +// (if any). Bash then expects a sequence of output lines to be +// printed to stdout. If these lines all contain a common prefix +// longer than the cursor word, bash will replace the cursor word +// with that common prefix, and display nothing. If there isn't such +// a common prefix, bash will display the lines in pages using 'more'. +// +// ** Strategy taken for command line completions: +// If we can deduce either the exact flag intended, or a common flag +// prefix, we'll output exactly that. Otherwise, if information +// must be displayed to the user, we'll take the opportunity to add +// some helpful information beyond just the flag name (specifically, +// we'll include the default flag value and as much of the flag's +// description as can fit on a single terminal line width, as specified +// by the flag --tab_completion_columns). Furthermore, we'll try to +// make bash order the output such that the most useful or relevent +// flags are the most likely to be shown at the top. +// +// ** Additional features: +// To assist in finding that one really useful flag, substring matching +// was implemented. Before pressing a <TAB> to get completion for the +// current word, you can append one or more '?' to the flag to do +// substring matching. Here's the semantics: +// --foo<TAB> Show me all flags with names prefixed by 'foo' +// --foo?<TAB> Show me all flags with 'foo' somewhere in the name +// --foo??<TAB> Same as prior case, but also search in module +// definition path for 'foo' +// --foo???<TAB> Same as prior case, but also search in flag +// descriptions for 'foo' +// Finally, we'll trim the output to a relatively small number of +// flags to keep bash quiet about the verbosity of output. If one +// really wanted to see all possible matches, appending a '+' to the +// search word will force the exhaustive list of matches to be printed. +// +// ** How to have bash accept completions from a binary: +// Bash requires that it be informed about each command that programmatic +// completion should be enabled for. Example addition to a .bashrc +// file would be (your path to gflags_completions.sh file may differ): + +/* +$ complete -o bashdefault -o default -o nospace -C \ + '/usr/local/bin/gflags_completions.sh --tab_completion_columns $COLUMNS' \ + time env binary_name another_binary [...] +*/ + +// This would allow the following to work: +// $ /path/to/binary_name --vmodule<TAB> +// Or: +// $ ./bin/path/another_binary --gfs_u<TAB> +// (etc) +// +// Sadly, it appears that bash gives no easy way to force this behavior for +// all commands. That's where the "time" in the above example comes in. +// If you haven't specifically added a command to the list of completion +// supported commands, you can still get completions by prefixing the +// entire command with "env". +// $ env /some/brand/new/binary --vmod<TAB> +// Assuming that "binary" is a newly compiled binary, this should still +// produce the expected completion output. + + +#ifndef GOOGLE_GFLAGS_COMPLETIONS_H_ +#define GOOGLE_GFLAGS_COMPLETIONS_H_ + +namespace google { + +void HandleCommandLineCompletions(void); + +} + +#endif // GOOGLE_GFLAGS_COMPLETIONS_H_ diff --git a/extern/libmv/third_party/gflags/gflags_reporting.cc b/extern/libmv/third_party/gflags/gflags_reporting.cc new file mode 100644 index 00000000000..fa3024d974e --- /dev/null +++ b/extern/libmv/third_party/gflags/gflags_reporting.cc @@ -0,0 +1,446 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// --- +// Author: Ray Sidney +// Revamped and reorganized by Craig Silverstein +// +// This file contains code for handling the 'reporting' flags. These +// are flags that, when present, cause the program to report some +// information and then exit. --help and --version are the canonical +// reporting flags, but we also have flags like --helpxml, etc. +// +// There's only one function that's meant to be called externally: +// HandleCommandLineHelpFlags(). (Well, actually, ShowUsageWithFlags(), +// ShowUsageWithFlagsRestrict(), and DescribeOneFlag() can be called +// externally too, but there's little need for it.) These are all +// declared in the main commandlineflags.h header file. +// +// HandleCommandLineHelpFlags() will check what 'reporting' flags have +// been defined, if any -- the "help" part of the function name is a +// bit misleading -- and do the relevant reporting. It should be +// called after all flag-values have been assigned, that is, after +// parsing the command-line. + +#include "config.h" +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <assert.h> +#include <string> +#include <vector> +#include "gflags.h" +#include "gflags_completions.h" + +#ifndef PATH_SEPARATOR +#define PATH_SEPARATOR '/' +#endif + +// The 'reporting' flags. They all call exit(). +DEFINE_bool(help, false, + "show help on all flags [tip: all flags can have two dashes]"); +DEFINE_bool(helpfull, false, + "show help on all flags -- same as -help"); +DEFINE_bool(helpshort, false, + "show help on only the main module for this program"); +DEFINE_string(helpon, "", + "show help on the modules named by this flag value"); +DEFINE_string(helpmatch, "", + "show help on modules whose name contains the specified substr"); +DEFINE_bool(helppackage, false, + "show help on all modules in the main package"); +DEFINE_bool(helpxml, false, + "produce an xml version of help"); +DEFINE_bool(version, false, + "show version and build info and exit"); + +_START_GOOGLE_NAMESPACE_ + +using std::string; +using std::vector; + +// -------------------------------------------------------------------- +// DescribeOneFlag() +// DescribeOneFlagInXML() +// Routines that pretty-print info about a flag. These use +// a CommandLineFlagInfo, which is the way the commandlineflags +// API exposes static info about a flag. +// -------------------------------------------------------------------- + +static const int kLineLength = 80; + +static void AddString(const string& s, + string* final_string, int* chars_in_line) { + const int slen = static_cast<int>(s.length()); + if (*chars_in_line + 1 + slen >= kLineLength) { // < 80 chars/line + *final_string += "\n "; + *chars_in_line = 6; + } else { + *final_string += " "; + *chars_in_line += 1; + } + *final_string += s; + *chars_in_line += slen; +} + +static string PrintStringFlagsWithQuotes(const CommandLineFlagInfo& flag, + const string& text, bool current) { + const char* c_string = (current ? flag.current_value.c_str() : + flag.default_value.c_str()); + if (strcmp(flag.type.c_str(), "string") == 0) { // add quotes for strings + return text + ": \"" + c_string + "\""; + } else { + return text + ": " + c_string; + } +} + +// Create a descriptive string for a flag. +// Goes to some trouble to make pretty line breaks. +string DescribeOneFlag(const CommandLineFlagInfo& flag) { + string main_part = (string(" -") + flag.name + + " (" + flag.description + ')'); + const char* c_string = main_part.c_str(); + int chars_left = static_cast<int>(main_part.length()); + string final_string = ""; + int chars_in_line = 0; // how many chars in current line so far? + while (1) { + assert(chars_left == strlen(c_string)); // Unless there's a \0 in there? + const char* newline = strchr(c_string, '\n'); + if (newline == NULL && chars_in_line+chars_left < kLineLength) { + // The whole remainder of the string fits on this line + final_string += c_string; + chars_in_line += chars_left; + break; + } + if (newline != NULL && newline - c_string < kLineLength - chars_in_line) { + int n = static_cast<int>(newline - c_string); + final_string.append(c_string, n); + chars_left -= n + 1; + c_string += n + 1; + } else { + // Find the last whitespace on this 80-char line + int whitespace = kLineLength-chars_in_line-1; // < 80 chars/line + while ( whitespace > 0 && !isspace(c_string[whitespace]) ) { + --whitespace; + } + if (whitespace <= 0) { + // Couldn't find any whitespace to make a line break. Just dump the + // rest out! + final_string += c_string; + chars_in_line = kLineLength; // next part gets its own line for sure! + break; + } + final_string += string(c_string, whitespace); + chars_in_line += whitespace; + while (isspace(c_string[whitespace])) ++whitespace; + c_string += whitespace; + chars_left -= whitespace; + } + if (*c_string == '\0') + break; + final_string += "\n "; + chars_in_line = 6; + } + + // Append data type + AddString(string("type: ") + flag.type, &final_string, &chars_in_line); + // The listed default value will be the actual default from the flag + // definition in the originating source file, unless the value has + // subsequently been modified using SetCommandLineOptionWithMode() with mode + // SET_FLAGS_DEFAULT, or by setting FLAGS_foo = bar before initializing. + AddString(PrintStringFlagsWithQuotes(flag, "default", false), &final_string, + &chars_in_line); + if (!flag.is_default) { + AddString(PrintStringFlagsWithQuotes(flag, "currently", true), + &final_string, &chars_in_line); + } + + final_string += '\n'; + return final_string; +} + +// Simple routine to xml-escape a string: escape & and < only. +static string XMLText(const string& txt) { + string ans = txt; + for (string::size_type pos = 0; (pos = ans.find("&", pos)) != string::npos; ) + ans.replace(pos++, 1, "&"); + for (string::size_type pos = 0; (pos = ans.find("<", pos)) != string::npos; ) + ans.replace(pos++, 1, "<"); + return ans; +} + +static void AddXMLTag(string* r, const char* tag, const string& txt) { + *r += ('<'); + *r += (tag); + *r += ('>'); + *r += (XMLText(txt)); + *r += ("</"); + *r += (tag); + *r += ('>'); +} + +static string DescribeOneFlagInXML(const CommandLineFlagInfo& flag) { + // The file and flagname could have been attributes, but default + // and meaning need to avoid attribute normalization. This way it + // can be parsed by simple programs, in addition to xml parsers. + string r("<flag>"); + AddXMLTag(&r, "file", flag.filename); + AddXMLTag(&r, "name", flag.name); + AddXMLTag(&r, "meaning", flag.description); + AddXMLTag(&r, "default", flag.default_value); + AddXMLTag(&r, "current", flag.current_value); + AddXMLTag(&r, "type", flag.type); + r += "</flag>"; + return r; +} + +// -------------------------------------------------------------------- +// ShowUsageWithFlags() +// ShowUsageWithFlagsRestrict() +// ShowXMLOfFlags() +// These routines variously expose the registry's list of flag +// values. ShowUsage*() prints the flag-value information +// to stdout in a user-readable format (that's what --help uses). +// The Restrict() version limits what flags are shown. +// ShowXMLOfFlags() prints the flag-value information to stdout +// in a machine-readable format. In all cases, the flags are +// sorted: first by filename they are defined in, then by flagname. +// -------------------------------------------------------------------- + +static const char* Basename(const char* filename) { + const char* sep = strrchr(filename, PATH_SEPARATOR); + return sep ? sep + 1 : filename; +} + +static string Dirname(const string& filename) { + string::size_type sep = filename.rfind(PATH_SEPARATOR); + return filename.substr(0, (sep == string::npos) ? 0 : sep); +} + +// Test whether a filename contains at least one of the substrings. +static bool FileMatchesSubstring(const string& filename, + const vector<string>& substrings) { + for (vector<string>::const_iterator target = substrings.begin(); + target != substrings.end(); + ++target) { + if (strstr(filename.c_str(), target->c_str()) != NULL) + return true; + // If the substring starts with a '/', that means that we want + // the string to be at the beginning of a directory component. + // That should match the first directory component as well, so + // we allow '/foo' to match a filename of 'foo'. + if (!target->empty() && (*target)[0] == '/' && + strncmp(filename.c_str(), target->c_str() + 1, + strlen(target->c_str() + 1)) == 0) + return true; + } + return false; +} + +// Show help for every filename which matches any of the target substrings. +// If substrings is empty, shows help for every file. If a flag's help message +// has been stripped (e.g. by adding '#define STRIP_FLAG_HELP 1' before +// including gflags/gflags.h), then this flag will not be displayed by +// '--help' and its variants. +static void ShowUsageWithFlagsMatching(const char *argv0, + const vector<string> &substrings) { + fprintf(stdout, "%s: %s\n", Basename(argv0), ProgramUsage()); + + vector<CommandLineFlagInfo> flags; + GetAllFlags(&flags); // flags are sorted by filename, then flagname + + string last_filename; // so we know when we're at a new file + bool first_directory = true; // controls blank lines between dirs + bool found_match = false; // stays false iff no dir matches restrict + for (vector<CommandLineFlagInfo>::const_iterator flag = flags.begin(); + flag != flags.end(); + ++flag) { + if (substrings.empty() || + FileMatchesSubstring(flag->filename, substrings)) { + // If the flag has been stripped, pretend that it doesn't exist. + if (flag->description == kStrippedFlagHelp) continue; + found_match = true; // this flag passed the match! + if (flag->filename != last_filename) { // new file + if (Dirname(flag->filename) != Dirname(last_filename)) { // new dir! + if (!first_directory) + fprintf(stdout, "\n\n"); // put blank lines between directories + first_directory = false; + } + fprintf(stdout, "\n Flags from %s:\n", flag->filename.c_str()); + last_filename = flag->filename; + } + // Now print this flag + fprintf(stdout, "%s", DescribeOneFlag(*flag).c_str()); + } + } + if (!found_match && !substrings.empty()) { + fprintf(stdout, "\n No modules matched: use -help\n"); + } +} + +void ShowUsageWithFlagsRestrict(const char *argv0, const char *restrict) { + vector<string> substrings; + if (restrict != NULL && *restrict != '\0') { + substrings.push_back(restrict); + } + ShowUsageWithFlagsMatching(argv0, substrings); +} + +void ShowUsageWithFlags(const char *argv0) { + ShowUsageWithFlagsRestrict(argv0, ""); +} + +// Convert the help, program, and usage to xml. +static void ShowXMLOfFlags(const char *prog_name) { + vector<CommandLineFlagInfo> flags; + GetAllFlags(&flags); // flags are sorted: by filename, then flagname + + // XML. There is no corresponding schema yet + fprintf(stdout, "<?xml version=\"1.0\"?>\n"); + // The document + fprintf(stdout, "<AllFlags>\n"); + // the program name and usage + fprintf(stdout, "<program>%s</program>\n", + XMLText(Basename(prog_name)).c_str()); + fprintf(stdout, "<usage>%s</usage>\n", + XMLText(ProgramUsage()).c_str()); + // All the flags + for (vector<CommandLineFlagInfo>::const_iterator flag = flags.begin(); + flag != flags.end(); + ++flag) { + if (flag->description != kStrippedFlagHelp) + fprintf(stdout, "%s\n", DescribeOneFlagInXML(*flag).c_str()); + } + // The end of the document + fprintf(stdout, "</AllFlags>\n"); +} + +// -------------------------------------------------------------------- +// ShowVersion() +// Called upon --version. Prints build-related info. +// -------------------------------------------------------------------- + +static void ShowVersion() { + fprintf(stdout, "%s\n", ProgramInvocationShortName()); + // TODO: add other stuff, like a timestamp, who built it, what + // target they built, etc. + +# if !defined(NDEBUG) + fprintf(stdout, "Debug build (NDEBUG not #defined)\n"); +# endif +} + +static void AppendPrognameStrings(vector<string>* substrings, + const char* progname) { + string r("/"); + r += progname; + substrings->push_back(r + "."); + substrings->push_back(r + "-main."); + substrings->push_back(r + "_main."); +} + +// -------------------------------------------------------------------- +// HandleCommandLineHelpFlags() +// Checks all the 'reporting' commandline flags to see if any +// have been set. If so, handles them appropriately. Note +// that all of them, by definition, cause the program to exit +// if they trigger. +// -------------------------------------------------------------------- + +void HandleCommandLineHelpFlags() { + const char* progname = ProgramInvocationShortName(); + extern void (*commandlineflags_exitfunc)(int); // in gflags.cc + + HandleCommandLineCompletions(); + + vector<string> substrings; + AppendPrognameStrings(&substrings, progname); + + if (FLAGS_helpshort) { + // show only flags related to this binary: + // E.g. for fileutil.cc, want flags containing ... "/fileutil." cc + ShowUsageWithFlagsMatching(progname, substrings); + commandlineflags_exitfunc(1); // almost certainly exit() + + } else if (FLAGS_help || FLAGS_helpfull) { + // show all options + ShowUsageWithFlagsRestrict(progname, ""); // empty restrict + commandlineflags_exitfunc(1); + + } else if (!FLAGS_helpon.empty()) { + string restrict = "/" + FLAGS_helpon + "."; + ShowUsageWithFlagsRestrict(progname, restrict.c_str()); + commandlineflags_exitfunc(1); + + } else if (!FLAGS_helpmatch.empty()) { + ShowUsageWithFlagsRestrict(progname, FLAGS_helpmatch.c_str()); + commandlineflags_exitfunc(1); + + } else if (FLAGS_helppackage) { + // Shows help for all files in the same directory as main(). We + // don't want to resort to looking at dirname(progname), because + // the user can pick progname, and it may not relate to the file + // where main() resides. So instead, we search the flags for a + // filename like "/progname.cc", and take the dirname of that. + vector<CommandLineFlagInfo> flags; + GetAllFlags(&flags); + string last_package; + for (vector<CommandLineFlagInfo>::const_iterator flag = flags.begin(); + flag != flags.end(); + ++flag) { + if (!FileMatchesSubstring(flag->filename, substrings)) + continue; + const string package = Dirname(flag->filename) + "/"; + if (package != last_package) { + ShowUsageWithFlagsRestrict(progname, package.c_str()); + if (!last_package.empty()) { // means this isn't our first pkg + fprintf(stderr, "WARNING: Multiple packages contain a file=%s\n", + progname); + } + last_package = package; + } + } + if (last_package.empty()) { // never found a package to print + fprintf(stderr, "WARNING: Unable to find a package for file=%s\n", + progname); + } + commandlineflags_exitfunc(1); + + } else if (FLAGS_helpxml) { + ShowXMLOfFlags(progname); + commandlineflags_exitfunc(1); + + } else if (FLAGS_version) { + ShowVersion(); + // Unlike help, we may be asking for version in a script, so return 0 + commandlineflags_exitfunc(0); + } +} + +_END_GOOGLE_NAMESPACE_ diff --git a/extern/libmv/third_party/gflags/mutex.h b/extern/libmv/third_party/gflags/mutex.h new file mode 100644 index 00000000000..6e1e8976b6d --- /dev/null +++ b/extern/libmv/third_party/gflags/mutex.h @@ -0,0 +1,349 @@ +// Copyright (c) 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --- +// Author: Craig Silverstein. +// +// A simple mutex wrapper, supporting locks and read-write locks. +// You should assume the locks are *not* re-entrant. +// +// To use: you should define the following macros in your configure.ac: +// ACX_PTHREAD +// AC_RWLOCK +// The latter is defined in ../autoconf. +// +// This class is meant to be internal-only and should be wrapped by an +// internal namespace. Before you use this module, please give the +// name of your internal namespace for this module. Or, if you want +// to expose it, you'll want to move it to the Google namespace. We +// cannot put this class in global namespace because there can be some +// problems when we have multiple versions of Mutex in each shared object. +// +// NOTE: by default, we have #ifdef'ed out the TryLock() method. +// This is for two reasons: +// 1) TryLock() under Windows is a bit annoying (it requires a +// #define to be defined very early). +// 2) TryLock() is broken for NO_THREADS mode, at least in NDEBUG +// mode. +// If you need TryLock(), and either these two caveats are not a +// problem for you, or you're willing to work around them, then +// feel free to #define GMUTEX_TRYLOCK, or to remove the #ifdefs +// in the code below. +// +// CYGWIN NOTE: Cygwin support for rwlock seems to be buggy: +// http://www.cygwin.com/ml/cygwin/2008-12/msg00017.html +// Because of that, we might as well use windows locks for +// cygwin. They seem to be more reliable than the cygwin pthreads layer. +// +// TRICKY IMPLEMENTATION NOTE: +// This class is designed to be safe to use during +// dynamic-initialization -- that is, by global constructors that are +// run before main() starts. The issue in this case is that +// dynamic-initialization happens in an unpredictable order, and it +// could be that someone else's dynamic initializer could call a +// function that tries to acquire this mutex -- but that all happens +// before this mutex's constructor has run. (This can happen even if +// the mutex and the function that uses the mutex are in the same .cc +// file.) Basically, because Mutex does non-trivial work in its +// constructor, it's not, in the naive implementation, safe to use +// before dynamic initialization has run on it. +// +// The solution used here is to pair the actual mutex primitive with a +// bool that is set to true when the mutex is dynamically initialized. +// (Before that it's false.) Then we modify all mutex routines to +// look at the bool, and not try to lock/unlock until the bool makes +// it to true (which happens after the Mutex constructor has run.) +// +// This works because before main() starts -- particularly, during +// dynamic initialization -- there are no threads, so a) it's ok that +// the mutex operations are a no-op, since we don't need locking then +// anyway; and b) we can be quite confident our bool won't change +// state between a call to Lock() and a call to Unlock() (that would +// require a global constructor in one translation unit to call Lock() +// and another global constructor in another translation unit to call +// Unlock() later, which is pretty perverse). +// +// That said, it's tricky, and can conceivably fail; it's safest to +// avoid trying to acquire a mutex in a global constructor, if you +// can. One way it can fail is that a really smart compiler might +// initialize the bool to true at static-initialization time (too +// early) rather than at dynamic-initialization time. To discourage +// that, we set is_safe_ to true in code (not the constructor +// colon-initializer) and set it to true via a function that always +// evaluates to true, but that the compiler can't know always +// evaluates to true. This should be good enough. +// +// A related issue is code that could try to access the mutex +// after it's been destroyed in the global destructors (because +// the Mutex global destructor runs before some other global +// destructor, that tries to acquire the mutex). The way we +// deal with this is by taking a constructor arg that global +// mutexes should pass in, that causes the destructor to do no +// work. We still depend on the compiler not doing anything +// weird to a Mutex's memory after it is destroyed, but for a +// static global variable, that's pretty safe. + +#ifndef GOOGLE_MUTEX_H_ +#define GOOGLE_MUTEX_H_ + +#include "config.h" // to figure out pthreads support + +#if defined(NO_THREADS) + typedef int MutexType; // to keep a lock-count +#elif defined(_WIN32) || defined(__CYGWIN32__) || defined(__CYGWIN64__) +# define WIN32_LEAN_AND_MEAN // We only need minimal includes +# ifdef GMUTEX_TRYLOCK + // We need Windows NT or later for TryEnterCriticalSection(). If you + // don't need that functionality, you can remove these _WIN32_WINNT + // lines, and change TryLock() to assert(0) or something. +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0400 +# endif +# endif +# include <windows.h> + typedef CRITICAL_SECTION MutexType; +#elif defined(HAVE_PTHREAD) && defined(HAVE_RWLOCK) + // Needed for pthread_rwlock_*. If it causes problems, you could take it + // out, but then you'd have to unset HAVE_RWLOCK (at least on linux -- it + // *does* cause problems for FreeBSD, or MacOSX, but isn't needed + // for locking there.) +# ifdef __linux__ +# define _XOPEN_SOURCE 500 // may be needed to get the rwlock calls +# endif +# include <pthread.h> + typedef pthread_rwlock_t MutexType; +#elif defined(HAVE_PTHREAD) +# include <pthread.h> + typedef pthread_mutex_t MutexType; +#else +# error Need to implement mutex.h for your architecture, or #define NO_THREADS +#endif + +#include <assert.h> +#include <stdlib.h> // for abort() + +#define MUTEX_NAMESPACE gflags_mutex_namespace + +namespace MUTEX_NAMESPACE { + +class Mutex { + public: + // This is used for the single-arg constructor + enum LinkerInitialized { LINKER_INITIALIZED }; + + // Create a Mutex that is not held by anybody. This constructor is + // typically used for Mutexes allocated on the heap or the stack. + inline Mutex(); + // This constructor should be used for global, static Mutex objects. + // It inhibits work being done by the destructor, which makes it + // safer for code that tries to acqiure this mutex in their global + // destructor. + inline Mutex(LinkerInitialized); + + // Destructor + inline ~Mutex(); + + inline void Lock(); // Block if needed until free then acquire exclusively + inline void Unlock(); // Release a lock acquired via Lock() +#ifdef GMUTEX_TRYLOCK + inline bool TryLock(); // If free, Lock() and return true, else return false +#endif + // Note that on systems that don't support read-write locks, these may + // be implemented as synonyms to Lock() and Unlock(). So you can use + // these for efficiency, but don't use them anyplace where being able + // to do shared reads is necessary to avoid deadlock. + inline void ReaderLock(); // Block until free or shared then acquire a share + inline void ReaderUnlock(); // Release a read share of this Mutex + inline void WriterLock() { Lock(); } // Acquire an exclusive lock + inline void WriterUnlock() { Unlock(); } // Release a lock from WriterLock() + + private: + MutexType mutex_; + // We want to make sure that the compiler sets is_safe_ to true only + // when we tell it to, and never makes assumptions is_safe_ is + // always true. volatile is the most reliable way to do that. + volatile bool is_safe_; + // This indicates which constructor was called. + bool destroy_; + + inline void SetIsSafe() { is_safe_ = true; } + + // Catch the error of writing Mutex when intending MutexLock. + Mutex(Mutex* /*ignored*/) {} + // Disallow "evil" constructors + Mutex(const Mutex&); + void operator=(const Mutex&); +}; + +// Now the implementation of Mutex for various systems +#if defined(NO_THREADS) + +// When we don't have threads, we can be either reading or writing, +// but not both. We can have lots of readers at once (in no-threads +// mode, that's most likely to happen in recursive function calls), +// but only one writer. We represent this by having mutex_ be -1 when +// writing and a number > 0 when reading (and 0 when no lock is held). +// +// In debug mode, we assert these invariants, while in non-debug mode +// we do nothing, for efficiency. That's why everything is in an +// assert. + +Mutex::Mutex() : mutex_(0) { } +Mutex::Mutex(Mutex::LinkerInitialized) : mutex_(0) { } +Mutex::~Mutex() { assert(mutex_ == 0); } +void Mutex::Lock() { assert(--mutex_ == -1); } +void Mutex::Unlock() { assert(mutex_++ == -1); } +#ifdef GMUTEX_TRYLOCK +bool Mutex::TryLock() { if (mutex_) return false; Lock(); return true; } +#endif +void Mutex::ReaderLock() { assert(++mutex_ > 0); } +void Mutex::ReaderUnlock() { assert(mutex_-- > 0); } + +#elif defined(_WIN32) || defined(__CYGWIN32__) || defined(__CYGWIN64__) + +Mutex::Mutex() : destroy_(true) { + InitializeCriticalSection(&mutex_); + SetIsSafe(); +} +Mutex::Mutex(LinkerInitialized) : destroy_(false) { + InitializeCriticalSection(&mutex_); + SetIsSafe(); +} +Mutex::~Mutex() { if (destroy_) DeleteCriticalSection(&mutex_); } +void Mutex::Lock() { if (is_safe_) EnterCriticalSection(&mutex_); } +void Mutex::Unlock() { if (is_safe_) LeaveCriticalSection(&mutex_); } +#ifdef GMUTEX_TRYLOCK +bool Mutex::TryLock() { return is_safe_ ? + TryEnterCriticalSection(&mutex_) != 0 : true; } +#endif +void Mutex::ReaderLock() { Lock(); } // we don't have read-write locks +void Mutex::ReaderUnlock() { Unlock(); } + +#elif defined(HAVE_PTHREAD) && defined(HAVE_RWLOCK) + +#define SAFE_PTHREAD(fncall) do { /* run fncall if is_safe_ is true */ \ + if (is_safe_ && fncall(&mutex_) != 0) abort(); \ +} while (0) + +Mutex::Mutex() : destroy_(true) { + SetIsSafe(); + if (is_safe_ && pthread_rwlock_init(&mutex_, NULL) != 0) abort(); +} +Mutex::Mutex(Mutex::LinkerInitialized) : destroy_(false) { + SetIsSafe(); + if (is_safe_ && pthread_rwlock_init(&mutex_, NULL) != 0) abort(); +} +Mutex::~Mutex() { if (destroy_) SAFE_PTHREAD(pthread_rwlock_destroy); } +void Mutex::Lock() { SAFE_PTHREAD(pthread_rwlock_wrlock); } +void Mutex::Unlock() { SAFE_PTHREAD(pthread_rwlock_unlock); } +#ifdef GMUTEX_TRYLOCK +bool Mutex::TryLock() { return is_safe_ ? + pthread_rwlock_trywrlock(&mutex_) == 0 : true; } +#endif +void Mutex::ReaderLock() { SAFE_PTHREAD(pthread_rwlock_rdlock); } +void Mutex::ReaderUnlock() { SAFE_PTHREAD(pthread_rwlock_unlock); } +#undef SAFE_PTHREAD + +#elif defined(HAVE_PTHREAD) + +#define SAFE_PTHREAD(fncall) do { /* run fncall if is_safe_ is true */ \ + if (is_safe_ && fncall(&mutex_) != 0) abort(); \ +} while (0) + +Mutex::Mutex() : destroy_(true) { + SetIsSafe(); + if (is_safe_ && pthread_mutex_init(&mutex_, NULL) != 0) abort(); +} +Mutex::Mutex(Mutex::LinkerInitialized) : destroy_(false) { + SetIsSafe(); + if (is_safe_ && pthread_mutex_init(&mutex_, NULL) != 0) abort(); +} +Mutex::~Mutex() { if (destroy_) SAFE_PTHREAD(pthread_mutex_destroy); } +void Mutex::Lock() { SAFE_PTHREAD(pthread_mutex_lock); } +void Mutex::Unlock() { SAFE_PTHREAD(pthread_mutex_unlock); } +#ifdef GMUTEX_TRYLOCK +bool Mutex::TryLock() { return is_safe_ ? + pthread_mutex_trylock(&mutex_) == 0 : true; } +#endif +void Mutex::ReaderLock() { Lock(); } +void Mutex::ReaderUnlock() { Unlock(); } +#undef SAFE_PTHREAD + +#endif + +// -------------------------------------------------------------------------- +// Some helper classes + +// MutexLock(mu) acquires mu when constructed and releases it when destroyed. +class MutexLock { + public: + explicit MutexLock(Mutex *mu) : mu_(mu) { mu_->Lock(); } + ~MutexLock() { mu_->Unlock(); } + private: + Mutex * const mu_; + // Disallow "evil" constructors + MutexLock(const MutexLock&); + void operator=(const MutexLock&); +}; + +// ReaderMutexLock and WriterMutexLock do the same, for rwlocks +class ReaderMutexLock { + public: + explicit ReaderMutexLock(Mutex *mu) : mu_(mu) { mu_->ReaderLock(); } + ~ReaderMutexLock() { mu_->ReaderUnlock(); } + private: + Mutex * const mu_; + // Disallow "evil" constructors + ReaderMutexLock(const ReaderMutexLock&); + void operator=(const ReaderMutexLock&); +}; + +class WriterMutexLock { + public: + explicit WriterMutexLock(Mutex *mu) : mu_(mu) { mu_->WriterLock(); } + ~WriterMutexLock() { mu_->WriterUnlock(); } + private: + Mutex * const mu_; + // Disallow "evil" constructors + WriterMutexLock(const WriterMutexLock&); + void operator=(const WriterMutexLock&); +}; + +// Catch bug where variable name is omitted, e.g. MutexLock (&mu); +#define MutexLock(x) COMPILE_ASSERT(0, mutex_lock_decl_missing_var_name) +#define ReaderMutexLock(x) COMPILE_ASSERT(0, rmutex_lock_decl_missing_var_name) +#define WriterMutexLock(x) COMPILE_ASSERT(0, wmutex_lock_decl_missing_var_name) + +} // namespace MUTEX_NAMESPACE + +using namespace MUTEX_NAMESPACE; + +#undef MUTEX_NAMESPACE + +#endif /* #define GOOGLE_MUTEX_H__ */ diff --git a/extern/libmv/third_party/glog/AUTHORS b/extern/libmv/third_party/glog/AUTHORS new file mode 100644 index 00000000000..ee92be88dcf --- /dev/null +++ b/extern/libmv/third_party/glog/AUTHORS @@ -0,0 +1,2 @@ +opensource@google.com + diff --git a/extern/libmv/third_party/glog/COPYING b/extern/libmv/third_party/glog/COPYING new file mode 100644 index 00000000000..38396b580b3 --- /dev/null +++ b/extern/libmv/third_party/glog/COPYING @@ -0,0 +1,65 @@ +Copyright (c) 2008, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +A function gettimeofday in utilities.cc is based on + +http://www.google.com/codesearch/p?hl=en#dR3YEbitojA/COPYING&q=GetSystemTimeAsFileTime%20license:bsd + +The license of this code is: + +Copyright (c) 2003-2008, Jouni Malinen <j@w1.fi> and contributors +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name(s) of the above-listed copyright holder(s) nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/extern/libmv/third_party/glog/ChangeLog b/extern/libmv/third_party/glog/ChangeLog new file mode 100644 index 00000000000..350fee921e3 --- /dev/null +++ b/extern/libmv/third_party/glog/ChangeLog @@ -0,0 +1,59 @@ +2010-06-15 Google Inc. <opensource@google.com> + + * google-glog: version 0.3.1 + * GLOG_* environment variables now work even when gflags is installed. + * Snow leopard support. + * Now we can build and test from out side tree. + * Add DCHECK_NOTNULL. + * Add ShutdownGoogleLogging to close syslog (thanks DGunchev) + * Fix --enable-frame-pointers option (thanks kazuki.ohta) + * Fix libunwind detection (thanks giantchen) + +2009-07-30 Google Inc. <opensource@google.com> + + * google-glog: version 0.3.0 + * Fix a deadlock happened when user uses glog with recent gflags. + * Suppress several unnecessary warnings (thanks keir). + * NetBSD and OpenBSD support. + * Use Win32API GetComputeNameA properly (thanks magila). + * Fix user name detection for Windows (thanks ademin). + * Fix several minor bugs. + +2009-04-10 Google Inc. <opensource@google.com> + * google-glog: version 0.2.1 + * Fix timestamps of VC++ version. + * Add pkg-config support (thanks Tomasz) + * Fix build problem when building with gtest (thanks Michael) + * Add --with-gflags option for configure (thanks Michael) + * Fixes for GCC 4.4 (thanks John) + +2009-01-23 Google Inc. <opensource@google.com> + * google-glog: version 0.2 + * Add initial Windows VC++ support. + * Google testing/mocking frameworks integration. + * Link pthread library automatically. + * Flush logs in signal handlers. + * Add macros LOG_TO_STRING, LOG_AT_LEVEL, DVLOG, and LOG_TO_SINK_ONLY. + * Log microseconds. + * Add --log_backtrace_at option. + * Fix some minor bugs. + +2008-11-18 Google Inc. <opensource@google.com> + * google-glog: version 0.1.2 + * Add InstallFailureSignalHandler(). (satorux) + * Re-organize the way to produce stacktraces. + * Don't define unnecessary macro DISALLOW_EVIL_CONSTRUCTORS. + +2008-10-15 Google Inc. <opensource@google.com> + * google-glog: version 0.1.1 + * Support symbolize for MacOSX 10.5. + * BUG FIX: --vmodule didn't work with gflags. + * BUG FIX: symbolize_unittest failed with GCC 4.3. + * Several fixes on the document. + +2008-10-07 Google Inc. <opensource@google.com> + + * google-glog: initial release: + The glog package contains a library that implements application-level + logging. This library provides logging APIs based on C++-style + streams and various helper macros. diff --git a/extern/libmv/third_party/glog/NEWS b/extern/libmv/third_party/glog/NEWS new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/extern/libmv/third_party/glog/NEWS diff --git a/extern/libmv/third_party/glog/README b/extern/libmv/third_party/glog/README new file mode 100644 index 00000000000..77efd37505a --- /dev/null +++ b/extern/libmv/third_party/glog/README @@ -0,0 +1,5 @@ +This repository contains a C++ implementation of the Google logging +module. Documentation for the implementation is in doc/. + +See INSTALL for (generic) installation instructions for C++: basically + ./configure && make && make install diff --git a/extern/libmv/third_party/glog/README.libmv b/extern/libmv/third_party/glog/README.libmv new file mode 100644 index 00000000000..8f1243b2430 --- /dev/null +++ b/extern/libmv/third_party/glog/README.libmv @@ -0,0 +1,38 @@ +Project: Google Logging +URL: http://code.google.com/p/google-glog/ +License: New BSD +Upstream version: 0.3.1 +Local modifications: + +Upgrading Notes +* Had to change #include <gflags/gflags.h> to #include "gflags/gflags.h" +* Make sure to copy over a config_YOUR_PLATFORM.h and put it in config.h + +Old changes which got obsoleted (maybe?) by 0.3.1 merge: +* The config_linux.h is generated by configure on Keir's Ubuntu 9.04 desktop. +* Commented out some struct ::tm weirdness causing compile failures on + ubuntu 8.10 and 9.04. +* Switched several initializers to memset instead of = {}. +* Changed some includes pointing to gflags. Not sure why the regular inclusion + didn't work. +* Added some compile flags to silence various warnings, allowing us to keep the + differences between upstream small. +* Don't redefine _XOPEN_SOURCE. +* Added "google::" to GetReferenceableValue in CHECK_OP_LOG. +* Add virtual destructor to Thread in googletest.h. +* Update windows/glog/log_severity to build with QT library that include WinGDI + (It cause a double definition of ERROR variable). + +Old changes which got obsoleted (maybe?) by 0.2.1 merge: +* Added #ifndef / def REG_EIP; not sure what that is. +* Added (void) arg stuff to prevent unused variable warnings. +* Added google:: namespace prefix to GetReferencableValue +* Added assignments for several functions marked with no_ignore_return, where + the return value was ignored. +* Commented out the unused function DumpPCAndSymbol() in utilities.cc to silent + gcc on the mac + +TODO(keir): Remove any obsoleted changes above if they are not necessary after +testing on more platforms. + +WARNING: Mac port not updated for 0.2.1 diff --git a/extern/libmv/third_party/glog/src/base/commandlineflags.h b/extern/libmv/third_party/glog/src/base/commandlineflags.h new file mode 100644 index 00000000000..6c529ccd847 --- /dev/null +++ b/extern/libmv/third_party/glog/src/base/commandlineflags.h @@ -0,0 +1,132 @@ +// Copyright (c) 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// --- +// This file is a compatibility layer that defines Google's version of +// command line flags that are used for configuration. +// +// We put flags into their own namespace. It is purposefully +// named in an opaque way that people should have trouble typing +// directly. The idea is that DEFINE puts the flag in the weird +// namespace, and DECLARE imports the flag from there into the +// current namespace. The net result is to force people to use +// DECLARE to get access to a flag, rather than saying +// extern bool FLAGS_logtostderr; +// or some such instead. We want this so we can put extra +// functionality (like sanity-checking) in DECLARE if we want, +// and make sure it is picked up everywhere. +// +// We also put the type of the variable in the namespace, so that +// people can't DECLARE_int32 something that they DEFINE_bool'd +// elsewhere. +#ifndef BASE_COMMANDLINEFLAGS_H__ +#define BASE_COMMANDLINEFLAGS_H__ + +#include "config.h" +#include <string> +#include <string.h> // for memchr +#include <stdlib.h> // for getenv + +#ifdef HAVE_LIB_GFLAGS + +#include "third_party/gflags/gflags.h" + +#else + +#include "glog/logging.h" + +#define DECLARE_VARIABLE(type, name, tn) \ + namespace FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead { \ + extern GOOGLE_GLOG_DLL_DECL type FLAGS_##name; \ + } \ + using FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead::FLAGS_##name +#define DEFINE_VARIABLE(type, name, value, meaning, tn) \ + namespace FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead { \ + GOOGLE_GLOG_DLL_DECL type FLAGS_##name(value); \ + char FLAGS_no##name; \ + } \ + using FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead::FLAGS_##name + +// bool specialization +#define DECLARE_bool(name) \ + DECLARE_VARIABLE(bool, name, bool) +#define DEFINE_bool(name, value, meaning) \ + DEFINE_VARIABLE(bool, name, value, meaning, bool) + +// int32 specialization +#define DECLARE_int32(name) \ + DECLARE_VARIABLE(GOOGLE_NAMESPACE::int32, name, int32) +#define DEFINE_int32(name, value, meaning) \ + DEFINE_VARIABLE(GOOGLE_NAMESPACE::int32, name, value, meaning, int32) + +// Special case for string, because we have to specify the namespace +// std::string, which doesn't play nicely with our FLAG__namespace hackery. +#define DECLARE_string(name) \ + namespace FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead { \ + extern GOOGLE_GLOG_DLL_DECL std::string FLAGS_##name; \ + } \ + using FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead::FLAGS_##name +#define DEFINE_string(name, value, meaning) \ + namespace FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead { \ + GOOGLE_GLOG_DLL_DECL std::string FLAGS_##name(value); \ + char FLAGS_no##name; \ + } \ + using FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead::FLAGS_##name + +#endif // HAVE_LIB_GFLAGS + +// Define GLOG_DEFINE_* using DEFINE_* . By using these macros, we +// have GLOG_* environ variables even if we have gflags installed. +// +// If both an environment variable and a flag are specified, the value +// specified by a flag wins. E.g., if GLOG_v=0 and --v=1, the +// verbosity will be 1, not 0. + +#define GLOG_DEFINE_bool(name, value, meaning) \ + DEFINE_bool(name, EnvToBool("GLOG_" #name, value), meaning) + +#define GLOG_DEFINE_int32(name, value, meaning) \ + DEFINE_int32(name, EnvToInt("GLOG_" #name, value), meaning) + +#define GLOG_DEFINE_string(name, value, meaning) \ + DEFINE_string(name, EnvToString("GLOG_" #name, value), meaning) + +// These macros (could be functions, but I don't want to bother with a .cc +// file), make it easier to initialize flags from the environment. + +#define EnvToString(envname, dflt) \ + (!getenv(envname) ? (dflt) : getenv(envname)) + +#define EnvToBool(envname, dflt) \ + (!getenv(envname) ? (dflt) : memchr("tTyY1\0", getenv(envname)[0], 6) != NULL) + +#define EnvToInt(envname, dflt) \ + (!getenv(envname) ? (dflt) : strtol(getenv(envname), NULL, 10)) + +#endif // BASE_COMMANDLINEFLAGS_H__ diff --git a/extern/libmv/third_party/glog/src/base/googleinit.h b/extern/libmv/third_party/glog/src/base/googleinit.h new file mode 100644 index 00000000000..c907308e852 --- /dev/null +++ b/extern/libmv/third_party/glog/src/base/googleinit.h @@ -0,0 +1,51 @@ +// Copyright (c) 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// --- +// Author: Jacob Hoffman-Andrews + +#ifndef _GOOGLEINIT_H +#define _GOOGLEINIT_H + +class GoogleInitializer { + public: + typedef void (*void_function)(void); + GoogleInitializer(const char* name, void_function f) { + f(); + } +}; + +#define REGISTER_MODULE_INITIALIZER(name, body) \ + namespace { \ + static void google_init_module_##name () { body; } \ + GoogleInitializer google_initializer_module_##name(#name, \ + google_init_module_##name); \ + } + +#endif /* _GOOGLEINIT_H */ diff --git a/extern/libmv/third_party/glog/src/base/mutex.h b/extern/libmv/third_party/glog/src/base/mutex.h new file mode 100644 index 00000000000..7ba88cb5a63 --- /dev/null +++ b/extern/libmv/third_party/glog/src/base/mutex.h @@ -0,0 +1,325 @@ +// Copyright (c) 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --- +// Author: Craig Silverstein. +// +// A simple mutex wrapper, supporting locks and read-write locks. +// You should assume the locks are *not* re-entrant. +// +// To use: you should define the following macros in your configure.ac: +// ACX_PTHREAD +// AC_RWLOCK +// The latter is defined in ../autoconf. +// +// This class is meant to be internal-only and should be wrapped by an +// internal namespace. Before you use this module, please give the +// name of your internal namespace for this module. Or, if you want +// to expose it, you'll want to move it to the Google namespace. We +// cannot put this class in global namespace because there can be some +// problems when we have multiple versions of Mutex in each shared object. +// +// NOTE: by default, we have #ifdef'ed out the TryLock() method. +// This is for two reasons: +// 1) TryLock() under Windows is a bit annoying (it requires a +// #define to be defined very early). +// 2) TryLock() is broken for NO_THREADS mode, at least in NDEBUG +// mode. +// If you need TryLock(), and either these two caveats are not a +// problem for you, or you're willing to work around them, then +// feel free to #define GMUTEX_TRYLOCK, or to remove the #ifdefs +// in the code below. +// +// CYGWIN NOTE: Cygwin support for rwlock seems to be buggy: +// http://www.cygwin.com/ml/cygwin/2008-12/msg00017.html +// Because of that, we might as well use windows locks for +// cygwin. They seem to be more reliable than the cygwin pthreads layer. +// +// TRICKY IMPLEMENTATION NOTE: +// This class is designed to be safe to use during +// dynamic-initialization -- that is, by global constructors that are +// run before main() starts. The issue in this case is that +// dynamic-initialization happens in an unpredictable order, and it +// could be that someone else's dynamic initializer could call a +// function that tries to acquire this mutex -- but that all happens +// before this mutex's constructor has run. (This can happen even if +// the mutex and the function that uses the mutex are in the same .cc +// file.) Basically, because Mutex does non-trivial work in its +// constructor, it's not, in the naive implementation, safe to use +// before dynamic initialization has run on it. +// +// The solution used here is to pair the actual mutex primitive with a +// bool that is set to true when the mutex is dynamically initialized. +// (Before that it's false.) Then we modify all mutex routines to +// look at the bool, and not try to lock/unlock until the bool makes +// it to true (which happens after the Mutex constructor has run.) +// +// This works because before main() starts -- particularly, during +// dynamic initialization -- there are no threads, so a) it's ok that +// the mutex operations are a no-op, since we don't need locking then +// anyway; and b) we can be quite confident our bool won't change +// state between a call to Lock() and a call to Unlock() (that would +// require a global constructor in one translation unit to call Lock() +// and another global constructor in another translation unit to call +// Unlock() later, which is pretty perverse). +// +// That said, it's tricky, and can conceivably fail; it's safest to +// avoid trying to acquire a mutex in a global constructor, if you +// can. One way it can fail is that a really smart compiler might +// initialize the bool to true at static-initialization time (too +// early) rather than at dynamic-initialization time. To discourage +// that, we set is_safe_ to true in code (not the constructor +// colon-initializer) and set it to true via a function that always +// evaluates to true, but that the compiler can't know always +// evaluates to true. This should be good enough. + +#ifndef GOOGLE_MUTEX_H_ +#define GOOGLE_MUTEX_H_ + +#include "config.h" // to figure out pthreads support + +#if defined(NO_THREADS) + typedef int MutexType; // to keep a lock-count +#elif defined(_WIN32) || defined(__CYGWIN32__) || defined(__CYGWIN64__) +# define WIN32_LEAN_AND_MEAN // We only need minimal includes +# ifdef GMUTEX_TRYLOCK + // We need Windows NT or later for TryEnterCriticalSection(). If you + // don't need that functionality, you can remove these _WIN32_WINNT + // lines, and change TryLock() to assert(0) or something. +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0400 +# endif +# endif +// To avoid macro definition of ERROR. +# define NOGDI +// To avoid macro definition of min/max. +# define NOMINMAX +# include <windows.h> + typedef CRITICAL_SECTION MutexType; +#elif defined(HAVE_PTHREAD) && defined(HAVE_RWLOCK) + // Needed for pthread_rwlock_*. If it causes problems, you could take it + // out, but then you'd have to unset HAVE_RWLOCK (at least on linux -- it + // *does* cause problems for FreeBSD, or MacOSX, but isn't needed + // for locking there.) +# ifdef __linux__ +# define _XOPEN_SOURCE 500 // may be needed to get the rwlock calls +# endif +# include <pthread.h> + typedef pthread_rwlock_t MutexType; +#elif defined(HAVE_PTHREAD) +# include <pthread.h> + typedef pthread_mutex_t MutexType; +#else +# error Need to implement mutex.h for your architecture, or #define NO_THREADS +#endif + +// We need to include these header files after defining _XOPEN_SOURCE +// as they may define the _XOPEN_SOURCE macro. +#include <assert.h> +#include <stdlib.h> // for abort() + +#define MUTEX_NAMESPACE glog_internal_namespace_ + +namespace MUTEX_NAMESPACE { + +class Mutex { + public: + // Create a Mutex that is not held by anybody. This constructor is + // typically used for Mutexes allocated on the heap or the stack. + // See below for a recommendation for constructing global Mutex + // objects. + inline Mutex(); + + // Destructor + inline ~Mutex(); + + inline void Lock(); // Block if needed until free then acquire exclusively + inline void Unlock(); // Release a lock acquired via Lock() +#ifdef GMUTEX_TRYLOCK + inline bool TryLock(); // If free, Lock() and return true, else return false +#endif + // Note that on systems that don't support read-write locks, these may + // be implemented as synonyms to Lock() and Unlock(). So you can use + // these for efficiency, but don't use them anyplace where being able + // to do shared reads is necessary to avoid deadlock. + inline void ReaderLock(); // Block until free or shared then acquire a share + inline void ReaderUnlock(); // Release a read share of this Mutex + inline void WriterLock() { Lock(); } // Acquire an exclusive lock + inline void WriterUnlock() { Unlock(); } // Release a lock from WriterLock() + + // TODO(hamaji): Do nothing, implement correctly. + inline void AssertHeld() {} + + private: + MutexType mutex_; + // We want to make sure that the compiler sets is_safe_ to true only + // when we tell it to, and never makes assumptions is_safe_ is + // always true. volatile is the most reliable way to do that. + volatile bool is_safe_; + + inline void SetIsSafe() { is_safe_ = true; } + + // Catch the error of writing Mutex when intending MutexLock. + Mutex(Mutex* /*ignored*/) {} + // Disallow "evil" constructors + Mutex(const Mutex&); + void operator=(const Mutex&); +}; + +// Now the implementation of Mutex for various systems +#if defined(NO_THREADS) + +// When we don't have threads, we can be either reading or writing, +// but not both. We can have lots of readers at once (in no-threads +// mode, that's most likely to happen in recursive function calls), +// but only one writer. We represent this by having mutex_ be -1 when +// writing and a number > 0 when reading (and 0 when no lock is held). +// +// In debug mode, we assert these invariants, while in non-debug mode +// we do nothing, for efficiency. That's why everything is in an +// assert. + +Mutex::Mutex() : mutex_(0) { } +Mutex::~Mutex() { assert(mutex_ == 0); } +void Mutex::Lock() { assert(--mutex_ == -1); } +void Mutex::Unlock() { assert(mutex_++ == -1); } +#ifdef GMUTEX_TRYLOCK +bool Mutex::TryLock() { if (mutex_) return false; Lock(); return true; } +#endif +void Mutex::ReaderLock() { assert(++mutex_ > 0); } +void Mutex::ReaderUnlock() { assert(mutex_-- > 0); } + +#elif defined(_WIN32) || defined(__CYGWIN32__) || defined(__CYGWIN64__) + +Mutex::Mutex() { InitializeCriticalSection(&mutex_); SetIsSafe(); } +Mutex::~Mutex() { DeleteCriticalSection(&mutex_); } +void Mutex::Lock() { if (is_safe_) EnterCriticalSection(&mutex_); } +void Mutex::Unlock() { if (is_safe_) LeaveCriticalSection(&mutex_); } +#ifdef GMUTEX_TRYLOCK +bool Mutex::TryLock() { return is_safe_ ? + TryEnterCriticalSection(&mutex_) != 0 : true; } +#endif +void Mutex::ReaderLock() { Lock(); } // we don't have read-write locks +void Mutex::ReaderUnlock() { Unlock(); } + +#elif defined(HAVE_PTHREAD) && defined(HAVE_RWLOCK) + +#define SAFE_PTHREAD(fncall) do { /* run fncall if is_safe_ is true */ \ + if (is_safe_ && fncall(&mutex_) != 0) abort(); \ +} while (0) + +Mutex::Mutex() { + SetIsSafe(); + if (is_safe_ && pthread_rwlock_init(&mutex_, NULL) != 0) abort(); +} +Mutex::~Mutex() { SAFE_PTHREAD(pthread_rwlock_destroy); } +void Mutex::Lock() { SAFE_PTHREAD(pthread_rwlock_wrlock); } +void Mutex::Unlock() { SAFE_PTHREAD(pthread_rwlock_unlock); } +#ifdef GMUTEX_TRYLOCK +bool Mutex::TryLock() { return is_safe_ ? + pthread_rwlock_trywrlock(&mutex_) == 0 : + true; } +#endif +void Mutex::ReaderLock() { SAFE_PTHREAD(pthread_rwlock_rdlock); } +void Mutex::ReaderUnlock() { SAFE_PTHREAD(pthread_rwlock_unlock); } +#undef SAFE_PTHREAD + +#elif defined(HAVE_PTHREAD) + +#define SAFE_PTHREAD(fncall) do { /* run fncall if is_safe_ is true */ \ + if (is_safe_ && fncall(&mutex_) != 0) abort(); \ +} while (0) + +Mutex::Mutex() { + SetIsSafe(); + if (is_safe_ && pthread_mutex_init(&mutex_, NULL) != 0) abort(); +} +Mutex::~Mutex() { SAFE_PTHREAD(pthread_mutex_destroy); } +void Mutex::Lock() { SAFE_PTHREAD(pthread_mutex_lock); } +void Mutex::Unlock() { SAFE_PTHREAD(pthread_mutex_unlock); } +#ifdef GMUTEX_TRYLOCK +bool Mutex::TryLock() { return is_safe_ ? + pthread_mutex_trylock(&mutex_) == 0 : true; } +#endif +void Mutex::ReaderLock() { Lock(); } +void Mutex::ReaderUnlock() { Unlock(); } +#undef SAFE_PTHREAD + +#endif + +// -------------------------------------------------------------------------- +// Some helper classes + +// MutexLock(mu) acquires mu when constructed and releases it when destroyed. +class MutexLock { + public: + explicit MutexLock(Mutex *mu) : mu_(mu) { mu_->Lock(); } + ~MutexLock() { mu_->Unlock(); } + private: + Mutex * const mu_; + // Disallow "evil" constructors + MutexLock(const MutexLock&); + void operator=(const MutexLock&); +}; + +// ReaderMutexLock and WriterMutexLock do the same, for rwlocks +class ReaderMutexLock { + public: + explicit ReaderMutexLock(Mutex *mu) : mu_(mu) { mu_->ReaderLock(); } + ~ReaderMutexLock() { mu_->ReaderUnlock(); } + private: + Mutex * const mu_; + // Disallow "evil" constructors + ReaderMutexLock(const ReaderMutexLock&); + void operator=(const ReaderMutexLock&); +}; + +class WriterMutexLock { + public: + explicit WriterMutexLock(Mutex *mu) : mu_(mu) { mu_->WriterLock(); } + ~WriterMutexLock() { mu_->WriterUnlock(); } + private: + Mutex * const mu_; + // Disallow "evil" constructors + WriterMutexLock(const WriterMutexLock&); + void operator=(const WriterMutexLock&); +}; + +// Catch bug where variable name is omitted, e.g. MutexLock (&mu); +#define MutexLock(x) COMPILE_ASSERT(0, mutex_lock_decl_missing_var_name) +#define ReaderMutexLock(x) COMPILE_ASSERT(0, rmutex_lock_decl_missing_var_name) +#define WriterMutexLock(x) COMPILE_ASSERT(0, wmutex_lock_decl_missing_var_name) + +} // namespace MUTEX_NAMESPACE + +using namespace MUTEX_NAMESPACE; + +#undef MUTEX_NAMESPACE + +#endif /* #define GOOGLE_MUTEX_H__ */ diff --git a/extern/libmv/third_party/glog/src/config.h b/extern/libmv/third_party/glog/src/config.h new file mode 100644 index 00000000000..ed8d56e7799 --- /dev/null +++ b/extern/libmv/third_party/glog/src/config.h @@ -0,0 +1,11 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Namespace for Google classes */ +#ifdef __APPLE__ + #include "config_mac.h" +#elif __GNUC__ + #include "config_linux.h" +#elif _MSC_VER + #include "windows/config.h" +#endif diff --git a/extern/libmv/third_party/glog/src/config_linux.h b/extern/libmv/third_party/glog/src/config_linux.h new file mode 100644 index 00000000000..df6956c9ecf --- /dev/null +++ b/extern/libmv/third_party/glog/src/config_linux.h @@ -0,0 +1,164 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Namespace for Google classes */ +#define GOOGLE_NAMESPACE google + +/* Define if you have the `dladdr' function */ +/* #undef HAVE_DLADDR */ + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the <execinfo.h> header file. */ +#define HAVE_EXECINFO_H 1 + +/* Define if you have the `fcntl' function */ +#define HAVE_FCNTL 1 + +/* Define to 1 if you have the <glob.h> header file. */ +#define HAVE_GLOB_H 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#define HAVE_LIBPTHREAD 1 + +/* Define to 1 if you have the <libunwind.h> header file. */ +/* #undef HAVE_LIBUNWIND_H */ + +/* define if you have google gflags library */ +#define HAVE_LIB_GFLAGS 1 + +/* define if you have google gmock library */ +/* #undef HAVE_LIB_GMOCK */ + +/* define if you have google gtest library */ +/* #undef HAVE_LIB_GTEST */ + +/* define if you have libunwind */ +/* #undef HAVE_LIB_UNWIND */ + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* define if the compiler implements namespaces */ +#define HAVE_NAMESPACES 1 + +/* Define if you have POSIX threads libraries and header files. */ +#define HAVE_PTHREAD 1 + +/* Define to 1 if you have the <pwd.h> header file. */ +#define HAVE_PWD_H 1 + +/* define if the compiler implements pthread_rwlock_* */ +#define HAVE_RWLOCK 1 + +/* Define if you have the `sigaltstack' function */ +#define HAVE_SIGALTSTACK 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <syscall.h> header file. */ +#define HAVE_SYSCALL_H 1 + +/* Define to 1 if you have the <syslog.h> header file. */ +#define HAVE_SYSLOG_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/syscall.h> header file. */ +#define HAVE_SYS_SYSCALL_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/ucontext.h> header file. */ +#define HAVE_SYS_UCONTEXT_H 1 + +/* Define to 1 if you have the <sys/utsname.h> header file. */ +#define HAVE_SYS_UTSNAME_H 1 + +/* Define to 1 if you have the <ucontext.h> header file. */ +#define HAVE_UCONTEXT_H 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* define if the compiler supports using expression for operator */ +#define HAVE_USING_OPERATOR 1 + +/* define if your compiler has __attribute__ */ +#define HAVE___ATTRIBUTE__ 1 + +/* define if your compiler has __builtin_expect */ +#define HAVE___BUILTIN_EXPECT 1 + +/* define if your compiler has __sync_val_compare_and_swap */ +/* #undef HAVE___SYNC_VAL_COMPARE_AND_SWAP */ + +/* Name of package */ +#define PACKAGE "glog" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "opensource@google.com" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "glog" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "glog 0.3.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "glog" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.3.1" + +/* How to access the PC from a struct ucontext */ +#if defined(_M_X64) || defined(__amd64__) + #define PC_FROM_UCONTEXT uc_mcontext.gregs[REG_RIP] +#else + #define PC_FROM_UCONTEXT uc_mcontext.gregs[REG_EIP] +#endif + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 8 + +/* Define to 1 if you have the ANSI C header files. */ +/* #undef STDC_HEADERS */ + +#define STDC_HEADERS 1 +/* the namespace where STL code like vector<> is defined */ +#define STL_NAMESPACE std + +/* location of source code */ +#define TEST_SRC_DIR "." + +/* Version number of package */ +#define VERSION "0.3.1" + +/* Stops putting the code inside the Google namespace */ +#define _END_GOOGLE_NAMESPACE_ } + +/* Puts following code inside the Google namespace */ +#define _START_GOOGLE_NAMESPACE_ namespace google { diff --git a/extern/libmv/third_party/glog/src/config_mac.h b/extern/libmv/third_party/glog/src/config_mac.h new file mode 100644 index 00000000000..5f953d17ba9 --- /dev/null +++ b/extern/libmv/third_party/glog/src/config_mac.h @@ -0,0 +1,159 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Namespace for Google classes */ +#define GOOGLE_NAMESPACE google + +/* Define if you have the `dladdr' function */ +#define HAVE_DLADDR 1 + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the <execinfo.h> header file. */ +#define HAVE_EXECINFO_H 1 + +/* Define if you have the `fcntl' function */ +#define HAVE_FCNTL 1 + +/* Define to 1 if you have the <glob.h> header file. */ +#define HAVE_GLOB_H 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#define HAVE_LIBPTHREAD 1 + +/* Define to 1 if you have the <libunwind.h> header file. */ +#define HAVE_LIBUNWIND_H 1 + +/* define if you have google gflags library */ +#define HAVE_LIB_GFLAGS 1 + +/* define if you have google gmock library */ +/* #undef HAVE_LIB_GMOCK */ + +/* define if you have google gtest library */ +//#define HAVE_LIB_GTEST 1 + +/* define if you have libunwind */ +/* #undef HAVE_LIB_UNWIND */ + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* define if the compiler implements namespaces */ +#define HAVE_NAMESPACES 1 + +/* Define if you have POSIX threads libraries and header files. */ +#define HAVE_PTHREAD 1 + +/* Define to 1 if you have the <pwd.h> header file. */ +#define HAVE_PWD_H 1 + +/* define if the compiler implements pthread_rwlock_* */ +#define HAVE_RWLOCK 1 + +/* Define if you have the `sigaltstack' function */ +#define HAVE_SIGALTSTACK 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <syscall.h> header file. */ +/* #undef HAVE_SYSCALL_H */ + +/* Define to 1 if you have the <syslog.h> header file. */ +#define HAVE_SYSLOG_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/syscall.h> header file. */ +#define HAVE_SYS_SYSCALL_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/ucontext.h> header file. */ +#define HAVE_SYS_UCONTEXT_H 1 + +/* Define to 1 if you have the <sys/utsname.h> header file. */ +#define HAVE_SYS_UTSNAME_H 1 + +/* Define to 1 if you have the <ucontext.h> header file. */ +/* #undef HAVE_UCONTEXT_H */ + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* define if the compiler supports using expression for operator */ +#define HAVE_USING_OPERATOR 1 + +/* define if your compiler has __attribute__ */ +#define HAVE___ATTRIBUTE__ 1 + +/* define if your compiler has __builtin_expect */ +#define HAVE___BUILTIN_EXPECT 1 + +/* define if your compiler has __sync_val_compare_and_swap */ +/* #undef HAVE___SYNC_VAL_COMPARE_AND_SWAP */ + +/* Name of package */ +#define PACKAGE "glog" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "opensource@google.com" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "glog" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "glog 0.3.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "glog" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.3.1" + +/* How to access the PC from a struct ucontext */ +#undef PC_FROM_UCONTEXT + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 8 + +/* Define to 1 if you have the ANSI C header files. */ +/* #undef STDC_HEADERS */ + +/* the namespace where STL code like vector<> is defined */ +#define STL_NAMESPACE std + +/* location of source code */ +#define TEST_SRC_DIR "." + +/* Version number of package */ +#define VERSION "0.3.1" + +/* Stops putting the code inside the Google namespace */ +#define _END_GOOGLE_NAMESPACE_ } + +/* Puts following code inside the Google namespace */ +#define _START_GOOGLE_NAMESPACE_ namespace google { diff --git a/extern/libmv/third_party/glog/src/demangle.cc b/extern/libmv/third_party/glog/src/demangle.cc new file mode 100644 index 00000000000..46556bf3c13 --- /dev/null +++ b/extern/libmv/third_party/glog/src/demangle.cc @@ -0,0 +1,1231 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Satoru Takabayashi + +#include <stdio.h> // for NULL +#include "demangle.h" + +_START_GOOGLE_NAMESPACE_ + +typedef struct { + const char *abbrev; + const char *real_name; +} AbbrevPair; + +// List of operators from Itanium C++ ABI. +static const AbbrevPair kOperatorList[] = { + { "nw", "new" }, + { "na", "new[]" }, + { "dl", "delete" }, + { "da", "delete[]" }, + { "ps", "+" }, + { "ng", "-" }, + { "ad", "&" }, + { "de", "*" }, + { "co", "~" }, + { "pl", "+" }, + { "mi", "-" }, + { "ml", "*" }, + { "dv", "/" }, + { "rm", "%" }, + { "an", "&" }, + { "or", "|" }, + { "eo", "^" }, + { "aS", "=" }, + { "pL", "+=" }, + { "mI", "-=" }, + { "mL", "*=" }, + { "dV", "/=" }, + { "rM", "%=" }, + { "aN", "&=" }, + { "oR", "|=" }, + { "eO", "^=" }, + { "ls", "<<" }, + { "rs", ">>" }, + { "lS", "<<=" }, + { "rS", ">>=" }, + { "eq", "==" }, + { "ne", "!=" }, + { "lt", "<" }, + { "gt", ">" }, + { "le", "<=" }, + { "ge", ">=" }, + { "nt", "!" }, + { "aa", "&&" }, + { "oo", "||" }, + { "pp", "++" }, + { "mm", "--" }, + { "cm", "," }, + { "pm", "->*" }, + { "pt", "->" }, + { "cl", "()" }, + { "ix", "[]" }, + { "qu", "?" }, + { "st", "sizeof" }, + { "sz", "sizeof" }, + { NULL, NULL }, +}; + +// List of builtin types from Itanium C++ ABI. +static const AbbrevPair kBuiltinTypeList[] = { + { "v", "void" }, + { "w", "wchar_t" }, + { "b", "bool" }, + { "c", "char" }, + { "a", "signed char" }, + { "h", "unsigned char" }, + { "s", "short" }, + { "t", "unsigned short" }, + { "i", "int" }, + { "j", "unsigned int" }, + { "l", "long" }, + { "m", "unsigned long" }, + { "x", "long long" }, + { "y", "unsigned long long" }, + { "n", "__int128" }, + { "o", "unsigned __int128" }, + { "f", "float" }, + { "d", "double" }, + { "e", "long double" }, + { "g", "__float128" }, + { "z", "ellipsis" }, + { NULL, NULL } +}; + +// List of substitutions Itanium C++ ABI. +static const AbbrevPair kSubstitutionList[] = { + { "St", "" }, + { "Sa", "allocator" }, + { "Sb", "basic_string" }, + // std::basic_string<char, std::char_traits<char>,std::allocator<char> > + { "Ss", "string"}, + // std::basic_istream<char, std::char_traits<char> > + { "Si", "istream" }, + // std::basic_ostream<char, std::char_traits<char> > + { "So", "ostream" }, + // std::basic_iostream<char, std::char_traits<char> > + { "Sd", "iostream" }, + { NULL, NULL } +}; + +// State needed for demangling. +typedef struct { + const char *mangled_cur; // Cursor of mangled name. + const char *mangled_end; // End of mangled name. + char *out_cur; // Cursor of output string. + const char *out_begin; // Beginning of output string. + const char *out_end; // End of output string. + const char *prev_name; // For constructors/destructors. + int prev_name_length; // For constructors/destructors. + int nest_level; // For nested names. + int number; // Remember the previous number. + bool append; // Append flag. + bool overflowed; // True if output gets overflowed. +} State; + +// We don't use strlen() in libc since it's not guaranteed to be async +// signal safe. +static size_t StrLen(const char *str) { + size_t len = 0; + while (*str != '\0') { + ++str; + ++len; + } + return len; +} + +// Returns true if "str" has "prefix" as a prefix. +static bool StrPrefix(const char *str, const char *prefix) { + size_t i = 0; + while (str[i] != '\0' && prefix[i] != '\0' && + str[i] == prefix[i]) { + ++i; + } + return prefix[i] == '\0'; // Consumed everything in "prefix". +} + +static void InitState(State *state, const char *mangled, + char *out, int out_size) { + state->mangled_cur = mangled; + state->mangled_end = mangled + StrLen(mangled); + state->out_cur = out; + state->out_begin = out; + state->out_end = out + out_size; + state->prev_name = NULL; + state->prev_name_length = -1; + state->nest_level = -1; + state->number = -1; + state->append = true; + state->overflowed = false; +} + +// Calculates the remaining length of the mangled name. +static int RemainingLength(State *state) { + return state->mangled_end - state->mangled_cur; +} + +// Returns true and advances "mangled_cur" if we find "c" at +// "mangled_cur" position. +static bool ParseChar(State *state, const char c) { + if (RemainingLength(state) >= 1 && *state->mangled_cur == c) { + ++state->mangled_cur; + return true; + } + return false; +} + +// Returns true and advances "mangled_cur" if we find "two_chars" at +// "mangled_cur" position. +static bool ParseTwoChar(State *state, const char *two_chars) { + if (RemainingLength(state) >= 2 && + state->mangled_cur[0] == two_chars[0] && + state->mangled_cur[1] == two_chars[1]) { + state->mangled_cur += 2; + return true; + } + return false; +} + +// Returns true and advances "mangled_cur" if we find any character in +// "char_class" at "mangled_cur" position. +static bool ParseCharClass(State *state, const char *char_class) { + if (state->mangled_cur == state->mangled_end) { + return false; + } + const char *p = char_class; + for (; *p != '\0'; ++p) { + if (*state->mangled_cur == *p) { + state->mangled_cur += 1; + return true; + } + } + return false; +} + +// This function is used for handling an optional non-terminal. +static bool Optional(bool status) { + return true; +} + +// This function is used for handling <non-terminal>+ syntax. +typedef bool (*ParseFunc)(State *); +static bool OneOrMore(ParseFunc parse_func, State *state) { + if (parse_func(state)) { + while (parse_func(state)) { + } + return true; + } + return false; +} + +// Append "str" at "out_cur". If there is an overflow, "overflowed" +// is set to true for later use. The output string is ensured to +// always terminate with '\0' as long as there is no overflow. +static void Append(State *state, const char * const str, const int length) { + int i; + for (i = 0; i < length; ++i) { + if (state->out_cur + 1 < state->out_end) { // +1 for '\0' + *state->out_cur = str[i]; + ++state->out_cur; + } else { + state->overflowed = true; + break; + } + } + if (!state->overflowed) { + *state->out_cur = '\0'; // Terminate it with '\0' + } +} + +// We don't use equivalents in libc to avoid locale issues. +static bool IsLower(char c) { + return c >= 'a' && c <= 'z'; +} + +static bool IsAlpha(char c) { + return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')); +} + +// Append "str" with some tweaks, iff "append" state is true. +// Returns true so that it can be placed in "if" conditions. +static void MaybeAppendWithLength(State *state, const char * const str, + const int length) { + if (state->append && length > 0) { + // Append a space if the output buffer ends with '<' and "str" + // starts with '<' to avoid <<<. + if (str[0] == '<' && state->out_begin < state->out_cur && + state->out_cur[-1] == '<') { + Append(state, " ", 1); + } + // Remember the last identifier name for ctors/dtors. + if (IsAlpha(str[0]) || str[0] == '_') { + state->prev_name = state->out_cur; + state->prev_name_length = length; + } + Append(state, str, length); + } +} + +// A convenient wrapper arount MaybeAppendWithLength(). +static bool MaybeAppend(State *state, const char * const str) { + if (state->append) { + int length = StrLen(str); + MaybeAppendWithLength(state, str, length); + } + return true; +} + +// This function is used for handling nested names. +static bool EnterNestedName(State *state) { + state->nest_level = 0; + return true; +} + +// This function is used for handling nested names. +static bool LeaveNestedName(State *state, int prev_value) { + state->nest_level = prev_value; + return true; +} + +// Disable the append mode not to print function parameters, etc. +static bool DisableAppend(State *state) { + state->append = false; + return true; +} + +// Restore the append mode to the previous state. +static bool RestoreAppend(State *state, bool prev_value) { + state->append = prev_value; + return true; +} + +// Increase the nest level for nested names. +static void MaybeIncreaseNestLevel(State *state) { + if (state->nest_level > -1) { + ++state->nest_level; + } +} + +// Appends :: for nested names if necessary. +static void MaybeAppendSeparator(State *state) { + if (state->nest_level >= 1) { + MaybeAppend(state, "::"); + } +} + +// Cancel the last separator if necessary. +static void MaybeCancelLastSeparator(State *state) { + if (state->nest_level >= 1 && state->append && + state->out_begin <= state->out_cur - 2) { + state->out_cur -= 2; + *state->out_cur = '\0'; + } +} + +// Returns true if identifier pointed by "mangled_cur" is anonymous +// namespace. +static bool IdentifierIsAnonymousNamespace(State *state) { + const char anon_prefix[] = "_GLOBAL__N_"; + return (state->number > sizeof(anon_prefix) - 1 && // Should be longer. + StrPrefix(state->mangled_cur, anon_prefix)); +} + +// Forward declarations of our parsing functions. +static bool ParseMangledName(State *state); +static bool ParseEncoding(State *state); +static bool ParseName(State *state); +static bool ParseUnscopedName(State *state); +static bool ParseUnscopedTemplateName(State *state); +static bool ParseNestedName(State *state); +static bool ParsePrefix(State *state); +static bool ParseUnqualifiedName(State *state); +static bool ParseSourceName(State *state); +static bool ParseLocalSourceName(State *state); +static bool ParseNumber(State *state); +static bool ParseFloatNumber(State *state); +static bool ParseSeqId(State *state); +static bool ParseIdentifier(State *state); +static bool ParseOperatorName(State *state); +static bool ParseSpecialName(State *state); +static bool ParseCallOffset(State *state); +static bool ParseNVOffset(State *state); +static bool ParseVOffset(State *state); +static bool ParseCtorDtorName(State *state); +static bool ParseType(State *state); +static bool ParseCVQualifiers(State *state); +static bool ParseBuiltinType(State *state); +static bool ParseFunctionType(State *state); +static bool ParseBareFunctionType(State *state); +static bool ParseClassEnumType(State *state); +static bool ParseArrayType(State *state); +static bool ParsePointerToMemberType(State *state); +static bool ParseTemplateParam(State *state); +static bool ParseTemplateTemplateParam(State *state); +static bool ParseTemplateArgs(State *state); +static bool ParseTemplateArg(State *state); +static bool ParseExpression(State *state); +static bool ParseExprPrimary(State *state); +static bool ParseLocalName(State *state); +static bool ParseDiscriminator(State *state); +static bool ParseSubstitution(State *state); + +// Implementation note: the following code is a straightforward +// translation of the Itanium C++ ABI defined in BNF with a couple of +// exceptions. +// +// - Support GNU extensions not defined in the Itanium C++ ABI +// - <prefix> and <template-prefix> are combined to avoid infinite loop +// - Reorder patterns to shorten the code +// - Reorder patterns to give greedier functions precedence +// We'll mark "Less greedy than" for these cases in the code +// +// Each parsing function changes the state and returns true on +// success. Otherwise, don't change the state and returns false. To +// ensure that the state isn't changed in the latter case, we save the +// original state before we call more than one parsing functions +// consecutively with &&, and restore the state if unsuccessful. See +// ParseEncoding() as an example of this convention. We follow the +// convention throughout the code. +// +// Originally we tried to do demangling without following the full ABI +// syntax but it turned out we needed to follow the full syntax to +// parse complicated cases like nested template arguments. Note that +// implementing a full-fledged demangler isn't trivial (libiberty's +// cp-demangle.c has +4300 lines). +// +// Note that (foo) in <(foo) ...> is a modifier to be ignored. +// +// Reference: +// - Itanium C++ ABI +// <http://www.codesourcery.com/cxx-abi/abi.html#mangling> + +// <mangled-name> ::= _Z <encoding> +static bool ParseMangledName(State *state) { + if (ParseTwoChar(state, "_Z") && ParseEncoding(state)) { + // Append trailing version suffix if any. + // ex. _Z3foo@@GLIBCXX_3.4 + if (state->mangled_cur < state->mangled_end && + state->mangled_cur[0] == '@') { + MaybeAppend(state, state->mangled_cur); + state->mangled_cur = state->mangled_end; + } + return true; + } + return false; +} + +// <encoding> ::= <(function) name> <bare-function-type> +// ::= <(data) name> +// ::= <special-name> +static bool ParseEncoding(State *state) { + State copy = *state; + if (ParseName(state) && ParseBareFunctionType(state)) { + return true; + } + *state = copy; + + if (ParseName(state) || ParseSpecialName(state)) { + return true; + } + return false; +} + +// <name> ::= <nested-name> +// ::= <unscoped-template-name> <template-args> +// ::= <unscoped-name> +// ::= <local-name> +static bool ParseName(State *state) { + if (ParseNestedName(state) || ParseLocalName(state)) { + return true; + } + + State copy = *state; + if (ParseUnscopedTemplateName(state) && + ParseTemplateArgs(state)) { + return true; + } + *state = copy; + + // Less greedy than <unscoped-template-name> <template-args>. + if (ParseUnscopedName(state)) { + return true; + } + return false; +} + +// <unscoped-name> ::= <unqualified-name> +// ::= St <unqualified-name> +static bool ParseUnscopedName(State *state) { + if (ParseUnqualifiedName(state)) { + return true; + } + + State copy = *state; + if (ParseTwoChar(state, "St") && + MaybeAppend(state, "std::") && + ParseUnqualifiedName(state)) { + return true; + } + *state = copy; + return false; +} + +// <unscoped-template-name> ::= <unscoped-name> +// ::= <substitution> +static bool ParseUnscopedTemplateName(State *state) { + return ParseUnscopedName(state) || ParseSubstitution(state); +} + +// <nested-name> ::= N [<CV-qualifiers>] <prefix> <unqualified-name> E +// ::= N [<CV-qualifiers>] <template-prefix> <template-args> E +static bool ParseNestedName(State *state) { + State copy = *state; + if (ParseChar(state, 'N') && + EnterNestedName(state) && + Optional(ParseCVQualifiers(state)) && + ParsePrefix(state) && + LeaveNestedName(state, copy.nest_level) && + ParseChar(state, 'E')) { + return true; + } + *state = copy; + return false; +} + +// This part is tricky. If we literally translate them to code, we'll +// end up infinite loop. Hence we merge them to avoid the case. +// +// <prefix> ::= <prefix> <unqualified-name> +// ::= <template-prefix> <template-args> +// ::= <template-param> +// ::= <substitution> +// ::= # empty +// <template-prefix> ::= <prefix> <(template) unqualified-name> +// ::= <template-param> +// ::= <substitution> +static bool ParsePrefix(State *state) { + bool has_something = false; + while (true) { + MaybeAppendSeparator(state); + if (ParseTemplateParam(state) || + ParseSubstitution(state) || + ParseUnscopedName(state)) { + has_something = true; + MaybeIncreaseNestLevel(state); + continue; + } + MaybeCancelLastSeparator(state); + if (has_something && ParseTemplateArgs(state)) { + return ParsePrefix(state); + } else { + break; + } + } + return true; +} + +// <unqualified-name> ::= <operator-name> +// ::= <ctor-dtor-name> +// ::= <source-name> +// ::= <local-source-name> +static bool ParseUnqualifiedName(State *state) { + return (ParseOperatorName(state) || + ParseCtorDtorName(state) || + ParseSourceName(state) || + ParseLocalSourceName(state)); +} + +// <source-name> ::= <positive length number> <identifier> +static bool ParseSourceName(State *state) { + State copy = *state; + if (ParseNumber(state) && ParseIdentifier(state)) { + return true; + } + *state = copy; + return false; +} + +// <local-source-name> ::= L <source-name> [<discriminator>] +// +// References: +// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31775 +// http://gcc.gnu.org/viewcvs?view=rev&revision=124467 +static bool ParseLocalSourceName(State *state) { + State copy = *state; + if (ParseChar(state, 'L') && ParseSourceName(state) && + Optional(ParseDiscriminator(state))) { + return true; + } + *state = copy; + return false; +} + +// <number> ::= [n] <non-negative decimal integer> +static bool ParseNumber(State *state) { + int sign = 1; + if (ParseChar(state, 'n')) { + sign = -1; + } + const char *p = state->mangled_cur; + int number = 0; + for (;p < state->mangled_end; ++p) { + if ((*p >= '0' && *p <= '9')) { + number = number * 10 + (*p - '0'); + } else { + break; + } + } + if (p != state->mangled_cur) { // Conversion succeeded. + state->mangled_cur = p; + state->number = number * sign; + return true; + } + return false; +} + +// Floating-point literals are encoded using a fixed-length lowercase +// hexadecimal string. +static bool ParseFloatNumber(State *state) { + const char *p = state->mangled_cur; + int number = 0; + for (;p < state->mangled_end; ++p) { + if ((*p >= '0' && *p <= '9')) { + number = number * 16 + (*p - '0'); + } else if (*p >= 'a' && *p <= 'f') { + number = number * 16 + (*p - 'a' + 10); + } else { + break; + } + } + if (p != state->mangled_cur) { // Conversion succeeded. + state->mangled_cur = p; + state->number = number; + return true; + } + return false; +} + +// The <seq-id> is a sequence number in base 36, +// using digits and upper case letters +static bool ParseSeqId(State *state) { + const char *p = state->mangled_cur; + int number = 0; + for (;p < state->mangled_end; ++p) { + if ((*p >= '0' && *p <= '9')) { + number = number * 36 + (*p - '0'); + } else if (*p >= 'A' && *p <= 'Z') { + number = number * 36 + (*p - 'A' + 10); + } else { + break; + } + } + if (p != state->mangled_cur) { // Conversion succeeded. + state->mangled_cur = p; + state->number = number; + return true; + } + return false; +} + +// <identifier> ::= <unqualified source code identifier> +static bool ParseIdentifier(State *state) { + if (state->number == -1 || + RemainingLength(state) < state->number) { + return false; + } + if (IdentifierIsAnonymousNamespace(state)) { + MaybeAppend(state, "(anonymous namespace)"); + } else { + MaybeAppendWithLength(state, state->mangled_cur, state->number); + } + state->mangled_cur += state->number; + state->number = -1; // Reset the number. + return true; +} + +// <operator-name> ::= nw, and other two letters cases +// ::= cv <type> # (cast) +// ::= v <digit> <source-name> # vendor extended operator +static bool ParseOperatorName(State *state) { + if (RemainingLength(state) < 2) { + return false; + } + // First check with "cv" (cast) case. + State copy = *state; + if (ParseTwoChar(state, "cv") && + MaybeAppend(state, "operator ") && + EnterNestedName(state) && + ParseType(state) && + LeaveNestedName(state, copy.nest_level)) { + return true; + } + *state = copy; + + // Then vendor extended operators. + if (ParseChar(state, 'v') && ParseCharClass(state, "0123456789") && + ParseSourceName(state)) { + return true; + } + *state = copy; + + // Other operator names should start with a lower alphabet followed + // by a lower/upper alphabet. + if (!(IsLower(state->mangled_cur[0]) && + IsAlpha(state->mangled_cur[1]))) { + return false; + } + // We may want to perform a binary search if we really need speed. + const AbbrevPair *p; + for (p = kOperatorList; p->abbrev != NULL; ++p) { + if (state->mangled_cur[0] == p->abbrev[0] && + state->mangled_cur[1] == p->abbrev[1]) { + MaybeAppend(state, "operator"); + if (IsLower(*p->real_name)) { // new, delete, etc. + MaybeAppend(state, " "); + } + MaybeAppend(state, p->real_name); + state->mangled_cur += 2; + return true; + } + } + return false; +} + +// <special-name> ::= TV <type> +// ::= TT <type> +// ::= TI <type> +// ::= TS <type> +// ::= Tc <call-offset> <call-offset> <(base) encoding> +// ::= GV <(object) name> +// ::= T <call-offset> <(base) encoding> +// G++ extensions: +// ::= TC <type> <(offset) number> _ <(base) type> +// ::= TF <type> +// ::= TJ <type> +// ::= GR <name> +// ::= GA <encoding> +// ::= Th <call-offset> <(base) encoding> +// ::= Tv <call-offset> <(base) encoding> +// +// Note: we don't care much about them since they don't appear in +// stack traces. The are special data. +static bool ParseSpecialName(State *state) { + State copy = *state; + if (ParseChar(state, 'T') && + ParseCharClass(state, "VTIS") && + ParseType(state)) { + return true; + } + *state = copy; + + if (ParseTwoChar(state, "Tc") && ParseCallOffset(state) && + ParseCallOffset(state) && ParseEncoding(state)) { + return true; + } + *state = copy; + + if (ParseTwoChar(state, "GV") && + ParseName(state)) { + return true; + } + *state = copy; + + if (ParseChar(state, 'T') && ParseCallOffset(state) && + ParseEncoding(state)) { + return true; + } + *state = copy; + + // G++ extensions + if (ParseTwoChar(state, "TC") && ParseType(state) && + ParseNumber(state) && ParseChar(state, '_') && + DisableAppend(state) && + ParseType(state)) { + RestoreAppend(state, copy.append); + return true; + } + *state = copy; + + if (ParseChar(state, 'T') && ParseCharClass(state, "FJ") && + ParseType(state)) { + return true; + } + *state = copy; + + if (ParseTwoChar(state, "GR") && ParseName(state)) { + return true; + } + *state = copy; + + if (ParseTwoChar(state, "GA") && ParseEncoding(state)) { + return true; + } + *state = copy; + + if (ParseChar(state, 'T') && ParseCharClass(state, "hv") && + ParseCallOffset(state) && ParseEncoding(state)) { + return true; + } + *state = copy; + return false; +} + +// <call-offset> ::= h <nv-offset> _ +// ::= v <v-offset> _ +static bool ParseCallOffset(State *state) { + State copy = *state; + if (ParseChar(state, 'h') && + ParseNVOffset(state) && ParseChar(state, '_')) { + return true; + } + *state = copy; + + if (ParseChar(state, 'v') && + ParseVOffset(state) && ParseChar(state, '_')) { + return true; + } + *state = copy; + + return false; +} + +// <nv-offset> ::= <(offset) number> +static bool ParseNVOffset(State *state) { + return ParseNumber(state); +} + +// <v-offset> ::= <(offset) number> _ <(virtual offset) number> +static bool ParseVOffset(State *state) { + State copy = *state; + if (ParseNumber(state) && ParseChar(state, '_') && + ParseNumber(state)) { + return true; + } + *state = copy; + return false; +} + +// <ctor-dtor-name> ::= C1 | C2 | C3 +// ::= D0 | D1 | D2 +static bool ParseCtorDtorName(State *state) { + State copy = *state; + if (ParseChar(state, 'C') && + ParseCharClass(state, "123")) { + const char * const prev_name = state->prev_name; + const int prev_name_length = state->prev_name_length; + MaybeAppendWithLength(state, prev_name, prev_name_length); + return true; + } + *state = copy; + + if (ParseChar(state, 'D') && + ParseCharClass(state, "012")) { + const char * const prev_name = state->prev_name; + const int prev_name_length = state->prev_name_length; + MaybeAppend(state, "~"); + MaybeAppendWithLength(state, prev_name, prev_name_length); + return true; + } + *state = copy; + return false; +} + +// <type> ::= <CV-qualifiers> <type> +// ::= P <type> +// ::= R <type> +// ::= C <type> +// ::= G <type> +// ::= U <source-name> <type> +// ::= <builtin-type> +// ::= <function-type> +// ::= <class-enum-type> +// ::= <array-type> +// ::= <pointer-to-member-type> +// ::= <template-template-param> <template-args> +// ::= <template-param> +// ::= <substitution> +static bool ParseType(State *state) { + // We should check CV-qualifers, and PRGC things first. + State copy = *state; + if (ParseCVQualifiers(state) && ParseType(state)) { + return true; + } + *state = copy; + + if (ParseCharClass(state, "PRCG") && ParseType(state)) { + return true; + } + *state = copy; + + if (ParseChar(state, 'U') && ParseSourceName(state) && + ParseType(state)) { + return true; + } + *state = copy; + + if (ParseBuiltinType(state) || + ParseFunctionType(state) || + ParseClassEnumType(state) || + ParseArrayType(state) || + ParsePointerToMemberType(state) || + ParseSubstitution(state)) { + return true; + } + + if (ParseTemplateTemplateParam(state) && + ParseTemplateArgs(state)) { + return true; + } + *state = copy; + + // Less greedy than <template-template-param> <template-args>. + if (ParseTemplateParam(state)) { + return true; + } + + return false; +} + +// <CV-qualifiers> ::= [r] [V] [K] +// We don't allow empty <CV-qualifiers> to avoid infinite loop in +// ParseType(). +static bool ParseCVQualifiers(State *state) { + int num_cv_qualifiers = 0; + num_cv_qualifiers += ParseChar(state, 'r'); + num_cv_qualifiers += ParseChar(state, 'V'); + num_cv_qualifiers += ParseChar(state, 'K'); + return num_cv_qualifiers > 0; +} + +// <builtin-type> ::= v, etc. +// ::= u <source-name> +static bool ParseBuiltinType(State *state) { + const AbbrevPair *p; + for (p = kBuiltinTypeList; p->abbrev != NULL; ++p) { + if (state->mangled_cur[0] == p->abbrev[0]) { + MaybeAppend(state, p->real_name); + ++state->mangled_cur; + return true; + } + } + + State copy = *state; + if (ParseChar(state, 'u') && ParseSourceName(state)) { + return true; + } + *state = copy; + return false; +} + +// <function-type> ::= F [Y] <bare-function-type> E +static bool ParseFunctionType(State *state) { + State copy = *state; + if (ParseChar(state, 'F') && Optional(ParseChar(state, 'Y')) && + ParseBareFunctionType(state) && ParseChar(state, 'E')) { + return true; + } + *state = copy; + return false; +} + +// <bare-function-type> ::= <(signature) type>+ +static bool ParseBareFunctionType(State *state) { + State copy = *state; + DisableAppend(state); + if (OneOrMore(ParseType, state)) { + RestoreAppend(state, copy.append); + MaybeAppend(state, "()"); + return true; + } + *state = copy; + return false; +} + +// <class-enum-type> ::= <name> +static bool ParseClassEnumType(State *state) { + return ParseName(state); +} + +// <array-type> ::= A <(positive dimension) number> _ <(element) type> +// ::= A [<(dimension) expression>] _ <(element) type> +static bool ParseArrayType(State *state) { + State copy = *state; + if (ParseChar(state, 'A') && ParseNumber(state) && + ParseChar(state, '_') && ParseType(state)) { + return true; + } + *state = copy; + + if (ParseChar(state, 'A') && Optional(ParseExpression(state)) && + ParseChar(state, '_') && ParseType(state)) { + return true; + } + *state = copy; + return false; +} + +// <pointer-to-member-type> ::= M <(class) type> <(member) type> +static bool ParsePointerToMemberType(State *state) { + State copy = *state; + if (ParseChar(state, 'M') && ParseType(state) && + ParseType(state)) { + return true; + } + *state = copy; + return false; +} + +// <template-param> ::= T_ +// ::= T <parameter-2 non-negative number> _ +static bool ParseTemplateParam(State *state) { + if (ParseTwoChar(state, "T_")) { + MaybeAppend(state, "?"); // We don't support template substitutions. + return true; + } + + State copy = *state; + if (ParseChar(state, 'T') && ParseNumber(state) && + ParseChar(state, '_')) { + MaybeAppend(state, "?"); // We don't support template substitutions. + return true; + } + *state = copy; + return false; +} + + +// <template-template-param> ::= <template-param> +// ::= <substitution> +static bool ParseTemplateTemplateParam(State *state) { + return (ParseTemplateParam(state) || + ParseSubstitution(state)); +} + +// <template-args> ::= I <template-arg>+ E +static bool ParseTemplateArgs(State *state) { + State copy = *state; + DisableAppend(state); + if (ParseChar(state, 'I') && + OneOrMore(ParseTemplateArg, state) && + ParseChar(state, 'E')) { + RestoreAppend(state, copy.append); + MaybeAppend(state, "<>"); + return true; + } + *state = copy; + return false; +} + +// <template-arg> ::= <type> +// ::= <expr-primary> +// ::= X <expression> E +static bool ParseTemplateArg(State *state) { + if (ParseType(state) || + ParseExprPrimary(state)) { + return true; + } + + State copy = *state; + if (ParseChar(state, 'X') && ParseExpression(state) && + ParseChar(state, 'E')) { + return true; + } + *state = copy; + return false; +} + +// <expression> ::= <template-param> +// ::= <expr-primary> +// ::= <unary operator-name> <expression> +// ::= <binary operator-name> <expression> <expression> +// ::= <trinary operator-name> <expression> <expression> +// <expression> +// ::= st <type> +// ::= sr <type> <unqualified-name> <template-args> +// ::= sr <type> <unqualified-name> +static bool ParseExpression(State *state) { + if (ParseTemplateParam(state) || ParseExprPrimary(state)) { + return true; + } + + State copy = *state; + if (ParseOperatorName(state) && + ParseExpression(state) && + ParseExpression(state) && + ParseExpression(state)) { + return true; + } + *state = copy; + + if (ParseOperatorName(state) && + ParseExpression(state) && + ParseExpression(state)) { + return true; + } + *state = copy; + + if (ParseOperatorName(state) && + ParseExpression(state)) { + return true; + } + *state = copy; + + if (ParseTwoChar(state, "st") && ParseType(state)) { + return true; + } + *state = copy; + + if (ParseTwoChar(state, "sr") && ParseType(state) && + ParseUnqualifiedName(state) && + ParseTemplateArgs(state)) { + return true; + } + *state = copy; + + if (ParseTwoChar(state, "sr") && ParseType(state) && + ParseUnqualifiedName(state)) { + return true; + } + *state = copy; + return false; +} + +// <expr-primary> ::= L <type> <(value) number> E +// ::= L <type> <(value) float> E +// ::= L <mangled-name> E +// // A bug in g++'s C++ ABI version 2 (-fabi-version=2). +// ::= LZ <encoding> E +static bool ParseExprPrimary(State *state) { + State copy = *state; + if (ParseChar(state, 'L') && ParseType(state) && + ParseNumber(state) && + ParseChar(state, 'E')) { + return true; + } + *state = copy; + + if (ParseChar(state, 'L') && ParseType(state) && + ParseFloatNumber(state) && + ParseChar(state, 'E')) { + return true; + } + *state = copy; + + if (ParseChar(state, 'L') && ParseMangledName(state) && + ParseChar(state, 'E')) { + return true; + } + *state = copy; + + if (ParseTwoChar(state, "LZ") && ParseEncoding(state) && + ParseChar(state, 'E')) { + return true; + } + *state = copy; + + return false; +} + +// <local-name> := Z <(function) encoding> E <(entity) name> +// [<discriminator>] +// := Z <(function) encoding> E s [<discriminator>] +static bool ParseLocalName(State *state) { + State copy = *state; + if (ParseChar(state, 'Z') && ParseEncoding(state) && + ParseChar(state, 'E') && MaybeAppend(state, "::") && + ParseName(state) && Optional(ParseDiscriminator(state))) { + return true; + } + *state = copy; + + if (ParseChar(state, 'Z') && ParseEncoding(state) && + ParseTwoChar(state, "Es") && Optional(ParseDiscriminator(state))) { + return true; + } + *state = copy; + return false; +} + +// <discriminator> := _ <(non-negative) number> +static bool ParseDiscriminator(State *state) { + State copy = *state; + if (ParseChar(state, '_') && ParseNumber(state)) { + return true; + } + *state = copy; + return false; +} + +// <substitution> ::= S_ +// ::= S <seq-id> _ +// ::= St, etc. +static bool ParseSubstitution(State *state) { + if (ParseTwoChar(state, "S_")) { + MaybeAppend(state, "?"); // We don't support substitutions. + return true; + } + + State copy = *state; + if (ParseChar(state, 'S') && ParseSeqId(state) && + ParseChar(state, '_')) { + MaybeAppend(state, "?"); // We don't support substitutions. + return true; + } + *state = copy; + + // Expand abbreviations like "St" => "std". + if (ParseChar(state, 'S')) { + const AbbrevPair *p; + for (p = kSubstitutionList; p->abbrev != NULL; ++p) { + if (state->mangled_cur[0] == p->abbrev[1]) { + MaybeAppend(state, "std"); + if (p->real_name[0] != '\0') { + MaybeAppend(state, "::"); + MaybeAppend(state, p->real_name); + } + state->mangled_cur += 1; + return true; + } + } + } + *state = copy; + return false; +} + +// The demangler entry point. +bool Demangle(const char *mangled, char *out, int out_size) { + State state; + InitState(&state, mangled, out, out_size); + return (ParseMangledName(&state) && + state.overflowed == false && + RemainingLength(&state) == 0); +} + +_END_GOOGLE_NAMESPACE_ diff --git a/extern/libmv/third_party/glog/src/demangle.h b/extern/libmv/third_party/glog/src/demangle.h new file mode 100644 index 00000000000..9c7591527c0 --- /dev/null +++ b/extern/libmv/third_party/glog/src/demangle.h @@ -0,0 +1,84 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Satoru Takabayashi +// +// An async-signal-safe and thread-safe demangler for Itanium C++ ABI +// (aka G++ V3 ABI). + +// The demangler is implemented to be used in async signal handlers to +// symbolize stack traces. We cannot use libstdc++'s +// abi::__cxa_demangle() in such signal handlers since it's not async +// signal safe (it uses malloc() internally). +// +// Note that this demangler doesn't support full demangling. More +// specifically, it doesn't print types of function parameters and +// types of template arguments. It just skips them. However, it's +// still very useful to extract basic information such as class, +// function, constructor, destructor, and operator names. +// +// See the implementation note in demangle.cc if you are interested. +// +// Example: +// +// | Mangled Name | The Demangler | abi::__cxa_demangle() +// |---------------|---------------|----------------------- +// | _Z1fv | f() | f() +// | _Z1fi | f() | f(int) +// | _Z3foo3bar | foo() | foo(bar) +// | _Z1fIiEvi | f<>() | void f<int>(int) +// | _ZN1N1fE | N::f | N::f +// | _ZN3Foo3BarEv | Foo::Bar() | Foo::Bar() +// | _Zrm1XS_" | operator%() | operator%(X, X) +// | _ZN3FooC1Ev | Foo::Foo() | Foo::Foo() +// | _Z1fSs | f() | f(std::basic_string<char, +// | | | std::char_traits<char>, +// | | | std::allocator<char> >) +// +// See the unit test for more examples. +// +// Note: we might want to write demanglers for ABIs other than Itanium +// C++ ABI in the future. +// + +#ifndef BASE_DEMANGLE_H_ +#define BASE_DEMANGLE_H_ + +#include "config.h" + +_START_GOOGLE_NAMESPACE_ + +// Demangle "mangled". On success, return true and write the +// demangled symbol name to "out". Otherwise, return false. +// "out" is modified even if demangling is unsuccessful. +bool Demangle(const char *mangled, char *out, int out_size); + +_END_GOOGLE_NAMESPACE_ + +#endif // BASE_DEMANGLE_H_ diff --git a/extern/libmv/third_party/glog/src/glog/log_severity.h b/extern/libmv/third_party/glog/src/glog/log_severity.h new file mode 100644 index 00000000000..17805fbadd4 --- /dev/null +++ b/extern/libmv/third_party/glog/src/glog/log_severity.h @@ -0,0 +1,84 @@ +// Copyright (c) 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef BASE_LOG_SEVERITY_H__ +#define BASE_LOG_SEVERITY_H__ + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +// Variables of type LogSeverity are widely taken to lie in the range +// [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if +// you ever need to change their values or add a new severity. +typedef int LogSeverity; + +const int INFO = 0, WARNING = 1, ERROR = 2, FATAL = 3, NUM_SEVERITIES = 4; + +// DFATAL is FATAL in debug mode, ERROR in normal mode +#ifdef NDEBUG +#define DFATAL_LEVEL ERROR +#else +#define DFATAL_LEVEL FATAL +#endif + +extern GOOGLE_GLOG_DLL_DECL const char* const LogSeverityNames[NUM_SEVERITIES]; + +// NDEBUG usage helpers related to (RAW_)DCHECK: +// +// DEBUG_MODE is for small !NDEBUG uses like +// if (DEBUG_MODE) foo.CheckThatFoo(); +// instead of substantially more verbose +// #ifndef NDEBUG +// foo.CheckThatFoo(); +// #endif +// +// IF_DEBUG_MODE is for small !NDEBUG uses like +// IF_DEBUG_MODE( string error; ) +// DCHECK(Foo(&error)) << error; +// instead of substantially more verbose +// #ifndef NDEBUG +// string error; +// DCHECK(Foo(&error)) << error; +// #endif +// +#ifdef NDEBUG +enum { DEBUG_MODE = 0 }; +#define IF_DEBUG_MODE(x) +#else +enum { DEBUG_MODE = 1 }; +#define IF_DEBUG_MODE(x) x +#endif + +#endif // BASE_LOG_SEVERITY_H__ diff --git a/extern/libmv/third_party/glog/src/glog/logging.h b/extern/libmv/third_party/glog/src/glog/logging.h new file mode 100644 index 00000000000..a58d478ab17 --- /dev/null +++ b/extern/libmv/third_party/glog/src/glog/logging.h @@ -0,0 +1,1507 @@ +// Copyright (c) 1999, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Ray Sidney +// +// This file contains #include information about logging-related stuff. +// Pretty much everybody needs to #include this file so that they can +// log various happenings. +// + +#ifndef _LOGGING_H_ +#define _LOGGING_H_ + +#include <errno.h> +#include <string.h> +#include <time.h> +#include <string> +#if 1 +# include <unistd.h> +#endif +#ifdef __DEPRECATED +// Make GCC quiet. +# undef __DEPRECATED +# include <strstream> +# define __DEPRECATED +#else +# include <strstream> +#endif +#include <vector> + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +// We care a lot about number of bits things take up. Unfortunately, +// systems define their bit-specific ints in a lot of different ways. +// We use our own way, and have a typedef to get there. +// Note: these commands below may look like "#if 1" or "#if 0", but +// that's because they were constructed that way at ./configure time. +// Look at logging.h.in to see how they're calculated (based on your config). +#if 1 +#include <stdint.h> // the normal place uint16_t is defined +#endif +#if 1 +#include <sys/types.h> // the normal place u_int16_t is defined +#endif +#if 1 +#include <inttypes.h> // a third place for uint16_t or u_int16_t +#endif + +#if 1 +#include "third_party/gflags/gflags.h" +#endif + +namespace google { + +#if 1 // the C99 format +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +#elif 1 // the BSD format +typedef int32_t int32; +typedef u_int32_t uint32; +typedef int64_t int64; +typedef u_int64_t uint64; +#elif 0 // the windows (vc7) format +typedef __int32 int32; +typedef unsigned __int32 uint32; +typedef __int64 int64; +typedef unsigned __int64 uint64; +#else +#error Do not know how to define a 32-bit integer quantity on your system +#endif + +} + +// The global value of GOOGLE_STRIP_LOG. All the messages logged to +// LOG(XXX) with severity less than GOOGLE_STRIP_LOG will not be displayed. +// If it can be determined at compile time that the message will not be +// printed, the statement will be compiled out. +// +// Example: to strip out all INFO and WARNING messages, use the value +// of 2 below. To make an exception for WARNING messages from a single +// file, add "#define GOOGLE_STRIP_LOG 1" to that file _before_ including +// base/logging.h +#ifndef GOOGLE_STRIP_LOG +#define GOOGLE_STRIP_LOG 0 +#endif + +// GCC can be told that a certain branch is not likely to be taken (for +// instance, a CHECK failure), and use that information in static analysis. +// Giving it this information can help it optimize for the common case in +// the absence of better information (ie. -fprofile-arcs). +// +#ifndef GOOGLE_PREDICT_BRANCH_NOT_TAKEN +#if 1 +#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x) (__builtin_expect(x, 0)) +#else +#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x) x +#endif +#endif + +// Make a bunch of macros for logging. The way to log things is to stream +// things to LOG(<a particular severity level>). E.g., +// +// LOG(INFO) << "Found " << num_cookies << " cookies"; +// +// You can capture log messages in a string, rather than reporting them +// immediately: +// +// vector<string> errors; +// LOG_STRING(ERROR, &errors) << "Couldn't parse cookie #" << cookie_num; +// +// This pushes back the new error onto 'errors'; if given a NULL pointer, +// it reports the error via LOG(ERROR). +// +// You can also do conditional logging: +// +// LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; +// +// You can also do occasional logging (log every n'th occurrence of an +// event): +// +// LOG_EVERY_N(INFO, 10) << "Got the " << COUNTER << "th cookie"; +// +// The above will cause log messages to be output on the 1st, 11th, 21st, ... +// times it is executed. Note that the special COUNTER value is used to +// identify which repetition is happening. +// +// You can also do occasional conditional logging (log every n'th +// occurrence of an event, when condition is satisfied): +// +// LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << COUNTER +// << "th big cookie"; +// +// You can log messages the first N times your code executes a line. E.g. +// +// LOG_FIRST_N(INFO, 20) << "Got the " << COUNTER << "th cookie"; +// +// Outputs log messages for the first 20 times it is executed. +// +// Analogous SYSLOG, SYSLOG_IF, and SYSLOG_EVERY_N macros are available. +// These log to syslog as well as to the normal logs. If you use these at +// all, you need to be aware that syslog can drastically reduce performance, +// especially if it is configured for remote logging! Don't use these +// unless you fully understand this and have a concrete need to use them. +// Even then, try to minimize your use of them. +// +// There are also "debug mode" logging macros like the ones above: +// +// DLOG(INFO) << "Found cookies"; +// +// DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; +// +// DLOG_EVERY_N(INFO, 10) << "Got the " << COUNTER << "th cookie"; +// +// All "debug mode" logging is compiled away to nothing for non-debug mode +// compiles. +// +// We also have +// +// LOG_ASSERT(assertion); +// DLOG_ASSERT(assertion); +// +// which is syntactic sugar for {,D}LOG_IF(FATAL, assert fails) << assertion; +// +// There are "verbose level" logging macros. They look like +// +// VLOG(1) << "I'm printed when you run the program with --v=1 or more"; +// VLOG(2) << "I'm printed when you run the program with --v=2 or more"; +// +// These always log at the INFO log level (when they log at all). +// The verbose logging can also be turned on module-by-module. For instance, +// --vmodule=mapreduce=2,file=1,gfs*=3 --v=0 +// will cause: +// a. VLOG(2) and lower messages to be printed from mapreduce.{h,cc} +// b. VLOG(1) and lower messages to be printed from file.{h,cc} +// c. VLOG(3) and lower messages to be printed from files prefixed with "gfs" +// d. VLOG(0) and lower messages to be printed from elsewhere +// +// The wildcarding functionality shown by (c) supports both '*' (match +// 0 or more characters) and '?' (match any single character) wildcards. +// +// There's also VLOG_IS_ON(n) "verbose level" condition macro. To be used as +// +// if (VLOG_IS_ON(2)) { +// // do some logging preparation and logging +// // that can't be accomplished with just VLOG(2) << ...; +// } +// +// There are also VLOG_IF, VLOG_EVERY_N and VLOG_IF_EVERY_N "verbose level" +// condition macros for sample cases, when some extra computation and +// preparation for logs is not needed. +// VLOG_IF(1, (size > 1024)) +// << "I'm printed when size is more than 1024 and when you run the " +// "program with --v=1 or more"; +// VLOG_EVERY_N(1, 10) +// << "I'm printed every 10th occurrence, and when you run the program " +// "with --v=1 or more. Present occurence is " << COUNTER; +// VLOG_IF_EVERY_N(1, (size > 1024), 10) +// << "I'm printed on every 10th occurence of case when size is more " +// " than 1024, when you run the program with --v=1 or more. "; +// "Present occurence is " << COUNTER; +// +// The supported severity levels for macros that allow you to specify one +// are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL. +// Note that messages of a given severity are logged not only in the +// logfile for that severity, but also in all logfiles of lower severity. +// E.g., a message of severity FATAL will be logged to the logfiles of +// severity FATAL, ERROR, WARNING, and INFO. +// +// There is also the special severity of DFATAL, which logs FATAL in +// debug mode, ERROR in normal mode. +// +// Very important: logging a message at the FATAL severity level causes +// the program to terminate (after the message is logged). +// +// Unless otherwise specified, logs will be written to the filename +// "<program name>.<hostname>.<user name>.log.<severity level>.", followed +// by the date, time, and pid (you can't prevent the date, time, and pid +// from being in the filename). +// +// The logging code takes two flags: +// --v=# set the verbose level +// --logtostderr log all the messages to stderr instead of to logfiles + +// LOG LINE PREFIX FORMAT +// +// Log lines have this form: +// +// Lmmdd hh:mm:ss.uuuuuu threadid file:line] msg... +// +// where the fields are defined as follows: +// +// L A single character, representing the log level +// (eg 'I' for INFO) +// mm The month (zero padded; ie May is '05') +// dd The day (zero padded) +// hh:mm:ss.uuuuuu Time in hours, minutes and fractional seconds +// threadid The space-padded thread ID as returned by GetTID() +// (this matches the PID on Linux) +// file The file name +// line The line number +// msg The user-supplied message +// +// Example: +// +// I1103 11:57:31.739339 24395 google.cc:2341] Command line: ./some_prog +// I1103 11:57:31.739403 24395 google.cc:2342] Process id 24395 +// +// NOTE: although the microseconds are useful for comparing events on +// a single machine, clocks on different machines may not be well +// synchronized. Hence, use caution when comparing the low bits of +// timestamps from different machines. + +#ifndef DECLARE_VARIABLE +#define MUST_UNDEF_GFLAGS_DECLARE_MACROS +#define DECLARE_VARIABLE(type, name, tn) \ + namespace FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead { \ + extern GOOGLE_GLOG_DLL_DECL type FLAGS_##name; \ + } \ + using FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead::FLAGS_##name + +// bool specialization +#define DECLARE_bool(name) \ + DECLARE_VARIABLE(bool, name, bool) + +// int32 specialization +#define DECLARE_int32(name) \ + DECLARE_VARIABLE(google::int32, name, int32) + +// Special case for string, because we have to specify the namespace +// std::string, which doesn't play nicely with our FLAG__namespace hackery. +#define DECLARE_string(name) \ + namespace FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead { \ + extern GOOGLE_GLOG_DLL_DECL std::string FLAGS_##name; \ + } \ + using FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead::FLAGS_##name +#endif + +// Set whether log messages go to stderr instead of logfiles +DECLARE_bool(logtostderr); + +// Set whether log messages go to stderr in addition to logfiles. +DECLARE_bool(alsologtostderr); + +// Log messages at a level >= this flag are automatically sent to +// stderr in addition to log files. +DECLARE_int32(stderrthreshold); + +// Set whether the log prefix should be prepended to each line of output. +DECLARE_bool(log_prefix); + +// Log messages at a level <= this flag are buffered. +// Log messages at a higher level are flushed immediately. +DECLARE_int32(logbuflevel); + +// Sets the maximum number of seconds which logs may be buffered for. +DECLARE_int32(logbufsecs); + +// Log suppression level: messages logged at a lower level than this +// are suppressed. +DECLARE_int32(minloglevel); + +// If specified, logfiles are written into this directory instead of the +// default logging directory. +DECLARE_string(log_dir); + +// Sets the path of the directory into which to put additional links +// to the log files. +DECLARE_string(log_link); + +DECLARE_int32(v); // in vlog_is_on.cc + +// Sets the maximum log file size (in MB). +DECLARE_int32(max_log_size); + +// Sets whether to avoid logging to the disk if the disk is full. +DECLARE_bool(stop_logging_if_full_disk); + +#ifdef MUST_UNDEF_GFLAGS_DECLARE_MACROS +#undef MUST_UNDEF_GFLAGS_DECLARE_MACROS +#undef DECLARE_VARIABLE +#undef DECLARE_bool +#undef DECLARE_int32 +#undef DECLARE_string +#endif + +// Log messages below the GOOGLE_STRIP_LOG level will be compiled away for +// security reasons. See LOG(severtiy) below. + +// A few definitions of macros that don't generate much code. Since +// LOG(INFO) and its ilk are used all over our code, it's +// better to have compact code for these operations. + +#if GOOGLE_STRIP_LOG == 0 +#define COMPACT_GOOGLE_LOG_INFO google::LogMessage( \ + __FILE__, __LINE__) +#define LOG_TO_STRING_INFO(message) google::LogMessage( \ + __FILE__, __LINE__, google::INFO, message) +#else +#define COMPACT_GOOGLE_LOG_INFO google::NullStream() +#define LOG_TO_STRING_INFO(message) google::NullStream() +#endif + +#if GOOGLE_STRIP_LOG <= 1 +#define COMPACT_GOOGLE_LOG_WARNING google::LogMessage( \ + __FILE__, __LINE__, google::WARNING) +#define LOG_TO_STRING_WARNING(message) google::LogMessage( \ + __FILE__, __LINE__, google::WARNING, message) +#else +#define COMPACT_GOOGLE_LOG_WARNING google::NullStream() +#define LOG_TO_STRING_WARNING(message) google::NullStream() +#endif + +#if GOOGLE_STRIP_LOG <= 2 +#define COMPACT_GOOGLE_LOG_ERROR google::LogMessage( \ + __FILE__, __LINE__, google::ERROR) +#define LOG_TO_STRING_ERROR(message) google::LogMessage( \ + __FILE__, __LINE__, google::ERROR, message) +#else +#define COMPACT_GOOGLE_LOG_ERROR google::NullStream() +#define LOG_TO_STRING_ERROR(message) google::NullStream() +#endif + +#if GOOGLE_STRIP_LOG <= 3 +#define COMPACT_GOOGLE_LOG_FATAL google::LogMessageFatal( \ + __FILE__, __LINE__) +#define LOG_TO_STRING_FATAL(message) google::LogMessage( \ + __FILE__, __LINE__, google::FATAL, message) +#else +#define COMPACT_GOOGLE_LOG_FATAL google::NullStreamFatal() +#define LOG_TO_STRING_FATAL(message) google::NullStreamFatal() +#endif + +// For DFATAL, we want to use LogMessage (as opposed to +// LogMessageFatal), to be consistent with the original behavior. +#ifdef NDEBUG +#define COMPACT_GOOGLE_LOG_DFATAL COMPACT_GOOGLE_LOG_ERROR +#elif GOOGLE_STRIP_LOG <= 3 +#define COMPACT_GOOGLE_LOG_DFATAL google::LogMessage( \ + __FILE__, __LINE__, google::FATAL) +#else +#define COMPACT_GOOGLE_LOG_DFATAL google::NullStreamFatal() +#endif + +#define GOOGLE_LOG_INFO(counter) google::LogMessage(__FILE__, __LINE__, google::INFO, counter, &google::LogMessage::SendToLog) +#define SYSLOG_INFO(counter) \ + google::LogMessage(__FILE__, __LINE__, google::INFO, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_WARNING(counter) \ + google::LogMessage(__FILE__, __LINE__, google::WARNING, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_WARNING(counter) \ + google::LogMessage(__FILE__, __LINE__, google::WARNING, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_ERROR(counter) \ + google::LogMessage(__FILE__, __LINE__, google::ERROR, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_ERROR(counter) \ + google::LogMessage(__FILE__, __LINE__, google::ERROR, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_FATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::FATAL, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_FATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::FATAL, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_DFATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::DFATAL_LEVEL, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_DFATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::DFATAL_LEVEL, counter, \ + &google::LogMessage::SendToSyslogAndLog) + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) || defined(__CYGWIN32__) +// A very useful logging macro to log windows errors: +#define LOG_SYSRESULT(result) \ + if (FAILED(result)) { \ + LPTSTR message = NULL; \ + LPTSTR msg = reinterpret_cast<LPTSTR>(&message); \ + DWORD message_length = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | \ + FORMAT_MESSAGE_FROM_SYSTEM, \ + 0, result, 0, msg, 100, NULL); \ + if (message_length > 0) { \ + google::LogMessage(__FILE__, __LINE__, ERROR, 0, \ + &google::LogMessage::SendToLog).stream() << message; \ + LocalFree(message); \ + } \ + } +#endif + +// We use the preprocessor's merging operator, "##", so that, e.g., +// LOG(INFO) becomes the token GOOGLE_LOG_INFO. There's some funny +// subtle difference between ostream member streaming functions (e.g., +// ostream::operator<<(int) and ostream non-member streaming functions +// (e.g., ::operator<<(ostream&, string&): it turns out that it's +// impossible to stream something like a string directly to an unnamed +// ostream. We employ a neat hack by calling the stream() member +// function of LogMessage which seems to avoid the problem. +#define LOG(severity) COMPACT_GOOGLE_LOG_ ## severity.stream() +#define SYSLOG(severity) SYSLOG_ ## severity(0).stream() + +namespace google { + +// They need the definitions of integer types. +#include "glog/log_severity.h" +#include "glog/vlog_is_on.h" + +// Initialize google's logging library. You will see the program name +// specified by argv0 in log outputs. +GOOGLE_GLOG_DLL_DECL void InitGoogleLogging(const char* argv0); + +// Shutdown google's logging library. +GOOGLE_GLOG_DLL_DECL void ShutdownGoogleLogging(); + +// Install a function which will be called after LOG(FATAL). +GOOGLE_GLOG_DLL_DECL void InstallFailureFunction(void (*fail_func)()); + +class LogSink; // defined below + +// If a non-NULL sink pointer is given, we push this message to that sink. +// For LOG_TO_SINK we then do normal LOG(severity) logging as well. +// This is useful for capturing messages and passing/storing them +// somewhere more specific than the global log of the process. +// Argument types: +// LogSink* sink; +// LogSeverity severity; +// The cast is to disambiguate NULL arguments. +#define LOG_TO_SINK(sink, severity) \ + google::LogMessage( \ + __FILE__, __LINE__, \ + google::severity, \ + static_cast<google::LogSink*>(sink), true).stream() +#define LOG_TO_SINK_BUT_NOT_TO_LOGFILE(sink, severity) \ + google::LogMessage( \ + __FILE__, __LINE__, \ + google::severity, \ + static_cast<google::LogSink*>(sink), false).stream() + +// If a non-NULL string pointer is given, we write this message to that string. +// We then do normal LOG(severity) logging as well. +// This is useful for capturing messages and storing them somewhere more +// specific than the global log of the process. +// Argument types: +// string* message; +// LogSeverity severity; +// The cast is to disambiguate NULL arguments. +// NOTE: LOG(severity) expands to LogMessage().stream() for the specified +// severity. +#define LOG_TO_STRING(severity, message) \ + LOG_TO_STRING_##severity(static_cast<string*>(message)).stream() + +// If a non-NULL pointer is given, we push the message onto the end +// of a vector of strings; otherwise, we report it with LOG(severity). +// This is handy for capturing messages and perhaps passing them back +// to the caller, rather than reporting them immediately. +// Argument types: +// LogSeverity severity; +// vector<string> *outvec; +// The cast is to disambiguate NULL arguments. +#define LOG_STRING(severity, outvec) \ + LOG_TO_STRING_##severity(static_cast<vector<string>*>(outvec)).stream() + +#define LOG_IF(severity, condition) \ + !(condition) ? (void) 0 : google::LogMessageVoidify() & LOG(severity) +#define SYSLOG_IF(severity, condition) \ + !(condition) ? (void) 0 : google::LogMessageVoidify() & SYSLOG(severity) + +#define LOG_ASSERT(condition) \ + LOG_IF(FATAL, !(condition)) << "Assert failed: " #condition +#define SYSLOG_ASSERT(condition) \ + SYSLOG_IF(FATAL, !(condition)) << "Assert failed: " #condition + +// CHECK dies with a fatal error if condition is not true. It is *not* +// controlled by NDEBUG, so the check will be executed regardless of +// compilation mode. Therefore, it is safe to do things like: +// CHECK(fp->Write(x) == 4) +#define CHECK(condition) \ + LOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN(!(condition))) \ + << "Check failed: " #condition " " + +// A container for a string pointer which can be evaluated to a bool - +// true iff the pointer is NULL. +struct CheckOpString { + CheckOpString(std::string* str) : str_(str) { } + // No destructor: if str_ is non-NULL, we're about to LOG(FATAL), + // so there's no point in cleaning up str_. + operator bool() const { + return GOOGLE_PREDICT_BRANCH_NOT_TAKEN(str_ != NULL); + } + std::string* str_; +}; + +// Function is overloaded for integral types to allow static const +// integrals declared in classes and not defined to be used as arguments to +// CHECK* macros. It's not encouraged though. +template <class T> +inline const T& GetReferenceableValue(const T& t) { return t; } +inline char GetReferenceableValue(char t) { return t; } +inline unsigned char GetReferenceableValue(unsigned char t) { return t; } +inline signed char GetReferenceableValue(signed char t) { return t; } +inline short GetReferenceableValue(short t) { return t; } +inline unsigned short GetReferenceableValue(unsigned short t) { return t; } +inline int GetReferenceableValue(int t) { return t; } +inline unsigned int GetReferenceableValue(unsigned int t) { return t; } +inline long GetReferenceableValue(long t) { return t; } +inline unsigned long GetReferenceableValue(unsigned long t) { return t; } +inline long long GetReferenceableValue(long long t) { return t; } +inline unsigned long long GetReferenceableValue(unsigned long long t) { + return t; +} + +// This is a dummy class to define the following operator. +struct DummyClassToDefineOperator {}; + +} + +// Define global operator<< to declare using ::operator<<. +// This declaration will allow use to use CHECK macros for user +// defined classes which have operator<< (e.g., stl_logging.h). +inline std::ostream& operator<<( + std::ostream& out, const google::DummyClassToDefineOperator&) { + return out; +} + +namespace google { + +// Build the error message string. +template<class t1, class t2> +std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) { + // It means that we cannot use stl_logging if compiler doesn't + // support using expression for operator. + // TODO(hamaji): Figure out a way to fix. +#if 1 + using ::operator<<; +#endif + std::strstream ss; + ss << names << " (" << v1 << " vs. " << v2 << ")"; + return new std::string(ss.str(), ss.pcount()); +} + +// Helper functions for CHECK_OP macro. +// The (int, int) specialization works around the issue that the compiler +// will not instantiate the template version of the function on values of +// unnamed enum type - see comment below. +#define DEFINE_CHECK_OP_IMPL(name, op) \ + template <class t1, class t2> \ + inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \ + const char* names) { \ + if (v1 op v2) return NULL; \ + else return MakeCheckOpString(v1, v2, names); \ + } \ + inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \ + return Check##name##Impl<int, int>(v1, v2, names); \ + } + +// Use _EQ, _NE, _LE, etc. in case the file including base/logging.h +// provides its own #defines for the simpler names EQ, NE, LE, etc. +// This happens if, for example, those are used as token names in a +// yacc grammar. +DEFINE_CHECK_OP_IMPL(_EQ, ==) +DEFINE_CHECK_OP_IMPL(_NE, !=) +DEFINE_CHECK_OP_IMPL(_LE, <=) +DEFINE_CHECK_OP_IMPL(_LT, < ) +DEFINE_CHECK_OP_IMPL(_GE, >=) +DEFINE_CHECK_OP_IMPL(_GT, > ) +#undef DEFINE_CHECK_OP_IMPL + +// Helper macro for binary operators. +// Don't use this macro directly in your code, use CHECK_EQ et al below. + +#if defined(STATIC_ANALYSIS) +// Only for static analysis tool to know that it is equivalent to assert +#define CHECK_OP_LOG(name, op, val1, val2, log) CHECK((val1) op (val2)) +#elif !defined(NDEBUG) +// In debug mode, avoid constructing CheckOpStrings if possible, +// to reduce the overhead of CHECK statments by 2x. +// Real DCHECK-heavy tests have seen 1.5x speedups. + +// The meaning of "string" might be different between now and +// when this macro gets invoked (e.g., if someone is experimenting +// with other string implementations that get defined after this +// file is included). Save the current meaning now and use it +// in the macro. +typedef std::string _Check_string; +#define CHECK_OP_LOG(name, op, val1, val2, log) \ + while (google::_Check_string* _result = \ + google::Check##name##Impl( \ + google::GetReferenceableValue(val1), \ + google::GetReferenceableValue(val2), \ + #val1 " " #op " " #val2)) \ + log(__FILE__, __LINE__, \ + google::CheckOpString(_result)).stream() +#else +// In optimized mode, use CheckOpString to hint to compiler that +// the while condition is unlikely. +#define CHECK_OP_LOG(name, op, val1, val2, log) \ + while (google::CheckOpString _result = \ + google::Check##name##Impl( \ + google::GetReferenceableValue(val1), \ + google::GetReferenceableValue(val2), \ + #val1 " " #op " " #val2)) \ + log(__FILE__, __LINE__, _result).stream() +#endif // STATIC_ANALYSIS, !NDEBUG + +#if GOOGLE_STRIP_LOG <= 3 +#define CHECK_OP(name, op, val1, val2) \ + CHECK_OP_LOG(name, op, val1, val2, google::LogMessageFatal) +#else +#define CHECK_OP(name, op, val1, val2) \ + CHECK_OP_LOG(name, op, val1, val2, google::NullStreamFatal) +#endif // STRIP_LOG <= 3 + +// Equality/Inequality checks - compare two values, and log a FATAL message +// including the two values when the result is not as expected. The values +// must have operator<<(ostream, ...) defined. +// +// You may append to the error message like so: +// CHECK_NE(1, 2) << ": The world must be ending!"; +// +// We are very careful to ensure that each argument is evaluated exactly +// once, and that anything which is legal to pass as a function argument is +// legal here. In particular, the arguments may be temporary expressions +// which will end up being destroyed at the end of the apparent statement, +// for example: +// CHECK_EQ(string("abc")[1], 'b'); +// +// WARNING: These don't compile correctly if one of the arguments is a pointer +// and the other is NULL. To work around this, simply static_cast NULL to the +// type of the desired pointer. + +#define CHECK_EQ(val1, val2) CHECK_OP(_EQ, ==, val1, val2) +#define CHECK_NE(val1, val2) CHECK_OP(_NE, !=, val1, val2) +#define CHECK_LE(val1, val2) CHECK_OP(_LE, <=, val1, val2) +#define CHECK_LT(val1, val2) CHECK_OP(_LT, < , val1, val2) +#define CHECK_GE(val1, val2) CHECK_OP(_GE, >=, val1, val2) +#define CHECK_GT(val1, val2) CHECK_OP(_GT, > , val1, val2) + +// Check that the input is non NULL. This very useful in constructor +// initializer lists. + +#define CHECK_NOTNULL(val) \ + google::CheckNotNull(__FILE__, __LINE__, "'" #val "' Must be non NULL", (val)) + +// Helper functions for string comparisons. +// To avoid bloat, the definitions are in logging.cc. +#define DECLARE_CHECK_STROP_IMPL(func, expected) \ + GOOGLE_GLOG_DLL_DECL std::string* Check##func##expected##Impl( \ + const char* s1, const char* s2, const char* names); +DECLARE_CHECK_STROP_IMPL(strcmp, true) +DECLARE_CHECK_STROP_IMPL(strcmp, false) +DECLARE_CHECK_STROP_IMPL(strcasecmp, true) +DECLARE_CHECK_STROP_IMPL(strcasecmp, false) +#undef DECLARE_CHECK_STROP_IMPL + +// Helper macro for string comparisons. +// Don't use this macro directly in your code, use CHECK_STREQ et al below. +#define CHECK_STROP(func, op, expected, s1, s2) \ + while (google::CheckOpString _result = \ + google::Check##func##expected##Impl((s1), (s2), \ + #s1 " " #op " " #s2)) \ + LOG(FATAL) << *_result.str_ + + +// String (char*) equality/inequality checks. +// CASE versions are case-insensitive. +// +// Note that "s1" and "s2" may be temporary strings which are destroyed +// by the compiler at the end of the current "full expression" +// (e.g. CHECK_STREQ(Foo().c_str(), Bar().c_str())). + +#define CHECK_STREQ(s1, s2) CHECK_STROP(strcmp, ==, true, s1, s2) +#define CHECK_STRNE(s1, s2) CHECK_STROP(strcmp, !=, false, s1, s2) +#define CHECK_STRCASEEQ(s1, s2) CHECK_STROP(strcasecmp, ==, true, s1, s2) +#define CHECK_STRCASENE(s1, s2) CHECK_STROP(strcasecmp, !=, false, s1, s2) + +#define CHECK_INDEX(I,A) CHECK(I < (sizeof(A)/sizeof(A[0]))) +#define CHECK_BOUND(B,A) CHECK(B <= (sizeof(A)/sizeof(A[0]))) + +#define CHECK_DOUBLE_EQ(val1, val2) \ + do { \ + CHECK_LE((val1), (val2)+0.000000000000001L); \ + CHECK_GE((val1), (val2)-0.000000000000001L); \ + } while (0) + +#define CHECK_NEAR(val1, val2, margin) \ + do { \ + CHECK_LE((val1), (val2)+(margin)); \ + CHECK_GE((val1), (val2)-(margin)); \ + } while (0) + +// perror()..googly style! +// +// PLOG() and PLOG_IF() and PCHECK() behave exactly like their LOG* and +// CHECK equivalents with the addition that they postpend a description +// of the current state of errno to their output lines. + +#define PLOG(severity) GOOGLE_PLOG(severity, 0).stream() + +#define GOOGLE_PLOG(severity, counter) \ + google::ErrnoLogMessage( \ + __FILE__, __LINE__, google::severity, counter, \ + &google::LogMessage::SendToLog) + +#define PLOG_IF(severity, condition) \ + !(condition) ? (void) 0 : google::LogMessageVoidify() & PLOG(severity) + +// A CHECK() macro that postpends errno if the condition is false. E.g. +// +// if (poll(fds, nfds, timeout) == -1) { PCHECK(errno == EINTR); ... } +#define PCHECK(condition) \ + PLOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN(!(condition))) \ + << "Check failed: " #condition " " + +// A CHECK() macro that lets you assert the success of a function that +// returns -1 and sets errno in case of an error. E.g. +// +// CHECK_ERR(mkdir(path, 0700)); +// +// or +// +// int fd = open(filename, flags); CHECK_ERR(fd) << ": open " << filename; +#define CHECK_ERR(invocation) \ +PLOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN((invocation) == -1)) \ + << #invocation + +// Use macro expansion to create, for each use of LOG_EVERY_N(), static +// variables with the __LINE__ expansion as part of the variable name. +#define LOG_EVERY_N_VARNAME(base, line) LOG_EVERY_N_VARNAME_CONCAT(base, line) +#define LOG_EVERY_N_VARNAME_CONCAT(base, line) base ## line + +#define LOG_OCCURRENCES LOG_EVERY_N_VARNAME(occurrences_, __LINE__) +#define LOG_OCCURRENCES_MOD_N LOG_EVERY_N_VARNAME(occurrences_mod_n_, __LINE__) + +#define SOME_KIND_OF_LOG_EVERY_N(severity, n, what_to_do) \ + static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ + ++LOG_OCCURRENCES; \ + if (++LOG_OCCURRENCES_MOD_N > n) LOG_OCCURRENCES_MOD_N -= n; \ + if (LOG_OCCURRENCES_MOD_N == 1) \ + google::LogMessage( \ + __FILE__, __LINE__, google::severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +#define SOME_KIND_OF_LOG_IF_EVERY_N(severity, condition, n, what_to_do) \ + static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ + ++LOG_OCCURRENCES; \ + if (condition && \ + ((LOG_OCCURRENCES_MOD_N=(LOG_OCCURRENCES_MOD_N + 1) % n) == (1 % n))) \ + google::LogMessage( \ + __FILE__, __LINE__, google::severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +#define SOME_KIND_OF_PLOG_EVERY_N(severity, n, what_to_do) \ + static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ + ++LOG_OCCURRENCES; \ + if (++LOG_OCCURRENCES_MOD_N > n) LOG_OCCURRENCES_MOD_N -= n; \ + if (LOG_OCCURRENCES_MOD_N == 1) \ + google::ErrnoLogMessage( \ + __FILE__, __LINE__, google::severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +#define SOME_KIND_OF_LOG_FIRST_N(severity, n, what_to_do) \ + static int LOG_OCCURRENCES = 0; \ + if (LOG_OCCURRENCES <= n) \ + ++LOG_OCCURRENCES; \ + if (LOG_OCCURRENCES <= n) \ + google::LogMessage( \ + __FILE__, __LINE__, google::severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +namespace glog_internal_namespace_ { +template <bool> +struct CompileAssert { +}; +struct CrashReason; +} // namespace glog_internal_namespace_ + +#define GOOGLE_GLOG_COMPILE_ASSERT(expr, msg) \ + typedef google::glog_internal_namespace_::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] + +#define LOG_EVERY_N(severity, n) \ + GOOGLE_GLOG_COMPILE_ASSERT(google::severity < \ + google::NUM_SEVERITIES, \ + INVALID_REQUESTED_LOG_SEVERITY); \ + SOME_KIND_OF_LOG_EVERY_N(severity, (n), google::LogMessage::SendToLog) + +#define SYSLOG_EVERY_N(severity, n) \ + SOME_KIND_OF_LOG_EVERY_N(severity, (n), google::LogMessage::SendToSyslogAndLog) + +#define PLOG_EVERY_N(severity, n) \ + SOME_KIND_OF_PLOG_EVERY_N(severity, (n), google::LogMessage::SendToLog) + +#define LOG_FIRST_N(severity, n) \ + SOME_KIND_OF_LOG_FIRST_N(severity, (n), google::LogMessage::SendToLog) + +#define LOG_IF_EVERY_N(severity, condition, n) \ + SOME_KIND_OF_LOG_IF_EVERY_N(severity, (condition), (n), google::LogMessage::SendToLog) + +// We want the special COUNTER value available for LOG_EVERY_X()'ed messages +enum PRIVATE_Counter {COUNTER}; + + +// Plus some debug-logging macros that get compiled to nothing for production + +#ifndef NDEBUG + +#define DLOG(severity) LOG(severity) +#define DVLOG(verboselevel) VLOG(verboselevel) +#define DLOG_IF(severity, condition) LOG_IF(severity, condition) +#define DLOG_EVERY_N(severity, n) LOG_EVERY_N(severity, n) +#define DLOG_IF_EVERY_N(severity, condition, n) \ + LOG_IF_EVERY_N(severity, condition, n) +#define DLOG_ASSERT(condition) LOG_ASSERT(condition) + +// debug-only checking. not executed in NDEBUG mode. +#define DCHECK(condition) CHECK(condition) +#define DCHECK_EQ(val1, val2) CHECK_EQ(val1, val2) +#define DCHECK_NE(val1, val2) CHECK_NE(val1, val2) +#define DCHECK_LE(val1, val2) CHECK_LE(val1, val2) +#define DCHECK_LT(val1, val2) CHECK_LT(val1, val2) +#define DCHECK_GE(val1, val2) CHECK_GE(val1, val2) +#define DCHECK_GT(val1, val2) CHECK_GT(val1, val2) +#define DCHECK_NOTNULL(val) CHECK_NOTNULL(val) +#define DCHECK_STREQ(str1, str2) CHECK_STREQ(str1, str2) +#define DCHECK_STRCASEEQ(str1, str2) CHECK_STRCASEEQ(str1, str2) +#define DCHECK_STRNE(str1, str2) CHECK_STRNE(str1, str2) +#define DCHECK_STRCASENE(str1, str2) CHECK_STRCASENE(str1, str2) + +#else // NDEBUG + +#define DLOG(severity) \ + true ? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DVLOG(verboselevel) \ + (true || !VLOG_IS_ON(verboselevel)) ?\ + (void) 0 : google::LogMessageVoidify() & LOG(INFO) + +#define DLOG_IF(severity, condition) \ + (true || !(condition)) ? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DLOG_EVERY_N(severity, n) \ + true ? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DLOG_IF_EVERY_N(severity, condition, n) \ + (true || !(condition))? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DLOG_ASSERT(condition) \ + true ? (void) 0 : LOG_ASSERT(condition) + +#define DCHECK(condition) \ + while (false) \ + CHECK(condition) + +#define DCHECK_EQ(val1, val2) \ + while (false) \ + CHECK_EQ(val1, val2) + +#define DCHECK_NE(val1, val2) \ + while (false) \ + CHECK_NE(val1, val2) + +#define DCHECK_LE(val1, val2) \ + while (false) \ + CHECK_LE(val1, val2) + +#define DCHECK_LT(val1, val2) \ + while (false) \ + CHECK_LT(val1, val2) + +#define DCHECK_GE(val1, val2) \ + while (false) \ + CHECK_GE(val1, val2) + +#define DCHECK_GT(val1, val2) \ + while (false) \ + CHECK_GT(val1, val2) + +#define DCHECK_NOTNULL(val) (val) + +#define DCHECK_STREQ(str1, str2) \ + while (false) \ + CHECK_STREQ(str1, str2) + +#define DCHECK_STRCASEEQ(str1, str2) \ + while (false) \ + CHECK_STRCASEEQ(str1, str2) + +#define DCHECK_STRNE(str1, str2) \ + while (false) \ + CHECK_STRNE(str1, str2) + +#define DCHECK_STRCASENE(str1, str2) \ + while (false) \ + CHECK_STRCASENE(str1, str2) + + +#endif // NDEBUG + +// Log only in verbose mode. + +#define VLOG(verboselevel) LOG_IF(INFO, VLOG_IS_ON(verboselevel)) + +#define VLOG_IF(verboselevel, condition) \ + LOG_IF(INFO, (condition) && VLOG_IS_ON(verboselevel)) + +#define VLOG_EVERY_N(verboselevel, n) \ + LOG_IF_EVERY_N(INFO, VLOG_IS_ON(verboselevel), n) + +#define VLOG_IF_EVERY_N(verboselevel, condition, n) \ + LOG_IF_EVERY_N(INFO, (condition) && VLOG_IS_ON(verboselevel), n) + +// +// This class more or less represents a particular log message. You +// create an instance of LogMessage and then stream stuff to it. +// When you finish streaming to it, ~LogMessage is called and the +// full message gets streamed to the appropriate destination. +// +// You shouldn't actually use LogMessage's constructor to log things, +// though. You should use the LOG() macro (and variants thereof) +// above. +class GOOGLE_GLOG_DLL_DECL LogMessage { +public: + enum { + // Passing kNoLogPrefix for the line number disables the + // log-message prefix. Useful for using the LogMessage + // infrastructure as a printing utility. See also the --log_prefix + // flag for controlling the log-message prefix on an + // application-wide basis. + kNoLogPrefix = -1 + }; + + // LogStream inherit from non-DLL-exported class (std::ostrstream) + // and VC++ produces a warning for this situation. + // However, MSDN says "C4275 can be ignored in Microsoft Visual C++ + // 2005 if you are deriving from a type in the Standard C++ Library" + // http://msdn.microsoft.com/en-us/library/3tdb471s(VS.80).aspx + // Let's just ignore the warning. +#ifdef _MSC_VER +# pragma warning(disable: 4275) +#endif + class GOOGLE_GLOG_DLL_DECL LogStream : public std::ostrstream { +#ifdef _MSC_VER +# pragma warning(default: 4275) +#endif + public: + LogStream(char *buf, int len, int ctr) + : ostrstream(buf, len), + ctr_(ctr) { + self_ = this; + } + + int ctr() const { return ctr_; } + void set_ctr(int ctr) { ctr_ = ctr; } + LogStream* self() const { return self_; } + + private: + int ctr_; // Counter hack (for the LOG_EVERY_X() macro) + LogStream *self_; // Consistency check hack + }; + +public: + // icc 8 requires this typedef to avoid an internal compiler error. + typedef void (LogMessage::*SendMethod)(); + + LogMessage(const char* file, int line, LogSeverity severity, int ctr, + SendMethod send_method); + + // Two special constructors that generate reduced amounts of code at + // LOG call sites for common cases. + + // Used for LOG(INFO): Implied are: + // severity = INFO, ctr = 0, send_method = &LogMessage::SendToLog. + // + // Using this constructor instead of the more complex constructor above + // saves 19 bytes per call site. + LogMessage(const char* file, int line); + + // Used for LOG(severity) where severity != INFO. Implied + // are: ctr = 0, send_method = &LogMessage::SendToLog + // + // Using this constructor instead of the more complex constructor above + // saves 17 bytes per call site. + LogMessage(const char* file, int line, LogSeverity severity); + + // Constructor to log this message to a specified sink (if not NULL). + // Implied are: ctr = 0, send_method = &LogMessage::SendToSinkAndLog if + // also_send_to_log is true, send_method = &LogMessage::SendToSink otherwise. + LogMessage(const char* file, int line, LogSeverity severity, LogSink* sink, + bool also_send_to_log); + + // Constructor where we also give a vector<string> pointer + // for storing the messages (if the pointer is not NULL). + // Implied are: ctr = 0, send_method = &LogMessage::SaveOrSendToLog. + LogMessage(const char* file, int line, LogSeverity severity, + std::vector<std::string>* outvec); + + // Constructor where we also give a string pointer for storing the + // message (if the pointer is not NULL). Implied are: ctr = 0, + // send_method = &LogMessage::WriteToStringAndLog. + LogMessage(const char* file, int line, LogSeverity severity, + std::string* message); + + // A special constructor used for check failures + LogMessage(const char* file, int line, const CheckOpString& result); + + ~LogMessage(); + + // Flush a buffered message to the sink set in the constructor. Always + // called by the destructor, it may also be called from elsewhere if + // needed. Only the first call is actioned; any later ones are ignored. + void Flush(); + + // An arbitrary limit on the length of a single log message. This + // is so that streaming can be done more efficiently. + static const size_t kMaxLogMessageLen; + + // Theses should not be called directly outside of logging.*, + // only passed as SendMethod arguments to other LogMessage methods: + void SendToLog(); // Actually dispatch to the logs + void SendToSyslogAndLog(); // Actually dispatch to syslog and the logs + + // Call abort() or similar to perform LOG(FATAL) crash. + static void Fail() __attribute__ ((noreturn)); + + std::ostream& stream() { return *(data_->stream_); } + + int preserved_errno() const { return data_->preserved_errno_; } + + // Must be called without the log_mutex held. (L < log_mutex) + static int64 num_messages(int severity); + +private: + // Fully internal SendMethod cases: + void SendToSinkAndLog(); // Send to sink if provided and dispatch to the logs + void SendToSink(); // Send to sink if provided, do nothing otherwise. + + // Write to string if provided and dispatch to the logs. + void WriteToStringAndLog(); + + void SaveOrSendToLog(); // Save to stringvec if provided, else to logs + + void Init(const char* file, int line, LogSeverity severity, + void (LogMessage::*send_method)()); + + // Used to fill in crash information during LOG(FATAL) failures. + void RecordCrashReason(glog_internal_namespace_::CrashReason* reason); + + // Counts of messages sent at each priority: + static int64 num_messages_[NUM_SEVERITIES]; // under log_mutex + + // We keep the data in a separate struct so that each instance of + // LogMessage uses less stack space. + struct GOOGLE_GLOG_DLL_DECL LogMessageData { + LogMessageData() {}; + + int preserved_errno_; // preserved errno + char* buf_; + char* message_text_; // Complete message text (points to selected buffer) + LogStream* stream_alloc_; + LogStream* stream_; + char severity_; // What level is this LogMessage logged at? + int line_; // line number where logging call is. + void (LogMessage::*send_method_)(); // Call this in destructor to send + union { // At most one of these is used: union to keep the size low. + LogSink* sink_; // NULL or sink to send message to + std::vector<std::string>* outvec_; // NULL or vector to push message onto + std::string* message_; // NULL or string to write message into + }; + time_t timestamp_; // Time of creation of LogMessage + struct ::tm tm_time_; // Time of creation of LogMessage + size_t num_prefix_chars_; // # of chars of prefix in this message + size_t num_chars_to_log_; // # of chars of msg to send to log + size_t num_chars_to_syslog_; // # of chars of msg to send to syslog + const char* basename_; // basename of file that called LOG + const char* fullname_; // fullname of file that called LOG + bool has_been_flushed_; // false => data has not been flushed + bool first_fatal_; // true => this was first fatal msg + + ~LogMessageData(); + private: + LogMessageData(const LogMessageData&); + void operator=(const LogMessageData&); + }; + + static LogMessageData fatal_msg_data_exclusive_; + static LogMessageData fatal_msg_data_shared_; + + LogMessageData* allocated_; + LogMessageData* data_; + + friend class LogDestination; + + LogMessage(const LogMessage&); + void operator=(const LogMessage&); +}; + +// This class happens to be thread-hostile because all instances share +// a single data buffer, but since it can only be created just before +// the process dies, we don't worry so much. +class GOOGLE_GLOG_DLL_DECL LogMessageFatal : public LogMessage { + public: + LogMessageFatal(const char* file, int line); + LogMessageFatal(const char* file, int line, const CheckOpString& result); + ~LogMessageFatal() __attribute__ ((noreturn)); +}; + +// A non-macro interface to the log facility; (useful +// when the logging level is not a compile-time constant). +inline void LogAtLevel(int const severity, std::string const &msg) { + LogMessage(__FILE__, __LINE__, severity).stream() << msg; +} + +// A macro alternative of LogAtLevel. New code may want to use this +// version since there are two advantages: 1. this version outputs the +// file name and the line number where this macro is put like other +// LOG macros, 2. this macro can be used as C++ stream. +#define LOG_AT_LEVEL(severity) google::LogMessage(__FILE__, __LINE__, severity).stream() + +// A small helper for CHECK_NOTNULL(). +template <typename T> +T* CheckNotNull(const char *file, int line, const char *names, T* t) { + if (t == NULL) { + LogMessageFatal(file, line, new std::string(names)); + } + return t; +} + +// Allow folks to put a counter in the LOG_EVERY_X()'ed messages. This +// only works if ostream is a LogStream. If the ostream is not a +// LogStream you'll get an assert saying as much at runtime. +GOOGLE_GLOG_DLL_DECL std::ostream& operator<<(std::ostream &os, + const PRIVATE_Counter&); + + +// Derived class for PLOG*() above. +class GOOGLE_GLOG_DLL_DECL ErrnoLogMessage : public LogMessage { + public: + + ErrnoLogMessage(const char* file, int line, LogSeverity severity, int ctr, + void (LogMessage::*send_method)()); + + // Postpends ": strerror(errno) [errno]". + ~ErrnoLogMessage(); + + private: + ErrnoLogMessage(const ErrnoLogMessage&); + void operator=(const ErrnoLogMessage&); +}; + + +// This class is used to explicitly ignore values in the conditional +// logging macros. This avoids compiler warnings like "value computed +// is not used" and "statement has no effect". + +class GOOGLE_GLOG_DLL_DECL LogMessageVoidify { + public: + LogMessageVoidify() { } + // This has to be an operator with a precedence lower than << but + // higher than ?: + void operator&(std::ostream&) { } +}; + + +// Flushes all log files that contains messages that are at least of +// the specified severity level. Thread-safe. +GOOGLE_GLOG_DLL_DECL void FlushLogFiles(LogSeverity min_severity); + +// Flushes all log files that contains messages that are at least of +// the specified severity level. Thread-hostile because it ignores +// locking -- used for catastrophic failures. +GOOGLE_GLOG_DLL_DECL void FlushLogFilesUnsafe(LogSeverity min_severity); + +// +// Set the destination to which a particular severity level of log +// messages is sent. If base_filename is "", it means "don't log this +// severity". Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetLogDestination(LogSeverity severity, + const char* base_filename); + +// +// Set the basename of the symlink to the latest log file at a given +// severity. If symlink_basename is empty, do not make a symlink. If +// you don't call this function, the symlink basename is the +// invocation name of the program. Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetLogSymlink(LogSeverity severity, + const char* symlink_basename); + +// +// Used to send logs to some other kind of destination +// Users should subclass LogSink and override send to do whatever they want. +// Implementations must be thread-safe because a shared instance will +// be called from whichever thread ran the LOG(XXX) line. +class GOOGLE_GLOG_DLL_DECL LogSink { + public: + virtual ~LogSink(); + + // Sink's logging logic (message_len is such as to exclude '\n' at the end). + // This method can't use LOG() or CHECK() as logging system mutex(s) are held + // during this call. + virtual void send(LogSeverity severity, const char* full_filename, + const char* base_filename, int line, + const struct ::tm* tm_time, + const char* message, size_t message_len) = 0; + + // Redefine this to implement waiting for + // the sink's logging logic to complete. + // It will be called after each send() returns, + // but before that LogMessage exits or crashes. + // By default this function does nothing. + // Using this function one can implement complex logic for send() + // that itself involves logging; and do all this w/o causing deadlocks and + // inconsistent rearrangement of log messages. + // E.g. if a LogSink has thread-specific actions, the send() method + // can simply add the message to a queue and wake up another thread that + // handles real logging while itself making some LOG() calls; + // WaitTillSent() can be implemented to wait for that logic to complete. + // See our unittest for an example. + virtual void WaitTillSent(); + + // Returns the normal text output of the log message. + // Can be useful to implement send(). + static std::string ToString(LogSeverity severity, const char* file, int line, + const struct ::tm* tm_time, + const char* message, size_t message_len); +}; + +// Add or remove a LogSink as a consumer of logging data. Thread-safe. +GOOGLE_GLOG_DLL_DECL void AddLogSink(LogSink *destination); +GOOGLE_GLOG_DLL_DECL void RemoveLogSink(LogSink *destination); + +// +// Specify an "extension" added to the filename specified via +// SetLogDestination. This applies to all severity levels. It's +// often used to append the port we're listening on to the logfile +// name. Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetLogFilenameExtension( + const char* filename_extension); + +// +// Make it so that all log messages of at least a particular severity +// are logged to stderr (in addition to logging to the usual log +// file(s)). Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetStderrLogging(LogSeverity min_severity); + +// +// Make it so that all log messages go only to stderr. Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void LogToStderr(); + +// +// Make it so that all log messages of at least a particular severity are +// logged via email to a list of addresses (in addition to logging to the +// usual log file(s)). The list of addresses is just a string containing +// the email addresses to send to (separated by spaces, say). Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetEmailLogging(LogSeverity min_severity, + const char* addresses); + +// A simple function that sends email. dest is a commma-separated +// list of addressess. Thread-safe. +GOOGLE_GLOG_DLL_DECL bool SendEmail(const char *dest, + const char *subject, const char *body); + +GOOGLE_GLOG_DLL_DECL const std::vector<std::string>& GetLoggingDirectories(); + +// For tests only: Clear the internal [cached] list of logging directories to +// force a refresh the next time GetLoggingDirectories is called. +// Thread-hostile. +void TestOnly_ClearLoggingDirectoriesList(); + +// Returns a set of existing temporary directories, which will be a +// subset of the directories returned by GetLogginDirectories(). +// Thread-safe. +GOOGLE_GLOG_DLL_DECL void GetExistingTempDirectories( + std::vector<std::string>* list); + +// Print any fatal message again -- useful to call from signal handler +// so that the last thing in the output is the fatal message. +// Thread-hostile, but a race is unlikely. +GOOGLE_GLOG_DLL_DECL void ReprintFatalMessage(); + +// Truncate a log file that may be the append-only output of multiple +// processes and hence can't simply be renamed/reopened (typically a +// stdout/stderr). If the file "path" is > "limit" bytes, copy the +// last "keep" bytes to offset 0 and truncate the rest. Since we could +// be racing with other writers, this approach has the potential to +// lose very small amounts of data. For security, only follow symlinks +// if the path is /proc/self/fd/* +GOOGLE_GLOG_DLL_DECL void TruncateLogFile(const char *path, + int64 limit, int64 keep); + +// Truncate stdout and stderr if they are over the value specified by +// --max_log_size; keep the final 1MB. This function has the same +// race condition as TruncateLogFile. +GOOGLE_GLOG_DLL_DECL void TruncateStdoutStderr(); + +// Return the string representation of the provided LogSeverity level. +// Thread-safe. +GOOGLE_GLOG_DLL_DECL const char* GetLogSeverityName(LogSeverity severity); + +// --------------------------------------------------------------------- +// Implementation details that are not useful to most clients +// --------------------------------------------------------------------- + +// A Logger is the interface used by logging modules to emit entries +// to a log. A typical implementation will dump formatted data to a +// sequence of files. We also provide interfaces that will forward +// the data to another thread so that the invoker never blocks. +// Implementations should be thread-safe since the logging system +// will write to them from multiple threads. + +namespace base { + +class GOOGLE_GLOG_DLL_DECL Logger { + public: + virtual ~Logger(); + + // Writes "message[0,message_len-1]" corresponding to an event that + // occurred at "timestamp". If "force_flush" is true, the log file + // is flushed immediately. + // + // The input message has already been formatted as deemed + // appropriate by the higher level logging facility. For example, + // textual log messages already contain timestamps, and the + // file:linenumber header. + virtual void Write(bool force_flush, + time_t timestamp, + const char* message, + int message_len) = 0; + + // Flush any buffered messages + virtual void Flush() = 0; + + // Get the current LOG file size. + // The returned value is approximate since some + // logged data may not have been flushed to disk yet. + virtual uint32 LogSize() = 0; +}; + +// Get the logger for the specified severity level. The logger +// remains the property of the logging module and should not be +// deleted by the caller. Thread-safe. +extern GOOGLE_GLOG_DLL_DECL Logger* GetLogger(LogSeverity level); + +// Set the logger for the specified severity level. The logger +// becomes the property of the logging module and should not +// be deleted by the caller. Thread-safe. +extern GOOGLE_GLOG_DLL_DECL void SetLogger(LogSeverity level, Logger* logger); + +} + +// glibc has traditionally implemented two incompatible versions of +// strerror_r(). There is a poorly defined convention for picking the +// version that we want, but it is not clear whether it even works with +// all versions of glibc. +// So, instead, we provide this wrapper that automatically detects the +// version that is in use, and then implements POSIX semantics. +// N.B. In addition to what POSIX says, we also guarantee that "buf" will +// be set to an empty string, if this function failed. This means, in most +// cases, you do not need to check the error code and you can directly +// use the value of "buf". It will never have an undefined value. +GOOGLE_GLOG_DLL_DECL int posix_strerror_r(int err, char *buf, size_t len); + + +// A class for which we define operator<<, which does nothing. +class GOOGLE_GLOG_DLL_DECL NullStream : public LogMessage::LogStream { + public: + // Initialize the LogStream so the messages can be written somewhere + // (they'll never be actually displayed). This will be needed if a + // NullStream& is implicitly converted to LogStream&, in which case + // the overloaded NullStream::operator<< will not be invoked. + NullStream() : LogMessage::LogStream(message_buffer_, 1, 0) { } + NullStream(const char* /*file*/, int /*line*/, + const CheckOpString& /*result*/) : + LogMessage::LogStream(message_buffer_, 1, 0) { } + NullStream &stream() { return *this; } + private: + // A very short buffer for messages (which we discard anyway). This + // will be needed if NullStream& converted to LogStream& (e.g. as a + // result of a conditional expression). + char message_buffer_[2]; +}; + +// Do nothing. This operator is inline, allowing the message to be +// compiled away. The message will not be compiled away if we do +// something like (flag ? LOG(INFO) : LOG(ERROR)) << message; when +// SKIP_LOG=WARNING. In those cases, NullStream will be implicitly +// converted to LogStream and the message will be computed and then +// quietly discarded. +template<class T> +inline NullStream& operator<<(NullStream &str, const T &value) { return str; } + +// Similar to NullStream, but aborts the program (without stack +// trace), like LogMessageFatal. +class GOOGLE_GLOG_DLL_DECL NullStreamFatal : public NullStream { + public: + NullStreamFatal() { } + NullStreamFatal(const char* file, int line, const CheckOpString& result) : + NullStream(file, line, result) { } + __attribute__ ((noreturn)) ~NullStreamFatal() { _exit(1); } +}; + +// Install a signal handler that will dump signal information and a stack +// trace when the program crashes on certain signals. We'll install the +// signal handler for the following signals. +// +// SIGSEGV, SIGILL, SIGFPE, SIGABRT, SIGBUS, and SIGTERM. +// +// By default, the signal handler will write the failure dump to the +// standard error. You can customize the destination by installing your +// own writer function by InstallFailureWriter() below. +// +// Note on threading: +// +// The function should be called before threads are created, if you want +// to use the failure signal handler for all threads. The stack trace +// will be shown only for the thread that receives the signal. In other +// words, stack traces of other threads won't be shown. +GOOGLE_GLOG_DLL_DECL void InstallFailureSignalHandler(); + +// Installs a function that is used for writing the failure dump. "data" +// is the pointer to the beginning of a message to be written, and "size" +// is the size of the message. You should not expect the data is +// terminated with '\0'. +GOOGLE_GLOG_DLL_DECL void InstallFailureWriter( + void (*writer)(const char* data, int size)); + +} + +#endif // _LOGGING_H_ diff --git a/extern/libmv/third_party/glog/src/glog/raw_logging.h b/extern/libmv/third_party/glog/src/glog/raw_logging.h new file mode 100644 index 00000000000..9e9b3772f3b --- /dev/null +++ b/extern/libmv/third_party/glog/src/glog/raw_logging.h @@ -0,0 +1,185 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Maxim Lifantsev +// +// Thread-safe logging routines that do not allocate any memory or +// acquire any locks, and can therefore be used by low-level memory +// allocation and synchronization code. + +#ifndef BASE_RAW_LOGGING_H_ +#define BASE_RAW_LOGGING_H_ + +#include <time.h> + +namespace google { + +#include "glog/log_severity.h" +#include "glog/vlog_is_on.h" + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +// This is similar to LOG(severity) << format... and VLOG(level) << format.., +// but +// * it is to be used ONLY by low-level modules that can't use normal LOG() +// * it is desiged to be a low-level logger that does not allocate any +// memory and does not need any locks, hence: +// * it logs straight and ONLY to STDERR w/o buffering +// * it uses an explicit format and arguments list +// * it will silently chop off really long message strings +// Usage example: +// RAW_LOG(ERROR, "Failed foo with %i: %s", status, error); +// RAW_VLOG(3, "status is %i", status); +// These will print an almost standard log lines like this to stderr only: +// E0821 211317 file.cc:123] RAW: Failed foo with 22: bad_file +// I0821 211317 file.cc:142] RAW: status is 20 +#define RAW_LOG(severity, ...) \ + do { \ + switch (google::severity) { \ + case 0: \ + RAW_LOG_INFO(__VA_ARGS__); \ + break; \ + case 1: \ + RAW_LOG_WARNING(__VA_ARGS__); \ + break; \ + case 2: \ + RAW_LOG_ERROR(__VA_ARGS__); \ + break; \ + case 3: \ + RAW_LOG_FATAL(__VA_ARGS__); \ + break; \ + default: \ + break; \ + } \ + } while (0) + +// The following STRIP_LOG testing is performed in the header file so that it's +// possible to completely compile out the logging code and the log messages. +#if STRIP_LOG == 0 +#define RAW_VLOG(verboselevel, ...) \ + do { \ + if (VLOG_IS_ON(verboselevel)) { \ + RAW_LOG_INFO(__VA_ARGS__); \ + } \ + } while (0) +#else +#define RAW_VLOG(verboselevel, ...) RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG == 0 + +#if STRIP_LOG == 0 +#define RAW_LOG_INFO(...) google::RawLog__(google::INFO, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG == 0 + +#if STRIP_LOG <= 1 +#define RAW_LOG_WARNING(...) google::RawLog__(google::WARNING, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG <= 1 + +#if STRIP_LOG <= 2 +#define RAW_LOG_ERROR(...) google::RawLog__(google::ERROR, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG <= 2 + +#if STRIP_LOG <= 3 +#define RAW_LOG_FATAL(...) google::RawLog__(google::FATAL, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_FATAL(...) \ + do { \ + google::RawLogStub__(0, __VA_ARGS__); \ + exit(1); \ + } while (0) +#endif // STRIP_LOG <= 3 + +// Similar to CHECK(condition) << message, +// but for low-level modules: we use only RAW_LOG that does not allocate memory. +// We do not want to provide args list here to encourage this usage: +// if (!cond) RAW_LOG(FATAL, "foo ...", hard_to_compute_args); +// so that the args are not computed when not needed. +#define RAW_CHECK(condition, message) \ + do { \ + if (!(condition)) { \ + RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \ + } \ + } while (0) + +// Debug versions of RAW_LOG and RAW_CHECK +#ifndef NDEBUG + +#define RAW_DLOG(severity, ...) RAW_LOG(severity, __VA_ARGS__) +#define RAW_DCHECK(condition, message) RAW_CHECK(condition, message) + +#else // NDEBUG + +#define RAW_DLOG(severity, ...) \ + while (false) \ + RAW_LOG(severity, __VA_ARGS__) +#define RAW_DCHECK(condition, message) \ + while (false) \ + RAW_CHECK(condition, message) + +#endif // NDEBUG + +// Stub log function used to work around for unused variable warnings when +// building with STRIP_LOG > 0. +static inline void RawLogStub__(int ignored, ...) { +} + +// Helper function to implement RAW_LOG and RAW_VLOG +// Logs format... at "severity" level, reporting it +// as called from file:line. +// This does not allocate memory or acquire locks. +GOOGLE_GLOG_DLL_DECL void RawLog__(LogSeverity severity, + const char* file, + int line, + const char* format, ...) + __attribute__((__format__ (__printf__, 4, 5))); + +// Hack to propagate time information into this module so that +// this module does not have to directly call localtime_r(), +// which could allocate memory. +GOOGLE_GLOG_DLL_DECL void RawLog__SetLastTime(const struct tm& t, int usecs); + +} + +#endif // BASE_RAW_LOGGING_H_ diff --git a/extern/libmv/third_party/glog/src/glog/vlog_is_on.h b/extern/libmv/third_party/glog/src/glog/vlog_is_on.h new file mode 100644 index 00000000000..02b0b867097 --- /dev/null +++ b/extern/libmv/third_party/glog/src/glog/vlog_is_on.h @@ -0,0 +1,129 @@ +// Copyright (c) 1999, 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Ray Sidney and many others +// +// Defines the VLOG_IS_ON macro that controls the variable-verbosity +// conditional logging. +// +// It's used by VLOG and VLOG_IF in logging.h +// and by RAW_VLOG in raw_logging.h to trigger the logging. +// +// It can also be used directly e.g. like this: +// if (VLOG_IS_ON(2)) { +// // do some logging preparation and logging +// // that can't be accomplished e.g. via just VLOG(2) << ...; +// } +// +// The truth value that VLOG_IS_ON(level) returns is determined by +// the three verbosity level flags: +// --v=<n> Gives the default maximal active V-logging level; +// 0 is the default. +// Normally positive values are used for V-logging levels. +// --vmodule=<str> Gives the per-module maximal V-logging levels to override +// the value given by --v. +// E.g. "my_module=2,foo*=3" would change the logging level +// for all code in source files "my_module.*" and "foo*.*" +// ("-inl" suffixes are also disregarded for this matching). +// +// SetVLOGLevel helper function is provided to do limited dynamic control over +// V-logging by overriding the per-module settings given via --vmodule flag. +// +// CAVEAT: --vmodule functionality is not available in non gcc compilers. +// + +#ifndef BASE_VLOG_IS_ON_H_ +#define BASE_VLOG_IS_ON_H_ + +#include "glog/log_severity.h" + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +#if defined(__GNUC__) +// We emit an anonymous static int* variable at every VLOG_IS_ON(n) site. +// (Normally) the first time every VLOG_IS_ON(n) site is hit, +// we determine what variable will dynamically control logging at this site: +// it's either FLAGS_v or an appropriate internal variable +// matching the current source file that represents results of +// parsing of --vmodule flag and/or SetVLOGLevel calls. +#define VLOG_IS_ON(verboselevel) \ + __extension__ \ + ({ static google::int32* vlocal__ = &google::kLogSiteUninitialized; \ + google::int32 verbose_level__ = (verboselevel); \ + (*vlocal__ >= verbose_level__) && \ + ((vlocal__ != &google::kLogSiteUninitialized) || \ + (google::InitVLOG3__(&vlocal__, &FLAGS_v, \ + __FILE__, verbose_level__))); }) +#else +// GNU extensions not available, so we do not support --vmodule. +// Dynamic value of FLAGS_v always controls the logging level. +#define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel)) +#endif + +// Set VLOG(_IS_ON) level for module_pattern to log_level. +// This lets us dynamically control what is normally set by the --vmodule flag. +// Returns the level that previously applied to module_pattern. +// NOTE: To change the log level for VLOG(_IS_ON) sites +// that have already executed after/during InitGoogleLogging, +// one needs to supply the exact --vmodule pattern that applied to them. +// (If no --vmodule pattern applied to them +// the value of FLAGS_v will continue to control them.) +extern GOOGLE_GLOG_DLL_DECL int SetVLOGLevel(const char* module_pattern, + int log_level); + +// Various declarations needed for VLOG_IS_ON above: ========================= + +// Special value used to indicate that a VLOG_IS_ON site has not been +// initialized. We make this a large value, so the common-case check +// of "*vlocal__ >= verbose_level__" in VLOG_IS_ON definition +// passes in such cases and InitVLOG3__ is then triggered. +extern google::int32 kLogSiteUninitialized; + +// Helper routine which determines the logging info for a particalur VLOG site. +// site_flag is the address of the site-local pointer to the controlling +// verbosity level +// site_default is the default to use for *site_flag +// fname is the current source file name +// verbose_level is the argument to VLOG_IS_ON +// We will return the return value for VLOG_IS_ON +// and if possible set *site_flag appropriately. +extern GOOGLE_GLOG_DLL_DECL bool InitVLOG3__( + google::int32** site_flag, + google::int32* site_default, + const char* fname, + google::int32 verbose_level); + +#endif // BASE_VLOG_IS_ON_H_ diff --git a/extern/libmv/third_party/glog/src/logging.cc b/extern/libmv/third_party/glog/src/logging.cc new file mode 100644 index 00000000000..1bb3867aa10 --- /dev/null +++ b/extern/libmv/third_party/glog/src/logging.cc @@ -0,0 +1,1783 @@ +// Copyright (c) 1999, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#define _GNU_SOURCE 1 // needed for O_NOFOLLOW and pread()/pwrite() + +#include "utilities.h" + +#include <assert.h> +#include <iomanip> +#include <string> +#ifdef HAVE_UNISTD_H +# include <unistd.h> // For _exit. +#endif +#include <climits> +#include <sys/types.h> +#include <sys/stat.h> +#ifdef HAVE_SYS_UTSNAME_H +# include <sys/utsname.h> // For uname. +#endif +#include <fcntl.h> +#include <cstdio> +#include <iostream> +#include <stdarg.h> +#include <stdlib.h> +#ifdef HAVE_PWD_H +# include <pwd.h> +#endif +#ifdef HAVE_SYSLOG_H +# include <syslog.h> +#endif +#include <vector> +#include <errno.h> // for errno +#include <sstream> +#include "base/commandlineflags.h" // to get the program name +#include <glog/logging.h> +#include <glog/raw_logging.h> +#include "base/googleinit.h" + +#ifdef HAVE_STACKTRACE +# include "stacktrace.h" +#endif + +using std::string; +using std::vector; +using std::ostrstream; +using std::setw; +using std::setfill; +using std::hex; +using std::dec; +using std::min; +using std::ostream; +using std::ostringstream; +using std::strstream; + +// There is no thread annotation support. +#define EXCLUSIVE_LOCKS_REQUIRED(mu) + +static bool BoolFromEnv(const char *varname, bool defval) { + const char* const valstr = getenv(varname); + if (!valstr) { + return defval; + } + return memchr("tTyY1\0", valstr[0], 6) != NULL; +} + +GLOG_DEFINE_bool(logtostderr, BoolFromEnv("GOOGLE_LOGTOSTDERR", false), + "log messages go to stderr instead of logfiles"); +GLOG_DEFINE_bool(alsologtostderr, BoolFromEnv("GOOGLE_ALSOLOGTOSTDERR", false), + "log messages go to stderr in addition to logfiles"); +#ifdef OS_LINUX +GLOG_DEFINE_bool(drop_log_memory, true, "Drop in-memory buffers of log contents. " + "Logs can grow very quickly and they are rarely read before they " + "need to be evicted from memory. Instead, drop them from memory " + "as soon as they are flushed to disk."); +_START_GOOGLE_NAMESPACE_ +namespace logging { +static const int64 kPageSize = getpagesize(); +} +_END_GOOGLE_NAMESPACE_ +#endif + +// By default, errors (including fatal errors) get logged to stderr as +// well as the file. +// +// The default is ERROR instead of FATAL so that users can see problems +// when they run a program without having to look in another file. +DEFINE_int32(stderrthreshold, + GOOGLE_NAMESPACE::ERROR, + "log messages at or above this level are copied to stderr in " + "addition to logfiles. This flag obsoletes --alsologtostderr."); + +GLOG_DEFINE_string(alsologtoemail, "", + "log messages go to these email addresses " + "in addition to logfiles"); +GLOG_DEFINE_bool(log_prefix, true, + "Prepend the log prefix to the start of each log line"); +GLOG_DEFINE_int32(minloglevel, 0, "Messages logged at a lower level than this don't " + "actually get logged anywhere"); +GLOG_DEFINE_int32(logbuflevel, 0, + "Buffer log messages logged at this level or lower" + " (-1 means don't buffer; 0 means buffer INFO only;" + " ...)"); +GLOG_DEFINE_int32(logbufsecs, 30, + "Buffer log messages for at most this many seconds"); +GLOG_DEFINE_int32(logemaillevel, 999, + "Email log messages logged at this level or higher" + " (0 means email all; 3 means email FATAL only;" + " ...)"); +GLOG_DEFINE_string(logmailer, "/bin/mail", + "Mailer used to send logging email"); + +// Compute the default value for --log_dir +static const char* DefaultLogDir() { + const char* env; + env = getenv("GOOGLE_LOG_DIR"); + if (env != NULL && env[0] != '\0') { + return env; + } + env = getenv("TEST_TMPDIR"); + if (env != NULL && env[0] != '\0') { + return env; + } + return ""; +} + +GLOG_DEFINE_string(log_dir, DefaultLogDir(), + "If specified, logfiles are written into this directory instead " + "of the default logging directory."); +GLOG_DEFINE_string(log_link, "", "Put additional links to the log " + "files in this directory"); + +GLOG_DEFINE_int32(max_log_size, 1800, + "approx. maximum log file size (in MB). A value of 0 will " + "be silently overridden to 1."); + +GLOG_DEFINE_bool(stop_logging_if_full_disk, false, + "Stop attempting to log to disk if the disk is full."); + +GLOG_DEFINE_string(log_backtrace_at, "", + "Emit a backtrace when logging at file:linenum."); + +// TODO(hamaji): consider windows +#define PATH_SEPARATOR '/' + +static void GetHostName(string* hostname) { +#if defined(HAVE_SYS_UTSNAME_H) + struct utsname buf; + if (0 != uname(&buf)) { + // ensure null termination on failure + *buf.nodename = '\0'; + } + *hostname = buf.nodename; +#elif defined(OS_WINDOWS) + char buf[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD len = MAX_COMPUTERNAME_LENGTH + 1; + if (GetComputerNameA(buf, &len)) { + *hostname = buf; + } else { + hostname->clear(); + } +#else +# warning There is no way to retrieve the host name. + *hostname = "(unknown)"; +#endif +} + +_START_GOOGLE_NAMESPACE_ + +// Safely get max_log_size, overriding to 1 if it somehow gets defined as 0 +static int32 MaxLogSize() { + return (FLAGS_max_log_size > 0 ? FLAGS_max_log_size : 1); +} + +// A mutex that allows only one thread to log at a time, to keep things from +// getting jumbled. Some other very uncommon logging operations (like +// changing the destination file for log messages of a given severity) also +// lock this mutex. Please be sure that anybody who might possibly need to +// lock it does so. +static Mutex log_mutex; + +// Number of messages sent at each severity. Under log_mutex. +int64 LogMessage::num_messages_[NUM_SEVERITIES] = {0, 0, 0, 0}; + +// Globally disable log writing (if disk is full) +static bool stop_writing = false; + +const char*const LogSeverityNames[NUM_SEVERITIES] = { + "INFO", "WARNING", "ERROR", "FATAL" +}; + +// Has the user called SetExitOnDFatal(true)? +static bool exit_on_dfatal = true; + +const char* GetLogSeverityName(LogSeverity severity) { + return LogSeverityNames[severity]; +} + +static bool SendEmailInternal(const char*dest, const char *subject, + const char*body, bool use_logging); + +base::Logger::~Logger() { +} + +namespace { + +// Encapsulates all file-system related state +class LogFileObject : public base::Logger { + public: + LogFileObject(LogSeverity severity, const char* base_filename); + ~LogFileObject(); + + virtual void Write(bool force_flush, // Should we force a flush here? + time_t timestamp, // Timestamp for this entry + const char* message, + int message_len); + + // Configuration options + void SetBasename(const char* basename); + void SetExtension(const char* ext); + void SetSymlinkBasename(const char* symlink_basename); + + // Normal flushing routine + virtual void Flush(); + + // It is the actual file length for the system loggers, + // i.e., INFO, ERROR, etc. + virtual uint32 LogSize() { + MutexLock l(&lock_); + return file_length_; + } + + // Internal flush routine. Exposed so that FlushLogFilesUnsafe() + // can avoid grabbing a lock. Usually Flush() calls it after + // acquiring lock_. + void FlushUnlocked(); + + private: + static const uint32 kRolloverAttemptFrequency = 0x20; + + Mutex lock_; + bool base_filename_selected_; + string base_filename_; + string symlink_basename_; + string filename_extension_; // option users can specify (eg to add port#) + FILE* file_; + LogSeverity severity_; + uint32 bytes_since_flush_; + uint32 file_length_; + unsigned int rollover_attempt_; + int64 next_flush_time_; // cycle count at which to flush log + + // Actually create a logfile using the value of base_filename_ and the + // supplied argument time_pid_string + // REQUIRES: lock_ is held + bool CreateLogfile(const char* time_pid_string); +}; + +} // namespace + +class LogDestination { + public: + friend class LogMessage; + friend void ReprintFatalMessage(); + friend base::Logger* base::GetLogger(LogSeverity); + friend void base::SetLogger(LogSeverity, base::Logger*); + + // These methods are just forwarded to by their global versions. + static void SetLogDestination(LogSeverity severity, + const char* base_filename); + static void SetLogSymlink(LogSeverity severity, + const char* symlink_basename); + static void AddLogSink(LogSink *destination); + static void RemoveLogSink(LogSink *destination); + static void SetLogFilenameExtension(const char* filename_extension); + static void SetStderrLogging(LogSeverity min_severity); + static void SetEmailLogging(LogSeverity min_severity, const char* addresses); + static void LogToStderr(); + // Flush all log files that are at least at the given severity level + static void FlushLogFiles(int min_severity); + static void FlushLogFilesUnsafe(int min_severity); + + // we set the maximum size of our packet to be 1400, the logic being + // to prevent fragmentation. + // Really this number is arbitrary. + static const int kNetworkBytes = 1400; + + static const string& hostname(); + private: + + LogDestination(LogSeverity severity, const char* base_filename); + ~LogDestination() { } + + // Take a log message of a particular severity and log it to stderr + // iff it's of a high enough severity to deserve it. + static void MaybeLogToStderr(LogSeverity severity, const char* message, + size_t len); + + // Take a log message of a particular severity and log it to email + // iff it's of a high enough severity to deserve it. + static void MaybeLogToEmail(LogSeverity severity, const char* message, + size_t len); + // Take a log message of a particular severity and log it to a file + // iff the base filename is not "" (which means "don't log to me") + static void MaybeLogToLogfile(LogSeverity severity, + time_t timestamp, + const char* message, size_t len); + // Take a log message of a particular severity and log it to the file + // for that severity and also for all files with severity less than + // this severity. + static void LogToAllLogfiles(LogSeverity severity, + time_t timestamp, + const char* message, size_t len); + + // Send logging info to all registered sinks. + static void LogToSinks(LogSeverity severity, + const char *full_filename, + const char *base_filename, + int line, + const struct ::tm* tm_time, + const char* message, + size_t message_len); + + // Wait for all registered sinks via WaitTillSent + // including the optional one in "data". + static void WaitForSinks(LogMessage::LogMessageData* data); + + static LogDestination* log_destination(LogSeverity severity); + + LogFileObject fileobject_; + base::Logger* logger_; // Either &fileobject_, or wrapper around it + + static LogDestination* log_destinations_[NUM_SEVERITIES]; + static LogSeverity email_logging_severity_; + static string addresses_; + static string hostname_; + + // arbitrary global logging destinations. + static vector<LogSink*>* sinks_; + + // Protects the vector sinks_, + // but not the LogSink objects its elements reference. + static Mutex sink_mutex_; + + // Disallow + LogDestination(const LogDestination&); + LogDestination& operator=(const LogDestination&); +}; + +// Errors do not get logged to email by default. +LogSeverity LogDestination::email_logging_severity_ = 99999; + +string LogDestination::addresses_; +string LogDestination::hostname_; + +vector<LogSink*>* LogDestination::sinks_ = NULL; +Mutex LogDestination::sink_mutex_; + +/* static */ +const string& LogDestination::hostname() { + if (hostname_.empty()) { + GetHostName(&hostname_); + if (hostname_.empty()) { + hostname_ = "(unknown)"; + } + } + return hostname_; +} + +LogDestination::LogDestination(LogSeverity severity, + const char* base_filename) + : fileobject_(severity, base_filename), + logger_(&fileobject_) { +} + +inline void LogDestination::FlushLogFilesUnsafe(int min_severity) { + // assume we have the log_mutex or we simply don't care + // about it + for (int i = min_severity; i < NUM_SEVERITIES; i++) { + LogDestination* log = log_destination(i); + if (log != NULL) { + // Flush the base fileobject_ logger directly instead of going + // through any wrappers to reduce chance of deadlock. + log->fileobject_.FlushUnlocked(); + } + } +} + +inline void LogDestination::FlushLogFiles(int min_severity) { + // Prevent any subtle race conditions by wrapping a mutex lock around + // all this stuff. + MutexLock l(&log_mutex); + for (int i = min_severity; i < NUM_SEVERITIES; i++) { + LogDestination* log = log_destination(i); + if (log != NULL) { + log->logger_->Flush(); + } + } +} + +inline void LogDestination::SetLogDestination(LogSeverity severity, + const char* base_filename) { + assert(severity >= 0 && severity < NUM_SEVERITIES); + // Prevent any subtle race conditions by wrapping a mutex lock around + // all this stuff. + MutexLock l(&log_mutex); + log_destination(severity)->fileobject_.SetBasename(base_filename); +} + +inline void LogDestination::SetLogSymlink(LogSeverity severity, + const char* symlink_basename) { + CHECK_GE(severity, 0); + CHECK_LT(severity, NUM_SEVERITIES); + MutexLock l(&log_mutex); + log_destination(severity)->fileobject_.SetSymlinkBasename(symlink_basename); +} + +inline void LogDestination::AddLogSink(LogSink *destination) { + // Prevent any subtle race conditions by wrapping a mutex lock around + // all this stuff. + MutexLock l(&sink_mutex_); + if (!sinks_) sinks_ = new vector<LogSink*>; + sinks_->push_back(destination); +} + +inline void LogDestination::RemoveLogSink(LogSink *destination) { + // Prevent any subtle race conditions by wrapping a mutex lock around + // all this stuff. + MutexLock l(&sink_mutex_); + // This doesn't keep the sinks in order, but who cares? + if (sinks_) { + for (int i = sinks_->size() - 1; i >= 0; i--) { + if ((*sinks_)[i] == destination) { + (*sinks_)[i] = (*sinks_)[sinks_->size() - 1]; + sinks_->pop_back(); + break; + } + } + } +} + +inline void LogDestination::SetLogFilenameExtension(const char* ext) { + // Prevent any subtle race conditions by wrapping a mutex lock around + // all this stuff. + MutexLock l(&log_mutex); + for ( int severity = 0; severity < NUM_SEVERITIES; ++severity ) { + log_destination(severity)->fileobject_.SetExtension(ext); + } +} + +inline void LogDestination::SetStderrLogging(LogSeverity min_severity) { + assert(min_severity >= 0 && min_severity < NUM_SEVERITIES); + // Prevent any subtle race conditions by wrapping a mutex lock around + // all this stuff. + MutexLock l(&log_mutex); + FLAGS_stderrthreshold = min_severity; +} + +inline void LogDestination::LogToStderr() { + // *Don't* put this stuff in a mutex lock, since SetStderrLogging & + // SetLogDestination already do the locking! + SetStderrLogging(0); // thus everything is "also" logged to stderr + for ( int i = 0; i < NUM_SEVERITIES; ++i ) { + SetLogDestination(i, ""); // "" turns off logging to a logfile + } +} + +inline void LogDestination::SetEmailLogging(LogSeverity min_severity, + const char* addresses) { + assert(min_severity >= 0 && min_severity < NUM_SEVERITIES); + // Prevent any subtle race conditions by wrapping a mutex lock around + // all this stuff. + MutexLock l(&log_mutex); + LogDestination::email_logging_severity_ = min_severity; + LogDestination::addresses_ = addresses; +} + +static void WriteToStderr(const char* message, size_t len) { + // Avoid using cerr from this module since we may get called during + // exit code, and cerr may be partially or fully destroyed by then. + write(STDERR_FILENO, message, len); +} + +inline void LogDestination::MaybeLogToStderr(LogSeverity severity, + const char* message, size_t len) { + if ((severity >= FLAGS_stderrthreshold) || FLAGS_alsologtostderr) { + WriteToStderr(message, len); +#ifdef OS_WINDOWS + // On Windows, also output to the debugger + ::OutputDebugStringA(string(message,len).c_str()); +#endif + } +} + + +inline void LogDestination::MaybeLogToEmail(LogSeverity severity, + const char* message, size_t len) { + if (severity >= email_logging_severity_ || + severity >= FLAGS_logemaillevel) { + string to(FLAGS_alsologtoemail); + if (!addresses_.empty()) { + if (!to.empty()) { + to += ","; + } + to += addresses_; + } + const string subject(string("[LOG] ") + LogSeverityNames[severity] + ": " + + glog_internal_namespace_::ProgramInvocationShortName()); + string body(hostname()); + body += "\n\n"; + body.append(message, len); + + // should NOT use SendEmail(). The caller of this function holds the + // log_mutex and SendEmail() calls LOG/VLOG which will block trying to + // acquire the log_mutex object. Use SendEmailInternal() and set + // use_logging to false. + SendEmailInternal(to.c_str(), subject.c_str(), body.c_str(), false); + } +} + + +inline void LogDestination::MaybeLogToLogfile(LogSeverity severity, + time_t timestamp, + const char* message, + size_t len) { + const bool should_flush = severity > FLAGS_logbuflevel; + LogDestination* destination = log_destination(severity); + destination->logger_->Write(should_flush, timestamp, message, len); +} + +inline void LogDestination::LogToAllLogfiles(LogSeverity severity, + time_t timestamp, + const char* message, + size_t len) { + + if ( FLAGS_logtostderr ) // global flag: never log to file + WriteToStderr(message, len); + else + for (int i = severity; i >= 0; --i) + LogDestination::MaybeLogToLogfile(i, timestamp, message, len); + +} + +inline void LogDestination::LogToSinks(LogSeverity severity, + const char *full_filename, + const char *base_filename, + int line, + const struct ::tm* tm_time, + const char* message, + size_t message_len) { + ReaderMutexLock l(&sink_mutex_); + if (sinks_) { + for (int i = sinks_->size() - 1; i >= 0; i--) { + (*sinks_)[i]->send(severity, full_filename, base_filename, + line, tm_time, message, message_len); + } + } +} + +inline void LogDestination::WaitForSinks(LogMessage::LogMessageData* data) { + ReaderMutexLock l(&sink_mutex_); + if (sinks_) { + for (int i = sinks_->size() - 1; i >= 0; i--) { + (*sinks_)[i]->WaitTillSent(); + } + } + const bool send_to_sink = + (data->send_method_ == &LogMessage::SendToSink) || + (data->send_method_ == &LogMessage::SendToSinkAndLog); + if (send_to_sink && data->sink_ != NULL) { + data->sink_->WaitTillSent(); + } +} + +LogDestination* LogDestination::log_destinations_[NUM_SEVERITIES]; + +inline LogDestination* LogDestination::log_destination(LogSeverity severity) { + assert(severity >=0 && severity < NUM_SEVERITIES); + if (!log_destinations_[severity]) { + log_destinations_[severity] = new LogDestination(severity, NULL); + } + return log_destinations_[severity]; +} + +namespace { + +LogFileObject::LogFileObject(LogSeverity severity, + const char* base_filename) + : base_filename_selected_(base_filename != NULL), + base_filename_((base_filename != NULL) ? base_filename : ""), + symlink_basename_(glog_internal_namespace_::ProgramInvocationShortName()), + filename_extension_(), + file_(NULL), + severity_(severity), + bytes_since_flush_(0), + file_length_(0), + rollover_attempt_(kRolloverAttemptFrequency-1), + next_flush_time_(0) { + assert(severity >= 0); + assert(severity < NUM_SEVERITIES); +} + +LogFileObject::~LogFileObject() { + MutexLock l(&lock_); + if (file_ != NULL) { + fclose(file_); + file_ = NULL; + } +} + +void LogFileObject::SetBasename(const char* basename) { + MutexLock l(&lock_); + base_filename_selected_ = true; + if (base_filename_ != basename) { + // Get rid of old log file since we are changing names + if (file_ != NULL) { + fclose(file_); + file_ = NULL; + rollover_attempt_ = kRolloverAttemptFrequency-1; + } + base_filename_ = basename; + } +} + +void LogFileObject::SetExtension(const char* ext) { + MutexLock l(&lock_); + if (filename_extension_ != ext) { + // Get rid of old log file since we are changing names + if (file_ != NULL) { + fclose(file_); + file_ = NULL; + rollover_attempt_ = kRolloverAttemptFrequency-1; + } + filename_extension_ = ext; + } +} + +void LogFileObject::SetSymlinkBasename(const char* symlink_basename) { + MutexLock l(&lock_); + symlink_basename_ = symlink_basename; +} + +void LogFileObject::Flush() { + MutexLock l(&lock_); + FlushUnlocked(); +} + +void LogFileObject::FlushUnlocked(){ + if (file_ != NULL) { + fflush(file_); + bytes_since_flush_ = 0; + } + // Figure out when we are due for another flush. + const int64 next = (FLAGS_logbufsecs + * static_cast<int64>(1000000)); // in usec + next_flush_time_ = CycleClock_Now() + UsecToCycles(next); +} + +bool LogFileObject::CreateLogfile(const char* time_pid_string) { + string string_filename = base_filename_+filename_extension_+ + time_pid_string; + const char* filename = string_filename.c_str(); + int fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0664); + if (fd == -1) return false; +#ifdef HAVE_FCNTL + // Mark the file close-on-exec. We don't really care if this fails + fcntl(fd, F_SETFD, FD_CLOEXEC); +#endif + + file_ = fdopen(fd, "a"); // Make a FILE*. + if (file_ == NULL) { // Man, we're screwed! + close(fd); + unlink(filename); // Erase the half-baked evidence: an unusable log file + return false; + } + + // We try to create a symlink called <program_name>.<severity>, + // which is easier to use. (Every time we create a new logfile, + // we destroy the old symlink and create a new one, so it always + // points to the latest logfile.) If it fails, we're sad but it's + // no error. + if (!symlink_basename_.empty()) { + // take directory from filename + const char* slash = strrchr(filename, PATH_SEPARATOR); + const string linkname = + symlink_basename_ + '.' + LogSeverityNames[severity_]; + string linkpath; + if ( slash ) linkpath = string(filename, slash-filename+1); // get dirname + linkpath += linkname; + unlink(linkpath.c_str()); // delete old one if it exists + + // We must have unistd.h. +#ifdef HAVE_UNISTD_H + // Make the symlink be relative (in the same dir) so that if the + // entire log directory gets relocated the link is still valid. + const char *linkdest = slash ? (slash + 1) : filename; + symlink(linkdest, linkpath.c_str()); // silently ignore failures + + // Make an additional link to the log file in a place specified by + // FLAGS_log_link, if indicated + if (!FLAGS_log_link.empty()) { + linkpath = FLAGS_log_link + "/" + linkname; + unlink(linkpath.c_str()); // delete old one if it exists + symlink(filename, linkpath.c_str()); // silently ignore failures + } +#endif + } + + return true; // Everything worked +} + +void LogFileObject::Write(bool force_flush, + time_t timestamp, + const char* message, + int message_len) { + MutexLock l(&lock_); + + // We don't log if the base_name_ is "" (which means "don't write") + if (base_filename_selected_ && base_filename_.empty()) { + return; + } + + if (static_cast<int>(file_length_ >> 20) >= MaxLogSize()) { + if (file_ != NULL) fclose(file_); + file_ = NULL; + file_length_ = bytes_since_flush_ = 0; + rollover_attempt_ = kRolloverAttemptFrequency-1; + } + + // If there's no destination file, make one before outputting + if (file_ == NULL) { + // Try to rollover the log file every 32 log messages. The only time + // this could matter would be when we have trouble creating the log + // file. If that happens, we'll lose lots of log messages, of course! + if (++rollover_attempt_ != kRolloverAttemptFrequency) return; + rollover_attempt_ = 0; + + struct ::tm tm_time; + localtime_r(×tamp, &tm_time); + + // The logfile's filename will have the date/time & pid in it + char time_pid_string[256]; // More than enough chars for time, pid, \0 + ostrstream time_pid_stream(time_pid_string, sizeof(time_pid_string)); + time_pid_stream.fill('0'); + time_pid_stream << 1900+tm_time.tm_year + << setw(2) << 1+tm_time.tm_mon + << setw(2) << tm_time.tm_mday + << '-' + << setw(2) << tm_time.tm_hour + << setw(2) << tm_time.tm_min + << setw(2) << tm_time.tm_sec + << '.' + << GetMainThreadPid() + << '\0'; + + if (base_filename_selected_) { + if (!CreateLogfile(time_pid_string)) { + perror("Could not create log file"); + fprintf(stderr, "COULD NOT CREATE LOGFILE '%s'!\n", time_pid_string); + return; + } + } else { + // If no base filename for logs of this severity has been set, use a + // default base filename of + // "<program name>.<hostname>.<user name>.log.<severity level>.". So + // logfiles will have names like + // webserver.examplehost.root.log.INFO.19990817-150000.4354, where + // 19990817 is a date (1999 August 17), 150000 is a time (15:00:00), + // and 4354 is the pid of the logging process. The date & time reflect + // when the file was created for output. + // + // Where does the file get put? Successively try the directories + // "/tmp", and "." + string stripped_filename( + glog_internal_namespace_::ProgramInvocationShortName()); + string hostname; + GetHostName(&hostname); + + string uidname = MyUserName(); + // We should not call CHECK() here because this function can be + // called after holding on to log_mutex. We don't want to + // attempt to hold on to the same mutex, and get into a + // deadlock. Simply use a name like invalid-user. + if (uidname.empty()) uidname = "invalid-user"; + + stripped_filename = stripped_filename+'.'+hostname+'.' + +uidname+".log." + +LogSeverityNames[severity_]+'.'; + // We're going to (potentially) try to put logs in several different dirs + const vector<string> & log_dirs = GetLoggingDirectories(); + + // Go through the list of dirs, and try to create the log file in each + // until we succeed or run out of options + bool success = false; + for (vector<string>::const_iterator dir = log_dirs.begin(); + dir != log_dirs.end(); + ++dir) { + base_filename_ = *dir + "/" + stripped_filename; + if ( CreateLogfile(time_pid_string) ) { + success = true; + break; + } + } + // If we never succeeded, we have to give up + if ( success == false ) { + perror("Could not create logging file"); + fprintf(stderr, "COULD NOT CREATE A LOGGINGFILE %s!", time_pid_string); + return; + } + } + + // Write a header message into the log file + char file_header_string[512]; // Enough chars for time and binary info + ostrstream file_header_stream(file_header_string, + sizeof(file_header_string)); + file_header_stream.fill('0'); + file_header_stream << "Log file created at: " + << 1900+tm_time.tm_year << '/' + << setw(2) << 1+tm_time.tm_mon << '/' + << setw(2) << tm_time.tm_mday + << ' ' + << setw(2) << tm_time.tm_hour << ':' + << setw(2) << tm_time.tm_min << ':' + << setw(2) << tm_time.tm_sec << '\n' + << "Running on machine: " + << LogDestination::hostname() << '\n' + << "Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu " + << "threadid file:line] msg" << '\n' + << '\0'; + int header_len = strlen(file_header_string); + fwrite(file_header_string, 1, header_len, file_); + file_length_ += header_len; + bytes_since_flush_ += header_len; + } + + // Write to LOG file + if ( !stop_writing ) { + // fwrite() doesn't return an error when the disk is full, for + // messages that are less than 4096 bytes. When the disk is full, + // it returns the message length for messages that are less than + // 4096 bytes. fwrite() returns 4096 for message lengths that are + // greater than 4096, thereby indicating an error. + errno = 0; + fwrite(message, 1, message_len, file_); + if ( FLAGS_stop_logging_if_full_disk && + errno == ENOSPC ) { // disk full, stop writing to disk + stop_writing = true; // until the disk is + return; + } else { + file_length_ += message_len; + bytes_since_flush_ += message_len; + } + } else { + if ( CycleClock_Now() >= next_flush_time_ ) + stop_writing = false; // check to see if disk has free space. + return; // no need to flush + } + + // See important msgs *now*. Also, flush logs at least every 10^6 chars, + // or every "FLAGS_logbufsecs" seconds. + if ( force_flush || + (bytes_since_flush_ >= 1000000) || + (CycleClock_Now() >= next_flush_time_) ) { + FlushUnlocked(); +#ifdef OS_LINUX + if (FLAGS_drop_log_memory) { + if (file_length_ >= logging::kPageSize) { + // don't evict the most recent page + uint32 len = file_length_ & ~(logging::kPageSize - 1); + posix_fadvise(fileno(file_), 0, len, POSIX_FADV_DONTNEED); + } + } +#endif + } +} + +} // namespace + +// An arbitrary limit on the length of a single log message. This +// is so that streaming can be done more efficiently. +const size_t LogMessage::kMaxLogMessageLen = 30000; + +// Static log data space to avoid alloc failures in a LOG(FATAL) +// +// Since multiple threads may call LOG(FATAL), and we want to preserve +// the data from the first call, we allocate two sets of space. One +// for exclusive use by the first thread, and one for shared use by +// all other threads. +static Mutex fatal_msg_lock; +static CrashReason crash_reason; +static bool fatal_msg_exclusive = true; +static char fatal_msg_buf_exclusive[LogMessage::kMaxLogMessageLen+1]; +static char fatal_msg_buf_shared[LogMessage::kMaxLogMessageLen+1]; +static LogMessage::LogStream fatal_msg_stream_exclusive( + fatal_msg_buf_exclusive, LogMessage::kMaxLogMessageLen, 0); +static LogMessage::LogStream fatal_msg_stream_shared( + fatal_msg_buf_shared, LogMessage::kMaxLogMessageLen, 0); +LogMessage::LogMessageData LogMessage::fatal_msg_data_exclusive_; +LogMessage::LogMessageData LogMessage::fatal_msg_data_shared_; + +LogMessage::LogMessageData::~LogMessageData() { + delete[] buf_; + delete stream_alloc_; +} + +LogMessage::LogMessage(const char* file, int line, LogSeverity severity, + int ctr, void (LogMessage::*send_method)()) { + Init(file, line, severity, send_method); + data_->stream_->set_ctr(ctr); +} + +LogMessage::LogMessage(const char* file, int line, + const CheckOpString& result) { + Init(file, line, FATAL, &LogMessage::SendToLog); + stream() << "Check failed: " << (*result.str_) << " "; +} + +LogMessage::LogMessage(const char* file, int line) { + Init(file, line, INFO, &LogMessage::SendToLog); +} + +LogMessage::LogMessage(const char* file, int line, LogSeverity severity) { + Init(file, line, severity, &LogMessage::SendToLog); +} + +LogMessage::LogMessage(const char* file, int line, LogSeverity severity, + LogSink* sink, bool also_send_to_log) { + Init(file, line, severity, also_send_to_log ? &LogMessage::SendToSinkAndLog : + &LogMessage::SendToSink); + data_->sink_ = sink; // override Init()'s setting to NULL +} + +LogMessage::LogMessage(const char* file, int line, LogSeverity severity, + vector<string> *outvec) { + Init(file, line, severity, &LogMessage::SaveOrSendToLog); + data_->outvec_ = outvec; // override Init()'s setting to NULL +} + +LogMessage::LogMessage(const char* file, int line, LogSeverity severity, + string *message) { + Init(file, line, severity, &LogMessage::WriteToStringAndLog); + data_->message_ = message; // override Init()'s setting to NULL +} + +void LogMessage::Init(const char* file, + int line, + LogSeverity severity, + void (LogMessage::*send_method)()) { + allocated_ = NULL; + if (severity != FATAL || !exit_on_dfatal) { + allocated_ = new LogMessageData(); + data_ = allocated_; + data_->buf_ = new char[kMaxLogMessageLen+1]; + data_->message_text_ = data_->buf_; + data_->stream_alloc_ = + new LogStream(data_->message_text_, kMaxLogMessageLen, 0); + data_->stream_ = data_->stream_alloc_; + data_->first_fatal_ = false; + } else { + MutexLock l(&fatal_msg_lock); + if (fatal_msg_exclusive) { + fatal_msg_exclusive = false; + data_ = &fatal_msg_data_exclusive_; + data_->message_text_ = fatal_msg_buf_exclusive; + data_->stream_ = &fatal_msg_stream_exclusive; + data_->first_fatal_ = true; + } else { + data_ = &fatal_msg_data_shared_; + data_->message_text_ = fatal_msg_buf_shared; + data_->stream_ = &fatal_msg_stream_shared; + data_->first_fatal_ = false; + } + data_->stream_alloc_ = NULL; + } + + stream().fill('0'); + data_->preserved_errno_ = errno; + data_->severity_ = severity; + data_->line_ = line; + data_->send_method_ = send_method; + data_->sink_ = NULL; + data_->outvec_ = NULL; + WallTime now = WallTime_Now(); + data_->timestamp_ = static_cast<time_t>(now); + localtime_r(&data_->timestamp_, &data_->tm_time_); + int usecs = static_cast<int>((now - data_->timestamp_) * 1000000); + RawLog__SetLastTime(data_->tm_time_, usecs); + + data_->num_chars_to_log_ = 0; + data_->num_chars_to_syslog_ = 0; + data_->basename_ = const_basename(file); + data_->fullname_ = file; + data_->has_been_flushed_ = false; + + // If specified, prepend a prefix to each line. For example: + // I1018 160715 f5d4fbb0 logging.cc:1153] + // (log level, GMT month, date, time, thread_id, file basename, line) + // We exclude the thread_id for the default thread. + if (FLAGS_log_prefix && (line != kNoLogPrefix)) { + stream() << LogSeverityNames[severity][0] + << setw(2) << 1+data_->tm_time_.tm_mon + << setw(2) << data_->tm_time_.tm_mday + << ' ' + << setw(2) << data_->tm_time_.tm_hour << ':' + << setw(2) << data_->tm_time_.tm_min << ':' + << setw(2) << data_->tm_time_.tm_sec << "." + << setw(6) << usecs + << ' ' + << setfill(' ') << setw(5) + << static_cast<unsigned int>(GetTID()) << setfill('0') + << ' ' + << data_->basename_ << ':' << data_->line_ << "] "; + } + data_->num_prefix_chars_ = data_->stream_->pcount(); + + if (!FLAGS_log_backtrace_at.empty()) { + char fileline[128]; + snprintf(fileline, sizeof(fileline), "%s:%d", data_->basename_, line); +#ifdef HAVE_STACKTRACE + if (!strcmp(FLAGS_log_backtrace_at.c_str(), fileline)) { + string stacktrace; + DumpStackTraceToString(&stacktrace); + stream() << " (stacktrace:\n" << stacktrace << ") "; + } +#endif + } +} + +LogMessage::~LogMessage() { + Flush(); + delete allocated_; +} + +// Flush buffered message, called by the destructor, or any other function +// that needs to synchronize the log. +void LogMessage::Flush() { + if (data_->has_been_flushed_ || data_->severity_ < FLAGS_minloglevel) + return; + + data_->num_chars_to_log_ = data_->stream_->pcount(); + data_->num_chars_to_syslog_ = + data_->num_chars_to_log_ - data_->num_prefix_chars_; + + // Do we need to add a \n to the end of this message? + bool append_newline = + (data_->message_text_[data_->num_chars_to_log_-1] != '\n'); + char original_final_char = '\0'; + + // If we do need to add a \n, we'll do it by violating the memory of the + // ostrstream buffer. This is quick, and we'll make sure to undo our + // modification before anything else is done with the ostrstream. It + // would be preferable not to do things this way, but it seems to be + // the best way to deal with this. + if (append_newline) { + original_final_char = data_->message_text_[data_->num_chars_to_log_]; + data_->message_text_[data_->num_chars_to_log_++] = '\n'; + } + + // Prevent any subtle race conditions by wrapping a mutex lock around + // the actual logging action per se. + { + MutexLock l(&log_mutex); + (this->*(data_->send_method_))(); + ++num_messages_[static_cast<int>(data_->severity_)]; + } + LogDestination::WaitForSinks(data_); + + if (append_newline) { + // Fix the ostrstream back how it was before we screwed with it. + // It's 99.44% certain that we don't need to worry about doing this. + data_->message_text_[data_->num_chars_to_log_-1] = original_final_char; + } + + // If errno was already set before we enter the logging call, we'll + // set it back to that value when we return from the logging call. + // It happens often that we log an error message after a syscall + // failure, which can potentially set the errno to some other + // values. We would like to preserve the original errno. + if (data_->preserved_errno_ != 0) { + errno = data_->preserved_errno_; + } + + // Note that this message is now safely logged. If we're asked to flush + // again, as a result of destruction, say, we'll do nothing on future calls. + data_->has_been_flushed_ = true; +} + +// Copy of first FATAL log message so that we can print it out again +// after all the stack traces. To preserve legacy behavior, we don't +// use fatal_msg_buf_exclusive. +static time_t fatal_time; +static char fatal_message[256]; + +void ReprintFatalMessage() { + if (fatal_message[0]) { + const int n = strlen(fatal_message); + if (!FLAGS_logtostderr) { + // Also write to stderr + WriteToStderr(fatal_message, n); + } + LogDestination::LogToAllLogfiles(ERROR, fatal_time, fatal_message, n); + } +} + +// L >= log_mutex (callers must hold the log_mutex). +void LogMessage::SendToLog() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) { + static bool already_warned_before_initgoogle = false; + + log_mutex.AssertHeld(); + + RAW_DCHECK(data_->num_chars_to_log_ > 0 && + data_->message_text_[data_->num_chars_to_log_-1] == '\n', ""); + + // Messages of a given severity get logged to lower severity logs, too + + if (!already_warned_before_initgoogle && !IsGoogleLoggingInitialized()) { + const char w[] = "WARNING: Logging before InitGoogleLogging() is " + "written to STDERR\n"; + WriteToStderr(w, strlen(w)); + already_warned_before_initgoogle = true; + } + + // global flag: never log to file if set. Also -- don't log to a + // file if we haven't parsed the command line flags to get the + // program name. + if (FLAGS_logtostderr || !IsGoogleLoggingInitialized()) { + WriteToStderr(data_->message_text_, data_->num_chars_to_log_); + + // this could be protected by a flag if necessary. + LogDestination::LogToSinks(data_->severity_, + data_->fullname_, data_->basename_, + data_->line_, &data_->tm_time_, + data_->message_text_ + data_->num_prefix_chars_, + (data_->num_chars_to_log_ - + data_->num_prefix_chars_ - 1)); + } else { + + // log this message to all log files of severity <= severity_ + LogDestination::LogToAllLogfiles(data_->severity_, data_->timestamp_, + data_->message_text_, + data_->num_chars_to_log_); + + LogDestination::MaybeLogToStderr(data_->severity_, data_->message_text_, + data_->num_chars_to_log_); + LogDestination::MaybeLogToEmail(data_->severity_, data_->message_text_, + data_->num_chars_to_log_); + LogDestination::LogToSinks(data_->severity_, + data_->fullname_, data_->basename_, + data_->line_, &data_->tm_time_, + data_->message_text_ + data_->num_prefix_chars_, + (data_->num_chars_to_log_ + - data_->num_prefix_chars_ - 1)); + // NOTE: -1 removes trailing \n + } + + // If we log a FATAL message, flush all the log destinations, then toss + // a signal for others to catch. We leave the logs in a state that + // someone else can use them (as long as they flush afterwards) + if (data_->severity_ == FATAL && exit_on_dfatal) { + if (data_->first_fatal_) { + // Store crash information so that it is accessible from within signal + // handlers that may be invoked later. + RecordCrashReason(&crash_reason); + SetCrashReason(&crash_reason); + + // Store shortened fatal message for other logs and GWQ status + const int copy = min<int>(data_->num_chars_to_log_, + sizeof(fatal_message)-1); + memcpy(fatal_message, data_->message_text_, copy); + fatal_message[copy] = '\0'; + fatal_time = data_->timestamp_; + } + + if (!FLAGS_logtostderr) { + for (int i = 0; i < NUM_SEVERITIES; ++i) { + if ( LogDestination::log_destinations_[i] ) + LogDestination::log_destinations_[i]->logger_->Write(true, 0, "", 0); + } + } + + // release the lock that our caller (directly or indirectly) + // LogMessage::~LogMessage() grabbed so that signal handlers + // can use the logging facility. Alternately, we could add + // an entire unsafe logging interface to bypass locking + // for signal handlers but this seems simpler. + log_mutex.Unlock(); + LogDestination::WaitForSinks(data_); + + const char* message = "*** Check failure stack trace: ***\n"; + write(STDERR_FILENO, message, strlen(message)); + Fail(); + } +} + +void LogMessage::RecordCrashReason( + glog_internal_namespace_::CrashReason* reason) { + reason->filename = fatal_msg_data_exclusive_.fullname_; + reason->line_number = fatal_msg_data_exclusive_.line_; + reason->message = fatal_msg_buf_exclusive + + fatal_msg_data_exclusive_.num_prefix_chars_; +#ifdef HAVE_STACKTRACE + // Retrieve the stack trace, omitting the logging frames that got us here. + reason->depth = GetStackTrace(reason->stack, ARRAYSIZE(reason->stack), 4); +#else + reason->depth = 0; +#endif +} + +static void logging_fail() { +// #if defined(_DEBUG) && defined(_MSC_VER) +// doesn't work for my laptop (sergey) +#if 0 + // When debugging on windows, avoid the obnoxious dialog and make + // it possible to continue past a LOG(FATAL) in the debugger + _asm int 3 +#else + abort(); +#endif +} + +#ifdef HAVE___ATTRIBUTE__ +GOOGLE_GLOG_DLL_DECL +void (*g_logging_fail_func)() __attribute__((noreturn)) = &logging_fail; +#else +GOOGLE_GLOG_DLL_DECL void (*g_logging_fail_func)() = &logging_fail; +#endif + +void InstallFailureFunction(void (*fail_func)()) { + g_logging_fail_func = fail_func; +} + +void LogMessage::Fail() { + g_logging_fail_func(); +} + +// L >= log_mutex (callers must hold the log_mutex). +void LogMessage::SendToSink() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) { + if (data_->sink_ != NULL) { + RAW_DCHECK(data_->num_chars_to_log_ > 0 && + data_->message_text_[data_->num_chars_to_log_-1] == '\n', ""); + data_->sink_->send(data_->severity_, data_->fullname_, data_->basename_, + data_->line_, &data_->tm_time_, + data_->message_text_ + data_->num_prefix_chars_, + (data_->num_chars_to_log_ - + data_->num_prefix_chars_ - 1)); + } +} + +// L >= log_mutex (callers must hold the log_mutex). +void LogMessage::SendToSinkAndLog() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) { + SendToSink(); + SendToLog(); +} + +// L >= log_mutex (callers must hold the log_mutex). +void LogMessage::SaveOrSendToLog() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) { + if (data_->outvec_ != NULL) { + RAW_DCHECK(data_->num_chars_to_log_ > 0 && + data_->message_text_[data_->num_chars_to_log_-1] == '\n', ""); + // Omit prefix of message and trailing newline when recording in outvec_. + const char *start = data_->message_text_ + data_->num_prefix_chars_; + int len = data_->num_chars_to_log_ - data_->num_prefix_chars_ - 1; + data_->outvec_->push_back(string(start, len)); + } else { + SendToLog(); + } +} + +void LogMessage::WriteToStringAndLog() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) { + if (data_->message_ != NULL) { + RAW_DCHECK(data_->num_chars_to_log_ > 0 && + data_->message_text_[data_->num_chars_to_log_-1] == '\n', ""); + // Omit prefix of message and trailing newline when writing to message_. + const char *start = data_->message_text_ + data_->num_prefix_chars_; + int len = data_->num_chars_to_log_ - data_->num_prefix_chars_ - 1; + data_->message_->assign(start, len); + } + SendToLog(); +} + +// L >= log_mutex (callers must hold the log_mutex). +void LogMessage::SendToSyslogAndLog() { +#ifdef HAVE_SYSLOG_H + // Before any calls to syslog(), make a single call to openlog() + static bool openlog_already_called = false; + if (!openlog_already_called) { + openlog(glog_internal_namespace_::ProgramInvocationShortName(), + LOG_CONS | LOG_NDELAY | LOG_PID, + LOG_USER); + openlog_already_called = true; + } + + // This array maps Google severity levels to syslog levels + const int SEVERITY_TO_LEVEL[] = { LOG_INFO, LOG_WARNING, LOG_ERR, LOG_EMERG }; + syslog(LOG_USER | SEVERITY_TO_LEVEL[static_cast<int>(data_->severity_)], "%.*s", + int(data_->num_chars_to_syslog_), + data_->message_text_ + data_->num_prefix_chars_); + SendToLog(); +#else + LOG(ERROR) << "No syslog support: message=" << data_->message_text_; +#endif +} + +base::Logger* base::GetLogger(LogSeverity severity) { + MutexLock l(&log_mutex); + return LogDestination::log_destination(severity)->logger_; +} + +void base::SetLogger(LogSeverity severity, base::Logger* logger) { + MutexLock l(&log_mutex); + LogDestination::log_destination(severity)->logger_ = logger; +} + +// L < log_mutex. Acquires and releases mutex_. +int64 LogMessage::num_messages(int severity) { + MutexLock l(&log_mutex); + return num_messages_[severity]; +} + +// Output the COUNTER value. This is only valid if ostream is a +// LogStream. +ostream& operator<<(ostream &os, const PRIVATE_Counter&) { + LogMessage::LogStream *log = dynamic_cast<LogMessage::LogStream*>(&os); + CHECK(log == log->self()); + os << log->ctr(); + return os; +} + +ErrnoLogMessage::ErrnoLogMessage(const char* file, int line, + LogSeverity severity, int ctr, + void (LogMessage::*send_method)()) + : LogMessage(file, line, severity, ctr, send_method) { +} + +ErrnoLogMessage::~ErrnoLogMessage() { + // Don't access errno directly because it may have been altered + // while streaming the message. + char buf[100]; + posix_strerror_r(preserved_errno(), buf, sizeof(buf)); + stream() << ": " << buf << " [" << preserved_errno() << "]"; +} + +void FlushLogFiles(LogSeverity min_severity) { + LogDestination::FlushLogFiles(min_severity); +} + +void FlushLogFilesUnsafe(LogSeverity min_severity) { + LogDestination::FlushLogFilesUnsafe(min_severity); +} + +void SetLogDestination(LogSeverity severity, const char* base_filename) { + LogDestination::SetLogDestination(severity, base_filename); +} + +void SetLogSymlink(LogSeverity severity, const char* symlink_basename) { + LogDestination::SetLogSymlink(severity, symlink_basename); +} + +LogSink::~LogSink() { +} + +void LogSink::WaitTillSent() { + // noop default +} + +string LogSink::ToString(LogSeverity severity, const char* file, int line, + const struct ::tm* tm_time, + const char* message, size_t message_len) { + ostringstream stream(string(message, message_len)); + stream.fill('0'); + + // FIXME(jrvb): Updating this to use the correct value for usecs + // requires changing the signature for both this method and + // LogSink::send(). This change needs to be done in a separate CL + // so subclasses of LogSink can be updated at the same time. + int usecs = 0; + + stream << LogSeverityNames[severity][0] + << setw(2) << 1+tm_time->tm_mon + << setw(2) << tm_time->tm_mday + << ' ' + << setw(2) << tm_time->tm_hour << ':' + << setw(2) << tm_time->tm_min << ':' + << setw(2) << tm_time->tm_sec << '.' + << setw(6) << usecs + << ' ' + << setfill(' ') << setw(5) << GetTID() << setfill('0') + << ' ' + << file << ':' << line << "] "; + + stream << string(message, message_len); + return stream.str(); +} + +void AddLogSink(LogSink *destination) { + LogDestination::AddLogSink(destination); +} + +void RemoveLogSink(LogSink *destination) { + LogDestination::RemoveLogSink(destination); +} + +void SetLogFilenameExtension(const char* ext) { + LogDestination::SetLogFilenameExtension(ext); +} + +void SetStderrLogging(LogSeverity min_severity) { + LogDestination::SetStderrLogging(min_severity); +} + +void SetEmailLogging(LogSeverity min_severity, const char* addresses) { + LogDestination::SetEmailLogging(min_severity, addresses); +} + +void LogToStderr() { + LogDestination::LogToStderr(); +} + +namespace base { +namespace internal { + +bool GetExitOnDFatal() { + MutexLock l(&log_mutex); + return exit_on_dfatal; +} + +// Determines whether we exit the program for a LOG(DFATAL) message in +// debug mode. It does this by skipping the call to Fail/FailQuietly. +// This is intended for testing only. +// +// This can have some effects on LOG(FATAL) as well. Failure messages +// are always allocated (rather than sharing a buffer), the crash +// reason is not recorded, the "gwq" status message is not updated, +// and the stack trace is not recorded. The LOG(FATAL) *will* still +// exit the program. Since this function is used only in testing, +// these differences are acceptable. +void SetExitOnDFatal(bool value) { + MutexLock l(&log_mutex); + exit_on_dfatal = value; +} + +} // namespace internal +} // namespace base + +// use_logging controls whether the logging functions LOG/VLOG are used +// to log errors. It should be set to false when the caller holds the +// log_mutex. +static bool SendEmailInternal(const char*dest, const char *subject, + const char*body, bool use_logging) { + if (dest && *dest) { + if ( use_logging ) { + VLOG(1) << "Trying to send TITLE:" << subject + << " BODY:" << body << " to " << dest; + } else { + fprintf(stderr, "Trying to send TITLE: %s BODY: %s to %s\n", + subject, body, dest); + } + + string cmd = + FLAGS_logmailer + " -s\"" + subject + "\" " + dest; + FILE* pipe = popen(cmd.c_str(), "w"); + if (pipe != NULL) { + // Add the body if we have one + if (body) + fwrite(body, sizeof(char), strlen(body), pipe); + bool ok = pclose(pipe) != -1; + if ( !ok ) { + if ( use_logging ) { + char buf[100]; + posix_strerror_r(errno, buf, sizeof(buf)); + LOG(ERROR) << "Problems sending mail to " << dest << ": " << buf; + } else { + char buf[100]; + posix_strerror_r(errno, buf, sizeof(buf)); + fprintf(stderr, "Problems sending mail to %s: %s\n", dest, buf); + } + } + return ok; + } else { + if ( use_logging ) { + LOG(ERROR) << "Unable to send mail to " << dest; + } else { + fprintf(stderr, "Unable to send mail to %s\n", dest); + } + } + } + return false; +} + +bool SendEmail(const char*dest, const char *subject, const char*body){ + return SendEmailInternal(dest, subject, body, true); +} + +static void GetTempDirectories(vector<string>* list) { + list->clear(); +#ifdef OS_WINDOWS + // On windows we'll try to find a directory in this order: + // C:/Documents & Settings/whomever/TEMP (or whatever GetTempPath() is) + // C:/TMP/ + // C:/TEMP/ + // C:/WINDOWS/ or C:/WINNT/ + // . + char tmp[MAX_PATH]; + if (GetTempPathA(MAX_PATH, tmp)) + list->push_back(tmp); + list->push_back("C:\\tmp\\"); + list->push_back("C:\\temp\\"); +#else + // Directories, in order of preference. If we find a dir that + // exists, we stop adding other less-preferred dirs + const char * candidates[] = { + // Non-null only during unittest/regtest + getenv("TEST_TMPDIR"), + + // Explicitly-supplied temp dirs + getenv("TMPDIR"), getenv("TMP"), + + // If all else fails + "/tmp", + }; + + for (int i = 0; i < ARRAYSIZE(candidates); i++) { + const char *d = candidates[i]; + if (!d) continue; // Empty env var + + // Make sure we don't surprise anyone who's expecting a '/' + string dstr = d; + if (dstr[dstr.size() - 1] != '/') { + dstr += "/"; + } + list->push_back(dstr); + + struct stat statbuf; + if (!stat(d, &statbuf) && S_ISDIR(statbuf.st_mode)) { + // We found a dir that exists - we're done. + return; + } + } + +#endif +} + +static vector<string>* logging_directories_list; + +const vector<string>& GetLoggingDirectories() { + // Not strictly thread-safe but we're called early in InitGoogle(). + if (logging_directories_list == NULL) { + logging_directories_list = new vector<string>; + + if ( !FLAGS_log_dir.empty() ) { + // A dir was specified, we should use it + logging_directories_list->push_back(FLAGS_log_dir.c_str()); + } else { + GetTempDirectories(logging_directories_list); +#ifdef OS_WINDOWS + char tmp[MAX_PATH]; + if (GetWindowsDirectoryA(tmp, MAX_PATH)) + logging_directories_list->push_back(tmp); + logging_directories_list->push_back(".\\"); +#else + logging_directories_list->push_back("./"); +#endif + } + } + return *logging_directories_list; +} + +void TestOnly_ClearLoggingDirectoriesList() { + fprintf(stderr, "TestOnly_ClearLoggingDirectoriesList should only be " + "called from test code.\n"); + delete logging_directories_list; + logging_directories_list = NULL; +} + +void GetExistingTempDirectories(vector<string>* list) { + GetTempDirectories(list); + vector<string>::iterator i_dir = list->begin(); + while( i_dir != list->end() ) { + // zero arg to access means test for existence; no constant + // defined on windows + if ( access(i_dir->c_str(), 0) ) { + i_dir = list->erase(i_dir); + } else { + ++i_dir; + } + } +} + +void TruncateLogFile(const char *path, int64 limit, int64 keep) { +#ifdef HAVE_UNISTD_H + struct stat statbuf; + const int kCopyBlockSize = 8 << 10; + char copybuf[kCopyBlockSize]; + int64 read_offset, write_offset; + // Don't follow symlinks unless they're our own fd symlinks in /proc + int flags = O_RDWR; + const char *procfd_prefix = "/proc/self/fd/"; + if (strncmp(procfd_prefix, path, strlen(procfd_prefix))) flags |= O_NOFOLLOW; + + int fd = open(path, flags); + if (fd == -1) { + if (errno == EFBIG) { + // The log file in question has got too big for us to open. The + // real fix for this would be to compile logging.cc (or probably + // all of base/...) with -D_FILE_OFFSET_BITS=64 but that's + // rather scary. + // Instead just truncate the file to something we can manage + if (truncate(path, 0) == -1) { + PLOG(ERROR) << "Unable to truncate " << path; + } else { + LOG(ERROR) << "Truncated " << path << " due to EFBIG error"; + } + } else { + PLOG(ERROR) << "Unable to open " << path; + } + return; + } + + if (fstat(fd, &statbuf) == -1) { + PLOG(ERROR) << "Unable to fstat()"; + goto out_close_fd; + } + + // See if the path refers to a regular file bigger than the + // specified limit + if (!S_ISREG(statbuf.st_mode)) goto out_close_fd; + if (statbuf.st_size <= limit) goto out_close_fd; + if (statbuf.st_size <= keep) goto out_close_fd; + + // This log file is too large - we need to truncate it + LOG(INFO) << "Truncating " << path << " to " << keep << " bytes"; + + // Copy the last "keep" bytes of the file to the beginning of the file + read_offset = statbuf.st_size - keep; + write_offset = 0; + int bytesin, bytesout; + while ((bytesin = pread(fd, copybuf, sizeof(copybuf), read_offset)) > 0) { + bytesout = pwrite(fd, copybuf, bytesin, write_offset); + if (bytesout == -1) { + PLOG(ERROR) << "Unable to write to " << path; + break; + } else if (bytesout != bytesin) { + LOG(ERROR) << "Expected to write " << bytesin << ", wrote " << bytesout; + } + read_offset += bytesin; + write_offset += bytesout; + } + if (bytesin == -1) PLOG(ERROR) << "Unable to read from " << path; + + // Truncate the remainder of the file. If someone else writes to the + // end of the file after our last read() above, we lose their latest + // data. Too bad ... + if (ftruncate(fd, write_offset) == -1) { + PLOG(ERROR) << "Unable to truncate " << path; + } + + out_close_fd: + close(fd); +#else + LOG(ERROR) << "No log truncation support."; +#endif +} + +void TruncateStdoutStderr() { +#ifdef HAVE_UNISTD_H + int64 limit = MaxLogSize() << 20; + int64 keep = 1 << 20; + TruncateLogFile("/proc/self/fd/1", limit, keep); + TruncateLogFile("/proc/self/fd/2", limit, keep); +#else + LOG(ERROR) << "No log truncation support."; +#endif +} + + +// Helper functions for string comparisons. +#define DEFINE_CHECK_STROP_IMPL(name, func, expected) \ + string* Check##func##expected##Impl(const char* s1, const char* s2, \ + const char* names) { \ + bool equal = s1 == s2 || (s1 && s2 && !func(s1, s2)); \ + if (equal == expected) return NULL; \ + else { \ + strstream ss; \ + if (!s1) s1 = ""; \ + if (!s2) s2 = ""; \ + ss << #name " failed: " << names << " (" << s1 << " vs. " << s2 << ")"; \ + return new string(ss.str(), ss.pcount()); \ + } \ + } +DEFINE_CHECK_STROP_IMPL(CHECK_STREQ, strcmp, true) +DEFINE_CHECK_STROP_IMPL(CHECK_STRNE, strcmp, false) +DEFINE_CHECK_STROP_IMPL(CHECK_STRCASEEQ, strcasecmp, true) +DEFINE_CHECK_STROP_IMPL(CHECK_STRCASENE, strcasecmp, false) +#undef DEFINE_CHECK_STROP_IMPL + +int posix_strerror_r(int err, char *buf, size_t len) { + // Sanity check input parameters + if (buf == NULL || len <= 0) { + errno = EINVAL; + return -1; + } + + // Reset buf and errno, and try calling whatever version of strerror_r() + // is implemented by glibc + buf[0] = '\000'; + int old_errno = errno; + errno = 0; + char *rc = reinterpret_cast<char *>(strerror_r(err, buf, len)); + + // Both versions set errno on failure + if (errno) { + // Should already be there, but better safe than sorry + buf[0] = '\000'; + return -1; + } + errno = old_errno; + + // POSIX is vague about whether the string will be terminated, although + // is indirectly implies that typically ERANGE will be returned, instead + // of truncating the string. This is different from the GNU implementation. + // We play it safe by always terminating the string explicitly. + buf[len-1] = '\000'; + + // If the function succeeded, we can use its exit code to determine the + // semantics implemented by glibc + if (!rc) { + return 0; + } else { + // GNU semantics detected + if (rc == buf) { + return 0; + } else { + buf[0] = '\000'; +#if defined(OS_MACOSX) || defined(OS_FREEBSD) || defined(OS_OPENBSD) + if (reinterpret_cast<intptr_t>(rc) < sys_nerr) { + // This means an error on MacOSX or FreeBSD. + return -1; + } +#endif + strncat(buf, rc, len-1); + return 0; + } + } +} + +LogMessageFatal::LogMessageFatal(const char* file, int line) : + LogMessage(file, line, FATAL) {} + +LogMessageFatal::LogMessageFatal(const char* file, int line, + const CheckOpString& result) : + LogMessage(file, line, result) {} + +LogMessageFatal::~LogMessageFatal() { + Flush(); + LogMessage::Fail(); +} + +_END_GOOGLE_NAMESPACE_ diff --git a/extern/libmv/third_party/glog/src/raw_logging.cc b/extern/libmv/third_party/glog/src/raw_logging.cc new file mode 100644 index 00000000000..b179a1eded4 --- /dev/null +++ b/extern/libmv/third_party/glog/src/raw_logging.cc @@ -0,0 +1,172 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Maxim Lifantsev +// +// logging_unittest.cc covers the functionality herein + +#include "utilities.h" + +#include <stdarg.h> +#include <stdio.h> +#include <errno.h> +#ifdef HAVE_UNISTD_H +# include <unistd.h> // for close() and write() +#endif +#include <fcntl.h> // for open() +#include <time.h> +#include "config.h" +#include <glog/logging.h> // To pick up flag settings etc. +#include <glog/raw_logging.h> +#include "base/commandlineflags.h" + +#ifdef HAVE_STACKTRACE +# include "stacktrace.h" +#endif + +#if defined(HAVE_SYSCALL_H) +#include <syscall.h> // for syscall() +#elif defined(HAVE_SYS_SYSCALL_H) +#include <sys/syscall.h> // for syscall() +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif + +#if defined(HAVE_SYSCALL_H) || defined(HAVE_SYS_SYSCALL_H) +# define safe_write(fd, s, len) syscall(SYS_write, fd, s, len) +#else + // Not so safe, but what can you do? +# define safe_write(fd, s, len) write(fd, s, len) +#endif + +_START_GOOGLE_NAMESPACE_ + +// Data for RawLog__ below. We simply pick up the latest +// time data created by a normal log message to avoid calling +// localtime_r which can allocate memory. +static struct ::tm last_tm_time_for_raw_log; +static int last_usecs_for_raw_log; + +void RawLog__SetLastTime(const struct ::tm& t, int usecs) { + memcpy(&last_tm_time_for_raw_log, &t, sizeof(last_tm_time_for_raw_log)); + last_usecs_for_raw_log = usecs; +} + +// CAVEAT: vsnprintf called from *DoRawLog below has some (exotic) code paths +// that invoke malloc() and getenv() that might acquire some locks. +// If this becomes a problem we should reimplement a subset of vsnprintf +// that does not need locks and malloc. + +// Helper for RawLog__ below. +// *DoRawLog writes to *buf of *size and move them past the written portion. +// It returns true iff there was no overflow or error. +static bool DoRawLog(char** buf, int* size, const char* format, ...) { + va_list ap; + va_start(ap, format); + int n = vsnprintf(*buf, *size, format, ap); + va_end(ap); + if (n < 0 || n > *size) return false; + *size -= n; + *buf += n; + return true; +} + +// Helper for RawLog__ below. +inline static bool VADoRawLog(char** buf, int* size, + const char* format, va_list ap) { + int n = vsnprintf(*buf, *size, format, ap); + if (n < 0 || n > *size) return false; + *size -= n; + *buf += n; + return true; +} + +static const int kLogBufSize = 3000; +static bool crashed = false; +static CrashReason crash_reason; +static char crash_buf[kLogBufSize + 1] = { 0 }; // Will end in '\0' + +void RawLog__(LogSeverity severity, const char* file, int line, + const char* format, ...) { + if (!(FLAGS_logtostderr || severity >= FLAGS_stderrthreshold || + FLAGS_alsologtostderr || !IsGoogleLoggingInitialized())) { + return; // this stderr log message is suppressed + } + // can't call localtime_r here: it can allocate + struct ::tm& t = last_tm_time_for_raw_log; + char buffer[kLogBufSize]; + char* buf = buffer; + int size = sizeof(buffer); + + // NOTE: this format should match the specification in base/logging.h + DoRawLog(&buf, &size, "%c%02d%02d %02d:%02d:%02d.%06d %5u %s:%d] RAW: ", + LogSeverityNames[severity][0], + 1 + t.tm_mon, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, + last_usecs_for_raw_log, + static_cast<unsigned int>(GetTID()), + const_basename(const_cast<char *>(file)), line); + + // Record the position and size of the buffer after the prefix + const char* msg_start = buf; + const int msg_size = size; + + va_list ap; + va_start(ap, format); + bool no_chop = VADoRawLog(&buf, &size, format, ap); + va_end(ap); + if (no_chop) { + DoRawLog(&buf, &size, "\n"); + } else { + DoRawLog(&buf, &size, "RAW_LOG ERROR: The Message was too long!\n"); + } + // We make a raw syscall to write directly to the stderr file descriptor, + // avoiding FILE buffering (to avoid invoking malloc()), and bypassing + // libc (to side-step any libc interception). + // We write just once to avoid races with other invocations of RawLog__. + safe_write(STDERR_FILENO, buffer, strlen(buffer)); + if (severity == FATAL) { + if (!sync_val_compare_and_swap(&crashed, false, true)) { + crash_reason.filename = file; + crash_reason.line_number = line; + memcpy(crash_buf, msg_start, msg_size); // Don't include prefix + crash_reason.message = crash_buf; +#ifdef HAVE_STACKTRACE + crash_reason.depth = + GetStackTrace(crash_reason.stack, ARRAYSIZE(crash_reason.stack), 1); +#else + crash_reason.depth = 0; +#endif + SetCrashReason(&crash_reason); + } + LogMessage::Fail(); // abort() + } +} + +_END_GOOGLE_NAMESPACE_ diff --git a/extern/libmv/third_party/glog/src/signalhandler.cc b/extern/libmv/third_party/glog/src/signalhandler.cc new file mode 100644 index 00000000000..9fc91b3390d --- /dev/null +++ b/extern/libmv/third_party/glog/src/signalhandler.cc @@ -0,0 +1,348 @@ +// Copyright (c) 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Satoru Takabayashi +// +// Implementation of InstallFailureSignalHandler(). + +#include "utilities.h" +#include "stacktrace.h" +#include "symbolize.h" +#include "glog/logging.h" + +#include <signal.h> +#include <time.h> +#ifdef HAVE_UCONTEXT_H +# include <ucontext.h> +#endif +#ifdef HAVE_SYS_UCONTEXT_H +# include <sys/ucontext.h> +#endif +#include <algorithm> + +_START_GOOGLE_NAMESPACE_ + +namespace { + +// We'll install the failure signal handler for these signals. We could +// use strsignal() to get signal names, but we don't use it to avoid +// introducing yet another #ifdef complication. +// +// The list should be synced with the comment in signalhandler.h. +const struct { + int number; + const char *name; +} kFailureSignals[] = { + { SIGSEGV, "SIGSEGV" }, + { SIGILL, "SIGILL" }, + { SIGFPE, "SIGFPE" }, + { SIGABRT, "SIGABRT" }, + { SIGBUS, "SIGBUS" }, + { SIGTERM, "SIGTERM" }, +}; + +// Returns the program counter from signal context, NULL if unknown. +void* GetPC(void* ucontext_in_void) { +#if (defined(HAVE_UCONTEXT_H) || defined(HAVE_SYS_UCONTEXT_H)) && defined(PC_FROM_UCONTEXT) + if (ucontext_in_void != NULL) { + ucontext_t *context = reinterpret_cast<ucontext_t *>(ucontext_in_void); + return (void*)context->PC_FROM_UCONTEXT; + } +#endif + return NULL; +} + +// The class is used for formatting error messages. We don't use printf() +// as it's not async signal safe. +class MinimalFormatter { + public: + MinimalFormatter(char *buffer, int size) + : buffer_(buffer), + cursor_(buffer), + end_(buffer + size) { + } + + // Returns the number of bytes written in the buffer. + int num_bytes_written() const { return cursor_ - buffer_; } + + // Appends string from "str" and updates the internal cursor. + void AppendString(const char* str) { + int i = 0; + while (str[i] != '\0' && cursor_ + i < end_) { + cursor_[i] = str[i]; + ++i; + } + cursor_ += i; + } + + // Formats "number" in "radix" and updates the internal cursor. + // Lowercase letters are used for 'a' - 'z'. + void AppendUint64(uint64 number, int radix) { + int i = 0; + while (cursor_ + i < end_) { + const int tmp = number % radix; + number /= radix; + cursor_[i] = (tmp < 10 ? '0' + tmp : 'a' + tmp - 10); + ++i; + if (number == 0) { + break; + } + } + // Reverse the bytes written. + std::reverse(cursor_, cursor_ + i); + cursor_ += i; + } + + // Formats "number" as hexadecimal number, and updates the internal + // cursor. Padding will be added in front if needed. + void AppendHexWithPadding(uint64 number, int width) { + char* start = cursor_; + AppendString("0x"); + AppendUint64(number, 16); + // Move to right and add padding in front if needed. + if (cursor_ < start + width) { + const int64 delta = start + width - cursor_; + std::copy(start, cursor_, start + delta); + std::fill(start, start + delta, ' '); + cursor_ = start + width; + } + } + + private: + char *buffer_; + char *cursor_; + const char * const end_; +}; + +// Writes the given data with the size to the standard error. +void WriteToStderr(const char* data, int size) { + write(STDERR_FILENO, data, size); +} + +// The writer function can be changed by InstallFailureWriter(). +void (*g_failure_writer)(const char* data, int size) = WriteToStderr; + +// Dumps time information. We don't dump human-readable time information +// as localtime() is not guaranteed to be async signal safe. +void DumpTimeInfo() { + time_t time_in_sec = time(NULL); + char buf[256]; // Big enough for time info. + MinimalFormatter formatter(buf, sizeof(buf)); + formatter.AppendString("*** Aborted at "); + formatter.AppendUint64(time_in_sec, 10); + formatter.AppendString(" (unix time)"); + formatter.AppendString(" try \"date -d @"); + formatter.AppendUint64(time_in_sec, 10); + formatter.AppendString("\" if you are using GNU date ***\n"); + g_failure_writer(buf, formatter.num_bytes_written()); +} + +// Dumps information about the signal to STDERR. +void DumpSignalInfo(int signal_number, siginfo_t *siginfo) { + // Get the signal name. + const char* signal_name = NULL; + for (int i = 0; i < ARRAYSIZE(kFailureSignals); ++i) { + if (signal_number == kFailureSignals[i].number) { + signal_name = kFailureSignals[i].name; + } + } + + char buf[256]; // Big enough for signal info. + MinimalFormatter formatter(buf, sizeof(buf)); + + formatter.AppendString("*** "); + if (signal_name) { + formatter.AppendString(signal_name); + } else { + // Use the signal number if the name is unknown. The signal name + // should be known, but just in case. + formatter.AppendString("Signal "); + formatter.AppendUint64(signal_number, 10); + } + formatter.AppendString(" (@0x"); + formatter.AppendUint64(reinterpret_cast<uintptr_t>(siginfo->si_addr), 16); + formatter.AppendString(")"); + formatter.AppendString(" received by PID "); + formatter.AppendUint64(getpid(), 10); + formatter.AppendString(" (TID 0x"); + // We assume pthread_t is an integral number or a pointer, rather + // than a complex struct. In some environments, pthread_self() + // returns an uint64 but in some other environments pthread_self() + // returns a pointer. Hence we use C-style cast here, rather than + // reinterpret/static_cast, to support both types of environments. + formatter.AppendUint64((uintptr_t)pthread_self(), 16); + formatter.AppendString(") "); + // Only linux has the PID of the signal sender in si_pid. +#ifdef OS_LINUX + formatter.AppendString("from PID "); + formatter.AppendUint64(siginfo->si_pid, 10); + formatter.AppendString("; "); +#endif + formatter.AppendString("stack trace: ***\n"); + g_failure_writer(buf, formatter.num_bytes_written()); +} + +// Dumps information about the stack frame to STDERR. +void DumpStackFrameInfo(const char* prefix, void* pc) { + // Get the symbol name. + const char *symbol = "(unknown)"; + char symbolized[1024]; // Big enough for a sane symbol. + // Symbolizes the previous address of pc because pc may be in the + // next function. + if (Symbolize(reinterpret_cast<char *>(pc) - 1, + symbolized, sizeof(symbolized))) { + symbol = symbolized; + } + + char buf[1024]; // Big enough for stack frame info. + MinimalFormatter formatter(buf, sizeof(buf)); + + formatter.AppendString(prefix); + formatter.AppendString("@ "); + const int width = 2 * sizeof(void*) + 2; // + 2 for "0x". + formatter.AppendHexWithPadding(reinterpret_cast<uintptr_t>(pc), width); + formatter.AppendString(" "); + formatter.AppendString(symbol); + formatter.AppendString("\n"); + g_failure_writer(buf, formatter.num_bytes_written()); +} + +// Invoke the default signal handler. +void InvokeDefaultSignalHandler(int signal_number) { + struct sigaction sig_action; + memset(&sig_action, 0, sizeof(sig_action)); + sigemptyset(&sig_action.sa_mask); + sig_action.sa_handler = SIG_DFL; + sigaction(signal_number, &sig_action, NULL); + kill(getpid(), signal_number); +} + +// This variable is used for protecting FailureSignalHandler() from +// dumping stuff while another thread is doing it. Our policy is to let +// the first thread dump stuff and let other threads wait. +// See also comments in FailureSignalHandler(). +static pthread_t* g_entered_thread_id_pointer = NULL; + +// Dumps signal and stack frame information, and invokes the default +// signal handler once our job is done. +void FailureSignalHandler(int signal_number, + siginfo_t *signal_info, + void *ucontext) { + // First check if we've already entered the function. We use an atomic + // compare and swap operation for platforms that support it. For other + // platforms, we use a naive method that could lead to a subtle race. + + // We assume pthread_self() is async signal safe, though it's not + // officially guaranteed. + pthread_t my_thread_id = pthread_self(); + // NOTE: We could simply use pthread_t rather than pthread_t* for this, + // if pthread_self() is guaranteed to return non-zero value for thread + // ids, but there is no such guarantee. We need to distinguish if the + // old value (value returned from __sync_val_compare_and_swap) is + // different from the original value (in this case NULL). + pthread_t* old_thread_id_pointer = + glog_internal_namespace_::sync_val_compare_and_swap( + &g_entered_thread_id_pointer, + static_cast<pthread_t*>(NULL), + &my_thread_id); + if (old_thread_id_pointer != NULL) { + // We've already entered the signal handler. What should we do? + if (pthread_equal(my_thread_id, *g_entered_thread_id_pointer)) { + // It looks the current thread is reentering the signal handler. + // Something must be going wrong (maybe we are reentering by another + // type of signal?). Kill ourself by the default signal handler. + InvokeDefaultSignalHandler(signal_number); + } + // Another thread is dumping stuff. Let's wait until that thread + // finishes the job and kills the process. + while (true) { + sleep(1); + } + } + // This is the first time we enter the signal handler. We are going to + // do some interesting stuff from here. + // TODO(satorux): We might want to set timeout here using alarm(), but + // mixing alarm() and sleep() can be a bad idea. + + // First dump time info. + DumpTimeInfo(); + + // Get the program counter from ucontext. + void *pc = GetPC(ucontext); + DumpStackFrameInfo("PC: ", pc); + +#ifdef HAVE_STACKTRACE + // Get the stack traces. + void *stack[32]; + // +1 to exclude this function. + const int depth = GetStackTrace(stack, ARRAYSIZE(stack), 1); + DumpSignalInfo(signal_number, signal_info); + // Dump the stack traces. + for (int i = 0; i < depth; ++i) { + DumpStackFrameInfo(" ", stack[i]); + } +#endif + + // *** TRANSITION *** + // + // BEFORE this point, all code must be async-termination-safe! + // (See WARNING above.) + // + // AFTER this point, we do unsafe things, like using LOG()! + // The process could be terminated or hung at any time. We try to + // do more useful things first and riskier things later. + + // Flush the logs before we do anything in case 'anything' + // causes problems. + FlushLogFilesUnsafe(0); + + // Kill ourself by the default signal handler. + InvokeDefaultSignalHandler(signal_number); +} + +} // namespace + +void InstallFailureSignalHandler() { + // Build the sigaction struct. + struct sigaction sig_action; + memset(&sig_action, 0, sizeof(sig_action)); + sigemptyset(&sig_action.sa_mask); + sig_action.sa_flags |= SA_SIGINFO; + sig_action.sa_sigaction = &FailureSignalHandler; + + for (int i = 0; i < ARRAYSIZE(kFailureSignals); ++i) { + CHECK_ERR(sigaction(kFailureSignals[i].number, &sig_action, NULL)); + } +} + +void InstallFailureWriter(void (*writer)(const char* data, int size)) { + g_failure_writer = writer; +} + +_END_GOOGLE_NAMESPACE_ diff --git a/extern/libmv/third_party/glog/src/stacktrace.h b/extern/libmv/third_party/glog/src/stacktrace.h new file mode 100644 index 00000000000..8c3e8fe8f8d --- /dev/null +++ b/extern/libmv/third_party/glog/src/stacktrace.h @@ -0,0 +1,60 @@ +// Copyright (c) 2000 - 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Routines to extract the current stack trace. These functions are +// thread-safe. + +#ifndef BASE_STACKTRACE_H_ +#define BASE_STACKTRACE_H_ + +#include "config.h" + +_START_GOOGLE_NAMESPACE_ + +// This is similar to the GetStackFrames routine, except that it returns +// the stack trace only, and not the stack frame sizes as well. +// Example: +// main() { foo(); } +// foo() { bar(); } +// bar() { +// void* result[10]; +// int depth = GetStackFrames(result, 10, 1); +// } +// +// This produces: +// result[0] foo +// result[1] main +// .... ... +// +// "result" must not be NULL. +extern int GetStackTrace(void** result, int max_depth, int skip_count); + +_END_GOOGLE_NAMESPACE_ + +#endif // BASE_STACKTRACE_H_ diff --git a/extern/libmv/third_party/glog/src/stacktrace_generic-inl.h b/extern/libmv/third_party/glog/src/stacktrace_generic-inl.h new file mode 100644 index 00000000000..fad81d3e3f4 --- /dev/null +++ b/extern/libmv/third_party/glog/src/stacktrace_generic-inl.h @@ -0,0 +1,59 @@ +// Copyright (c) 2000 - 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Portable implementation - just use glibc +// +// Note: The glibc implementation may cause a call to malloc. +// This can cause a deadlock in HeapProfiler. +#include <execinfo.h> +#include <string.h> +#include "stacktrace.h" + +_START_GOOGLE_NAMESPACE_ + +// If you change this function, also change GetStackFrames below. +int GetStackTrace(void** result, int max_depth, int skip_count) { + static const int kStackLength = 64; + void * stack[kStackLength]; + int size; + + size = backtrace(stack, kStackLength); + skip_count++; // we want to skip the current frame as well + int result_count = size - skip_count; + if (result_count < 0) + result_count = 0; + if (result_count > max_depth) + result_count = max_depth; + for (int i = 0; i < result_count; i++) + result[i] = stack[i + skip_count]; + + return result_count; +} + +_END_GOOGLE_NAMESPACE_ diff --git a/extern/libmv/third_party/glog/src/stacktrace_libunwind-inl.h b/extern/libmv/third_party/glog/src/stacktrace_libunwind-inl.h new file mode 100644 index 00000000000..0dc14c6506e --- /dev/null +++ b/extern/libmv/third_party/glog/src/stacktrace_libunwind-inl.h @@ -0,0 +1,87 @@ +// Copyright (c) 2005 - 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Arun Sharma +// +// Produce stack trace using libunwind + +#include "utilities.h" + +extern "C" { +#define UNW_LOCAL_ONLY +#include <libunwind.h> +} +#include "glog/raw_logging.h" +#include "stacktrace.h" + +_START_GOOGLE_NAMESPACE_ + +// Sometimes, we can try to get a stack trace from within a stack +// trace, because libunwind can call mmap (maybe indirectly via an +// internal mmap based memory allocator), and that mmap gets trapped +// and causes a stack-trace request. If were to try to honor that +// recursive request, we'd end up with infinite recursion or deadlock. +// Luckily, it's safe to ignore those subsequent traces. In such +// cases, we return 0 to indicate the situation. +static bool g_now_entering = false; + +// If you change this function, also change GetStackFrames below. +int GetStackTrace(void** result, int max_depth, int skip_count) { + void *ip; + int n = 0; + unw_cursor_t cursor; + unw_context_t uc; + + if (sync_val_compare_and_swap(&g_now_entering, false, true)) { + return 0; + } + + unw_getcontext(&uc); + RAW_CHECK(unw_init_local(&cursor, &uc) >= 0, "unw_init_local failed"); + skip_count++; // Do not include the "GetStackTrace" frame + + while (n < max_depth) { + int ret = unw_get_reg(&cursor, UNW_REG_IP, (unw_word_t *) &ip); + if (ret < 0) + break; + if (skip_count > 0) { + skip_count--; + } else { + result[n++] = ip; + } + ret = unw_step(&cursor); + if (ret <= 0) + break; + } + + g_now_entering = false; + return n; +} + +_END_GOOGLE_NAMESPACE_ diff --git a/extern/libmv/third_party/glog/src/stacktrace_powerpc-inl.h b/extern/libmv/third_party/glog/src/stacktrace_powerpc-inl.h new file mode 100644 index 00000000000..1090ddedbc7 --- /dev/null +++ b/extern/libmv/third_party/glog/src/stacktrace_powerpc-inl.h @@ -0,0 +1,130 @@ +// Copyright (c) 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Craig Silverstein +// +// Produce stack trace. I'm guessing (hoping!) the code is much like +// for x86. For apple machines, at least, it seems to be; see +// http://developer.apple.com/documentation/mac/runtimehtml/RTArch-59.html +// http://www.linux-foundation.org/spec/ELF/ppc64/PPC-elf64abi-1.9.html#STACK +// Linux has similar code: http://patchwork.ozlabs.org/linuxppc/patch?id=8882 + +#include <stdio.h> +#include <stdint.h> // for uintptr_t +#include "stacktrace.h" + +_START_GOOGLE_NAMESPACE_ + +// Given a pointer to a stack frame, locate and return the calling +// stackframe, or return NULL if no stackframe can be found. Perform sanity +// checks (the strictness of which is controlled by the boolean parameter +// "STRICT_UNWINDING") to reduce the chance that a bad pointer is returned. +template<bool STRICT_UNWINDING> +static void **NextStackFrame(void **old_sp) { + void **new_sp = (void **) *old_sp; + + // Check that the transition from frame pointer old_sp to frame + // pointer new_sp isn't clearly bogus + if (STRICT_UNWINDING) { + // With the stack growing downwards, older stack frame must be + // at a greater address that the current one. + if (new_sp <= old_sp) return NULL; + // Assume stack frames larger than 100,000 bytes are bogus. + if ((uintptr_t)new_sp - (uintptr_t)old_sp > 100000) return NULL; + } else { + // In the non-strict mode, allow discontiguous stack frames. + // (alternate-signal-stacks for example). + if (new_sp == old_sp) return NULL; + // And allow frames upto about 1MB. + if ((new_sp > old_sp) + && ((uintptr_t)new_sp - (uintptr_t)old_sp > 1000000)) return NULL; + } + if ((uintptr_t)new_sp & (sizeof(void *) - 1)) return NULL; + return new_sp; +} + +// This ensures that GetStackTrace stes up the Link Register properly. +void StacktracePowerPCDummyFunction() __attribute__((noinline)); +void StacktracePowerPCDummyFunction() { __asm__ volatile(""); } + +// If you change this function, also change GetStackFrames below. +int GetStackTrace(void** result, int max_depth, int skip_count) { + void **sp; + // Apple OS X uses an old version of gnu as -- both Darwin 7.9.0 (Panther) + // and Darwin 8.8.1 (Tiger) use as 1.38. This means we have to use a + // different asm syntax. I don't know quite the best way to discriminate + // systems using the old as from the new one; I've gone with __APPLE__. +#ifdef __APPLE__ + __asm__ volatile ("mr %0,r1" : "=r" (sp)); +#else + __asm__ volatile ("mr %0,1" : "=r" (sp)); +#endif + + // On PowerPC, the "Link Register" or "Link Record" (LR), is a stack + // entry that holds the return address of the subroutine call (what + // instruction we run after our function finishes). This is the + // same as the stack-pointer of our parent routine, which is what we + // want here. While the compiler will always(?) set up LR for + // subroutine calls, it may not for leaf functions (such as this one). + // This routine forces the compiler (at least gcc) to push it anyway. + StacktracePowerPCDummyFunction(); + + // The LR save area is used by the callee, so the top entry is bogus. + skip_count++; + + int n = 0; + while (sp && n < max_depth) { + if (skip_count > 0) { + skip_count--; + } else { + // PowerPC has 3 main ABIs, which say where in the stack the + // Link Register is. For DARWIN and AIX (used by apple and + // linux ppc64), it's in sp[2]. For SYSV (used by linux ppc), + // it's in sp[1]. +#if defined(_CALL_AIX) || defined(_CALL_DARWIN) + result[n++] = *(sp+2); +#elif defined(_CALL_SYSV) + result[n++] = *(sp+1); +#elif defined(__APPLE__) || (defined(__linux) && defined(__PPC64__)) + // This check is in case the compiler doesn't define _CALL_AIX/etc. + result[n++] = *(sp+2); +#elif defined(__linux) + // This check is in case the compiler doesn't define _CALL_SYSV. + result[n++] = *(sp+1); +#else +#error Need to specify the PPC ABI for your archiecture. +#endif + } + // Use strict unwinding rules. + sp = NextStackFrame<true>(sp); + } + return n; +} + +_END_GOOGLE_NAMESPACE_ diff --git a/extern/libmv/third_party/glog/src/stacktrace_x86-inl.h b/extern/libmv/third_party/glog/src/stacktrace_x86-inl.h new file mode 100644 index 00000000000..cfd31f783e3 --- /dev/null +++ b/extern/libmv/third_party/glog/src/stacktrace_x86-inl.h @@ -0,0 +1,139 @@ +// Copyright (c) 2000 - 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Produce stack trace + +#include <stdint.h> // for uintptr_t + +#include "utilities.h" // for OS_* macros + +#if !defined(OS_WINDOWS) +#include <unistd.h> +#include <sys/mman.h> +#endif + +#include <stdio.h> // for NULL +#include "stacktrace.h" + +_START_GOOGLE_NAMESPACE_ + +// Given a pointer to a stack frame, locate and return the calling +// stackframe, or return NULL if no stackframe can be found. Perform sanity +// checks (the strictness of which is controlled by the boolean parameter +// "STRICT_UNWINDING") to reduce the chance that a bad pointer is returned. +template<bool STRICT_UNWINDING> +static void **NextStackFrame(void **old_sp) { + void **new_sp = (void **) *old_sp; + + // Check that the transition from frame pointer old_sp to frame + // pointer new_sp isn't clearly bogus + if (STRICT_UNWINDING) { + // With the stack growing downwards, older stack frame must be + // at a greater address that the current one. + if (new_sp <= old_sp) return NULL; + // Assume stack frames larger than 100,000 bytes are bogus. + if ((uintptr_t)new_sp - (uintptr_t)old_sp > 100000) return NULL; + } else { + // In the non-strict mode, allow discontiguous stack frames. + // (alternate-signal-stacks for example). + if (new_sp == old_sp) return NULL; + // And allow frames upto about 1MB. + if ((new_sp > old_sp) + && ((uintptr_t)new_sp - (uintptr_t)old_sp > 1000000)) return NULL; + } + if ((uintptr_t)new_sp & (sizeof(void *) - 1)) return NULL; +#ifdef __i386__ + // On 64-bit machines, the stack pointer can be very close to + // 0xffffffff, so we explicitly check for a pointer into the + // last two pages in the address space + if ((uintptr_t)new_sp >= 0xffffe000) return NULL; +#endif +#if !defined(OS_WINDOWS) + if (!STRICT_UNWINDING) { + // Lax sanity checks cause a crash in 32-bit tcmalloc/crash_reason_test + // on AMD-based machines with VDSO-enabled kernels. + // Make an extra sanity check to insure new_sp is readable. + // Note: NextStackFrame<false>() is only called while the program + // is already on its last leg, so it's ok to be slow here. + static int page_size = getpagesize(); + void *new_sp_aligned = (void *)((uintptr_t)new_sp & ~(page_size - 1)); + if (msync(new_sp_aligned, page_size, MS_ASYNC) == -1) + return NULL; + } +#endif + return new_sp; +} + +// If you change this function, also change GetStackFrames below. +int GetStackTrace(void** result, int max_depth, int skip_count) { + void **sp; +#ifdef __i386__ + // Stack frame format: + // sp[0] pointer to previous frame + // sp[1] caller address + // sp[2] first argument + // ... + sp = (void **)&result - 2; +#endif + +#ifdef __x86_64__ + // __builtin_frame_address(0) can return the wrong address on gcc-4.1.0-k8 + unsigned long rbp; + // Move the value of the register %rbp into the local variable rbp. + // We need 'volatile' to prevent this instruction from getting moved + // around during optimization to before function prologue is done. + // An alternative way to achieve this + // would be (before this __asm__ instruction) to call Noop() defined as + // static void Noop() __attribute__ ((noinline)); // prevent inlining + // static void Noop() { asm(""); } // prevent optimizing-away + __asm__ volatile ("mov %%rbp, %0" : "=r" (rbp)); + // Arguments are passed in registers on x86-64, so we can't just + // offset from &result + sp = (void **) rbp; +#endif + + int n = 0; + while (sp && n < max_depth) { + if (*(sp+1) == (void *)0) { + // In 64-bit code, we often see a frame that + // points to itself and has a return address of 0. + break; + } + if (skip_count > 0) { + skip_count--; + } else { + result[n++] = *(sp+1); + } + // Use strict unwinding rules. + sp = NextStackFrame<true>(sp); + } + return n; +} + +_END_GOOGLE_NAMESPACE_ diff --git a/extern/libmv/third_party/glog/src/stacktrace_x86_64-inl.h b/extern/libmv/third_party/glog/src/stacktrace_x86_64-inl.h new file mode 100644 index 00000000000..f7d1dca85bc --- /dev/null +++ b/extern/libmv/third_party/glog/src/stacktrace_x86_64-inl.h @@ -0,0 +1,105 @@ +// Copyright (c) 2005 - 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Arun Sharma +// +// Produce stack trace using libgcc + +extern "C" { +#include <stdlib.h> // for NULL +#include <unwind.h> // ABI defined unwinder +} +#include "stacktrace.h" + +_START_GOOGLE_NAMESPACE_ + +typedef struct { + void **result; + int max_depth; + int skip_count; + int count; +} trace_arg_t; + + +// Workaround for the malloc() in _Unwind_Backtrace() issue. +static _Unwind_Reason_Code nop_backtrace(struct _Unwind_Context *uc, void *opq) { + return _URC_NO_REASON; +} + + +// This code is not considered ready to run until +// static initializers run so that we are guaranteed +// that any malloc-related initialization is done. +static bool ready_to_run = false; +class StackTraceInit { + public: + StackTraceInit() { + // Extra call to force initialization + _Unwind_Backtrace(nop_backtrace, NULL); + ready_to_run = true; + } +}; + +static StackTraceInit module_initializer; // Force initialization + +static _Unwind_Reason_Code GetOneFrame(struct _Unwind_Context *uc, void *opq) { + trace_arg_t *targ = (trace_arg_t *) opq; + + if (targ->skip_count > 0) { + targ->skip_count--; + } else { + targ->result[targ->count++] = (void *) _Unwind_GetIP(uc); + } + + if (targ->count == targ->max_depth) + return _URC_END_OF_STACK; + + return _URC_NO_REASON; +} + +// If you change this function, also change GetStackFrames below. +int GetStackTrace(void** result, int max_depth, int skip_count) { + if (!ready_to_run) + return 0; + + trace_arg_t targ; + + skip_count += 1; // Do not include the "GetStackTrace" frame + + targ.result = result; + targ.max_depth = max_depth; + targ.skip_count = skip_count; + targ.count = 0; + + _Unwind_Backtrace(GetOneFrame, &targ); + + return targ.count; +} + +_END_GOOGLE_NAMESPACE_ diff --git a/extern/libmv/third_party/glog/src/symbolize.cc b/extern/libmv/third_party/glog/src/symbolize.cc new file mode 100644 index 00000000000..3465de6c6fe --- /dev/null +++ b/extern/libmv/third_party/glog/src/symbolize.cc @@ -0,0 +1,681 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Satoru Takabayashi +// Stack-footprint reduction work done by Raksit Ashok +// +// Implementation note: +// +// We don't use heaps but only use stacks. We want to reduce the +// stack consumption so that the symbolizer can run on small stacks. +// +// Here are some numbers collected with GCC 4.1.0 on x86: +// - sizeof(Elf32_Sym) = 16 +// - sizeof(Elf32_Shdr) = 40 +// - sizeof(Elf64_Sym) = 24 +// - sizeof(Elf64_Shdr) = 64 +// +// This implementation is intended to be async-signal-safe but uses +// some functions which are not guaranteed to be so, such as memchr() +// and memmove(). We assume they are async-signal-safe. +// + +#include "utilities.h" + +#if defined(HAVE_SYMBOLIZE) + +#include <limits> + +#include "symbolize.h" +#include "demangle.h" + +_START_GOOGLE_NAMESPACE_ + +// We don't use assert() since it's not guaranteed to be +// async-signal-safe. Instead we define a minimal assertion +// macro. So far, we don't need pretty printing for __FILE__, etc. + +// A wrapper for abort() to make it callable in ? :. +static int AssertFail() { + abort(); + return 0; // Should not reach. +} + +#define SAFE_ASSERT(expr) ((expr) ? 0 : AssertFail()) + +static SymbolizeCallback g_symbolize_callback = NULL; +void InstallSymbolizeCallback(SymbolizeCallback callback) { + g_symbolize_callback = callback; +} + +// This function wraps the Demangle function to provide an interface +// where the input symbol is demangled in-place. +// To keep stack consumption low, we would like this function to not +// get inlined. +static ATTRIBUTE_NOINLINE void DemangleInplace(char *out, int out_size) { + char demangled[256]; // Big enough for sane demangled symbols. + if (Demangle(out, demangled, sizeof(demangled))) { + // Demangling succeeded. Copy to out if the space allows. + int len = strlen(demangled); + if (len + 1 <= out_size) { // +1 for '\0'. + SAFE_ASSERT(len < sizeof(demangled)); + memmove(out, demangled, len + 1); + } + } +} + +_END_GOOGLE_NAMESPACE_ + +#if defined(__ELF__) + +#include <dlfcn.h> +#include <elf.h> +#include <errno.h> +#include <fcntl.h> +#include <limits.h> +#include <link.h> // For ElfW() macro. +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <stddef.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h> + +#include "symbolize.h" +#include "config.h" +#include "glog/raw_logging.h" + +// Re-runs fn until it doesn't cause EINTR. +#define NO_INTR(fn) do {} while ((fn) < 0 && errno == EINTR) + +_START_GOOGLE_NAMESPACE_ + +// Read up to "count" bytes from file descriptor "fd" into the buffer +// starting at "buf" while handling short reads and EINTR. On +// success, return the number of bytes read. Otherwise, return -1. +static ssize_t ReadPersistent(const int fd, void *buf, const size_t count) { + SAFE_ASSERT(fd >= 0); + SAFE_ASSERT(count >= 0 && count <= std::numeric_limits<ssize_t>::max()); + char *buf0 = reinterpret_cast<char *>(buf); + ssize_t num_bytes = 0; + while (num_bytes < count) { + ssize_t len; + NO_INTR(len = read(fd, buf0 + num_bytes, count - num_bytes)); + if (len < 0) { // There was an error other than EINTR. + return -1; + } + if (len == 0) { // Reached EOF. + break; + } + num_bytes += len; + } + SAFE_ASSERT(num_bytes <= count); + return num_bytes; +} + +// Read up to "count" bytes from "offset" in the file pointed by file +// descriptor "fd" into the buffer starting at "buf". On success, +// return the number of bytes read. Otherwise, return -1. +static ssize_t ReadFromOffset(const int fd, void *buf, + const size_t count, const off_t offset) { + off_t off = lseek(fd, offset, SEEK_SET); + if (off == (off_t)-1) { + return -1; + } + return ReadPersistent(fd, buf, count); +} + +// Try reading exactly "count" bytes from "offset" bytes in a file +// pointed by "fd" into the buffer starting at "buf" while handling +// short reads and EINTR. On success, return true. Otherwise, return +// false. +static bool ReadFromOffsetExact(const int fd, void *buf, + const size_t count, const off_t offset) { + ssize_t len = ReadFromOffset(fd, buf, count, offset); + return len == count; +} + +// Returns elf_header.e_type if the file pointed by fd is an ELF binary. +static int FileGetElfType(const int fd) { + ElfW(Ehdr) elf_header; + if (!ReadFromOffsetExact(fd, &elf_header, sizeof(elf_header), 0)) { + return -1; + } + if (memcmp(elf_header.e_ident, ELFMAG, SELFMAG) != 0) { + return -1; + } + return elf_header.e_type; +} + +// Read the section headers in the given ELF binary, and if a section +// of the specified type is found, set the output to this section header +// and return true. Otherwise, return false. +// To keep stack consumption low, we would like this function to not get +// inlined. +static ATTRIBUTE_NOINLINE bool +GetSectionHeaderByType(const int fd, ElfW(Half) sh_num, const off_t sh_offset, + ElfW(Word) type, ElfW(Shdr) *out) { + // Read at most 16 section headers at a time to save read calls. + ElfW(Shdr) buf[16]; + for (int i = 0; i < sh_num;) { + const ssize_t num_bytes_left = (sh_num - i) * sizeof(buf[0]); + const ssize_t num_bytes_to_read = + (sizeof(buf) > num_bytes_left) ? num_bytes_left : sizeof(buf); + const ssize_t len = ReadFromOffset(fd, buf, num_bytes_to_read, + sh_offset + i * sizeof(buf[0])); + SAFE_ASSERT(len % sizeof(buf[0]) == 0); + const ssize_t num_headers_in_buf = len / sizeof(buf[0]); + SAFE_ASSERT(num_headers_in_buf <= sizeof(buf) / sizeof(buf[0])); + for (int j = 0; j < num_headers_in_buf; ++j) { + if (buf[j].sh_type == type) { + *out = buf[j]; + return true; + } + } + i += num_headers_in_buf; + } + return false; +} + +// There is no particular reason to limit section name to 63 characters, +// but there has (as yet) been no need for anything longer either. +const int kMaxSectionNameLen = 64; + +// name_len should include terminating '\0'. +bool GetSectionHeaderByName(int fd, const char *name, size_t name_len, + ElfW(Shdr) *out) { + ElfW(Ehdr) elf_header; + if (!ReadFromOffsetExact(fd, &elf_header, sizeof(elf_header), 0)) { + return false; + } + + ElfW(Shdr) shstrtab; + off_t shstrtab_offset = (elf_header.e_shoff + + elf_header.e_shentsize * elf_header.e_shstrndx); + if (!ReadFromOffsetExact(fd, &shstrtab, sizeof(shstrtab), shstrtab_offset)) { + return false; + } + + for (int i = 0; i < elf_header.e_shnum; ++i) { + off_t section_header_offset = (elf_header.e_shoff + + elf_header.e_shentsize * i); + if (!ReadFromOffsetExact(fd, out, sizeof(*out), section_header_offset)) { + return false; + } + char header_name[kMaxSectionNameLen]; + if (sizeof(header_name) < name_len) { + RAW_LOG(WARNING, "Section name '%s' is too long (%"PRIuS"); " + "section will not be found (even if present).", name, name_len); + // No point in even trying. + return false; + } + off_t name_offset = shstrtab.sh_offset + out->sh_name; + ssize_t n_read = ReadFromOffset(fd, &header_name, name_len, name_offset); + if (n_read == -1) { + return false; + } else if (n_read != name_len) { + // Short read -- name could be at end of file. + continue; + } + if (memcmp(header_name, name, name_len) == 0) { + return true; + } + } + return false; +} + +// Read a symbol table and look for the symbol containing the +// pc. Iterate over symbols in a symbol table and look for the symbol +// containing "pc". On success, return true and write the symbol name +// to out. Otherwise, return false. +// To keep stack consumption low, we would like this function to not get +// inlined. +static ATTRIBUTE_NOINLINE bool +FindSymbol(uint64_t pc, const int fd, char *out, int out_size, + uint64_t symbol_offset, const ElfW(Shdr) *strtab, + const ElfW(Shdr) *symtab) { + if (symtab == NULL) { + return false; + } + const int num_symbols = symtab->sh_size / symtab->sh_entsize; + for (int i = 0; i < num_symbols;) { + off_t offset = symtab->sh_offset + i * symtab->sh_entsize; + + // If we are reading Elf64_Sym's, we want to limit this array to + // 32 elements (to keep stack consumption low), otherwise we can + // have a 64 element Elf32_Sym array. +#if __WORDSIZE == 64 +#define NUM_SYMBOLS 32 +#else +#define NUM_SYMBOLS 64 +#endif + + // Read at most NUM_SYMBOLS symbols at once to save read() calls. + ElfW(Sym) buf[NUM_SYMBOLS]; + const ssize_t len = ReadFromOffset(fd, &buf, sizeof(buf), offset); + SAFE_ASSERT(len % sizeof(buf[0]) == 0); + const ssize_t num_symbols_in_buf = len / sizeof(buf[0]); + SAFE_ASSERT(num_symbols_in_buf <= sizeof(buf)/sizeof(buf[0])); + for (int j = 0; j < num_symbols_in_buf; ++j) { + const ElfW(Sym)& symbol = buf[j]; + uint64_t start_address = symbol.st_value; + start_address += symbol_offset; + uint64_t end_address = start_address + symbol.st_size; + if (symbol.st_value != 0 && // Skip null value symbols. + symbol.st_shndx != 0 && // Skip undefined symbols. + start_address <= pc && pc < end_address) { + ssize_t len1 = ReadFromOffset(fd, out, out_size, + strtab->sh_offset + symbol.st_name); + if (len1 <= 0 || memchr(out, '\0', out_size) == NULL) { + return false; + } + return true; // Obtained the symbol name. + } + } + i += num_symbols_in_buf; + } + return false; +} + +// Get the symbol name of "pc" from the file pointed by "fd". Process +// both regular and dynamic symbol tables if necessary. On success, +// write the symbol name to "out" and return true. Otherwise, return +// false. +static bool GetSymbolFromObjectFile(const int fd, uint64_t pc, + char *out, int out_size, + uint64_t map_start_address) { + // Read the ELF header. + ElfW(Ehdr) elf_header; + if (!ReadFromOffsetExact(fd, &elf_header, sizeof(elf_header), 0)) { + return false; + } + + uint64_t symbol_offset = 0; + if (elf_header.e_type == ET_DYN) { // DSO needs offset adjustment. + symbol_offset = map_start_address; + } + + ElfW(Shdr) symtab, strtab; + + // Consult a regular symbol table first. + if (!GetSectionHeaderByType(fd, elf_header.e_shnum, elf_header.e_shoff, + SHT_SYMTAB, &symtab)) { + return false; + } + if (!ReadFromOffsetExact(fd, &strtab, sizeof(strtab), elf_header.e_shoff + + symtab.sh_link * sizeof(symtab))) { + return false; + } + if (FindSymbol(pc, fd, out, out_size, symbol_offset, + &strtab, &symtab)) { + return true; // Found the symbol in a regular symbol table. + } + + // If the symbol is not found, then consult a dynamic symbol table. + if (!GetSectionHeaderByType(fd, elf_header.e_shnum, elf_header.e_shoff, + SHT_DYNSYM, &symtab)) { + return false; + } + if (!ReadFromOffsetExact(fd, &strtab, sizeof(strtab), elf_header.e_shoff + + symtab.sh_link * sizeof(symtab))) { + return false; + } + if (FindSymbol(pc, fd, out, out_size, symbol_offset, + &strtab, &symtab)) { + return true; // Found the symbol in a dynamic symbol table. + } + + return false; +} + +namespace { +// Thin wrapper around a file descriptor so that the file descriptor +// gets closed for sure. +struct FileDescriptor { + const int fd_; + explicit FileDescriptor(int fd) : fd_(fd) {} + ~FileDescriptor() { + if (fd_ >= 0) { + NO_INTR(close(fd_)); + } + } + int get() { return fd_; } + + private: + explicit FileDescriptor(const FileDescriptor&); + void operator=(const FileDescriptor&); +}; + +// Helper class for reading lines from file. +// +// Note: we don't use ProcMapsIterator since the object is big (it has +// a 5k array member) and uses async-unsafe functions such as sscanf() +// and snprintf(). +class LineReader { + public: + explicit LineReader(int fd, char *buf, int buf_len) : fd_(fd), + buf_(buf), buf_len_(buf_len), bol_(buf), eol_(buf), eod_(buf) { + } + + // Read '\n'-terminated line from file. On success, modify "bol" + // and "eol", then return true. Otherwise, return false. + // + // Note: if the last line doesn't end with '\n', the line will be + // dropped. It's an intentional behavior to make the code simple. + bool ReadLine(const char **bol, const char **eol) { + if (BufferIsEmpty()) { // First time. + const ssize_t num_bytes = ReadPersistent(fd_, buf_, buf_len_); + if (num_bytes <= 0) { // EOF or error. + return false; + } + eod_ = buf_ + num_bytes; + bol_ = buf_; + } else { + bol_ = eol_ + 1; // Advance to the next line in the buffer. + SAFE_ASSERT(bol_ <= eod_); // "bol_" can point to "eod_". + if (!HasCompleteLine()) { + const int incomplete_line_length = eod_ - bol_; + // Move the trailing incomplete line to the beginning. + memmove(buf_, bol_, incomplete_line_length); + // Read text from file and append it. + char * const append_pos = buf_ + incomplete_line_length; + const int capacity_left = buf_len_ - incomplete_line_length; + const ssize_t num_bytes = ReadPersistent(fd_, append_pos, + capacity_left); + if (num_bytes <= 0) { // EOF or error. + return false; + } + eod_ = append_pos + num_bytes; + bol_ = buf_; + } + } + eol_ = FindLineFeed(); + if (eol_ == NULL) { // '\n' not found. Malformed line. + return false; + } + *eol_ = '\0'; // Replace '\n' with '\0'. + + *bol = bol_; + *eol = eol_; + return true; + } + + // Beginning of line. + const char *bol() { + return bol_; + } + + // End of line. + const char *eol() { + return eol_; + } + + private: + explicit LineReader(const LineReader&); + void operator=(const LineReader&); + + char *FindLineFeed() { + return reinterpret_cast<char *>(memchr(bol_, '\n', eod_ - bol_)); + } + + bool BufferIsEmpty() { + return buf_ == eod_; + } + + bool HasCompleteLine() { + return !BufferIsEmpty() && FindLineFeed() != NULL; + } + + const int fd_; + char * const buf_; + const int buf_len_; + char *bol_; + char *eol_; + const char *eod_; // End of data in "buf_". +}; +} // namespace + +// Place the hex number read from "start" into "*hex". The pointer to +// the first non-hex character or "end" is returned. +static char *GetHex(const char *start, const char *end, uint64_t *hex) { + *hex = 0; + const char *p; + for (p = start; p < end; ++p) { + int ch = *p; + if ((ch >= '0' && ch <= '9') || + (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f')) { + *hex = (*hex << 4) | (ch < 'A' ? ch - '0' : (ch & 0xF) + 9); + } else { // Encountered the first non-hex character. + break; + } + } + SAFE_ASSERT(p <= end); + return const_cast<char *>(p); +} + +// Search for the object file (from /proc/self/maps) that contains +// the specified pc. If found, open this file and return the file handle, +// and also set start_address to the start address of where this object +// file is mapped to in memory. Otherwise, return -1. +static ATTRIBUTE_NOINLINE int +OpenObjectFileContainingPcAndGetStartAddress(uint64_t pc, + uint64_t &start_address) { + int object_fd; + + // Open /proc/self/maps. + int maps_fd; + NO_INTR(maps_fd = open("/proc/self/maps", O_RDONLY)); + FileDescriptor wrapped_maps_fd(maps_fd); + if (wrapped_maps_fd.get() < 0) { + return -1; + } + + // Iterate over maps and look for the map containing the pc. Then + // look into the symbol tables inside. + char buf[1024]; // Big enough for line of sane /proc/self/maps + LineReader reader(wrapped_maps_fd.get(), buf, sizeof(buf)); + while (true) { + const char *cursor; + const char *eol; + if (!reader.ReadLine(&cursor, &eol)) { // EOF or malformed line. + return -1; + } + + // Start parsing line in /proc/self/maps. Here is an example: + // + // 08048000-0804c000 r-xp 00000000 08:01 2142121 /bin/cat + // + // We want start address (08048000), end address (0804c000), flags + // (r-xp) and file name (/bin/cat). + + // Read start address. + cursor = GetHex(cursor, eol, &start_address); + if (cursor == eol || *cursor != '-') { + return -1; // Malformed line. + } + ++cursor; // Skip '-'. + + // Read end address. + uint64_t end_address; + cursor = GetHex(cursor, eol, &end_address); + if (cursor == eol || *cursor != ' ') { + return -1; // Malformed line. + } + ++cursor; // Skip ' '. + + // Check start and end addresses. + if (!(start_address <= pc && pc < end_address)) { + continue; // We skip this map. PC isn't in this map. + } + + // Read flags. Skip flags until we encounter a space or eol. + const char * const flags_start = cursor; + while (cursor < eol && *cursor != ' ') { + ++cursor; + } + // We expect at least four letters for flags (ex. "r-xp"). + if (cursor == eol || cursor < flags_start + 4) { + return -1; // Malformed line. + } + + // Check flags. We are only interested in "r-x" maps. + if (memcmp(flags_start, "r-x", 3) != 0) { // Not a "r-x" map. + continue; // We skip this map. + } + ++cursor; // Skip ' '. + + // Skip to file name. "cursor" now points to file offset. We need to + // skip at least three spaces for file offset, dev, and inode. + int num_spaces = 0; + while (cursor < eol) { + if (*cursor == ' ') { + ++num_spaces; + } else if (num_spaces >= 3) { + // The first non-space character after skipping three spaces + // is the beginning of the file name. + break; + } + ++cursor; + } + if (cursor == eol) { + return -1; // Malformed line. + } + + // Finally, "cursor" now points to file name of our interest. + NO_INTR(object_fd = open(cursor, O_RDONLY)); + if (object_fd < 0) { + return -1; + } + return object_fd; + } +} + +// The implementation of our symbolization routine. If it +// successfully finds the symbol containing "pc" and obtains the +// symbol name, returns true and write the symbol name to "out". +// Otherwise, returns false. If Callback function is installed via +// InstallSymbolizeCallback(), the function is also called in this function, +// and "out" is used as its output. +// To keep stack consumption low, we would like this function to not +// get inlined. +static ATTRIBUTE_NOINLINE bool SymbolizeAndDemangle(void *pc, char *out, + int out_size) { + uint64_t pc0 = reinterpret_cast<uintptr_t>(pc); + uint64_t start_address = 0; + + int object_fd = OpenObjectFileContainingPcAndGetStartAddress(pc0, + start_address); + if (object_fd == -1) { + return false; + } + FileDescriptor wrapped_object_fd(object_fd); + int elf_type = FileGetElfType(wrapped_object_fd.get()); + if (elf_type == -1) { + return false; + } + if (g_symbolize_callback) { + // Run the call back if it's installed. + // Note: relocation (and much of the rest of this code) will be + // wrong for prelinked shared libraries and PIE executables. + uint64 relocation = (elf_type == ET_DYN) ? start_address : 0; + int num_bytes_written = g_symbolize_callback(wrapped_object_fd.get(), + pc, out, out_size, + relocation); + if (num_bytes_written > 0) { + out += num_bytes_written; + out_size -= num_bytes_written; + } + } + if (!GetSymbolFromObjectFile(wrapped_object_fd.get(), pc0, + out, out_size, start_address)) { + return false; + } + + // Symbolization succeeded. Now we try to demangle the symbol. + DemangleInplace(out, out_size); + return true; +} + +_END_GOOGLE_NAMESPACE_ + +#elif defined(OS_MACOSX) && defined(HAVE_DLADDR) + +#include <dlfcn.h> +#include <string.h> + +_START_GOOGLE_NAMESPACE_ + +static ATTRIBUTE_NOINLINE bool SymbolizeAndDemangle(void *pc, char *out, + int out_size) { + Dl_info info; + if (dladdr(pc, &info)) { + if (strlen(info.dli_sname) < out_size) { + strcpy(out, info.dli_sname); + // Symbolization succeeded. Now we try to demangle the symbol. + DemangleInplace(out, out_size); + return true; + } + } + return false; +} + +_END_GOOGLE_NAMESPACE_ + +#else +# error BUG: HAVE_SYMBOLIZE was wrongly set +#endif + +_START_GOOGLE_NAMESPACE_ + +bool Symbolize(void *pc, char *out, int out_size) { + SAFE_ASSERT(out_size >= 0); + return SymbolizeAndDemangle(pc, out, out_size); +} + +_END_GOOGLE_NAMESPACE_ + +#else /* HAVE_SYMBOLIZE */ + +#include <assert.h> + +#include "config.h" + +_START_GOOGLE_NAMESPACE_ + +// TODO: Support other environments. +bool Symbolize(void *pc, char *out, int out_size) { + assert(0); + return false; +} + +_END_GOOGLE_NAMESPACE_ + +#endif diff --git a/extern/libmv/third_party/glog/src/symbolize.h b/extern/libmv/third_party/glog/src/symbolize.h new file mode 100644 index 00000000000..1ebe4dd94a2 --- /dev/null +++ b/extern/libmv/third_party/glog/src/symbolize.h @@ -0,0 +1,116 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Satoru Takabayashi +// +// This library provides Symbolize() function that symbolizes program +// counters to their corresponding symbol names on linux platforms. +// This library has a minimal implementation of an ELF symbol table +// reader (i.e. it doesn't depend on libelf, etc.). +// +// The algorithm used in Symbolize() is as follows. +// +// 1. Go through a list of maps in /proc/self/maps and find the map +// containing the program counter. +// +// 2. Open the mapped file and find a regular symbol table inside. +// Iterate over symbols in the symbol table and look for the symbol +// containing the program counter. If such a symbol is found, +// obtain the symbol name, and demangle the symbol if possible. +// If the symbol isn't found in the regular symbol table (binary is +// stripped), try the same thing with a dynamic symbol table. +// +// Note that Symbolize() is originally implemented to be used in +// FailureSignalHandler() in base/google.cc. Hence it doesn't use +// malloc() and other unsafe operations. It should be both +// thread-safe and async-signal-safe. + +#ifndef BASE_SYMBOLIZE_H_ +#define BASE_SYMBOLIZE_H_ + +#include "utilities.h" +#include "config.h" +#include "glog/logging.h" + +#ifdef HAVE_SYMBOLIZE + +#if defined(__ELF__) // defined by gcc on Linux +#include <elf.h> +#include <link.h> // For ElfW() macro. + +// If there is no ElfW macro, let's define it by ourself. +#ifndef ElfW +# if SIZEOF_VOID_P == 4 +# define ElfW(type) Elf32_##type +# elif SIZEOF_VOID_P == 8 +# define ElfW(type) Elf64_##type +# else +# error "Unknown sizeof(void *)" +# endif +#endif + +_START_GOOGLE_NAMESPACE_ + +// Gets the section header for the given name, if it exists. Returns true on +// success. Otherwise, returns false. +bool GetSectionHeaderByName(int fd, const char *name, size_t name_len, + ElfW(Shdr) *out); + +_END_GOOGLE_NAMESPACE_ + +#endif /* __ELF__ */ + +_START_GOOGLE_NAMESPACE_ + +// Installs a callback function, which will be called right before a symbol name +// is printed. The callback is intended to be used for showing a file name and a +// line number preceding a symbol name. +// "fd" is a file descriptor of the object file containing the program +// counter "pc". The callback function should write output to "out" +// and return the size of the output written. On error, the callback +// function should return -1. +typedef int (*SymbolizeCallback)(int fd, void *pc, char *out, size_t out_size, + uint64 relocation); +void InstallSymbolizeCallback(SymbolizeCallback callback); + +_END_GOOGLE_NAMESPACE_ + +#endif + +_START_GOOGLE_NAMESPACE_ + +// Symbolizes a program counter. On success, returns true and write the +// symbol name to "out". The symbol name is demangled if possible +// (supports symbols generated by GCC 3.x or newer). Otherwise, +// returns false. +bool Symbolize(void *pc, char *out, int out_size); + +_END_GOOGLE_NAMESPACE_ + +#endif // BASE_SYMBOLIZE_H_ diff --git a/extern/libmv/third_party/glog/src/utilities.cc b/extern/libmv/third_party/glog/src/utilities.cc new file mode 100644 index 00000000000..e97d4f237ec --- /dev/null +++ b/extern/libmv/third_party/glog/src/utilities.cc @@ -0,0 +1,335 @@ +// Copyright (c) 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Shinichiro Hamaji + +#include "utilities.h" + +#include <stdio.h> +#include <stdlib.h> + +#include <signal.h> +#ifdef HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#include <time.h> +#if defined(HAVE_SYSCALL_H) +#include <syscall.h> // for syscall() +#elif defined(HAVE_SYS_SYSCALL_H) +#include <sys/syscall.h> // for syscall() +#endif +#ifdef HAVE_SYSLOG_H +# include <syslog.h> +#endif + +#include "base/googleinit.h" + +using std::string; + +_START_GOOGLE_NAMESPACE_ + +static const char* g_program_invocation_short_name = NULL; +static pthread_t g_main_thread_id; + +_END_GOOGLE_NAMESPACE_ + +// The following APIs are all internal. +#ifdef HAVE_STACKTRACE + +#include "stacktrace.h" +#include "symbolize.h" +#include "base/commandlineflags.h" + +GLOG_DEFINE_bool(symbolize_stacktrace, true, + "Symbolize the stack trace in the tombstone"); + +_START_GOOGLE_NAMESPACE_ + +typedef void DebugWriter(const char*, void*); + +// The %p field width for printf() functions is two characters per byte. +// For some environments, add two extra bytes for the leading "0x". +static const int kPrintfPointerFieldWidth = 2 + 2 * sizeof(void*); + +static void DebugWriteToStderr(const char* data, void *unused) { + // This one is signal-safe. + write(STDERR_FILENO, data, strlen(data)); +} + +void DebugWriteToString(const char* data, void *arg) { + reinterpret_cast<string*>(arg)->append(data); +} + +#ifdef HAVE_SYMBOLIZE +// Print a program counter and its symbol name. +static void DumpPCAndSymbol(DebugWriter *writerfn, void *arg, void *pc, + const char * const prefix) { + char tmp[1024]; + const char *symbol = "(unknown)"; + // Symbolizes the previous address of pc because pc may be in the + // next function. The overrun happens when the function ends with + // a call to a function annotated noreturn (e.g. CHECK). + if (Symbolize(reinterpret_cast<char *>(pc) - 1, tmp, sizeof(tmp))) { + symbol = tmp; + } + char buf[1024]; + snprintf(buf, sizeof(buf), "%s@ %*p %s\n", + prefix, kPrintfPointerFieldWidth, pc, symbol); + writerfn(buf, arg); +} +#endif + +static void DumpPC(DebugWriter *writerfn, void *arg, void *pc, + const char * const prefix) { + char buf[100]; + snprintf(buf, sizeof(buf), "%s@ %*p\n", + prefix, kPrintfPointerFieldWidth, pc); + writerfn(buf, arg); +} + +// Dump current stack trace as directed by writerfn +static void DumpStackTrace(int skip_count, DebugWriter *writerfn, void *arg) { + // Print stack trace + void* stack[32]; + int depth = GetStackTrace(stack, ARRAYSIZE(stack), skip_count+1); + for (int i = 0; i < depth; i++) { +#if defined(HAVE_SYMBOLIZE) + if (FLAGS_symbolize_stacktrace) { + DumpPCAndSymbol(writerfn, arg, stack[i], " "); + } else { + DumpPC(writerfn, arg, stack[i], " "); + } +#else + DumpPC(writerfn, arg, stack[i], " "); +#endif + } +} + +static void DumpStackTraceAndExit() { + DumpStackTrace(1, DebugWriteToStderr, NULL); + + // Set the default signal handler for SIGABRT, to avoid invoking our + // own signal handler installed by InstallFailedSignalHandler(). + struct sigaction sig_action; + memset(&sig_action, 0, sizeof(sig_action)); + sigemptyset(&sig_action.sa_mask); + sig_action.sa_handler = SIG_DFL; + sigaction(SIGABRT, &sig_action, NULL); + + abort(); +} + +_END_GOOGLE_NAMESPACE_ + +#endif // HAVE_STACKTRACE + +_START_GOOGLE_NAMESPACE_ + +namespace glog_internal_namespace_ { + +const char* ProgramInvocationShortName() { + if (g_program_invocation_short_name != NULL) { + return g_program_invocation_short_name; + } else { + // TODO(hamaji): Use /proc/self/cmdline and so? + return "UNKNOWN"; + } +} + +bool IsGoogleLoggingInitialized() { + return g_program_invocation_short_name != NULL; +} + +bool is_default_thread() { + if (g_program_invocation_short_name == NULL) { + // InitGoogleLogging() not yet called, so unlikely to be in a different + // thread + return true; + } else { + return pthread_equal(pthread_self(), g_main_thread_id); + } +} + +#ifdef OS_WINDOWS +struct timeval { + long tv_sec, tv_usec; +}; + +// Based on: http://www.google.com/codesearch/p?hl=en#dR3YEbitojA/os_win32.c&q=GetSystemTimeAsFileTime%20license:bsd +// See COPYING for copyright information. +static int gettimeofday(struct timeval *tv, void* tz) { +#define EPOCHFILETIME (116444736000000000ULL) + FILETIME ft; + LARGE_INTEGER li; + uint64 tt; + + GetSystemTimeAsFileTime(&ft); + li.LowPart = ft.dwLowDateTime; + li.HighPart = ft.dwHighDateTime; + tt = (li.QuadPart - EPOCHFILETIME) / 10; + tv->tv_sec = tt / 1000000; + tv->tv_usec = tt % 1000000; + + return 0; +} +#endif + +int64 CycleClock_Now() { + // TODO(hamaji): temporary impementation - it might be too slow. + struct timeval tv; + gettimeofday(&tv, NULL); + return static_cast<int64>(tv.tv_sec) * 1000000 + tv.tv_usec; +} + +int64 UsecToCycles(int64 usec) { + return usec; +} + +WallTime WallTime_Now() { + // Now, cycle clock is retuning microseconds since the epoch. + return CycleClock_Now() * 0.000001; +} + +static int32 g_main_thread_pid = getpid(); +int32 GetMainThreadPid() { + return g_main_thread_pid; +} + +pid_t GetTID() { + // On Linux and FreeBSD, we try to use gettid(). +#if defined OS_LINUX || defined OS_FREEBSD || defined OS_MACOSX +#ifndef __NR_gettid +#ifdef OS_MACOSX +#define __NR_gettid SYS_gettid +#elif ! defined __i386__ +#error "Must define __NR_gettid for non-x86 platforms" +#else +#define __NR_gettid 224 +#endif +#endif + static bool lacks_gettid = false; + if (!lacks_gettid) { + pid_t tid = syscall(__NR_gettid); + if (tid != -1) { + return tid; + } + // Technically, this variable has to be volatile, but there is a small + // performance penalty in accessing volatile variables and there should + // not be any serious adverse effect if a thread does not immediately see + // the value change to "true". + lacks_gettid = true; + } +#endif // OS_LINUX || OS_FREEBSD + + // If gettid() could not be used, we use one of the following. +#if defined OS_LINUX + return getpid(); // Linux: getpid returns thread ID when gettid is absent +#elif defined OS_WINDOWS || defined OS_CYGWIN + return GetCurrentThreadId(); +#else + // If none of the techniques above worked, we use pthread_self(). + return (pid_t)(uintptr_t)pthread_self(); +#endif +} + +const char* const_basename(const char* filepath) { + const char* base = strrchr(filepath, '/'); +#ifdef OS_WINDOWS // Look for either path separator in Windows + if (!base) + base = strrchr(filepath, '\\'); +#endif + return base ? (base+1) : filepath; +} + +static string g_my_user_name; +const string& MyUserName() { + return g_my_user_name; +} +static void MyUserNameInitializer() { + // TODO(hamaji): Probably this is not portable. +#if defined(OS_WINDOWS) + const char* user = getenv("USERNAME"); +#else + const char* user = getenv("USER"); +#endif + if (user != NULL) { + g_my_user_name = user; + } else { + g_my_user_name = "invalid-user"; + } +} +REGISTER_MODULE_INITIALIZER(utilities, MyUserNameInitializer()); + +#ifdef HAVE_STACKTRACE +void DumpStackTraceToString(string* stacktrace) { + DumpStackTrace(1, DebugWriteToString, stacktrace); +} +#endif + +// We use an atomic operation to prevent problems with calling CrashReason +// from inside the Mutex implementation (potentially through RAW_CHECK). +static const CrashReason* g_reason = 0; + +void SetCrashReason(const CrashReason* r) { + sync_val_compare_and_swap(&g_reason, + reinterpret_cast<const CrashReason*>(0), + r); +} + +} // namespace glog_internal_namespace_ + +void InitGoogleLogging(const char* argv0) { + CHECK(!IsGoogleLoggingInitialized()) + << "You called InitGoogleLogging() twice!"; + const char* slash = strrchr(argv0, '/'); +#ifdef OS_WINDOWS + if (!slash) slash = strrchr(argv0, '\\'); +#endif + g_program_invocation_short_name = slash ? slash + 1 : argv0; + g_main_thread_id = pthread_self(); + +#ifdef HAVE_STACKTRACE + InstallFailureFunction(&DumpStackTraceAndExit); +#endif +} + +void ShutdownGoogleLogging() { + CHECK(IsGoogleLoggingInitialized()) + << "You called ShutdownGoogleLogging() without InitGoogleLogging() first!"; +#ifdef HAVE_SYSLOG_H + closelog(); +#endif +} + +_END_GOOGLE_NAMESPACE_ + +// Make an implementation of stacktrace compiled. +#ifdef STACKTRACE_H +# include STACKTRACE_H +#endif diff --git a/extern/libmv/third_party/glog/src/utilities.h b/extern/libmv/third_party/glog/src/utilities.h new file mode 100644 index 00000000000..2d4e99e595e --- /dev/null +++ b/extern/libmv/third_party/glog/src/utilities.h @@ -0,0 +1,222 @@ +// Copyright (c) 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Shinichiro Hamaji +// +// Define utilties for glog internal usage. + +#ifndef UTILITIES_H__ +#define UTILITIES_H__ + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) +# define OS_WINDOWS +#elif defined(__CYGWIN__) || defined(__CYGWIN32__) +# define OS_CYGWIN +#elif defined(linux) || defined(__linux) || defined(__linux__) +# define OS_LINUX +#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) +# define OS_MACOSX +#elif defined(__FreeBSD__) +# define OS_FREEBSD +#elif defined(__NetBSD__) +# define OS_NETBSD +#elif defined(__OpenBSD__) +# define OS_OPENBSD +#else +// TODO(hamaji): Add other platforms. +#endif + +// printf macros for size_t, in the style of inttypes.h +#ifdef _LP64 +#define __PRIS_PREFIX "z" +#else +#define __PRIS_PREFIX +#endif + +// Use these macros after a % in a printf format string +// to get correct 32/64 bit behavior, like this: +// size_t size = records.size(); +// printf("%"PRIuS"\n", size); + +#define PRIdS __PRIS_PREFIX "d" +#define PRIxS __PRIS_PREFIX "x" +#define PRIuS __PRIS_PREFIX "u" +#define PRIXS __PRIS_PREFIX "X" +#define PRIoS __PRIS_PREFIX "o" + +#include "base/mutex.h" // This must go first so we get _XOPEN_SOURCE + +#include <string> + +#if defined(OS_WINDOWS) +# include "port.h" +#endif + +#include "config.h" +#include <glog/logging.h> + +// There are three different ways we can try to get the stack trace: +// +// 1) The libunwind library. This is still in development, and as a +// separate library adds a new dependency, but doesn't need a frame +// pointer. It also doesn't call malloc. +// +// 2) Our hand-coded stack-unwinder. This depends on a certain stack +// layout, which is used by gcc (and those systems using a +// gcc-compatible ABI) on x86 systems, at least since gcc 2.95. +// It uses the frame pointer to do its work. +// +// 3) The gdb unwinder -- also the one used by the c++ exception code. +// It's obviously well-tested, but has a fatal flaw: it can call +// malloc() from the unwinder. This is a problem because we're +// trying to use the unwinder to instrument malloc(). +// +// Note: if you add a new implementation here, make sure it works +// correctly when GetStackTrace() is called with max_depth == 0. +// Some code may do that. + +#if defined(HAVE_LIB_UNWIND) +# define STACKTRACE_H "stacktrace_libunwind-inl.h" +#elif !defined(NO_FRAME_POINTER) +# if defined(__i386__) && __GNUC__ >= 2 +# define STACKTRACE_H "stacktrace_x86-inl.h" +# elif defined(__x86_64__) && __GNUC__ >= 2 +# define STACKTRACE_H "stacktrace_x86_64-inl.h" +# elif (defined(__ppc__) || defined(__PPC__)) && __GNUC__ >= 2 +# define STACKTRACE_H "stacktrace_powerpc-inl.h" +# endif +#endif + +#if !defined(STACKTRACE_H) && defined(HAVE_EXECINFO_H) +# define STACKTRACE_H "stacktrace_generic-inl.h" +#endif + +#if defined(STACKTRACE_H) +# define HAVE_STACKTRACE +#endif + +// defined by gcc +#if defined(__ELF__) && defined(OS_LINUX) +# define HAVE_SYMBOLIZE +#elif defined(OS_MACOSX) && defined(HAVE_DLADDR) +// Use dladdr to symbolize. +# define HAVE_SYMBOLIZE +#endif + +#ifndef ARRAYSIZE +// There is a better way, but this is good enough for our purpose. +# define ARRAYSIZE(a) (sizeof(a) / sizeof(*(a))) +#endif + +_START_GOOGLE_NAMESPACE_ + +namespace glog_internal_namespace_ { + +#ifdef HAVE___ATTRIBUTE__ +# define ATTRIBUTE_NOINLINE __attribute__ ((noinline)) +# define HAVE_ATTRIBUTE_NOINLINE +#else +# define ATTRIBUTE_NOINLINE +#endif + +const char* ProgramInvocationShortName(); + +bool IsGoogleLoggingInitialized(); + +bool is_default_thread(); + +int64 CycleClock_Now(); + +int64 UsecToCycles(int64 usec); + +typedef double WallTime; +WallTime WallTime_Now(); + +int32 GetMainThreadPid(); + +pid_t GetTID(); + +const std::string& MyUserName(); + +// Get the part of filepath after the last path separator. +// (Doesn't modify filepath, contrary to basename() in libgen.h.) +const char* const_basename(const char* filepath); + +// Wrapper of __sync_val_compare_and_swap. If the GCC extension isn't +// defined, we try the CPU specific logics (we only support x86 and +// x86_64 for now) first, then use a naive implementation, which has a +// race condition. +template<typename T> +inline T sync_val_compare_and_swap(T* ptr, T oldval, T newval) { +#if defined(HAVE___SYNC_VAL_COMPARE_AND_SWAP) + return __sync_val_compare_and_swap(ptr, oldval, newval); +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) + T ret; + __asm__ __volatile__("lock; cmpxchg %1, (%2);" + :"=a"(ret) + // GCC may produces %sil or %dil for + // constraint "r", but some of apple's gas + // dosn't know the 8 bit registers. + // We use "q" to avoid these registers. + :"q"(newval), "q"(ptr), "a"(oldval) + :"memory", "cc"); + return ret; +#else + T ret = *ptr; + if (ret == oldval) { + *ptr = newval; + } + return ret; +#endif +} + +void DumpStackTraceToString(std::string* stacktrace); + +struct CrashReason { + CrashReason() : filename(0), line_number(0), message(0), depth(0) {} + + const char* filename; + int line_number; + const char* message; + + // We'll also store a bit of stack trace context at the time of crash as + // it may not be available later on. + void* stack[32]; + int depth; +}; + +void SetCrashReason(const CrashReason* r); + +} // namespace glog_internal_namespace_ + +_END_GOOGLE_NAMESPACE_ + +using namespace GOOGLE_NAMESPACE::glog_internal_namespace_; + +#endif // UTILITIES_H__ diff --git a/extern/libmv/third_party/glog/src/vlog_is_on.cc b/extern/libmv/third_party/glog/src/vlog_is_on.cc new file mode 100644 index 00000000000..ed88514dce5 --- /dev/null +++ b/extern/libmv/third_party/glog/src/vlog_is_on.cc @@ -0,0 +1,249 @@ +// Copyright (c) 1999, 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Ray Sidney and many others +// +// Broken out from logging.cc by Soren Lassen +// logging_unittest.cc covers the functionality herein + +#include "utilities.h" + +#include <string.h> +#include <stdlib.h> +#include <errno.h> +#include <cstdio> +#include <string> +#include "base/commandlineflags.h" +#include <glog/logging.h> +#include <glog/raw_logging.h> +#include "base/googleinit.h" + +// glog doesn't have annotation +#define ANNOTATE_BENIGN_RACE(address, description) + +using std::string; + +GLOG_DEFINE_int32(v, 0, "Show all VLOG(m) messages for m <= this." +" Overridable by --vmodule."); + +GLOG_DEFINE_string(vmodule, "", "per-module verbose level." +" Argument is a comma-separated list of <module name>=<log level>." +" <module name> is a glob pattern, matched against the filename base" +" (that is, name ignoring .cc/.h./-inl.h)." +" <log level> overrides any value given by --v."); + +_START_GOOGLE_NAMESPACE_ + +namespace glog_internal_namespace_ { + +// Implementation of fnmatch that does not need 0-termination +// of arguments and does not allocate any memory, +// but we only support "*" and "?" wildcards, not the "[...]" patterns. +// It's not a static function for the unittest. +GOOGLE_GLOG_DLL_DECL bool SafeFNMatch_(const char* pattern, + size_t patt_len, + const char* str, + size_t str_len) { + int p = 0; + int s = 0; + while (1) { + if (p == patt_len && s == str_len) return true; + if (p == patt_len) return false; + if (s == str_len) return p+1 == patt_len && pattern[p] == '*'; + if (pattern[p] == str[s] || pattern[p] == '?') { + p += 1; + s += 1; + continue; + } + if (pattern[p] == '*') { + if (p+1 == patt_len) return true; + do { + if (SafeFNMatch_(pattern+(p+1), patt_len-(p+1), str+s, str_len-s)) { + return true; + } + s += 1; + } while (s != str_len); + return false; + } + return false; + } +} + +} // namespace glog_internal_namespace_ + +using glog_internal_namespace_::SafeFNMatch_; + +int32 kLogSiteUninitialized = 1000; + +// List of per-module log levels from FLAGS_vmodule. +// Once created each element is never deleted/modified +// except for the vlog_level: other threads will read VModuleInfo blobs +// w/o locks and we'll store pointers to vlog_level at VLOG locations +// that will never go away. +// We can't use an STL struct here as we wouldn't know +// when it's safe to delete/update it: other threads need to use it w/o locks. +struct VModuleInfo { + string module_pattern; + mutable int32 vlog_level; // Conceptually this is an AtomicWord, but it's + // too much work to use AtomicWord type here + // w/o much actual benefit. + const VModuleInfo* next; +}; + +// This protects the following global variables. +static Mutex vmodule_lock; +// Pointer to head of the VModuleInfo list. +// It's a map from module pattern to logging level for those module(s). +static VModuleInfo* vmodule_list = 0; +// Boolean initialization flag. +static bool inited_vmodule = false; + +// L >= vmodule_lock. +static void VLOG2Initializer() { + vmodule_lock.AssertHeld(); + // Can now parse --vmodule flag and initialize mapping of module-specific + // logging levels. + inited_vmodule = false; + const char* vmodule = FLAGS_vmodule.c_str(); + const char* sep; + VModuleInfo* head = NULL; + VModuleInfo* tail = NULL; + while ((sep = strchr(vmodule, '=')) != NULL) { + string pattern(vmodule, sep - vmodule); + int module_level; + if (sscanf(sep, "=%d", &module_level) == 1) { + VModuleInfo* info = new VModuleInfo; + info->module_pattern = pattern; + info->vlog_level = module_level; + if (head) tail->next = info; + else head = info; + tail = info; + } + // Skip past this entry + vmodule = strchr(sep, ','); + if (vmodule == NULL) break; + vmodule++; // Skip past "," + } + if (head) { // Put them into the list at the head: + tail->next = vmodule_list; + vmodule_list = head; + } + inited_vmodule = true; +} + +// This can be called very early, so we use SpinLock and RAW_VLOG here. +int SetVLOGLevel(const char* module_pattern, int log_level) { + int result = FLAGS_v; + int const pattern_len = strlen(module_pattern); + bool found = false; + MutexLock l(&vmodule_lock); // protect whole read-modify-write + for (const VModuleInfo* info = vmodule_list; + info != NULL; info = info->next) { + if (info->module_pattern == module_pattern) { + if (!found) { + result = info->vlog_level; + found = true; + } + info->vlog_level = log_level; + } else if (!found && + SafeFNMatch_(info->module_pattern.c_str(), + info->module_pattern.size(), + module_pattern, pattern_len)) { + result = info->vlog_level; + found = true; + } + } + if (!found) { + VModuleInfo* info = new VModuleInfo; + info->module_pattern = module_pattern; + info->vlog_level = log_level; + info->next = vmodule_list; + vmodule_list = info; + } + RAW_VLOG(1, "Set VLOG level for \"%s\" to %d", module_pattern, log_level); + return result; +} + +// NOTE: Individual VLOG statements cache the integer log level pointers. +// NOTE: This function must not allocate memory or require any locks. +bool InitVLOG3__(int32** site_flag, int32* site_default, + const char* fname, int32 verbose_level) { + MutexLock l(&vmodule_lock); + bool read_vmodule_flag = inited_vmodule; + if (!read_vmodule_flag) { + VLOG2Initializer(); + } + + // protect the errno global in case someone writes: + // VLOG(..) << "The last error was " << strerror(errno) + int old_errno = errno; + + // site_default normally points to FLAGS_v + int32* site_flag_value = site_default; + + // Get basename for file + const char* base = strrchr(fname, '/'); + base = base ? (base+1) : fname; + const char* base_end = strchr(base, '.'); + size_t base_length = base_end ? (base_end - base) : strlen(base); + + // Trim out trailing "-inl" if any + if (base_length >= 4 && (memcmp(base+base_length-4, "-inl", 4) == 0)) { + base_length -= 4; + } + + // TODO: Trim out _unittest suffix? Perhaps it is better to have + // the extra control and just leave it there. + + // find target in vector of modules, replace site_flag_value with + // a module-specific verbose level, if any. + for (const VModuleInfo* info = vmodule_list; + info != NULL; info = info->next) { + if (SafeFNMatch_(info->module_pattern.c_str(), info->module_pattern.size(), + base, base_length)) { + site_flag_value = &info->vlog_level; + // value at info->vlog_level is now what controls + // the VLOG at the caller site forever + break; + } + } + + // Cache the vlog value pointer if --vmodule flag has been parsed. + ANNOTATE_BENIGN_RACE(site_flag, + "*site_flag may be written by several threads," + " but the value will be the same"); + if (read_vmodule_flag) *site_flag = site_flag_value; + + // restore the errno in case something recoverable went wrong during + // the initialization of the VLOG mechanism (see above note "protect the..") + errno = old_errno; + return *site_flag_value >= verbose_level; +} + +_END_GOOGLE_NAMESPACE_ diff --git a/extern/libmv/third_party/glog/src/windows/config.h b/extern/libmv/third_party/glog/src/windows/config.h new file mode 100644 index 00000000000..682a1b9309d --- /dev/null +++ b/extern/libmv/third_party/glog/src/windows/config.h @@ -0,0 +1,136 @@ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Namespace for Google classes */ +#define GOOGLE_NAMESPACE google + +/* Define if you have the `dladdr' function */ +#undef HAVE_DLADDR + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the <execinfo.h> header file. */ +#undef HAVE_EXECINFO_H + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the <libunwind.h> header file. */ +#undef HAVE_LIBUNWIND_H + +/* define if you have google gflags library */ +#define HAVE_LIB_GFLAGS 1 + +/* define if you have libunwind */ +#undef HAVE_LIB_UNWIND + +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* define if the compiler implements namespaces */ +#undef HAVE_NAMESPACES + +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* define if the compiler implements pthread_rwlock_* */ +#undef HAVE_RWLOCK + +/* Define if you have the `sigaltstack' function */ +#undef HAVE_SIGALTSTACK + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the <syscall.h> header file. */ +#undef HAVE_SYSCALL_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/syscall.h> header file. */ +#undef HAVE_SYS_SYSCALL_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <ucontext.h> header file. */ +#undef HAVE_UCONTEXT_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* define if the compiler supports using expression for operator */ +#undef HAVE_USING_OPERATOR + +/* define if your compiler has __attribute__ */ +#undef HAVE___ATTRIBUTE__ + +/* define if your compiler has __builtin_expect */ +#undef HAVE___BUILTIN_EXPECT + +/* define if your compiler has __sync_val_compare_and_swap */ +#undef HAVE___SYNC_VAL_COMPARE_AND_SWAP + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* How to access the PC from a struct ucontext */ +#undef PC_FROM_UCONTEXT + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* The size of `void *', as computed by sizeof. */ +#undef SIZEOF_VOID_P + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* the namespace where STL code like vector<> is defined */ +#undef STL_NAMESPACE + +/* Version number of package */ +#undef VERSION + +/* Stops putting the code inside the Google namespace */ +#define _END_GOOGLE_NAMESPACE_ } + +/* Puts following code inside the Google namespace */ +#define _START_GOOGLE_NAMESPACE_ namespace google { + +/* Always the empty-string on non-windows systems. On windows, should be + "__declspec(dllexport)". This way, when we compile the dll, we export our + functions/classes. It's safe to define this here because config.h is only + used internally, to compile the DLL, and every DLL source file #includes + "config.h" before anything else. */ +#ifndef GOOGLE_GLOG_DLL_DECL +# define GOOGLE_GLOG_IS_A_DLL 1 /* not set if you're statically linking */ +# define GOOGLE_GLOG_DLL_DECL __declspec(dllexport) +# define GOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS __declspec(dllimport) +#endif diff --git a/extern/libmv/third_party/glog/src/windows/glog/log_severity.h b/extern/libmv/third_party/glog/src/windows/glog/log_severity.h new file mode 100644 index 00000000000..5e7d09effb2 --- /dev/null +++ b/extern/libmv/third_party/glog/src/windows/glog/log_severity.h @@ -0,0 +1,88 @@ +// This file is automatically generated from src/glog/log_severity.h +// using src/windows/preprocess.sh. +// DO NOT EDIT! + +// Copyright (c) 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef BASE_LOG_SEVERITY_H__ +#define BASE_LOG_SEVERITY_H__ + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +// Variables of type LogSeverity are widely taken to lie in the range +// [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if +// you ever need to change their values or add a new severity. +typedef int LogSeverity; + +const int INFO = 0, WARNING = 1, ERROR = 2, FATAL = 3, NUM_SEVERITIES = 4; + +// DFATAL is FATAL in debug mode, ERROR in normal mode +#ifdef NDEBUG +#define DFATAL_LEVEL ERROR +#else +#define DFATAL_LEVEL FATAL +#endif + +extern GOOGLE_GLOG_DLL_DECL const char* const LogSeverityNames[NUM_SEVERITIES]; + +// NDEBUG usage helpers related to (RAW_)DCHECK: +// +// DEBUG_MODE is for small !NDEBUG uses like +// if (DEBUG_MODE) foo.CheckThatFoo(); +// instead of substantially more verbose +// #ifndef NDEBUG +// foo.CheckThatFoo(); +// #endif +// +// IF_DEBUG_MODE is for small !NDEBUG uses like +// IF_DEBUG_MODE( string error; ) +// DCHECK(Foo(&error)) << error; +// instead of substantially more verbose +// #ifndef NDEBUG +// string error; +// DCHECK(Foo(&error)) << error; +// #endif +// +#ifdef NDEBUG +enum { DEBUG_MODE = 0 }; +#define IF_DEBUG_MODE(x) +#else +enum { DEBUG_MODE = 1 }; +#define IF_DEBUG_MODE(x) x +#endif + +#endif // BASE_LOG_SEVERITY_H__ diff --git a/extern/libmv/third_party/glog/src/windows/glog/logging.h b/extern/libmv/third_party/glog/src/windows/glog/logging.h new file mode 100644 index 00000000000..de51586f8e3 --- /dev/null +++ b/extern/libmv/third_party/glog/src/windows/glog/logging.h @@ -0,0 +1,1510 @@ +// This file is automatically generated from src/glog/logging.h.in +// using src/windows/preprocess.sh. +// DO NOT EDIT! + +// Copyright (c) 1999, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Ray Sidney +// +// This file contains #include information about logging-related stuff. +// Pretty much everybody needs to #include this file so that they can +// log various happenings. +// +#ifndef _LOGGING_H_ +#define _LOGGING_H_ + +#include <errno.h> +#include <string.h> +#include <time.h> +#include <string> +#if 0 +# include <unistd.h> +#endif +#ifdef __DEPRECATED +// Make GCC quiet. +# undef __DEPRECATED +# include <strstream> +# define __DEPRECATED +#else +# include <strstream> +#endif +#include <vector> + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +// We care a lot about number of bits things take up. Unfortunately, +// systems define their bit-specific ints in a lot of different ways. +// We use our own way, and have a typedef to get there. +// Note: these commands below may look like "#if 1" or "#if 0", but +// that's because they were constructed that way at ./configure time. +// Look at logging.h.in to see how they're calculated (based on your config). +#if 0 +#include <stdint.h> // the normal place uint16_t is defined +#endif +#if 0 +#include <sys/types.h> // the normal place u_int16_t is defined +#endif +#if 0 +#include <inttypes.h> // a third place for uint16_t or u_int16_t +#endif + +#if 1 +#include "third_party/gflags/gflags.h" +#endif + +namespace google { + +#if 0 // the C99 format +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +#elif 0 // the BSD format +typedef int32_t int32; +typedef u_int32_t uint32; +typedef int64_t int64; +typedef u_int64_t uint64; +#elif 1 // the windows (vc7) format +typedef __int32 int32; +typedef unsigned __int32 uint32; +typedef __int64 int64; +typedef unsigned __int64 uint64; +#else +#error Do not know how to define a 32-bit integer quantity on your system +#endif + +} + +// The global value of GOOGLE_STRIP_LOG. All the messages logged to +// LOG(XXX) with severity less than GOOGLE_STRIP_LOG will not be displayed. +// If it can be determined at compile time that the message will not be +// printed, the statement will be compiled out. +// +// Example: to strip out all INFO and WARNING messages, use the value +// of 2 below. To make an exception for WARNING messages from a single +// file, add "#define GOOGLE_STRIP_LOG 1" to that file _before_ including +// base/logging.h +#ifndef GOOGLE_STRIP_LOG +#define GOOGLE_STRIP_LOG 0 +#endif + +// GCC can be told that a certain branch is not likely to be taken (for +// instance, a CHECK failure), and use that information in static analysis. +// Giving it this information can help it optimize for the common case in +// the absence of better information (ie. -fprofile-arcs). +// +#ifndef GOOGLE_PREDICT_BRANCH_NOT_TAKEN +#if 0 +#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x) (__builtin_expect(x, 0)) +#else +#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x) x +#endif +#endif + +// Make a bunch of macros for logging. The way to log things is to stream +// things to LOG(<a particular severity level>). E.g., +// +// LOG(INFO) << "Found " << num_cookies << " cookies"; +// +// You can capture log messages in a string, rather than reporting them +// immediately: +// +// vector<string> errors; +// LOG_STRING(ERROR, &errors) << "Couldn't parse cookie #" << cookie_num; +// +// This pushes back the new error onto 'errors'; if given a NULL pointer, +// it reports the error via LOG(ERROR). +// +// You can also do conditional logging: +// +// LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; +// +// You can also do occasional logging (log every n'th occurrence of an +// event): +// +// LOG_EVERY_N(INFO, 10) << "Got the " << COUNTER << "th cookie"; +// +// The above will cause log messages to be output on the 1st, 11th, 21st, ... +// times it is executed. Note that the special COUNTER value is used to +// identify which repetition is happening. +// +// You can also do occasional conditional logging (log every n'th +// occurrence of an event, when condition is satisfied): +// +// LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << COUNTER +// << "th big cookie"; +// +// You can log messages the first N times your code executes a line. E.g. +// +// LOG_FIRST_N(INFO, 20) << "Got the " << COUNTER << "th cookie"; +// +// Outputs log messages for the first 20 times it is executed. +// +// Analogous SYSLOG, SYSLOG_IF, and SYSLOG_EVERY_N macros are available. +// These log to syslog as well as to the normal logs. If you use these at +// all, you need to be aware that syslog can drastically reduce performance, +// especially if it is configured for remote logging! Don't use these +// unless you fully understand this and have a concrete need to use them. +// Even then, try to minimize your use of them. +// +// There are also "debug mode" logging macros like the ones above: +// +// DLOG(INFO) << "Found cookies"; +// +// DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; +// +// DLOG_EVERY_N(INFO, 10) << "Got the " << COUNTER << "th cookie"; +// +// All "debug mode" logging is compiled away to nothing for non-debug mode +// compiles. +// +// We also have +// +// LOG_ASSERT(assertion); +// DLOG_ASSERT(assertion); +// +// which is syntactic sugar for {,D}LOG_IF(FATAL, assert fails) << assertion; +// +// There are "verbose level" logging macros. They look like +// +// VLOG(1) << "I'm printed when you run the program with --v=1 or more"; +// VLOG(2) << "I'm printed when you run the program with --v=2 or more"; +// +// These always log at the INFO log level (when they log at all). +// The verbose logging can also be turned on module-by-module. For instance, +// --vmodule=mapreduce=2,file=1,gfs*=3 --v=0 +// will cause: +// a. VLOG(2) and lower messages to be printed from mapreduce.{h,cc} +// b. VLOG(1) and lower messages to be printed from file.{h,cc} +// c. VLOG(3) and lower messages to be printed from files prefixed with "gfs" +// d. VLOG(0) and lower messages to be printed from elsewhere +// +// The wildcarding functionality shown by (c) supports both '*' (match +// 0 or more characters) and '?' (match any single character) wildcards. +// +// There's also VLOG_IS_ON(n) "verbose level" condition macro. To be used as +// +// if (VLOG_IS_ON(2)) { +// // do some logging preparation and logging +// // that can't be accomplished with just VLOG(2) << ...; +// } +// +// There are also VLOG_IF, VLOG_EVERY_N and VLOG_IF_EVERY_N "verbose level" +// condition macros for sample cases, when some extra computation and +// preparation for logs is not needed. +// VLOG_IF(1, (size > 1024)) +// << "I'm printed when size is more than 1024 and when you run the " +// "program with --v=1 or more"; +// VLOG_EVERY_N(1, 10) +// << "I'm printed every 10th occurrence, and when you run the program " +// "with --v=1 or more. Present occurence is " << COUNTER; +// VLOG_IF_EVERY_N(1, (size > 1024), 10) +// << "I'm printed on every 10th occurence of case when size is more " +// " than 1024, when you run the program with --v=1 or more. "; +// "Present occurence is " << COUNTER; +// +// The supported severity levels for macros that allow you to specify one +// are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL. +// Note that messages of a given severity are logged not only in the +// logfile for that severity, but also in all logfiles of lower severity. +// E.g., a message of severity FATAL will be logged to the logfiles of +// severity FATAL, ERROR, WARNING, and INFO. +// +// There is also the special severity of DFATAL, which logs FATAL in +// debug mode, ERROR in normal mode. +// +// Very important: logging a message at the FATAL severity level causes +// the program to terminate (after the message is logged). +// +// Unless otherwise specified, logs will be written to the filename +// "<program name>.<hostname>.<user name>.log.<severity level>.", followed +// by the date, time, and pid (you can't prevent the date, time, and pid +// from being in the filename). +// +// The logging code takes two flags: +// --v=# set the verbose level +// --logtostderr log all the messages to stderr instead of to logfiles + +// LOG LINE PREFIX FORMAT +// +// Log lines have this form: +// +// Lmmdd hh:mm:ss.uuuuuu threadid file:line] msg... +// +// where the fields are defined as follows: +// +// L A single character, representing the log level +// (eg 'I' for INFO) +// mm The month (zero padded; ie May is '05') +// dd The day (zero padded) +// hh:mm:ss.uuuuuu Time in hours, minutes and fractional seconds +// threadid The space-padded thread ID as returned by GetTID() +// (this matches the PID on Linux) +// file The file name +// line The line number +// msg The user-supplied message +// +// Example: +// +// I1103 11:57:31.739339 24395 google.cc:2341] Command line: ./some_prog +// I1103 11:57:31.739403 24395 google.cc:2342] Process id 24395 +// +// NOTE: although the microseconds are useful for comparing events on +// a single machine, clocks on different machines may not be well +// synchronized. Hence, use caution when comparing the low bits of +// timestamps from different machines. + +#ifndef DECLARE_VARIABLE +#define MUST_UNDEF_GFLAGS_DECLARE_MACROS +#define DECLARE_VARIABLE(type, name, tn) \ + namespace FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead { \ + extern GOOGLE_GLOG_DLL_DECL type FLAGS_##name; \ + } \ + using FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead::FLAGS_##name + +// bool specialization +#define DECLARE_bool(name) \ + DECLARE_VARIABLE(bool, name, bool) + +// int32 specialization +#define DECLARE_int32(name) \ + DECLARE_VARIABLE(google::int32, name, int32) + +// Special case for string, because we have to specify the namespace +// std::string, which doesn't play nicely with our FLAG__namespace hackery. +#define DECLARE_string(name) \ + namespace FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead { \ + extern GOOGLE_GLOG_DLL_DECL std::string FLAGS_##name; \ + } \ + using FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead::FLAGS_##name +#endif + +// Set whether log messages go to stderr instead of logfiles +DECLARE_bool(logtostderr); + +// Set whether log messages go to stderr in addition to logfiles. +DECLARE_bool(alsologtostderr); + +// Log messages at a level >= this flag are automatically sent to +// stderr in addition to log files. +DECLARE_int32(stderrthreshold); + +// Set whether the log prefix should be prepended to each line of output. +DECLARE_bool(log_prefix); + +// Log messages at a level <= this flag are buffered. +// Log messages at a higher level are flushed immediately. +DECLARE_int32(logbuflevel); + +// Sets the maximum number of seconds which logs may be buffered for. +DECLARE_int32(logbufsecs); + +// Log suppression level: messages logged at a lower level than this +// are suppressed. +DECLARE_int32(minloglevel); + +// If specified, logfiles are written into this directory instead of the +// default logging directory. +DECLARE_string(log_dir); + +// Sets the path of the directory into which to put additional links +// to the log files. +DECLARE_string(log_link); + +DECLARE_int32(v); // in vlog_is_on.cc + +// Sets the maximum log file size (in MB). +DECLARE_int32(max_log_size); + +// Sets whether to avoid logging to the disk if the disk is full. +DECLARE_bool(stop_logging_if_full_disk); + +#ifdef MUST_UNDEF_GFLAGS_DECLARE_MACROS +#undef MUST_UNDEF_GFLAGS_DECLARE_MACROS +#undef DECLARE_VARIABLE +#undef DECLARE_bool +#undef DECLARE_int32 +#undef DECLARE_string +#endif + +// Log messages below the GOOGLE_STRIP_LOG level will be compiled away for +// security reasons. See LOG(severtiy) below. + +// A few definitions of macros that don't generate much code. Since +// LOG(INFO) and its ilk are used all over our code, it's +// better to have compact code for these operations. + +#if GOOGLE_STRIP_LOG == 0 +#define COMPACT_GOOGLE_LOG_INFO google::LogMessage( \ + __FILE__, __LINE__) +#define LOG_TO_STRING_INFO(message) google::LogMessage( \ + __FILE__, __LINE__, google::INFO, message) +#else +#define COMPACT_GOOGLE_LOG_INFO google::NullStream() +#define LOG_TO_STRING_INFO(message) google::NullStream() +#endif + +#if GOOGLE_STRIP_LOG <= 1 +#define COMPACT_GOOGLE_LOG_WARNING google::LogMessage( \ + __FILE__, __LINE__, google::WARNING) +#define LOG_TO_STRING_WARNING(message) google::LogMessage( \ + __FILE__, __LINE__, google::WARNING, message) +#else +#define COMPACT_GOOGLE_LOG_WARNING google::NullStream() +#define LOG_TO_STRING_WARNING(message) google::NullStream() +#endif + +#if GOOGLE_STRIP_LOG <= 2 +#define COMPACT_GOOGLE_LOG_ERROR google::LogMessage( \ + __FILE__, __LINE__, google::ERROR) +#define LOG_TO_STRING_ERROR(message) google::LogMessage( \ + __FILE__, __LINE__, google::ERROR, message) +#else +#define COMPACT_GOOGLE_LOG_ERROR google::NullStream() +#define LOG_TO_STRING_ERROR(message) google::NullStream() +#endif + +#if GOOGLE_STRIP_LOG <= 3 +#define COMPACT_GOOGLE_LOG_FATAL google::LogMessageFatal( \ + __FILE__, __LINE__) +#define LOG_TO_STRING_FATAL(message) google::LogMessage( \ + __FILE__, __LINE__, google::FATAL, message) +#else +#define COMPACT_GOOGLE_LOG_FATAL google::NullStreamFatal() +#define LOG_TO_STRING_FATAL(message) google::NullStreamFatal() +#endif + +// For DFATAL, we want to use LogMessage (as opposed to +// LogMessageFatal), to be consistent with the original behavior. +#ifdef NDEBUG +#define COMPACT_GOOGLE_LOG_DFATAL COMPACT_GOOGLE_LOG_ERROR +#elif GOOGLE_STRIP_LOG <= 3 +#define COMPACT_GOOGLE_LOG_DFATAL google::LogMessage( \ + __FILE__, __LINE__, google::FATAL) +#else +#define COMPACT_GOOGLE_LOG_DFATAL google::NullStreamFatal() +#endif + +#define GOOGLE_LOG_INFO(counter) google::LogMessage(__FILE__, __LINE__, google::INFO, counter, &google::LogMessage::SendToLog) +#define SYSLOG_INFO(counter) \ + google::LogMessage(__FILE__, __LINE__, google::INFO, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_WARNING(counter) \ + google::LogMessage(__FILE__, __LINE__, google::WARNING, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_WARNING(counter) \ + google::LogMessage(__FILE__, __LINE__, google::WARNING, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_ERROR(counter) \ + google::LogMessage(__FILE__, __LINE__, google::ERROR, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_ERROR(counter) \ + google::LogMessage(__FILE__, __LINE__, google::ERROR, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_FATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::FATAL, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_FATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::FATAL, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_DFATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::DFATAL_LEVEL, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_DFATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::DFATAL_LEVEL, counter, \ + &google::LogMessage::SendToSyslogAndLog) + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) || defined(__CYGWIN32__) +// A very useful logging macro to log windows errors: +#define LOG_SYSRESULT(result) \ + if (FAILED(result)) { \ + LPTSTR message = NULL; \ + LPTSTR msg = reinterpret_cast<LPTSTR>(&message); \ + DWORD message_length = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | \ + FORMAT_MESSAGE_FROM_SYSTEM, \ + 0, result, 0, msg, 100, NULL); \ + if (message_length > 0) { \ + google::LogMessage(__FILE__, __LINE__, ERROR, 0, \ + &google::LogMessage::SendToLog).stream() << message; \ + LocalFree(message); \ + } \ + } +#endif + +// We use the preprocessor's merging operator, "##", so that, e.g., +// LOG(INFO) becomes the token GOOGLE_LOG_INFO. There's some funny +// subtle difference between ostream member streaming functions (e.g., +// ostream::operator<<(int) and ostream non-member streaming functions +// (e.g., ::operator<<(ostream&, string&): it turns out that it's +// impossible to stream something like a string directly to an unnamed +// ostream. We employ a neat hack by calling the stream() member +// function of LogMessage which seems to avoid the problem. +#define LOG(severity) COMPACT_GOOGLE_LOG_ ## severity.stream() +#define SYSLOG(severity) SYSLOG_ ## severity(0).stream() + +namespace google { + +// They need the definitions of integer types. +#include "glog/log_severity.h" +#include "glog/vlog_is_on.h" + +// Initialize google's logging library. You will see the program name +// specified by argv0 in log outputs. +GOOGLE_GLOG_DLL_DECL void InitGoogleLogging(const char* argv0); + +// Shutdown google's logging library. +GOOGLE_GLOG_DLL_DECL void ShutdownGoogleLogging(); + +// Install a function which will be called after LOG(FATAL). +GOOGLE_GLOG_DLL_DECL void InstallFailureFunction(void (*fail_func)()); + +class LogSink; // defined below + +// If a non-NULL sink pointer is given, we push this message to that sink. +// For LOG_TO_SINK we then do normal LOG(severity) logging as well. +// This is useful for capturing messages and passing/storing them +// somewhere more specific than the global log of the process. +// Argument types: +// LogSink* sink; +// LogSeverity severity; +// The cast is to disambiguate NULL arguments. +#define LOG_TO_SINK(sink, severity) \ + google::LogMessage( \ + __FILE__, __LINE__, \ + google::severity, \ + static_cast<google::LogSink*>(sink), true).stream() +#define LOG_TO_SINK_BUT_NOT_TO_LOGFILE(sink, severity) \ + google::LogMessage( \ + __FILE__, __LINE__, \ + google::severity, \ + static_cast<google::LogSink*>(sink), false).stream() + +// If a non-NULL string pointer is given, we write this message to that string. +// We then do normal LOG(severity) logging as well. +// This is useful for capturing messages and storing them somewhere more +// specific than the global log of the process. +// Argument types: +// string* message; +// LogSeverity severity; +// The cast is to disambiguate NULL arguments. +// NOTE: LOG(severity) expands to LogMessage().stream() for the specified +// severity. +#define LOG_TO_STRING(severity, message) \ + LOG_TO_STRING_##severity(static_cast<string*>(message)).stream() + +// If a non-NULL pointer is given, we push the message onto the end +// of a vector of strings; otherwise, we report it with LOG(severity). +// This is handy for capturing messages and perhaps passing them back +// to the caller, rather than reporting them immediately. +// Argument types: +// LogSeverity severity; +// vector<string> *outvec; +// The cast is to disambiguate NULL arguments. +#define LOG_STRING(severity, outvec) \ + LOG_TO_STRING_##severity(static_cast<vector<string>*>(outvec)).stream() + +#define LOG_IF(severity, condition) \ + !(condition) ? (void) 0 : google::LogMessageVoidify() & LOG(severity) +#define SYSLOG_IF(severity, condition) \ + !(condition) ? (void) 0 : google::LogMessageVoidify() & SYSLOG(severity) + +#define LOG_ASSERT(condition) \ + LOG_IF(FATAL, !(condition)) << "Assert failed: " #condition +#define SYSLOG_ASSERT(condition) \ + SYSLOG_IF(FATAL, !(condition)) << "Assert failed: " #condition + +// CHECK dies with a fatal error if condition is not true. It is *not* +// controlled by NDEBUG, so the check will be executed regardless of +// compilation mode. Therefore, it is safe to do things like: +// CHECK(fp->Write(x) == 4) +#define CHECK(condition) \ + LOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN(!(condition))) \ + << "Check failed: " #condition " " + +// A container for a string pointer which can be evaluated to a bool - +// true iff the pointer is NULL. +struct CheckOpString { + CheckOpString(std::string* str) : str_(str) { } + // No destructor: if str_ is non-NULL, we're about to LOG(FATAL), + // so there's no point in cleaning up str_. + operator bool() const { + return GOOGLE_PREDICT_BRANCH_NOT_TAKEN(str_ != NULL); + } + std::string* str_; +}; + +// Function is overloaded for integral types to allow static const +// integrals declared in classes and not defined to be used as arguments to +// CHECK* macros. It's not encouraged though. +template <class T> +inline const T& GetReferenceableValue(const T& t) { return t; } +inline char GetReferenceableValue(char t) { return t; } +inline unsigned char GetReferenceableValue(unsigned char t) { return t; } +inline signed char GetReferenceableValue(signed char t) { return t; } +inline short GetReferenceableValue(short t) { return t; } +inline unsigned short GetReferenceableValue(unsigned short t) { return t; } +inline int GetReferenceableValue(int t) { return t; } +inline unsigned int GetReferenceableValue(unsigned int t) { return t; } +inline long GetReferenceableValue(long t) { return t; } +inline unsigned long GetReferenceableValue(unsigned long t) { return t; } +inline long long GetReferenceableValue(long long t) { return t; } +inline unsigned long long GetReferenceableValue(unsigned long long t) { + return t; +} + +// This is a dummy class to define the following operator. +struct DummyClassToDefineOperator {}; + +} + +// Define global operator<< to declare using ::operator<<. +// This declaration will allow use to use CHECK macros for user +// defined classes which have operator<< (e.g., stl_logging.h). +inline std::ostream& operator<<( + std::ostream& out, const google::DummyClassToDefineOperator&) { + return out; +} + +namespace google { + +// Build the error message string. +template<class t1, class t2> +std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) { + // It means that we cannot use stl_logging if compiler doesn't + // support using expression for operator. + // TODO(hamaji): Figure out a way to fix. +#if 1 + using ::operator<<; +#endif + std::strstream ss; + ss << names << " (" << v1 << " vs. " << v2 << ")"; + return new std::string(ss.str(), ss.pcount()); +} + +// Helper functions for CHECK_OP macro. +// The (int, int) specialization works around the issue that the compiler +// will not instantiate the template version of the function on values of +// unnamed enum type - see comment below. +#define DEFINE_CHECK_OP_IMPL(name, op) \ + template <class t1, class t2> \ + inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \ + const char* names) { \ + if (v1 op v2) return NULL; \ + else return MakeCheckOpString(v1, v2, names); \ + } \ + inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \ + return Check##name##Impl<int, int>(v1, v2, names); \ + } + +// Use _EQ, _NE, _LE, etc. in case the file including base/logging.h +// provides its own #defines for the simpler names EQ, NE, LE, etc. +// This happens if, for example, those are used as token names in a +// yacc grammar. +DEFINE_CHECK_OP_IMPL(_EQ, ==) +DEFINE_CHECK_OP_IMPL(_NE, !=) +DEFINE_CHECK_OP_IMPL(_LE, <=) +DEFINE_CHECK_OP_IMPL(_LT, < ) +DEFINE_CHECK_OP_IMPL(_GE, >=) +DEFINE_CHECK_OP_IMPL(_GT, > ) +#undef DEFINE_CHECK_OP_IMPL + +// Helper macro for binary operators. +// Don't use this macro directly in your code, use CHECK_EQ et al below. + +#if defined(STATIC_ANALYSIS) +// Only for static analysis tool to know that it is equivalent to assert +#define CHECK_OP_LOG(name, op, val1, val2, log) CHECK((val1) op (val2)) +#elif !defined(NDEBUG) +// In debug mode, avoid constructing CheckOpStrings if possible, +// to reduce the overhead of CHECK statments by 2x. +// Real DCHECK-heavy tests have seen 1.5x speedups. + +// The meaning of "string" might be different between now and +// when this macro gets invoked (e.g., if someone is experimenting +// with other string implementations that get defined after this +// file is included). Save the current meaning now and use it +// in the macro. +typedef std::string _Check_string; +#define CHECK_OP_LOG(name, op, val1, val2, log) \ + while (google::_Check_string* _result = \ + google::Check##name##Impl( \ + google::GetReferenceableValue(val1), \ + google::GetReferenceableValue(val2), \ + #val1 " " #op " " #val2)) \ + log(__FILE__, __LINE__, \ + google::CheckOpString(_result)).stream() +#else +// In optimized mode, use CheckOpString to hint to compiler that +// the while condition is unlikely. +#define CHECK_OP_LOG(name, op, val1, val2, log) \ + while (google::CheckOpString _result = \ + google::Check##name##Impl( \ + google::GetReferenceableValue(val1), \ + google::GetReferenceableValue(val2), \ + #val1 " " #op " " #val2)) \ + log(__FILE__, __LINE__, _result).stream() +#endif // STATIC_ANALYSIS, !NDEBUG + +#if GOOGLE_STRIP_LOG <= 3 +#define CHECK_OP(name, op, val1, val2) \ + CHECK_OP_LOG(name, op, val1, val2, google::LogMessageFatal) +#else +#define CHECK_OP(name, op, val1, val2) \ + CHECK_OP_LOG(name, op, val1, val2, google::NullStreamFatal) +#endif // STRIP_LOG <= 3 + +// Equality/Inequality checks - compare two values, and log a FATAL message +// including the two values when the result is not as expected. The values +// must have operator<<(ostream, ...) defined. +// +// You may append to the error message like so: +// CHECK_NE(1, 2) << ": The world must be ending!"; +// +// We are very careful to ensure that each argument is evaluated exactly +// once, and that anything which is legal to pass as a function argument is +// legal here. In particular, the arguments may be temporary expressions +// which will end up being destroyed at the end of the apparent statement, +// for example: +// CHECK_EQ(string("abc")[1], 'b'); +// +// WARNING: These don't compile correctly if one of the arguments is a pointer +// and the other is NULL. To work around this, simply static_cast NULL to the +// type of the desired pointer. + +#define CHECK_EQ(val1, val2) CHECK_OP(_EQ, ==, val1, val2) +#define CHECK_NE(val1, val2) CHECK_OP(_NE, !=, val1, val2) +#define CHECK_LE(val1, val2) CHECK_OP(_LE, <=, val1, val2) +#define CHECK_LT(val1, val2) CHECK_OP(_LT, < , val1, val2) +#define CHECK_GE(val1, val2) CHECK_OP(_GE, >=, val1, val2) +#define CHECK_GT(val1, val2) CHECK_OP(_GT, > , val1, val2) + +// Check that the input is non NULL. This very useful in constructor +// initializer lists. + +#define CHECK_NOTNULL(val) \ + google::CheckNotNull(__FILE__, __LINE__, "'" #val "' Must be non NULL", (val)) + +// Helper functions for string comparisons. +// To avoid bloat, the definitions are in logging.cc. +#define DECLARE_CHECK_STROP_IMPL(func, expected) \ + GOOGLE_GLOG_DLL_DECL std::string* Check##func##expected##Impl( \ + const char* s1, const char* s2, const char* names); +DECLARE_CHECK_STROP_IMPL(strcmp, true) +DECLARE_CHECK_STROP_IMPL(strcmp, false) +DECLARE_CHECK_STROP_IMPL(strcasecmp, true) +DECLARE_CHECK_STROP_IMPL(strcasecmp, false) +#undef DECLARE_CHECK_STROP_IMPL + +// Helper macro for string comparisons. +// Don't use this macro directly in your code, use CHECK_STREQ et al below. +#define CHECK_STROP(func, op, expected, s1, s2) \ + while (google::CheckOpString _result = \ + google::Check##func##expected##Impl((s1), (s2), \ + #s1 " " #op " " #s2)) \ + LOG(FATAL) << *_result.str_ + + +// String (char*) equality/inequality checks. +// CASE versions are case-insensitive. +// +// Note that "s1" and "s2" may be temporary strings which are destroyed +// by the compiler at the end of the current "full expression" +// (e.g. CHECK_STREQ(Foo().c_str(), Bar().c_str())). + +#define CHECK_STREQ(s1, s2) CHECK_STROP(strcmp, ==, true, s1, s2) +#define CHECK_STRNE(s1, s2) CHECK_STROP(strcmp, !=, false, s1, s2) +#define CHECK_STRCASEEQ(s1, s2) CHECK_STROP(strcasecmp, ==, true, s1, s2) +#define CHECK_STRCASENE(s1, s2) CHECK_STROP(strcasecmp, !=, false, s1, s2) + +#define CHECK_INDEX(I,A) CHECK(I < (sizeof(A)/sizeof(A[0]))) +#define CHECK_BOUND(B,A) CHECK(B <= (sizeof(A)/sizeof(A[0]))) + +#define CHECK_DOUBLE_EQ(val1, val2) \ + do { \ + CHECK_LE((val1), (val2)+0.000000000000001L); \ + CHECK_GE((val1), (val2)-0.000000000000001L); \ + } while (0) + +#define CHECK_NEAR(val1, val2, margin) \ + do { \ + CHECK_LE((val1), (val2)+(margin)); \ + CHECK_GE((val1), (val2)-(margin)); \ + } while (0) + +// perror()..googly style! +// +// PLOG() and PLOG_IF() and PCHECK() behave exactly like their LOG* and +// CHECK equivalents with the addition that they postpend a description +// of the current state of errno to their output lines. + +#define PLOG(severity) GOOGLE_PLOG(severity, 0).stream() + +#define GOOGLE_PLOG(severity, counter) \ + google::ErrnoLogMessage( \ + __FILE__, __LINE__, google::severity, counter, \ + &google::LogMessage::SendToLog) + +#define PLOG_IF(severity, condition) \ + !(condition) ? (void) 0 : google::LogMessageVoidify() & PLOG(severity) + +// A CHECK() macro that postpends errno if the condition is false. E.g. +// +// if (poll(fds, nfds, timeout) == -1) { PCHECK(errno == EINTR); ... } +#define PCHECK(condition) \ + PLOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN(!(condition))) \ + << "Check failed: " #condition " " + +// A CHECK() macro that lets you assert the success of a function that +// returns -1 and sets errno in case of an error. E.g. +// +// CHECK_ERR(mkdir(path, 0700)); +// +// or +// +// int fd = open(filename, flags); CHECK_ERR(fd) << ": open " << filename; +#define CHECK_ERR(invocation) \ +PLOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN((invocation) == -1)) \ + << #invocation + +// Use macro expansion to create, for each use of LOG_EVERY_N(), static +// variables with the __LINE__ expansion as part of the variable name. +#define LOG_EVERY_N_VARNAME(base, line) LOG_EVERY_N_VARNAME_CONCAT(base, line) +#define LOG_EVERY_N_VARNAME_CONCAT(base, line) base ## line + +#define LOG_OCCURRENCES LOG_EVERY_N_VARNAME(occurrences_, __LINE__) +#define LOG_OCCURRENCES_MOD_N LOG_EVERY_N_VARNAME(occurrences_mod_n_, __LINE__) + +#define SOME_KIND_OF_LOG_EVERY_N(severity, n, what_to_do) \ + static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ + ++LOG_OCCURRENCES; \ + if (++LOG_OCCURRENCES_MOD_N > n) LOG_OCCURRENCES_MOD_N -= n; \ + if (LOG_OCCURRENCES_MOD_N == 1) \ + google::LogMessage( \ + __FILE__, __LINE__, google::severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +#define SOME_KIND_OF_LOG_IF_EVERY_N(severity, condition, n, what_to_do) \ + static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ + ++LOG_OCCURRENCES; \ + if (condition && \ + ((LOG_OCCURRENCES_MOD_N=(LOG_OCCURRENCES_MOD_N + 1) % n) == (1 % n))) \ + google::LogMessage( \ + __FILE__, __LINE__, google::severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +#define SOME_KIND_OF_PLOG_EVERY_N(severity, n, what_to_do) \ + static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ + ++LOG_OCCURRENCES; \ + if (++LOG_OCCURRENCES_MOD_N > n) LOG_OCCURRENCES_MOD_N -= n; \ + if (LOG_OCCURRENCES_MOD_N == 1) \ + google::ErrnoLogMessage( \ + __FILE__, __LINE__, google::severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +#define SOME_KIND_OF_LOG_FIRST_N(severity, n, what_to_do) \ + static int LOG_OCCURRENCES = 0; \ + if (LOG_OCCURRENCES <= n) \ + ++LOG_OCCURRENCES; \ + if (LOG_OCCURRENCES <= n) \ + google::LogMessage( \ + __FILE__, __LINE__, google::severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +namespace glog_internal_namespace_ { +template <bool> +struct CompileAssert { +}; +struct CrashReason; +} // namespace glog_internal_namespace_ + +#define GOOGLE_GLOG_COMPILE_ASSERT(expr, msg) \ + typedef google::glog_internal_namespace_::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] + +#define LOG_EVERY_N(severity, n) \ + GOOGLE_GLOG_COMPILE_ASSERT(google::severity < \ + google::NUM_SEVERITIES, \ + INVALID_REQUESTED_LOG_SEVERITY); \ + SOME_KIND_OF_LOG_EVERY_N(severity, (n), google::LogMessage::SendToLog) + +#define SYSLOG_EVERY_N(severity, n) \ + SOME_KIND_OF_LOG_EVERY_N(severity, (n), google::LogMessage::SendToSyslogAndLog) + +#define PLOG_EVERY_N(severity, n) \ + SOME_KIND_OF_PLOG_EVERY_N(severity, (n), google::LogMessage::SendToLog) + +#define LOG_FIRST_N(severity, n) \ + SOME_KIND_OF_LOG_FIRST_N(severity, (n), google::LogMessage::SendToLog) + +#define LOG_IF_EVERY_N(severity, condition, n) \ + SOME_KIND_OF_LOG_IF_EVERY_N(severity, (condition), (n), google::LogMessage::SendToLog) + +// We want the special COUNTER value available for LOG_EVERY_X()'ed messages +enum PRIVATE_Counter {COUNTER}; + + +// Plus some debug-logging macros that get compiled to nothing for production + +#ifndef NDEBUG + +#define DLOG(severity) LOG(severity) +#define DVLOG(verboselevel) VLOG(verboselevel) +#define DLOG_IF(severity, condition) LOG_IF(severity, condition) +#define DLOG_EVERY_N(severity, n) LOG_EVERY_N(severity, n) +#define DLOG_IF_EVERY_N(severity, condition, n) \ + LOG_IF_EVERY_N(severity, condition, n) +#define DLOG_ASSERT(condition) LOG_ASSERT(condition) + +// debug-only checking. not executed in NDEBUG mode. +#define DCHECK(condition) CHECK(condition) +#define DCHECK_EQ(val1, val2) CHECK_EQ(val1, val2) +#define DCHECK_NE(val1, val2) CHECK_NE(val1, val2) +#define DCHECK_LE(val1, val2) CHECK_LE(val1, val2) +#define DCHECK_LT(val1, val2) CHECK_LT(val1, val2) +#define DCHECK_GE(val1, val2) CHECK_GE(val1, val2) +#define DCHECK_GT(val1, val2) CHECK_GT(val1, val2) +#define DCHECK_NOTNULL(val) CHECK_NOTNULL(val) +#define DCHECK_STREQ(str1, str2) CHECK_STREQ(str1, str2) +#define DCHECK_STRCASEEQ(str1, str2) CHECK_STRCASEEQ(str1, str2) +#define DCHECK_STRNE(str1, str2) CHECK_STRNE(str1, str2) +#define DCHECK_STRCASENE(str1, str2) CHECK_STRCASENE(str1, str2) + +#else // NDEBUG + +#define DLOG(severity) \ + true ? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DVLOG(verboselevel) \ + (true || !VLOG_IS_ON(verboselevel)) ?\ + (void) 0 : google::LogMessageVoidify() & LOG(INFO) + +#define DLOG_IF(severity, condition) \ + (true || !(condition)) ? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DLOG_EVERY_N(severity, n) \ + true ? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DLOG_IF_EVERY_N(severity, condition, n) \ + (true || !(condition))? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DLOG_ASSERT(condition) \ + true ? (void) 0 : LOG_ASSERT(condition) + +#define DCHECK(condition) \ + while (false) \ + CHECK(condition) + +#define DCHECK_EQ(val1, val2) \ + while (false) \ + CHECK_EQ(val1, val2) + +#define DCHECK_NE(val1, val2) \ + while (false) \ + CHECK_NE(val1, val2) + +#define DCHECK_LE(val1, val2) \ + while (false) \ + CHECK_LE(val1, val2) + +#define DCHECK_LT(val1, val2) \ + while (false) \ + CHECK_LT(val1, val2) + +#define DCHECK_GE(val1, val2) \ + while (false) \ + CHECK_GE(val1, val2) + +#define DCHECK_GT(val1, val2) \ + while (false) \ + CHECK_GT(val1, val2) + +#define DCHECK_NOTNULL(val) (val) + +#define DCHECK_STREQ(str1, str2) \ + while (false) \ + CHECK_STREQ(str1, str2) + +#define DCHECK_STRCASEEQ(str1, str2) \ + while (false) \ + CHECK_STRCASEEQ(str1, str2) + +#define DCHECK_STRNE(str1, str2) \ + while (false) \ + CHECK_STRNE(str1, str2) + +#define DCHECK_STRCASENE(str1, str2) \ + while (false) \ + CHECK_STRCASENE(str1, str2) + + +#endif // NDEBUG + +// Log only in verbose mode. + +#define VLOG(verboselevel) LOG_IF(INFO, VLOG_IS_ON(verboselevel)) + +#define VLOG_IF(verboselevel, condition) \ + LOG_IF(INFO, (condition) && VLOG_IS_ON(verboselevel)) + +#define VLOG_EVERY_N(verboselevel, n) \ + LOG_IF_EVERY_N(INFO, VLOG_IS_ON(verboselevel), n) + +#define VLOG_IF_EVERY_N(verboselevel, condition, n) \ + LOG_IF_EVERY_N(INFO, (condition) && VLOG_IS_ON(verboselevel), n) + +// +// This class more or less represents a particular log message. You +// create an instance of LogMessage and then stream stuff to it. +// When you finish streaming to it, ~LogMessage is called and the +// full message gets streamed to the appropriate destination. +// +// You shouldn't actually use LogMessage's constructor to log things, +// though. You should use the LOG() macro (and variants thereof) +// above. +class GOOGLE_GLOG_DLL_DECL LogMessage { +public: + enum { + // Passing kNoLogPrefix for the line number disables the + // log-message prefix. Useful for using the LogMessage + // infrastructure as a printing utility. See also the --log_prefix + // flag for controlling the log-message prefix on an + // application-wide basis. + kNoLogPrefix = -1 + }; + + // LogStream inherit from non-DLL-exported class (std::ostrstream) + // and VC++ produces a warning for this situation. + // However, MSDN says "C4275 can be ignored in Microsoft Visual C++ + // 2005 if you are deriving from a type in the Standard C++ Library" + // http://msdn.microsoft.com/en-us/library/3tdb471s(VS.80).aspx + // Let's just ignore the warning. +#ifdef _MSC_VER +# pragma warning(disable: 4275) +#endif + class GOOGLE_GLOG_DLL_DECL LogStream : public std::ostrstream { +#ifdef _MSC_VER +# pragma warning(default: 4275) +#endif + public: + LogStream(char *buf, int len, int ctr) + : ostrstream(buf, len), + ctr_(ctr) { + self_ = this; + } + + int ctr() const { return ctr_; } + void set_ctr(int ctr) { ctr_ = ctr; } + LogStream* self() const { return self_; } + + private: + int ctr_; // Counter hack (for the LOG_EVERY_X() macro) + LogStream *self_; // Consistency check hack + }; + +public: + // icc 8 requires this typedef to avoid an internal compiler error. + typedef void (LogMessage::*SendMethod)(); + + LogMessage(const char* file, int line, LogSeverity severity, int ctr, + SendMethod send_method); + + // Two special constructors that generate reduced amounts of code at + // LOG call sites for common cases. + + // Used for LOG(INFO): Implied are: + // severity = INFO, ctr = 0, send_method = &LogMessage::SendToLog. + // + // Using this constructor instead of the more complex constructor above + // saves 19 bytes per call site. + LogMessage(const char* file, int line); + + // Used for LOG(severity) where severity != INFO. Implied + // are: ctr = 0, send_method = &LogMessage::SendToLog + // + // Using this constructor instead of the more complex constructor above + // saves 17 bytes per call site. + LogMessage(const char* file, int line, LogSeverity severity); + + // Constructor to log this message to a specified sink (if not NULL). + // Implied are: ctr = 0, send_method = &LogMessage::SendToSinkAndLog if + // also_send_to_log is true, send_method = &LogMessage::SendToSink otherwise. + LogMessage(const char* file, int line, LogSeverity severity, LogSink* sink, + bool also_send_to_log); + + // Constructor where we also give a vector<string> pointer + // for storing the messages (if the pointer is not NULL). + // Implied are: ctr = 0, send_method = &LogMessage::SaveOrSendToLog. + LogMessage(const char* file, int line, LogSeverity severity, + std::vector<std::string>* outvec); + + // Constructor where we also give a string pointer for storing the + // message (if the pointer is not NULL). Implied are: ctr = 0, + // send_method = &LogMessage::WriteToStringAndLog. + LogMessage(const char* file, int line, LogSeverity severity, + std::string* message); + + // A special constructor used for check failures + LogMessage(const char* file, int line, const CheckOpString& result); + + ~LogMessage(); + + // Flush a buffered message to the sink set in the constructor. Always + // called by the destructor, it may also be called from elsewhere if + // needed. Only the first call is actioned; any later ones are ignored. + void Flush(); + + // An arbitrary limit on the length of a single log message. This + // is so that streaming can be done more efficiently. + static const size_t kMaxLogMessageLen; + + // Theses should not be called directly outside of logging.*, + // only passed as SendMethod arguments to other LogMessage methods: + void SendToLog(); // Actually dispatch to the logs + void SendToSyslogAndLog(); // Actually dispatch to syslog and the logs + + // Call abort() or similar to perform LOG(FATAL) crash. + static void Fail() ; + + std::ostream& stream() { return *(data_->stream_); } + + int preserved_errno() const { return data_->preserved_errno_; } + + // Must be called without the log_mutex held. (L < log_mutex) + static int64 num_messages(int severity); + +private: + // Fully internal SendMethod cases: + void SendToSinkAndLog(); // Send to sink if provided and dispatch to the logs + void SendToSink(); // Send to sink if provided, do nothing otherwise. + + // Write to string if provided and dispatch to the logs. + void WriteToStringAndLog(); + + void SaveOrSendToLog(); // Save to stringvec if provided, else to logs + + void Init(const char* file, int line, LogSeverity severity, + void (LogMessage::*send_method)()); + + // Used to fill in crash information during LOG(FATAL) failures. + void RecordCrashReason(glog_internal_namespace_::CrashReason* reason); + + // Counts of messages sent at each priority: + static int64 num_messages_[NUM_SEVERITIES]; // under log_mutex + + // We keep the data in a separate struct so that each instance of + // LogMessage uses less stack space. + struct GOOGLE_GLOG_DLL_DECL LogMessageData { + LogMessageData() {}; + + int preserved_errno_; // preserved errno + char* buf_; + char* message_text_; // Complete message text (points to selected buffer) + LogStream* stream_alloc_; + LogStream* stream_; + char severity_; // What level is this LogMessage logged at? + int line_; // line number where logging call is. + void (LogMessage::*send_method_)(); // Call this in destructor to send + union { // At most one of these is used: union to keep the size low. + LogSink* sink_; // NULL or sink to send message to + std::vector<std::string>* outvec_; // NULL or vector to push message onto + std::string* message_; // NULL or string to write message into + }; + time_t timestamp_; // Time of creation of LogMessage + struct ::tm tm_time_; // Time of creation of LogMessage + size_t num_prefix_chars_; // # of chars of prefix in this message + size_t num_chars_to_log_; // # of chars of msg to send to log + size_t num_chars_to_syslog_; // # of chars of msg to send to syslog + const char* basename_; // basename of file that called LOG + const char* fullname_; // fullname of file that called LOG + bool has_been_flushed_; // false => data has not been flushed + bool first_fatal_; // true => this was first fatal msg + + ~LogMessageData(); + private: + LogMessageData(const LogMessageData&); + void operator=(const LogMessageData&); + }; + + static LogMessageData fatal_msg_data_exclusive_; + static LogMessageData fatal_msg_data_shared_; + + LogMessageData* allocated_; + LogMessageData* data_; + + friend class LogDestination; + + LogMessage(const LogMessage&); + void operator=(const LogMessage&); +}; + +// This class happens to be thread-hostile because all instances share +// a single data buffer, but since it can only be created just before +// the process dies, we don't worry so much. +class GOOGLE_GLOG_DLL_DECL LogMessageFatal : public LogMessage { + public: + LogMessageFatal(const char* file, int line); + LogMessageFatal(const char* file, int line, const CheckOpString& result); + ~LogMessageFatal() ; +}; + +// A non-macro interface to the log facility; (useful +// when the logging level is not a compile-time constant). +inline void LogAtLevel(int const severity, std::string const &msg) { + LogMessage(__FILE__, __LINE__, severity).stream() << msg; +} + +// A macro alternative of LogAtLevel. New code may want to use this +// version since there are two advantages: 1. this version outputs the +// file name and the line number where this macro is put like other +// LOG macros, 2. this macro can be used as C++ stream. +#define LOG_AT_LEVEL(severity) google::LogMessage(__FILE__, __LINE__, severity).stream() + +// A small helper for CHECK_NOTNULL(). +template <typename T> +T* CheckNotNull(const char *file, int line, const char *names, T* t) { + if (t == NULL) { + LogMessageFatal(file, line, new std::string(names)); + } + return t; +} + +// Allow folks to put a counter in the LOG_EVERY_X()'ed messages. This +// only works if ostream is a LogStream. If the ostream is not a +// LogStream you'll get an assert saying as much at runtime. +GOOGLE_GLOG_DLL_DECL std::ostream& operator<<(std::ostream &os, + const PRIVATE_Counter&); + + +// Derived class for PLOG*() above. +class GOOGLE_GLOG_DLL_DECL ErrnoLogMessage : public LogMessage { + public: + + ErrnoLogMessage(const char* file, int line, LogSeverity severity, int ctr, + void (LogMessage::*send_method)()); + + // Postpends ": strerror(errno) [errno]". + ~ErrnoLogMessage(); + + private: + ErrnoLogMessage(const ErrnoLogMessage&); + void operator=(const ErrnoLogMessage&); +}; + + +// This class is used to explicitly ignore values in the conditional +// logging macros. This avoids compiler warnings like "value computed +// is not used" and "statement has no effect". + +class GOOGLE_GLOG_DLL_DECL LogMessageVoidify { + public: + LogMessageVoidify() { } + // This has to be an operator with a precedence lower than << but + // higher than ?: + void operator&(std::ostream&) { } +}; + + +// Flushes all log files that contains messages that are at least of +// the specified severity level. Thread-safe. +GOOGLE_GLOG_DLL_DECL void FlushLogFiles(LogSeverity min_severity); + +// Flushes all log files that contains messages that are at least of +// the specified severity level. Thread-hostile because it ignores +// locking -- used for catastrophic failures. +GOOGLE_GLOG_DLL_DECL void FlushLogFilesUnsafe(LogSeverity min_severity); + +// +// Set the destination to which a particular severity level of log +// messages is sent. If base_filename is "", it means "don't log this +// severity". Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetLogDestination(LogSeverity severity, + const char* base_filename); + +// +// Set the basename of the symlink to the latest log file at a given +// severity. If symlink_basename is empty, do not make a symlink. If +// you don't call this function, the symlink basename is the +// invocation name of the program. Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetLogSymlink(LogSeverity severity, + const char* symlink_basename); + +// +// Used to send logs to some other kind of destination +// Users should subclass LogSink and override send to do whatever they want. +// Implementations must be thread-safe because a shared instance will +// be called from whichever thread ran the LOG(XXX) line. +class GOOGLE_GLOG_DLL_DECL LogSink { + public: + virtual ~LogSink(); + + // Sink's logging logic (message_len is such as to exclude '\n' at the end). + // This method can't use LOG() or CHECK() as logging system mutex(s) are held + // during this call. + virtual void send(LogSeverity severity, const char* full_filename, + const char* base_filename, int line, + const struct ::tm* tm_time, + const char* message, size_t message_len) = 0; + + // Redefine this to implement waiting for + // the sink's logging logic to complete. + // It will be called after each send() returns, + // but before that LogMessage exits or crashes. + // By default this function does nothing. + // Using this function one can implement complex logic for send() + // that itself involves logging; and do all this w/o causing deadlocks and + // inconsistent rearrangement of log messages. + // E.g. if a LogSink has thread-specific actions, the send() method + // can simply add the message to a queue and wake up another thread that + // handles real logging while itself making some LOG() calls; + // WaitTillSent() can be implemented to wait for that logic to complete. + // See our unittest for an example. + virtual void WaitTillSent(); + + // Returns the normal text output of the log message. + // Can be useful to implement send(). + static std::string ToString(LogSeverity severity, const char* file, int line, + const struct ::tm* tm_time, + const char* message, size_t message_len); +}; + +// Add or remove a LogSink as a consumer of logging data. Thread-safe. +GOOGLE_GLOG_DLL_DECL void AddLogSink(LogSink *destination); +GOOGLE_GLOG_DLL_DECL void RemoveLogSink(LogSink *destination); + +// +// Specify an "extension" added to the filename specified via +// SetLogDestination. This applies to all severity levels. It's +// often used to append the port we're listening on to the logfile +// name. Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetLogFilenameExtension( + const char* filename_extension); + +// +// Make it so that all log messages of at least a particular severity +// are logged to stderr (in addition to logging to the usual log +// file(s)). Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetStderrLogging(LogSeverity min_severity); + +// +// Make it so that all log messages go only to stderr. Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void LogToStderr(); + +// +// Make it so that all log messages of at least a particular severity are +// logged via email to a list of addresses (in addition to logging to the +// usual log file(s)). The list of addresses is just a string containing +// the email addresses to send to (separated by spaces, say). Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetEmailLogging(LogSeverity min_severity, + const char* addresses); + +// A simple function that sends email. dest is a commma-separated +// list of addressess. Thread-safe. +GOOGLE_GLOG_DLL_DECL bool SendEmail(const char *dest, + const char *subject, const char *body); + +GOOGLE_GLOG_DLL_DECL const std::vector<std::string>& GetLoggingDirectories(); + +// For tests only: Clear the internal [cached] list of logging directories to +// force a refresh the next time GetLoggingDirectories is called. +// Thread-hostile. +void TestOnly_ClearLoggingDirectoriesList(); + +// Returns a set of existing temporary directories, which will be a +// subset of the directories returned by GetLogginDirectories(). +// Thread-safe. +GOOGLE_GLOG_DLL_DECL void GetExistingTempDirectories( + std::vector<std::string>* list); + +// Print any fatal message again -- useful to call from signal handler +// so that the last thing in the output is the fatal message. +// Thread-hostile, but a race is unlikely. +GOOGLE_GLOG_DLL_DECL void ReprintFatalMessage(); + +// Truncate a log file that may be the append-only output of multiple +// processes and hence can't simply be renamed/reopened (typically a +// stdout/stderr). If the file "path" is > "limit" bytes, copy the +// last "keep" bytes to offset 0 and truncate the rest. Since we could +// be racing with other writers, this approach has the potential to +// lose very small amounts of data. For security, only follow symlinks +// if the path is /proc/self/fd/* +GOOGLE_GLOG_DLL_DECL void TruncateLogFile(const char *path, + int64 limit, int64 keep); + +// Truncate stdout and stderr if they are over the value specified by +// --max_log_size; keep the final 1MB. This function has the same +// race condition as TruncateLogFile. +GOOGLE_GLOG_DLL_DECL void TruncateStdoutStderr(); + +// Return the string representation of the provided LogSeverity level. +// Thread-safe. +GOOGLE_GLOG_DLL_DECL const char* GetLogSeverityName(LogSeverity severity); + +// --------------------------------------------------------------------- +// Implementation details that are not useful to most clients +// --------------------------------------------------------------------- + +// A Logger is the interface used by logging modules to emit entries +// to a log. A typical implementation will dump formatted data to a +// sequence of files. We also provide interfaces that will forward +// the data to another thread so that the invoker never blocks. +// Implementations should be thread-safe since the logging system +// will write to them from multiple threads. + +namespace base { + +class GOOGLE_GLOG_DLL_DECL Logger { + public: + virtual ~Logger(); + + // Writes "message[0,message_len-1]" corresponding to an event that + // occurred at "timestamp". If "force_flush" is true, the log file + // is flushed immediately. + // + // The input message has already been formatted as deemed + // appropriate by the higher level logging facility. For example, + // textual log messages already contain timestamps, and the + // file:linenumber header. + virtual void Write(bool force_flush, + time_t timestamp, + const char* message, + int message_len) = 0; + + // Flush any buffered messages + virtual void Flush() = 0; + + // Get the current LOG file size. + // The returned value is approximate since some + // logged data may not have been flushed to disk yet. + virtual uint32 LogSize() = 0; +}; + +// Get the logger for the specified severity level. The logger +// remains the property of the logging module and should not be +// deleted by the caller. Thread-safe. +extern GOOGLE_GLOG_DLL_DECL Logger* GetLogger(LogSeverity level); + +// Set the logger for the specified severity level. The logger +// becomes the property of the logging module and should not +// be deleted by the caller. Thread-safe. +extern GOOGLE_GLOG_DLL_DECL void SetLogger(LogSeverity level, Logger* logger); + +} + +// glibc has traditionally implemented two incompatible versions of +// strerror_r(). There is a poorly defined convention for picking the +// version that we want, but it is not clear whether it even works with +// all versions of glibc. +// So, instead, we provide this wrapper that automatically detects the +// version that is in use, and then implements POSIX semantics. +// N.B. In addition to what POSIX says, we also guarantee that "buf" will +// be set to an empty string, if this function failed. This means, in most +// cases, you do not need to check the error code and you can directly +// use the value of "buf". It will never have an undefined value. +GOOGLE_GLOG_DLL_DECL int posix_strerror_r(int err, char *buf, size_t len); + + +// A class for which we define operator<<, which does nothing. +class GOOGLE_GLOG_DLL_DECL NullStream : public LogMessage::LogStream { + public: + // Initialize the LogStream so the messages can be written somewhere + // (they'll never be actually displayed). This will be needed if a + // NullStream& is implicitly converted to LogStream&, in which case + // the overloaded NullStream::operator<< will not be invoked. + NullStream() : LogMessage::LogStream(message_buffer_, 1, 0) { } + NullStream(const char* /*file*/, int /*line*/, + const CheckOpString& /*result*/) : + LogMessage::LogStream(message_buffer_, 1, 0) { } + NullStream &stream() { return *this; } + private: + // A very short buffer for messages (which we discard anyway). This + // will be needed if NullStream& converted to LogStream& (e.g. as a + // result of a conditional expression). + char message_buffer_[2]; +}; + +// Do nothing. This operator is inline, allowing the message to be +// compiled away. The message will not be compiled away if we do +// something like (flag ? LOG(INFO) : LOG(ERROR)) << message; when +// SKIP_LOG=WARNING. In those cases, NullStream will be implicitly +// converted to LogStream and the message will be computed and then +// quietly discarded. +template<class T> +inline NullStream& operator<<(NullStream &str, const T &value) { return str; } + +// Similar to NullStream, but aborts the program (without stack +// trace), like LogMessageFatal. +class GOOGLE_GLOG_DLL_DECL NullStreamFatal : public NullStream { + public: + NullStreamFatal() { } + NullStreamFatal(const char* file, int line, const CheckOpString& result) : + NullStream(file, line, result) { } + ~NullStreamFatal() { _exit(1); } +}; + +// Install a signal handler that will dump signal information and a stack +// trace when the program crashes on certain signals. We'll install the +// signal handler for the following signals. +// +// SIGSEGV, SIGILL, SIGFPE, SIGABRT, SIGBUS, and SIGTERM. +// +// By default, the signal handler will write the failure dump to the +// standard error. You can customize the destination by installing your +// own writer function by InstallFailureWriter() below. +// +// Note on threading: +// +// The function should be called before threads are created, if you want +// to use the failure signal handler for all threads. The stack trace +// will be shown only for the thread that receives the signal. In other +// words, stack traces of other threads won't be shown. +GOOGLE_GLOG_DLL_DECL void InstallFailureSignalHandler(); + +// Installs a function that is used for writing the failure dump. "data" +// is the pointer to the beginning of a message to be written, and "size" +// is the size of the message. You should not expect the data is +// terminated with '\0'. +GOOGLE_GLOG_DLL_DECL void InstallFailureWriter( + void (*writer)(const char* data, int size)); + +} + +#endif // _LOGGING_H_ diff --git a/extern/libmv/third_party/glog/src/windows/glog/raw_logging.h b/extern/libmv/third_party/glog/src/windows/glog/raw_logging.h new file mode 100644 index 00000000000..c81e67bf99c --- /dev/null +++ b/extern/libmv/third_party/glog/src/windows/glog/raw_logging.h @@ -0,0 +1,189 @@ +// This file is automatically generated from src/glog/raw_logging.h.in +// using src/windows/preprocess.sh. +// DO NOT EDIT! + +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Maxim Lifantsev +// +// Thread-safe logging routines that do not allocate any memory or +// acquire any locks, and can therefore be used by low-level memory +// allocation and synchronization code. + +#ifndef BASE_RAW_LOGGING_H_ +#define BASE_RAW_LOGGING_H_ + +#include <time.h> + +namespace google { + +#include "glog/log_severity.h" +#include "glog/vlog_is_on.h" + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +// This is similar to LOG(severity) << format... and VLOG(level) << format.., +// but +// * it is to be used ONLY by low-level modules that can't use normal LOG() +// * it is desiged to be a low-level logger that does not allocate any +// memory and does not need any locks, hence: +// * it logs straight and ONLY to STDERR w/o buffering +// * it uses an explicit format and arguments list +// * it will silently chop off really long message strings +// Usage example: +// RAW_LOG(ERROR, "Failed foo with %i: %s", status, error); +// RAW_VLOG(3, "status is %i", status); +// These will print an almost standard log lines like this to stderr only: +// E0821 211317 file.cc:123] RAW: Failed foo with 22: bad_file +// I0821 211317 file.cc:142] RAW: status is 20 +#define RAW_LOG(severity, ...) \ + do { \ + switch (google::severity) { \ + case 0: \ + RAW_LOG_INFO(__VA_ARGS__); \ + break; \ + case 1: \ + RAW_LOG_WARNING(__VA_ARGS__); \ + break; \ + case 2: \ + RAW_LOG_ERROR(__VA_ARGS__); \ + break; \ + case 3: \ + RAW_LOG_FATAL(__VA_ARGS__); \ + break; \ + default: \ + break; \ + } \ + } while (0) + +// The following STRIP_LOG testing is performed in the header file so that it's +// possible to completely compile out the logging code and the log messages. +#if STRIP_LOG == 0 +#define RAW_VLOG(verboselevel, ...) \ + do { \ + if (VLOG_IS_ON(verboselevel)) { \ + RAW_LOG_INFO(__VA_ARGS__); \ + } \ + } while (0) +#else +#define RAW_VLOG(verboselevel, ...) RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG == 0 + +#if STRIP_LOG == 0 +#define RAW_LOG_INFO(...) google::RawLog__(google::INFO, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG == 0 + +#if STRIP_LOG <= 1 +#define RAW_LOG_WARNING(...) google::RawLog__(google::WARNING, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG <= 1 + +#if STRIP_LOG <= 2 +#define RAW_LOG_ERROR(...) google::RawLog__(google::ERROR, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG <= 2 + +#if STRIP_LOG <= 3 +#define RAW_LOG_FATAL(...) google::RawLog__(google::FATAL, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_FATAL(...) \ + do { \ + google::RawLogStub__(0, __VA_ARGS__); \ + exit(1); \ + } while (0) +#endif // STRIP_LOG <= 3 + +// Similar to CHECK(condition) << message, +// but for low-level modules: we use only RAW_LOG that does not allocate memory. +// We do not want to provide args list here to encourage this usage: +// if (!cond) RAW_LOG(FATAL, "foo ...", hard_to_compute_args); +// so that the args are not computed when not needed. +#define RAW_CHECK(condition, message) \ + do { \ + if (!(condition)) { \ + RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \ + } \ + } while (0) + +// Debug versions of RAW_LOG and RAW_CHECK +#ifndef NDEBUG + +#define RAW_DLOG(severity, ...) RAW_LOG(severity, __VA_ARGS__) +#define RAW_DCHECK(condition, message) RAW_CHECK(condition, message) + +#else // NDEBUG + +#define RAW_DLOG(severity, ...) \ + while (false) \ + RAW_LOG(severity, __VA_ARGS__) +#define RAW_DCHECK(condition, message) \ + while (false) \ + RAW_CHECK(condition, message) + +#endif // NDEBUG + +// Stub log function used to work around for unused variable warnings when +// building with STRIP_LOG > 0. +static inline void RawLogStub__(int ignored, ...) { +} + +// Helper function to implement RAW_LOG and RAW_VLOG +// Logs format... at "severity" level, reporting it +// as called from file:line. +// This does not allocate memory or acquire locks. +GOOGLE_GLOG_DLL_DECL void RawLog__(LogSeverity severity, + const char* file, + int line, + const char* format, ...) + ; + +// Hack to propagate time information into this module so that +// this module does not have to directly call localtime_r(), +// which could allocate memory. +GOOGLE_GLOG_DLL_DECL void RawLog__SetLastTime(const struct tm& t, int usecs); + +} + +#endif // BASE_RAW_LOGGING_H_ diff --git a/extern/libmv/third_party/glog/src/windows/glog/vlog_is_on.h b/extern/libmv/third_party/glog/src/windows/glog/vlog_is_on.h new file mode 100644 index 00000000000..409a4011b38 --- /dev/null +++ b/extern/libmv/third_party/glog/src/windows/glog/vlog_is_on.h @@ -0,0 +1,133 @@ +// This file is automatically generated from src/glog/vlog_is_on.h.in +// using src/windows/preprocess.sh. +// DO NOT EDIT! + +// Copyright (c) 1999, 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Ray Sidney and many others +// +// Defines the VLOG_IS_ON macro that controls the variable-verbosity +// conditional logging. +// +// It's used by VLOG and VLOG_IF in logging.h +// and by RAW_VLOG in raw_logging.h to trigger the logging. +// +// It can also be used directly e.g. like this: +// if (VLOG_IS_ON(2)) { +// // do some logging preparation and logging +// // that can't be accomplished e.g. via just VLOG(2) << ...; +// } +// +// The truth value that VLOG_IS_ON(level) returns is determined by +// the three verbosity level flags: +// --v=<n> Gives the default maximal active V-logging level; +// 0 is the default. +// Normally positive values are used for V-logging levels. +// --vmodule=<str> Gives the per-module maximal V-logging levels to override +// the value given by --v. +// E.g. "my_module=2,foo*=3" would change the logging level +// for all code in source files "my_module.*" and "foo*.*" +// ("-inl" suffixes are also disregarded for this matching). +// +// SetVLOGLevel helper function is provided to do limited dynamic control over +// V-logging by overriding the per-module settings given via --vmodule flag. +// +// CAVEAT: --vmodule functionality is not available in non gcc compilers. +// + +#ifndef BASE_VLOG_IS_ON_H_ +#define BASE_VLOG_IS_ON_H_ + +#include "glog/log_severity.h" + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +#if defined(__GNUC__) +// We emit an anonymous static int* variable at every VLOG_IS_ON(n) site. +// (Normally) the first time every VLOG_IS_ON(n) site is hit, +// we determine what variable will dynamically control logging at this site: +// it's either FLAGS_v or an appropriate internal variable +// matching the current source file that represents results of +// parsing of --vmodule flag and/or SetVLOGLevel calls. +#define VLOG_IS_ON(verboselevel) \ + __extension__ \ + ({ static google::int32* vlocal__ = &google::kLogSiteUninitialized; \ + google::int32 verbose_level__ = (verboselevel); \ + (*vlocal__ >= verbose_level__) && \ + ((vlocal__ != &google::kLogSiteUninitialized) || \ + (google::InitVLOG3__(&vlocal__, &FLAGS_v, \ + __FILE__, verbose_level__))); }) +#else +// GNU extensions not available, so we do not support --vmodule. +// Dynamic value of FLAGS_v always controls the logging level. +#define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel)) +#endif + +// Set VLOG(_IS_ON) level for module_pattern to log_level. +// This lets us dynamically control what is normally set by the --vmodule flag. +// Returns the level that previously applied to module_pattern. +// NOTE: To change the log level for VLOG(_IS_ON) sites +// that have already executed after/during InitGoogleLogging, +// one needs to supply the exact --vmodule pattern that applied to them. +// (If no --vmodule pattern applied to them +// the value of FLAGS_v will continue to control them.) +extern GOOGLE_GLOG_DLL_DECL int SetVLOGLevel(const char* module_pattern, + int log_level); + +// Various declarations needed for VLOG_IS_ON above: ========================= + +// Special value used to indicate that a VLOG_IS_ON site has not been +// initialized. We make this a large value, so the common-case check +// of "*vlocal__ >= verbose_level__" in VLOG_IS_ON definition +// passes in such cases and InitVLOG3__ is then triggered. +extern google::int32 kLogSiteUninitialized; + +// Helper routine which determines the logging info for a particalur VLOG site. +// site_flag is the address of the site-local pointer to the controlling +// verbosity level +// site_default is the default to use for *site_flag +// fname is the current source file name +// verbose_level is the argument to VLOG_IS_ON +// We will return the return value for VLOG_IS_ON +// and if possible set *site_flag appropriately. +extern GOOGLE_GLOG_DLL_DECL bool InitVLOG3__( + google::int32** site_flag, + google::int32* site_default, + const char* fname, + google::int32 verbose_level); + +#endif // BASE_VLOG_IS_ON_H_ diff --git a/extern/libmv/third_party/glog/src/windows/port.cc b/extern/libmv/third_party/glog/src/windows/port.cc new file mode 100644 index 00000000000..bfa6e70afbb --- /dev/null +++ b/extern/libmv/third_party/glog/src/windows/port.cc @@ -0,0 +1,64 @@ +/* Copyright (c) 2008, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * --- + * Author: Craig Silverstein + * Copied from google-perftools and modified by Shinichiro Hamaji + */ + +#ifndef _WIN32 +# error You should only be including windows/port.cc in a windows environment! +#endif + +#include "config.h" +#include <stdarg.h> // for va_list, va_start, va_end +#include <string.h> // for strstr() +#include <assert.h> +#include <string> +#include <vector> +#include "port.h" + +using std::string; +using std::vector; + +// These call the windows _vsnprintf, but always NUL-terminate. +int safe_vsnprintf(char *str, size_t size, const char *format, va_list ap) { + if (size == 0) // not even room for a \0? + return -1; // not what C99 says to do, but what windows does + str[size-1] = '\0'; + return _vsnprintf(str, size-1, format, ap); +} + +int snprintf(char *str, size_t size, const char *format, ...) { + va_list ap; + va_start(ap, format); + const int r = vsnprintf(str, size, format, ap); + va_end(ap); + return r; +} diff --git a/extern/libmv/third_party/glog/src/windows/port.h b/extern/libmv/third_party/glog/src/windows/port.h new file mode 100644 index 00000000000..d093bf5d34c --- /dev/null +++ b/extern/libmv/third_party/glog/src/windows/port.h @@ -0,0 +1,149 @@ +/* Copyright (c) 2008, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * --- + * Author: Craig Silverstein + * Copied from google-perftools and modified by Shinichiro Hamaji + * + * These are some portability typedefs and defines to make it a bit + * easier to compile this code under VC++. + * + * Several of these are taken from glib: + * http://developer.gnome.org/doc/API/glib/glib-windows-compatability-functions.html + */ + +#ifndef CTEMPLATE_WINDOWS_PORT_H_ +#define CTEMPLATE_WINDOWS_PORT_H_ + +#include "config.h" + +#ifdef _WIN32 + +#define WIN32_LEAN_AND_MEAN /* We always want minimal includes */ +#include <windows.h> +#include <winsock.h> /* for gethostname */ +#include <io.h> /* because we so often use open/close/etc */ +#include <direct.h> /* for _getcwd() */ +#include <process.h> /* for _getpid() */ +#include <stdio.h> /* read in vsnprintf decl. before redifining it */ +#include <stdarg.h> /* template_dictionary.cc uses va_copy */ +#include <string.h> /* for _strnicmp(), strerror_s() */ +#include <time.h> /* for localtime_s() */ +/* Note: the C++ #includes are all together at the bottom. This file is + * used by both C and C++ code, so we put all the C++ together. + */ + +/* 4244: otherwise we get problems when substracting two size_t's to an int + * 4251: it's complaining about a private struct I've chosen not to dllexport + * 4355: we use this in a constructor, but we do it safely + * 4715: for some reason VC++ stopped realizing you can't return after abort() + * 4800: we know we're casting ints/char*'s to bools, and we're ok with that + * 4996: Yes, we're ok using "unsafe" functions like fopen() and strerror() + */ +#pragma warning(disable:4244 4251 4355 4715 4800 4996) + +/* file I/O */ +#define PATH_MAX 1024 +#define access _access +#define getcwd _getcwd +#define open _open +#define read _read +#define write _write +#define lseek _lseek +#define close _close +#define popen _popen +#define pclose _pclose +#define R_OK 04 /* read-only (for access()) */ +#define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) +#ifndef __MINGW32__ +enum { STDIN_FILENO = 0, STDOUT_FILENO = 1, STDERR_FILENO = 2 }; +#endif +#define S_IRUSR S_IREAD +#define S_IWUSR S_IWRITE + +/* Not quite as lightweight as a hard-link, but more than good enough for us. */ +#define link(oldpath, newpath) CopyFileA(oldpath, newpath, false) + +#define strcasecmp _stricmp +#define strncasecmp _strnicmp + +/* In windows-land, hash<> is called hash_compare<> (from xhash.h) */ +#define hash hash_compare + +/* Sleep is in ms, on windows */ +#define sleep(secs) Sleep((secs) * 1000) + +/* We can't just use _vsnprintf and _snprintf as drop-in-replacements, + * because they don't always NUL-terminate. :-( We also can't use the + * name vsnprintf, since windows defines that (but not snprintf (!)). + */ +extern int snprintf(char *str, size_t size, + const char *format, ...); +extern int safe_vsnprintf(char *str, size_t size, + const char *format, va_list ap); +#define vsnprintf(str, size, format, ap) safe_vsnprintf(str, size, format, ap) +#define va_copy(dst, src) (dst) = (src) + +/* Windows doesn't support specifying the number of buckets as a + * hash_map constructor arg, so we leave this blank. + */ +#define CTEMPLATE_SMALL_HASHTABLE + +#define DEFAULT_TEMPLATE_ROOTDIR ".." + +// ----------------------------------- SYSTEM/PROCESS +typedef int pid_t; +#define getpid _getpid + +// ----------------------------------- THREADS +typedef DWORD pthread_t; +typedef DWORD pthread_key_t; +typedef LONG pthread_once_t; +enum { PTHREAD_ONCE_INIT = 0 }; // important that this be 0! for SpinLock +#define pthread_self GetCurrentThreadId +#define pthread_equal(pthread_t_1, pthread_t_2) ((pthread_t_1)==(pthread_t_2)) + +inline struct tm* localtime_r(const time_t* timep, struct tm* result) { + localtime_s(result, timep); + return result; +} + +inline char* strerror_r(int errnum, char* buf, size_t buflen) { + strerror_s(buf, buflen, errnum); + return buf; +} + +#ifndef __cplusplus +/* I don't see how to get inlining for C code in MSVC. Ah well. */ +#define inline +#endif + +#endif /* _WIN32 */ + +#endif /* CTEMPLATE_WINDOWS_PORT_H_ */ diff --git a/extern/libmv/third_party/glog/src/windows/preprocess.sh b/extern/libmv/third_party/glog/src/windows/preprocess.sh new file mode 100755 index 00000000000..ea4352e8e3a --- /dev/null +++ b/extern/libmv/third_party/glog/src/windows/preprocess.sh @@ -0,0 +1,118 @@ +#!/bin/sh + +# Copyright (c) 2008, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# --- +# Author: Craig Silverstein +# Copied from google-perftools and modified by Shinichiro Hamaji +# +# This script is meant to be run at distribution-generation time, for +# instance by autogen.sh. It does some of the work configure would +# normally do, for windows systems. In particular, it expands all the +# @...@ variables found in .in files, and puts them here, in the windows +# directory. +# +# This script should be run before any new release. + +if [ -z "$1" ]; then + echo "USAGE: $0 <src/ directory>" + exit 1 +fi + +DLLDEF_MACRO_NAME="GLOG_DLL_DECL" + +# The text we put in every .h files we create. As a courtesy, we'll +# include a helpful comment for windows users as to how to use +# GLOG_DLL_DECL. Apparently sed expands \n into a newline. Good! +DLLDEF_DEFINES="\ +// NOTE: if you are statically linking the template library into your binary\n\ +// (rather than using the template .dll), set '/D $DLLDEF_MACRO_NAME='\n\ +// as a compiler flag in your project file to turn off the dllimports.\n\ +#ifndef $DLLDEF_MACRO_NAME\n\ +# define $DLLDEF_MACRO_NAME __declspec(dllimport)\n\ +#endif" + +# Read all the windows config info into variables +# In order for the 'set' to take, this requires putting all in a subshell. +( + while read define varname value; do + [ "$define" != "#define" ] && continue + eval "$varname='$value'" + done + + # Process all the .in files in the "glog" subdirectory + mkdir -p "$1/windows/glog" + for file in `echo "$1"/glog/*.in`; do + echo "Processing $file" + outfile="$1/windows/glog/`basename $file .in`" + + echo "\ +// This file is automatically generated from $file +// using src/windows/preprocess.sh. +// DO NOT EDIT! +" > "$outfile" + # Besides replacing @...@, we also need to turn on dllimport + # We also need to replace hash by hash_compare (annoying we hard-code :-( ) + sed -e "s!@ac_windows_dllexport@!$DLLDEF_MACRO_NAME!g" \ + -e "s!@ac_windows_dllexport_defines@!$DLLDEF_DEFINES!g" \ + -e "s!@ac_cv_cxx_hash_map@!$HASH_MAP_H!g" \ + -e "s!@ac_cv_cxx_hash_namespace@!$HASH_NAMESPACE!g" \ + -e "s!@ac_cv_cxx_hash_set@!$HASH_SET_H!g" \ + -e "s!@ac_cv_have_stdint_h@!0!g" \ + -e "s!@ac_cv_have_systypes_h@!0!g" \ + -e "s!@ac_cv_have_inttypes_h@!0!g" \ + -e "s!@ac_cv_have_unistd_h@!0!g" \ + -e "s!@ac_cv_have_uint16_t@!0!g" \ + -e "s!@ac_cv_have_u_int16_t@!0!g" \ + -e "s!@ac_cv_have___uint16@!1!g" \ + -e "s!@ac_cv_have_libgflags@!0!g" \ + -e "s!@ac_cv_have___builtin_expect@!0!g" \ + -e "s!@ac_cv_cxx_using_operator@!1!g" \ + -e "s!@ac_cv___attribute___noreturn@!!g" \ + -e "s!@ac_cv___attribute___printf_4_5@!!g" \ + -e "s!@ac_google_attribute@!${HAVE___ATTRIBUTE__:-0}!g" \ + -e "s!@ac_google_end_namespace@!$_END_GOOGLE_NAMESPACE_!g" \ + -e "s!@ac_google_namespace@!$GOOGLE_NAMESPACE!g" \ + -e "s!@ac_google_start_namespace@!$_START_GOOGLE_NAMESPACE_!g" \ + -e "s!@ac_htmlparser_namespace@!$HTMLPARSER_NAMESPACE!g" \ + -e "s!\\bhash\\b!hash_compare!g" \ + "$file" >> "$outfile" + done +) < "$1/windows/config.h" + +# log_severity.h isn't a .in file. +echo "\ +// This file is automatically generated from $1/glog/log_severity.h +// using src/windows/preprocess.sh. +// DO NOT EDIT! +" > "$1/windows/glog/log_severity.h" +cat "$1/glog/log_severity.h" >> "$1/windows/glog/log_severity.h" + +echo "DONE" diff --git a/extern/libmv/third_party/ldl/CMakeLists.txt b/extern/libmv/third_party/ldl/CMakeLists.txt new file mode 100644 index 00000000000..db2d40e2612 --- /dev/null +++ b/extern/libmv/third_party/ldl/CMakeLists.txt @@ -0,0 +1,5 @@ +include_directories(../ufconfig) +include_directories(Include) +add_library(ldl Source/ldl.c) + +LIBMV_INSTALL_THIRD_PARTY_LIB(ldl) diff --git a/extern/libmv/third_party/ldl/Doc/ChangeLog b/extern/libmv/third_party/ldl/Doc/ChangeLog new file mode 100644 index 00000000000..48c322d3e77 --- /dev/null +++ b/extern/libmv/third_party/ldl/Doc/ChangeLog @@ -0,0 +1,39 @@ +May 31, 2007: version 2.0.0 + + * C-callable 64-bit version added + + * ported to 64-bit MATLAB + + * subdirectories added (Source/, Include/, Lib/, Demo/, Doc/, MATLAB/) + +Dec 12, 2006: version 1.3.4 + + * minor MATLAB cleanup + +Sept 11, 2006: version 1.3.1 + + * The ldl m-file renamed to ldlsparse, to avoid name conflict with the + new MATLAB ldl function (in MATLAB 7.3). + +Apr 30, 2006: version 1.3 + + * requires AMD v2.0. ldlmain.c demo program modified, since AMD can now + handle jumbled matrices. Minor change to Makefile. + +Aug 30, 2005: + + * Makefile changed to use ../UFconfig/UFconfig.mk. License changed to + GNU LGPL. + +July 4, 2005: + + * user guide added. Since no changes to the code were made, + the version number (1.1) and code release date (Apr 22, 2005) + were left unchanged. + +Apr. 22, 2005: LDL v1.1 released. + + * No real changes were made. The code was revised so + that each routine fits on a single page in the documentation. + +Dec 31, 2003: LDL v1.0 released. diff --git a/extern/libmv/third_party/ldl/Doc/lesser.txt b/extern/libmv/third_party/ldl/Doc/lesser.txt new file mode 100644 index 00000000000..8add30ad590 --- /dev/null +++ b/extern/libmv/third_party/ldl/Doc/lesser.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/extern/libmv/third_party/ldl/Include/ldl.h b/extern/libmv/third_party/ldl/Include/ldl.h new file mode 100644 index 00000000000..5840be322f7 --- /dev/null +++ b/extern/libmv/third_party/ldl/Include/ldl.h @@ -0,0 +1,104 @@ +/* ========================================================================== */ +/* === ldl.h: include file for the LDL package ============================= */ +/* ========================================================================== */ + +/* LDL Copyright (c) Timothy A Davis, + * University of Florida. All Rights Reserved. See README for the License. + */ + +#include "UFconfig.h" + +#ifdef LDL_LONG +#define LDL_int UF_long +#define LDL_ID UF_long_id + +#define LDL_symbolic ldl_l_symbolic +#define LDL_numeric ldl_l_numeric +#define LDL_lsolve ldl_l_lsolve +#define LDL_dsolve ldl_l_dsolve +#define LDL_ltsolve ldl_l_ltsolve +#define LDL_perm ldl_l_perm +#define LDL_permt ldl_l_permt +#define LDL_valid_perm ldl_l_valid_perm +#define LDL_valid_matrix ldl_l_valid_matrix + +#else +#define LDL_int int +#define LDL_ID "%d" + +#define LDL_symbolic ldl_symbolic +#define LDL_numeric ldl_numeric +#define LDL_lsolve ldl_lsolve +#define LDL_dsolve ldl_dsolve +#define LDL_ltsolve ldl_ltsolve +#define LDL_perm ldl_perm +#define LDL_permt ldl_permt +#define LDL_valid_perm ldl_valid_perm +#define LDL_valid_matrix ldl_valid_matrix + +#endif + +/* ========================================================================== */ +/* === int version ========================================================== */ +/* ========================================================================== */ + +void ldl_symbolic (int n, int Ap [ ], int Ai [ ], int Lp [ ], + int Parent [ ], int Lnz [ ], int Flag [ ], int P [ ], int Pinv [ ]) ; + +int ldl_numeric (int n, int Ap [ ], int Ai [ ], double Ax [ ], + int Lp [ ], int Parent [ ], int Lnz [ ], int Li [ ], double Lx [ ], + double D [ ], double Y [ ], int Pattern [ ], int Flag [ ], + int P [ ], int Pinv [ ]) ; + +void ldl_lsolve (int n, double X [ ], int Lp [ ], int Li [ ], + double Lx [ ]) ; + +void ldl_dsolve (int n, double X [ ], double D [ ]) ; + +void ldl_ltsolve (int n, double X [ ], int Lp [ ], int Li [ ], + double Lx [ ]) ; + +void ldl_perm (int n, double X [ ], double B [ ], int P [ ]) ; +void ldl_permt (int n, double X [ ], double B [ ], int P [ ]) ; + +int ldl_valid_perm (int n, int P [ ], int Flag [ ]) ; +int ldl_valid_matrix ( int n, int Ap [ ], int Ai [ ]) ; + +/* ========================================================================== */ +/* === long version ========================================================= */ +/* ========================================================================== */ + +void ldl_l_symbolic (UF_long n, UF_long Ap [ ], UF_long Ai [ ], UF_long Lp [ ], + UF_long Parent [ ], UF_long Lnz [ ], UF_long Flag [ ], UF_long P [ ], + UF_long Pinv [ ]) ; + +UF_long ldl_l_numeric (UF_long n, UF_long Ap [ ], UF_long Ai [ ], double Ax [ ], + UF_long Lp [ ], UF_long Parent [ ], UF_long Lnz [ ], UF_long Li [ ], + double Lx [ ], double D [ ], double Y [ ], UF_long Pattern [ ], + UF_long Flag [ ], UF_long P [ ], UF_long Pinv [ ]) ; + +void ldl_l_lsolve (UF_long n, double X [ ], UF_long Lp [ ], UF_long Li [ ], + double Lx [ ]) ; + +void ldl_l_dsolve (UF_long n, double X [ ], double D [ ]) ; + +void ldl_l_ltsolve (UF_long n, double X [ ], UF_long Lp [ ], UF_long Li [ ], + double Lx [ ]) ; + +void ldl_l_perm (UF_long n, double X [ ], double B [ ], UF_long P [ ]) ; +void ldl_l_permt (UF_long n, double X [ ], double B [ ], UF_long P [ ]) ; + +UF_long ldl_l_valid_perm (UF_long n, UF_long P [ ], UF_long Flag [ ]) ; +UF_long ldl_l_valid_matrix ( UF_long n, UF_long Ap [ ], UF_long Ai [ ]) ; + +/* ========================================================================== */ +/* === LDL version ========================================================== */ +/* ========================================================================== */ + +#define LDL_DATE "Nov 1, 2007" +#define LDL_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) +#define LDL_MAIN_VERSION 2 +#define LDL_SUB_VERSION 0 +#define LDL_SUBSUB_VERSION 1 +#define LDL_VERSION LDL_VERSION_CODE(LDL_MAIN_VERSION,LDL_SUB_VERSION) + diff --git a/extern/libmv/third_party/ldl/README.libmv b/extern/libmv/third_party/ldl/README.libmv new file mode 100644 index 00000000000..64ece48a390 --- /dev/null +++ b/extern/libmv/third_party/ldl/README.libmv @@ -0,0 +1,10 @@ +Project: LDL +URL: http://www.cise.ufl.edu/research/sparse/ldl/ +License: LGPL2.1 +Upstream version: 2.0.1 (despite the ChangeLog saying 2.0.0) + +Local modifications: + + * Deleted everything except ldl.c, ldl.h, the license, the ChangeLog, and the + README. + diff --git a/extern/libmv/third_party/ldl/README.txt b/extern/libmv/third_party/ldl/README.txt new file mode 100644 index 00000000000..7be8dd1f001 --- /dev/null +++ b/extern/libmv/third_party/ldl/README.txt @@ -0,0 +1,136 @@ +LDL Version 2.0: a sparse LDL' factorization and solve package. + Written in C, with both a C and MATLAB mexFunction interface. + +These routines are not terrifically fast (they do not use dense matrix kernels), +but the code is very short and concise. The purpose is to illustrate the +algorithms in a very concise and readable manner, primarily for educational +purposes. Although the code is very concise, this package is slightly faster +than the built-in sparse Cholesky factorization in MATLAB 6.5 (chol), when +using the same input permutation. + +Requires UFconfig, in the ../UFconfig directory relative to this directory. + +Quick start (Unix, or Windows with Cygwin): + + To compile, test, and install LDL, you may wish to first obtain a copy of + AMD v2.0 from http://www.cise.ufl.edu/research/sparse, and place it in the + ../AMD directory, relative to this directory. Next, type "make", which + will compile the LDL library and three demo main programs (one of which + requires AMD). It will also compile the LDL MATLAB mexFunction (if you + have MATLAB). Typing "make clean" will remove non-essential files. + AMD v2.0 or later is required. Its use is optional. + +Quick start (for MATLAB users); + + To compile, test, and install the LDL mexFunctions (ldlsparse and + ldlsymbol), start MATLAB in this directory and type ldl_install. + This works on any system supported by MATLAB. + +-------------------------------------------------------------------------------- + +LDL Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved. + +LDL License: + + Your use or distribution of LDL or any modified version of + LDL implies that you agree to this License. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + + Permission is hereby granted to use or copy this program under the + terms of the GNU LGPL, provided that the Copyright, this License, + and the Availability of the original version is retained on all copies. + User documentation of any code that uses this code or any modified + version of this code must cite the Copyright, this License, the + Availability note, and "Used by permission." Permission to modify + the code and to distribute modified code is granted, provided the + Copyright, this License, and the Availability note are retained, + and a notice that the code was modified is included. + +Availability: + + http://www.cise.ufl.edu/research/sparse/ldl + +Acknowledgements: + + This work was supported by the National Science Foundation, under + grant CCR-0203270. + + Portions of this work were done while on sabbatical at Stanford University + and Lawrence Berkeley National Laboratory (with funding from the SciDAC + program). I would like to thank Gene Golub, Esmond Ng, and Horst Simon + for making this sabbatical possible. I would like to thank Pete Stewart + for his comments on a draft of this software and paper. + +-------------------------------------------------------------------------------- +Files and directories in this distribution: +-------------------------------------------------------------------------------- + + Documentation, and compiling: + + README.txt this file + Makefile for compiling LDL + ChangeLog changes since V1.0 (Dec 31, 2003) + License license + lesser.txt the GNU LGPL license + + ldl_userguide.pdf user guide in PDF + ldl_userguide.ps user guide in postscript + ldl_userguide.tex user guide in Latex + ldl.bib bibliography for user guide + + The LDL library itself: + + ldl.c the C-callable routines + ldl.h include file for any code that calls LDL + + A simple C main program that demonstrates how to use LDL: + + ldlsimple.c a stand-alone C program, uses the basic features of LDL + ldlsimple.out output of ldlsimple + + ldllsimple.c long integer version of ldlsimple.c + + Demo C program, for testing LDL and providing an example of its use + + ldlmain.c a stand-alone C main program that uses and tests LDL + Matrix a directory containing matrices used by ldlmain.c + ldlmain.out output of ldlmain + ldlamd.out output of ldlamd (ldlmain.c compiled with AMD) + ldllamd.out output of ldllamd (ldlmain.c compiled with AMD, long) + + MATLAB-related, not required for use in a regular C program + + Contents.m a list of the MATLAB-callable routines + ldl.m MATLAB help file for the LDL mexFunction + ldldemo.m MATLAB demo of how to use the LDL mexFunction + ldldemo.out diary output of ldldemo + ldltest.m to test the LDL mexFunction + ldltest.out diary output of ldltest + ldlmex.c the LDL mexFunction for MATLAB + ldlrow.m the numerical algorithm that LDL is based on + ldlmain2.m compiles and runs ldlmain.c as a MATLAB mexFunction + ldlmain2.out output of ldlmain2.m + ldlsymbolmex.c symbolic factorization using LDL (see SYMBFACT, ETREE) + ldlsymbol.m help file for the LDLSYMBOL mexFunction + + ldl_install.m compile, install, and test LDL functions + ldl_make.m compile LDL (ldlsparse and ldlsymbol) + + ldlsparse.m help for ldlsparse + +See ldl.c for a description of how to use the code from a C program. Type +"help ldl" in MATLAB for information on how to use LDL in a MATLAB program. diff --git a/extern/libmv/third_party/ldl/Source/ldl.c b/extern/libmv/third_party/ldl/Source/ldl.c new file mode 100644 index 00000000000..a9b35c846ef --- /dev/null +++ b/extern/libmv/third_party/ldl/Source/ldl.c @@ -0,0 +1,507 @@ +/* ========================================================================== */ +/* === ldl.c: sparse LDL' factorization and solve package =================== */ +/* ========================================================================== */ + +/* LDL: a simple set of routines for sparse LDL' factorization. These routines + * are not terrifically fast (they do not use dense matrix kernels), but the + * code is very short. The purpose is to illustrate the algorithms in a very + * concise manner, primarily for educational purposes. Although the code is + * very concise, this package is slightly faster than the built-in sparse + * Cholesky factorization in MATLAB 7.0 (chol), when using the same input + * permutation. + * + * The routines compute the LDL' factorization of a real sparse symmetric + * matrix A (or PAP' if a permutation P is supplied), and solve upper + * and lower triangular systems with the resulting L and D factors. If A is + * positive definite then the factorization will be accurate. A can be + * indefinite (with negative values on the diagonal D), but in this case no + * guarantee of accuracy is provided, since no numeric pivoting is performed. + * + * The n-by-n sparse matrix A is in compressed-column form. The nonzero values + * in column j are stored in Ax [Ap [j] ... Ap [j+1]-1], with corresponding row + * indices in Ai [Ap [j] ... Ap [j+1]-1]. Ap [0] = 0 is required, and thus + * nz = Ap [n] is the number of nonzeros in A. Ap is an int array of size n+1. + * The int array Ai and the double array Ax are of size nz. This data structure + * is identical to the one used by MATLAB, except for the following + * generalizations. The row indices in each column of A need not be in any + * particular order, although they must be in the range 0 to n-1. Duplicate + * entries can be present; any duplicates are summed. That is, if row index i + * appears twice in a column j, then the value of A (i,j) is the sum of the two + * entries. The data structure used here for the input matrix A is more + * flexible than MATLAB's, which requires sorted columns with no duplicate + * entries. + * + * Only the diagonal and upper triangular part of A (or PAP' if a permutation + * P is provided) is accessed. The lower triangular parts of the matrix A or + * PAP' can be present, but they are ignored. + * + * The optional input permutation is provided as an array P of length n. If + * P [k] = j, the row and column j of A is the kth row and column of PAP'. + * If P is present then the factorization is LDL' = PAP' or L*D*L' = A(P,P) in + * 0-based MATLAB notation. If P is not present (a null pointer) then no + * permutation is performed, and the factorization is LDL' = A. + * + * The lower triangular matrix L is stored in the same compressed-column + * form (an int Lp array of size n+1, an int Li array of size Lp [n], and a + * double array Lx of the same size as Li). It has a unit diagonal, which is + * not stored. The row indices in each column of L are always returned in + * ascending order, with no duplicate entries. This format is compatible with + * MATLAB, except that it would be more convenient for MATLAB to include the + * unit diagonal of L. Doing so here would add additional complexity to the + * code, and is thus omitted in the interest of keeping this code short and + * readable. + * + * The elimination tree is held in the Parent [0..n-1] array. It is normally + * not required by the user, but it is required by ldl_numeric. The diagonal + * matrix D is held as an array D [0..n-1] of size n. + * + * -------------------- + * C-callable routines: + * -------------------- + * + * ldl_symbolic: Given the pattern of A, computes the Lp and Parent arrays + * required by ldl_numeric. Takes time proportional to the number of + * nonzeros in L. Computes the inverse Pinv of P if P is provided. + * Also returns Lnz, the count of nonzeros in each column of L below + * the diagonal (this is not required by ldl_numeric). + * ldl_numeric: Given the pattern and numerical values of A, the Lp array, + * the Parent array, and P and Pinv if applicable, computes the + * pattern and numerical values of L and D. + * ldl_lsolve: Solves Lx=b for a dense vector b. + * ldl_dsolve: Solves Dx=b for a dense vector b. + * ldl_ltsolve: Solves L'x=b for a dense vector b. + * ldl_perm: Computes x=Pb for a dense vector b. + * ldl_permt: Computes x=P'b for a dense vector b. + * ldl_valid_perm: checks the validity of a permutation vector + * ldl_valid_matrix: checks the validity of the sparse matrix A + * + * ---------------------------- + * Limitations of this package: + * ---------------------------- + * + * In the interest of keeping this code simple and readable, ldl_symbolic and + * ldl_numeric assume their inputs are valid. You can check your own inputs + * prior to calling these routines with the ldl_valid_perm and ldl_valid_matrix + * routines. Except for the two ldl_valid_* routines, no routine checks to see + * if the array arguments are present (non-NULL). Like all C routines, no + * routine can determine if the arrays are long enough and don't overlap. + * + * The ldl_numeric does check the numerical factorization, however. It returns + * n if the factorization is successful. If D (k,k) is zero, then k is + * returned, and L is only partially computed. + * + * No pivoting to control fill-in is performed, which is often critical for + * obtaining good performance. I recommend that you compute the permutation P + * using AMD or SYMAMD (approximate minimum degree ordering routines), or an + * appropriate graph-partitioning based ordering. See the ldldemo.m routine for + * an example in MATLAB, and the ldlmain.c stand-alone C program for examples of + * how to find P. Routines for manipulating compressed-column matrices are + * available in UMFPACK. AMD, SYMAMD, UMFPACK, and this LDL package are all + * available at http://www.cise.ufl.edu/research/sparse. + * + * ------------------------- + * Possible simplifications: + * ------------------------- + * + * These routines could be made even simpler with a few additional assumptions. + * If no input permutation were performed, the caller would have to permute the + * matrix first, but the computation of Pinv, and the use of P and Pinv could be + * removed. If only the diagonal and upper triangular part of A or PAP' are + * present, then the tests in the "if (i < k)" statement in ldl_symbolic and + * "if (i <= k)" in ldl_numeric, are always true, and could be removed (i can + * equal k in ldl_symbolic, but then the body of the if statement would + * correctly do no work since Flag [k] == k). If we could assume that no + * duplicate entries are present, then the statement Y [i] += Ax [p] could be + * replaced with Y [i] = Ax [p] in ldl_numeric. + * + * -------------------------- + * Description of the method: + * -------------------------- + * + * LDL computes the symbolic factorization by finding the pattern of L one row + * at a time. It does this based on the following theory. Consider a sparse + * system Lx=b, where L, x, and b, are all sparse, and where L comes from a + * Cholesky (or LDL') factorization. The elimination tree (etree) of L is + * defined as follows. The parent of node j is the smallest k > j such that + * L (k,j) is nonzero. Node j has no parent if column j of L is completely zero + * below the diagonal (j is a root of the etree in this case). The nonzero + * pattern of x is the union of the paths from each node i to the root, for + * each nonzero b (i). To compute the numerical solution to Lx=b, we can + * traverse the columns of L corresponding to nonzero values of x. This + * traversal does not need to be done in the order 0 to n-1. It can be done in + * any "topological" order, such that x (i) is computed before x (j) if i is a + * descendant of j in the elimination tree. + * + * The row-form of the LDL' factorization is shown in the MATLAB function + * ldlrow.m in this LDL package. Note that row k of L is found via a sparse + * triangular solve of L (1:k-1, 1:k-1) \ A (1:k-1, k), to use 1-based MATLAB + * notation. Thus, we can start with the nonzero pattern of the kth column of + * A (above the diagonal), follow the paths up to the root of the etree of the + * (k-1)-by-(k-1) leading submatrix of L, and obtain the pattern of the kth row + * of L. Note that we only need the leading (k-1)-by-(k-1) submatrix of L to + * do this. The elimination tree can be constructed as we go. + * + * The symbolic factorization does the same thing, except that it discards the + * pattern of L as it is computed. It simply counts the number of nonzeros in + * each column of L and then constructs the Lp index array when it's done. The + * symbolic factorization does not need to do this in topological order. + * Compare ldl_symbolic with the first part of ldl_numeric, and note that the + * while (len > 0) loop is not present in ldl_symbolic. + * + * LDL Version 1.3, Copyright (c) 2006 by Timothy A Davis, + * University of Florida. All Rights Reserved. Developed while on sabbatical + * at Stanford University and Lawrence Berkeley National Laboratory. Refer to + * the README file for the License. Available at + * http://www.cise.ufl.edu/research/sparse. + */ + +#include "ldl.h" + +/* ========================================================================== */ +/* === ldl_symbolic ========================================================= */ +/* ========================================================================== */ + +/* The input to this routine is a sparse matrix A, stored in column form, and + * an optional permutation P. The output is the elimination tree + * and the number of nonzeros in each column of L. Parent [i] = k if k is the + * parent of i in the tree. The Parent array is required by ldl_numeric. + * Lnz [k] gives the number of nonzeros in the kth column of L, excluding the + * diagonal. + * + * One workspace vector (Flag) of size n is required. + * + * If P is NULL, then it is ignored. The factorization will be LDL' = A. + * Pinv is not computed. In this case, neither P nor Pinv are required by + * ldl_numeric. + * + * If P is not NULL, then it is assumed to be a valid permutation. If + * row and column j of A is the kth pivot, the P [k] = j. The factorization + * will be LDL' = PAP', or A (p,p) in MATLAB notation. The inverse permutation + * Pinv is computed, where Pinv [j] = k if P [k] = j. In this case, both P + * and Pinv are required as inputs to ldl_numeric. + * + * The floating-point operation count of the subsequent call to ldl_numeric + * is not returned, but could be computed after ldl_symbolic is done. It is + * the sum of (Lnz [k]) * (Lnz [k] + 2) for k = 0 to n-1. + */ + +void LDL_symbolic +( + LDL_int n, /* A and L are n-by-n, where n >= 0 */ + LDL_int Ap [ ], /* input of size n+1, not modified */ + LDL_int Ai [ ], /* input of size nz=Ap[n], not modified */ + LDL_int Lp [ ], /* output of size n+1, not defined on input */ + LDL_int Parent [ ], /* output of size n, not defined on input */ + LDL_int Lnz [ ], /* output of size n, not defined on input */ + LDL_int Flag [ ], /* workspace of size n, not defn. on input or output */ + LDL_int P [ ], /* optional input of size n */ + LDL_int Pinv [ ] /* optional output of size n (used if P is not NULL) */ +) +{ + LDL_int i, k, p, kk, p2 ; + if (P) + { + /* If P is present then compute Pinv, the inverse of P */ + for (k = 0 ; k < n ; k++) + { + Pinv [P [k]] = k ; + } + } + for (k = 0 ; k < n ; k++) + { + /* L(k,:) pattern: all nodes reachable in etree from nz in A(0:k-1,k) */ + Parent [k] = -1 ; /* parent of k is not yet known */ + Flag [k] = k ; /* mark node k as visited */ + Lnz [k] = 0 ; /* count of nonzeros in column k of L */ + kk = (P) ? (P [k]) : (k) ; /* kth original, or permuted, column */ + p2 = Ap [kk+1] ; + for (p = Ap [kk] ; p < p2 ; p++) + { + /* A (i,k) is nonzero (original or permuted A) */ + i = (Pinv) ? (Pinv [Ai [p]]) : (Ai [p]) ; + if (i < k) + { + /* follow path from i to root of etree, stop at flagged node */ + for ( ; Flag [i] != k ; i = Parent [i]) + { + /* find parent of i if not yet determined */ + if (Parent [i] == -1) Parent [i] = k ; + Lnz [i]++ ; /* L (k,i) is nonzero */ + Flag [i] = k ; /* mark i as visited */ + } + } + } + } + /* construct Lp index array from Lnz column counts */ + Lp [0] = 0 ; + for (k = 0 ; k < n ; k++) + { + Lp [k+1] = Lp [k] + Lnz [k] ; + } +} + + +/* ========================================================================== */ +/* === ldl_numeric ========================================================== */ +/* ========================================================================== */ + +/* Given a sparse matrix A (the arguments n, Ap, Ai, and Ax) and its symbolic + * analysis (Lp and Parent, and optionally P and Pinv), compute the numeric LDL' + * factorization of A or PAP'. The outputs of this routine are arguments Li, + * Lx, and D. It also requires three size-n workspaces (Y, Pattern, and Flag). + */ + +LDL_int LDL_numeric /* returns n if successful, k if D (k,k) is zero */ +( + LDL_int n, /* A and L are n-by-n, where n >= 0 */ + LDL_int Ap [ ], /* input of size n+1, not modified */ + LDL_int Ai [ ], /* input of size nz=Ap[n], not modified */ + double Ax [ ], /* input of size nz=Ap[n], not modified */ + LDL_int Lp [ ], /* input of size n+1, not modified */ + LDL_int Parent [ ], /* input of size n, not modified */ + LDL_int Lnz [ ], /* output of size n, not defn. on input */ + LDL_int Li [ ], /* output of size lnz=Lp[n], not defined on input */ + double Lx [ ], /* output of size lnz=Lp[n], not defined on input */ + double D [ ], /* output of size n, not defined on input */ + double Y [ ], /* workspace of size n, not defn. on input or output */ + LDL_int Pattern [ ],/* workspace of size n, not defn. on input or output */ + LDL_int Flag [ ], /* workspace of size n, not defn. on input or output */ + LDL_int P [ ], /* optional input of size n */ + LDL_int Pinv [ ] /* optional input of size n */ +) +{ + double yi, l_ki ; + LDL_int i, k, p, kk, p2, len, top ; + for (k = 0 ; k < n ; k++) + { + /* compute nonzero Pattern of kth row of L, in topological order */ + Y [k] = 0.0 ; /* Y(0:k) is now all zero */ + top = n ; /* stack for pattern is empty */ + Flag [k] = k ; /* mark node k as visited */ + Lnz [k] = 0 ; /* count of nonzeros in column k of L */ + kk = (P) ? (P [k]) : (k) ; /* kth original, or permuted, column */ + p2 = Ap [kk+1] ; + for (p = Ap [kk] ; p < p2 ; p++) + { + i = (Pinv) ? (Pinv [Ai [p]]) : (Ai [p]) ; /* get A(i,k) */ + if (i <= k) + { + Y [i] += Ax [p] ; /* scatter A(i,k) into Y (sum duplicates) */ + for (len = 0 ; Flag [i] != k ; i = Parent [i]) + { + Pattern [len++] = i ; /* L(k,i) is nonzero */ + Flag [i] = k ; /* mark i as visited */ + } + while (len > 0) Pattern [--top] = Pattern [--len] ; + } + } + /* compute numerical values kth row of L (a sparse triangular solve) */ + D [k] = Y [k] ; /* get D(k,k) and clear Y(k) */ + Y [k] = 0.0 ; + for ( ; top < n ; top++) + { + i = Pattern [top] ; /* Pattern [top:n-1] is pattern of L(:,k) */ + yi = Y [i] ; /* get and clear Y(i) */ + Y [i] = 0.0 ; + p2 = Lp [i] + Lnz [i] ; + for (p = Lp [i] ; p < p2 ; p++) + { + Y [Li [p]] -= Lx [p] * yi ; + } + l_ki = yi / D [i] ; /* the nonzero entry L(k,i) */ + D [k] -= l_ki * yi ; + Li [p] = k ; /* store L(k,i) in column form of L */ + Lx [p] = l_ki ; + Lnz [i]++ ; /* increment count of nonzeros in col i */ + } + if (D [k] == 0.0) return (k) ; /* failure, D(k,k) is zero */ + } + return (n) ; /* success, diagonal of D is all nonzero */ +} + + +/* ========================================================================== */ +/* === ldl_lsolve: solve Lx=b ============================================== */ +/* ========================================================================== */ + +void LDL_lsolve +( + LDL_int n, /* L is n-by-n, where n >= 0 */ + double X [ ], /* size n. right-hand-side on input, soln. on output */ + LDL_int Lp [ ], /* input of size n+1, not modified */ + LDL_int Li [ ], /* input of size lnz=Lp[n], not modified */ + double Lx [ ] /* input of size lnz=Lp[n], not modified */ +) +{ + LDL_int j, p, p2 ; + for (j = 0 ; j < n ; j++) + { + p2 = Lp [j+1] ; + for (p = Lp [j] ; p < p2 ; p++) + { + X [Li [p]] -= Lx [p] * X [j] ; + } + } +} + + +/* ========================================================================== */ +/* === ldl_dsolve: solve Dx=b ============================================== */ +/* ========================================================================== */ + +void LDL_dsolve +( + LDL_int n, /* D is n-by-n, where n >= 0 */ + double X [ ], /* size n. right-hand-side on input, soln. on output */ + double D [ ] /* input of size n, not modified */ +) +{ + LDL_int j ; + for (j = 0 ; j < n ; j++) + { + X [j] /= D [j] ; + } +} + + +/* ========================================================================== */ +/* === ldl_ltsolve: solve L'x=b ============================================ */ +/* ========================================================================== */ + +void LDL_ltsolve +( + LDL_int n, /* L is n-by-n, where n >= 0 */ + double X [ ], /* size n. right-hand-side on input, soln. on output */ + LDL_int Lp [ ], /* input of size n+1, not modified */ + LDL_int Li [ ], /* input of size lnz=Lp[n], not modified */ + double Lx [ ] /* input of size lnz=Lp[n], not modified */ +) +{ + int j, p, p2 ; + for (j = n-1 ; j >= 0 ; j--) + { + p2 = Lp [j+1] ; + for (p = Lp [j] ; p < p2 ; p++) + { + X [j] -= Lx [p] * X [Li [p]] ; + } + } +} + + +/* ========================================================================== */ +/* === ldl_perm: permute a vector, x=Pb ===================================== */ +/* ========================================================================== */ + +void LDL_perm +( + LDL_int n, /* size of X, B, and P */ + double X [ ], /* output of size n. */ + double B [ ], /* input of size n. */ + LDL_int P [ ] /* input permutation array of size n. */ +) +{ + LDL_int j ; + for (j = 0 ; j < n ; j++) + { + X [j] = B [P [j]] ; + } +} + + +/* ========================================================================== */ +/* === ldl_permt: permute a vector, x=P'b =================================== */ +/* ========================================================================== */ + +void LDL_permt +( + LDL_int n, /* size of X, B, and P */ + double X [ ], /* output of size n. */ + double B [ ], /* input of size n. */ + LDL_int P [ ] /* input permutation array of size n. */ +) +{ + LDL_int j ; + for (j = 0 ; j < n ; j++) + { + X [P [j]] = B [j] ; + } +} + + +/* ========================================================================== */ +/* === ldl_valid_perm: check if a permutation vector is valid =============== */ +/* ========================================================================== */ + +LDL_int LDL_valid_perm /* returns 1 if valid, 0 otherwise */ +( + LDL_int n, + LDL_int P [ ], /* input of size n, a permutation of 0:n-1 */ + LDL_int Flag [ ] /* workspace of size n */ +) +{ + LDL_int j, k ; + if (n < 0 || !Flag) + { + return (0) ; /* n must be >= 0, and Flag must be present */ + } + if (!P) + { + return (1) ; /* If NULL, P is assumed to be the identity perm. */ + } + for (j = 0 ; j < n ; j++) + { + Flag [j] = 0 ; /* clear the Flag array */ + } + for (k = 0 ; k < n ; k++) + { + j = P [k] ; + if (j < 0 || j >= n || Flag [j] != 0) + { + return (0) ; /* P is not valid */ + } + Flag [j] = 1 ; + } + return (1) ; /* P is valid */ +} + + +/* ========================================================================== */ +/* === ldl_valid_matrix: check if a sparse matrix is valid ================== */ +/* ========================================================================== */ + +/* This routine checks to see if a sparse matrix A is valid for input to + * ldl_symbolic and ldl_numeric. It returns 1 if the matrix is valid, 0 + * otherwise. A is in sparse column form. The numerical values in column j + * are stored in Ax [Ap [j] ... Ap [j+1]-1], with row indices in + * Ai [Ap [j] ... Ap [j+1]-1]. The Ax array is not checked. + */ + +LDL_int LDL_valid_matrix +( + LDL_int n, + LDL_int Ap [ ], + LDL_int Ai [ ] +) +{ + LDL_int j, p ; + if (n < 0 || !Ap || !Ai || Ap [0] != 0) + { + return (0) ; /* n must be >= 0, and Ap and Ai must be present */ + } + for (j = 0 ; j < n ; j++) + { + if (Ap [j] > Ap [j+1]) + { + return (0) ; /* Ap must be monotonically nondecreasing */ + } + } + for (p = 0 ; p < Ap [n] ; p++) + { + if (Ai [p] < 0 || Ai [p] >= n) + { + return (0) ; /* row indices must be in the range 0 to n-1 */ + } + } + return (1) ; /* matrix is valid */ +} diff --git a/extern/libmv/third_party/msinttypes/README.libmv b/extern/libmv/third_party/msinttypes/README.libmv new file mode 100644 index 00000000000..423f599b4ad --- /dev/null +++ b/extern/libmv/third_party/msinttypes/README.libmv @@ -0,0 +1,5 @@ +Project: msinttypes +URL: http://code.google.com/p/msinttypes/ +License: New BSD License +Upstream version: r24 +Local modifications: None. diff --git a/extern/libmv/third_party/msinttypes/inttypes.h b/extern/libmv/third_party/msinttypes/inttypes.h new file mode 100644 index 00000000000..0e8af69cb07 --- /dev/null +++ b/extern/libmv/third_party/msinttypes/inttypes.h @@ -0,0 +1,305 @@ +// ISO C9x compliant inttypes.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. The name of the author may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_INTTYPES_H_ // [ +#define _MSC_INTTYPES_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include <stdint.h> + +// 7.8 Format conversion of integer types + +typedef struct { + intmax_t quot; + intmax_t rem; +} imaxdiv_t; + +// 7.8.1 Macros for format specifiers + +#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 + +// The fprintf macros for signed integers are: +#define PRId8 "d" +#define PRIi8 "i" +#define PRIdLEAST8 "d" +#define PRIiLEAST8 "i" +#define PRIdFAST8 "d" +#define PRIiFAST8 "i" + +#define PRId16 "hd" +#define PRIi16 "hi" +#define PRIdLEAST16 "hd" +#define PRIiLEAST16 "hi" +#define PRIdFAST16 "hd" +#define PRIiFAST16 "hi" + +#define PRId32 "I32d" +#define PRIi32 "I32i" +#define PRIdLEAST32 "I32d" +#define PRIiLEAST32 "I32i" +#define PRIdFAST32 "I32d" +#define PRIiFAST32 "I32i" + +#define PRId64 "I64d" +#define PRIi64 "I64i" +#define PRIdLEAST64 "I64d" +#define PRIiLEAST64 "I64i" +#define PRIdFAST64 "I64d" +#define PRIiFAST64 "I64i" + +#define PRIdMAX "I64d" +#define PRIiMAX "I64i" + +#define PRIdPTR "Id" +#define PRIiPTR "Ii" + +// The fprintf macros for unsigned integers are: +#define PRIo8 "o" +#define PRIu8 "u" +#define PRIx8 "x" +#define PRIX8 "X" +#define PRIoLEAST8 "o" +#define PRIuLEAST8 "u" +#define PRIxLEAST8 "x" +#define PRIXLEAST8 "X" +#define PRIoFAST8 "o" +#define PRIuFAST8 "u" +#define PRIxFAST8 "x" +#define PRIXFAST8 "X" + +#define PRIo16 "ho" +#define PRIu16 "hu" +#define PRIx16 "hx" +#define PRIX16 "hX" +#define PRIoLEAST16 "ho" +#define PRIuLEAST16 "hu" +#define PRIxLEAST16 "hx" +#define PRIXLEAST16 "hX" +#define PRIoFAST16 "ho" +#define PRIuFAST16 "hu" +#define PRIxFAST16 "hx" +#define PRIXFAST16 "hX" + +#define PRIo32 "I32o" +#define PRIu32 "I32u" +#define PRIx32 "I32x" +#define PRIX32 "I32X" +#define PRIoLEAST32 "I32o" +#define PRIuLEAST32 "I32u" +#define PRIxLEAST32 "I32x" +#define PRIXLEAST32 "I32X" +#define PRIoFAST32 "I32o" +#define PRIuFAST32 "I32u" +#define PRIxFAST32 "I32x" +#define PRIXFAST32 "I32X" + +#define PRIo64 "I64o" +#define PRIu64 "I64u" +#define PRIx64 "I64x" +#define PRIX64 "I64X" +#define PRIoLEAST64 "I64o" +#define PRIuLEAST64 "I64u" +#define PRIxLEAST64 "I64x" +#define PRIXLEAST64 "I64X" +#define PRIoFAST64 "I64o" +#define PRIuFAST64 "I64u" +#define PRIxFAST64 "I64x" +#define PRIXFAST64 "I64X" + +#define PRIoMAX "I64o" +#define PRIuMAX "I64u" +#define PRIxMAX "I64x" +#define PRIXMAX "I64X" + +#define PRIoPTR "Io" +#define PRIuPTR "Iu" +#define PRIxPTR "Ix" +#define PRIXPTR "IX" + +// The fscanf macros for signed integers are: +#define SCNd8 "d" +#define SCNi8 "i" +#define SCNdLEAST8 "d" +#define SCNiLEAST8 "i" +#define SCNdFAST8 "d" +#define SCNiFAST8 "i" + +#define SCNd16 "hd" +#define SCNi16 "hi" +#define SCNdLEAST16 "hd" +#define SCNiLEAST16 "hi" +#define SCNdFAST16 "hd" +#define SCNiFAST16 "hi" + +#define SCNd32 "ld" +#define SCNi32 "li" +#define SCNdLEAST32 "ld" +#define SCNiLEAST32 "li" +#define SCNdFAST32 "ld" +#define SCNiFAST32 "li" + +#define SCNd64 "I64d" +#define SCNi64 "I64i" +#define SCNdLEAST64 "I64d" +#define SCNiLEAST64 "I64i" +#define SCNdFAST64 "I64d" +#define SCNiFAST64 "I64i" + +#define SCNdMAX "I64d" +#define SCNiMAX "I64i" + +#ifdef _WIN64 // [ +# define SCNdPTR "I64d" +# define SCNiPTR "I64i" +#else // _WIN64 ][ +# define SCNdPTR "ld" +# define SCNiPTR "li" +#endif // _WIN64 ] + +// The fscanf macros for unsigned integers are: +#define SCNo8 "o" +#define SCNu8 "u" +#define SCNx8 "x" +#define SCNX8 "X" +#define SCNoLEAST8 "o" +#define SCNuLEAST8 "u" +#define SCNxLEAST8 "x" +#define SCNXLEAST8 "X" +#define SCNoFAST8 "o" +#define SCNuFAST8 "u" +#define SCNxFAST8 "x" +#define SCNXFAST8 "X" + +#define SCNo16 "ho" +#define SCNu16 "hu" +#define SCNx16 "hx" +#define SCNX16 "hX" +#define SCNoLEAST16 "ho" +#define SCNuLEAST16 "hu" +#define SCNxLEAST16 "hx" +#define SCNXLEAST16 "hX" +#define SCNoFAST16 "ho" +#define SCNuFAST16 "hu" +#define SCNxFAST16 "hx" +#define SCNXFAST16 "hX" + +#define SCNo32 "lo" +#define SCNu32 "lu" +#define SCNx32 "lx" +#define SCNX32 "lX" +#define SCNoLEAST32 "lo" +#define SCNuLEAST32 "lu" +#define SCNxLEAST32 "lx" +#define SCNXLEAST32 "lX" +#define SCNoFAST32 "lo" +#define SCNuFAST32 "lu" +#define SCNxFAST32 "lx" +#define SCNXFAST32 "lX" + +#define SCNo64 "I64o" +#define SCNu64 "I64u" +#define SCNx64 "I64x" +#define SCNX64 "I64X" +#define SCNoLEAST64 "I64o" +#define SCNuLEAST64 "I64u" +#define SCNxLEAST64 "I64x" +#define SCNXLEAST64 "I64X" +#define SCNoFAST64 "I64o" +#define SCNuFAST64 "I64u" +#define SCNxFAST64 "I64x" +#define SCNXFAST64 "I64X" + +#define SCNoMAX "I64o" +#define SCNuMAX "I64u" +#define SCNxMAX "I64x" +#define SCNXMAX "I64X" + +#ifdef _WIN64 // [ +# define SCNoPTR "I64o" +# define SCNuPTR "I64u" +# define SCNxPTR "I64x" +# define SCNXPTR "I64X" +#else // _WIN64 ][ +# define SCNoPTR "lo" +# define SCNuPTR "lu" +# define SCNxPTR "lx" +# define SCNXPTR "lX" +#endif // _WIN64 ] + +#endif // __STDC_FORMAT_MACROS ] + +// 7.8.2 Functions for greatest-width integer types + +// 7.8.2.1 The imaxabs function +#define imaxabs _abs64 + +// 7.8.2.2 The imaxdiv function + +// This is modified version of div() function from Microsoft's div.c found +// in %MSVC.NET%\crt\src\div.c +#ifdef STATIC_IMAXDIV // [ +static +#else // STATIC_IMAXDIV ][ +_inline +#endif // STATIC_IMAXDIV ] +imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) +{ + imaxdiv_t result; + + result.quot = numer / denom; + result.rem = numer % denom; + + if (numer < 0 && result.rem > 0) { + // did division wrong; must fix up + ++result.quot; + result.rem -= denom; + } + + return result; +} + +// 7.8.2.3 The strtoimax and strtoumax functions +#define strtoimax _strtoi64 +#define strtoumax _strtoui64 + +// 7.8.2.4 The wcstoimax and wcstoumax functions +#define wcstoimax _wcstoi64 +#define wcstoumax _wcstoui64 + + +#endif // _MSC_INTTYPES_H_ ] diff --git a/extern/libmv/third_party/msinttypes/stdint.h b/extern/libmv/third_party/msinttypes/stdint.h new file mode 100644 index 00000000000..e236bb00015 --- /dev/null +++ b/extern/libmv/third_party/msinttypes/stdint.h @@ -0,0 +1,247 @@ +// ISO C9x compliant stdint.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006-2008 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. The name of the author may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_STDINT_H_ // [ +#define _MSC_STDINT_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include <limits.h> + +// For Visual Studio 6 in C++ mode and for many Visual Studio versions when +// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}' +// or compiler give many errors like this: +// error C2733: second C linkage of overloaded function 'wmemchr' not allowed +#ifdef __cplusplus +extern "C" { +#endif +# include <wchar.h> +#ifdef __cplusplus +} +#endif + +// Define _W64 macros to mark types changing their size, like intptr_t. +#ifndef _W64 +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif + + +// 7.18.1 Integer types + +// 7.18.1.1 Exact-width integer types + +// Visual Studio 6 and Embedded Visual C++ 4 doesn't +// realize that, e.g. char has the same size as __int8 +// so we give up on __intX for them. +#if (_MSC_VER < 1300) + typedef char int8_t; + typedef short int16_t; + typedef int int32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; +#else + typedef __int8 int8_t; + typedef __int16 int16_t; + typedef __int32 int32_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; +#endif +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; + + +// 7.18.1.2 Minimum-width integer types +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + +// 7.18.1.3 Fastest minimum-width integer types +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + +// 7.18.1.4 Integer types capable of holding object pointers +#ifdef _WIN64 // [ + typedef __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +#else // _WIN64 ][ + typedef _W64 int intptr_t; + typedef _W64 unsigned int uintptr_t; +#endif // _WIN64 ] + +// 7.18.1.5 Greatest-width integer types +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; + + +// 7.18.2 Limits of specified-width integer types + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 + +// 7.18.2.1 Limits of exact-width integer types +#define INT8_MIN ((int8_t)_I8_MIN) +#define INT8_MAX _I8_MAX +#define INT16_MIN ((int16_t)_I16_MIN) +#define INT16_MAX _I16_MAX +#define INT32_MIN ((int32_t)_I32_MIN) +#define INT32_MAX _I32_MAX +#define INT64_MIN ((int64_t)_I64_MIN) +#define INT64_MAX _I64_MAX +#define UINT8_MAX _UI8_MAX +#define UINT16_MAX _UI16_MAX +#define UINT32_MAX _UI32_MAX +#define UINT64_MAX _UI64_MAX + +// 7.18.2.2 Limits of minimum-width integer types +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MIN INT64_MIN +#define INT_LEAST64_MAX INT64_MAX +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +// 7.18.2.3 Limits of fastest minimum-width integer types +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MIN INT64_MIN +#define INT_FAST64_MAX INT64_MAX +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +// 7.18.2.4 Limits of integer types capable of holding object pointers +#ifdef _WIN64 // [ +# define INTPTR_MIN INT64_MIN +# define INTPTR_MAX INT64_MAX +# define UINTPTR_MAX UINT64_MAX +#else // _WIN64 ][ +# define INTPTR_MIN INT32_MIN +# define INTPTR_MAX INT32_MAX +# define UINTPTR_MAX UINT32_MAX +#endif // _WIN64 ] + +// 7.18.2.5 Limits of greatest-width integer types +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +// 7.18.3 Limits of other integer types + +#ifdef _WIN64 // [ +# define PTRDIFF_MIN _I64_MIN +# define PTRDIFF_MAX _I64_MAX +#else // _WIN64 ][ +# define PTRDIFF_MIN _I32_MIN +# define PTRDIFF_MAX _I32_MAX +#endif // _WIN64 ] + +#define SIG_ATOMIC_MIN INT_MIN +#define SIG_ATOMIC_MAX INT_MAX + +#ifndef SIZE_MAX // [ +# ifdef _WIN64 // [ +# define SIZE_MAX _UI64_MAX +# else // _WIN64 ][ +# define SIZE_MAX _UI32_MAX +# endif // _WIN64 ] +#endif // SIZE_MAX ] + +// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h> +#ifndef WCHAR_MIN // [ +# define WCHAR_MIN 0 +#endif // WCHAR_MIN ] +#ifndef WCHAR_MAX // [ +# define WCHAR_MAX _UI16_MAX +#endif // WCHAR_MAX ] + +#define WINT_MIN 0 +#define WINT_MAX _UI16_MAX + +#endif // __STDC_LIMIT_MACROS ] + + +// 7.18.4 Limits of other integer types + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 + +// 7.18.4.1 Macros for minimum-width integer constants + +#define INT8_C(val) val##i8 +#define INT16_C(val) val##i16 +#define INT32_C(val) val##i32 +#define INT64_C(val) val##i64 + +#define UINT8_C(val) val##ui8 +#define UINT16_C(val) val##ui16 +#define UINT32_C(val) val##ui32 +#define UINT64_C(val) val##ui64 + +// 7.18.4.2 Macros for greatest-width integer constants +#define INTMAX_C INT64_C +#define UINTMAX_C UINT64_C + +#endif // __STDC_CONSTANT_MACROS ] + + +#endif // _MSC_STDINT_H_ ] diff --git a/extern/libmv/third_party/ssba/COPYING.TXT b/extern/libmv/third_party/ssba/COPYING.TXT new file mode 100644 index 00000000000..fc8a5de7edf --- /dev/null +++ b/extern/libmv/third_party/ssba/COPYING.TXT @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/extern/libmv/third_party/ssba/Geometry/v3d_cameramatrix.h b/extern/libmv/third_party/ssba/Geometry/v3d_cameramatrix.h new file mode 100644 index 00000000000..448ae9714e5 --- /dev/null +++ b/extern/libmv/third_party/ssba/Geometry/v3d_cameramatrix.h @@ -0,0 +1,204 @@ +// -*- C++ -*- +/* +Copyright (c) 2008 University of North Carolina at Chapel Hill + +This file is part of SSBA (Simple Sparse Bundle Adjustment). + +SSBA is free software: you can redistribute it and/or modify it under the +terms of the GNU Lesser General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your option) any +later version. + +SSBA 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 Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License along +with SSBA. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef V3D_CAMERA_MATRIX_H +#define V3D_CAMERA_MATRIX_H + +#include "Math/v3d_linear.h" +#include "Geometry/v3d_distortion.h" + +namespace V3D +{ + + struct CameraMatrix + { + CameraMatrix() + { + makeIdentityMatrix(_K); + makeIdentityMatrix(_R); + makeZeroVector(_T); + this->updateCachedValues(true, true); + } + + CameraMatrix(double f, double cx, double cy) + { + makeIdentityMatrix(_K); + _K[0][0] = f; + _K[1][1] = f; + _K[0][2] = cx; + _K[1][2] = cy; + makeIdentityMatrix(_R); + makeZeroVector(_T); + this->updateCachedValues(true, true); + } + + CameraMatrix(Matrix3x3d const& K, + Matrix3x3d const& R, + Vector3d const& T) + : _K(K), _R(R), _T(T) + { + this->updateCachedValues(true, true); + } + + void setIntrinsic(Matrix3x3d const& K) { _K = K; this->updateCachedValues(true, false); } + void setRotation(Matrix3x3d const& R) { _R = R; this->updateCachedValues(false, true); } + void setTranslation(Vector3d const& T) { _T = T; this->updateCachedValues(false, true); } + + template <typename Mat> + void setOrientation(Mat const& RT) + { + _R[0][0] = RT[0][0]; _R[0][1] = RT[0][1]; _R[0][2] = RT[0][2]; + _R[1][0] = RT[1][0]; _R[1][1] = RT[1][1]; _R[1][2] = RT[1][2]; + _R[2][0] = RT[2][0]; _R[2][1] = RT[2][1]; _R[2][2] = RT[2][2]; + _T[0] = RT[0][3]; _T[1] = RT[1][3]; _T[2] = RT[2][3]; + this->updateCachedValues(false, true); + } + + Matrix3x3d const& getIntrinsic() const { return _K; } + Matrix3x3d const& getRotation() const { return _R; } + Vector3d const& getTranslation() const { return _T; } + + Matrix3x4d getOrientation() const + { + Matrix3x4d RT; + RT[0][0] = _R[0][0]; RT[0][1] = _R[0][1]; RT[0][2] = _R[0][2]; + RT[1][0] = _R[1][0]; RT[1][1] = _R[1][1]; RT[1][2] = _R[1][2]; + RT[2][0] = _R[2][0]; RT[2][1] = _R[2][1]; RT[2][2] = _R[2][2]; + RT[0][3] = _T[0]; RT[1][3] = _T[1]; RT[2][3] = _T[2]; + return RT; + } + + Matrix3x4d getProjection() const + { + Matrix3x4d const RT = this->getOrientation(); + return _K * RT; + } + + double getFocalLength() const { return _K[0][0]; } + double getAspectRatio() const { return _K[1][1] / _K[0][0]; } + + Vector2d getPrincipalPoint() const + { + Vector2d pp; + pp[0] = _K[0][2]; + pp[1] = _K[1][2]; + return pp; + } + + Vector2d projectPoint(Vector3d const& X) const + { + Vector3d q = _K*(_R*X + _T); + Vector2d res; + res[0] = q[0]/q[2]; res[1] = q[1]/q[2]; + return res; + } + + template <typename Distortion> + Vector2d projectPoint(Distortion const& distortion, Vector3d const& X) const + { + Vector3d XX = _R*X + _T; + Vector2d p; + p[0] = XX[0] / XX[2]; + p[1] = XX[1] / XX[2]; + p = distortion(p); + + Vector2d res; + res[0] = _K[0][0] * p[0] + _K[0][1] * p[1] + _K[0][2]; + res[1] = _K[1][1] * p[1] + _K[1][2]; + return res; + } + + Vector3d unprojectPixel(Vector2d const &p, double depth = 1) const + { + Vector3d pp; + pp[0] = p[0]; pp[1] = p[1]; pp[2] = 1.0; + Vector3d ray = _invK * pp; + ray[0] *= depth/ray[2]; + ray[1] *= depth/ray[2]; + ray[2] = depth; + ray = _Rt * ray; + return _center + ray; + } + + Vector3d transformPointIntoCameraSpace(Vector3d const& p) const + { + return _R*p + _T; + } + + Vector3d transformPointFromCameraSpace(Vector3d const& p) const + { + return _Rt*(p-_T); + } + + Vector3d transformDirectionFromCameraSpace(Vector3d const& dir) const + { + return _Rt*dir; + } + + Vector3d const& cameraCenter() const + { + return _center; + } + + Vector3d opticalAxis() const + { + return this->transformDirectionFromCameraSpace(makeVector3(0.0, 0.0, 1.0)); + } + + Vector3d upVector() const + { + return this->transformDirectionFromCameraSpace(makeVector3(0.0, 1.0, 0.0)); + } + + Vector3d rightVector() const + { + return this->transformDirectionFromCameraSpace(makeVector3(1.0, 0.0, 0.0)); + } + + Vector3d getRay(Vector2d const& p) const + { + Vector3d pp = makeVector3(p[0], p[1], 1.0); + Vector3d ray = _invK * pp; + ray = _Rt * ray; + normalizeVector(ray); + return ray; + } + + protected: + void updateCachedValues(bool intrinsic, bool orientation) + { + if (intrinsic) _invK = invertedMatrix(_K); + + if (orientation) + { + makeTransposedMatrix(_R, _Rt); + _center = _Rt * (-1.0 * _T); + } + } + + Matrix3x3d _K, _R; + Vector3d _T; + Matrix3x3d _invK, _Rt; + Vector3d _center; + }; // end struct CameraMatrix + +} // end namespace V3D + +#endif diff --git a/extern/libmv/third_party/ssba/Geometry/v3d_distortion.h b/extern/libmv/third_party/ssba/Geometry/v3d_distortion.h new file mode 100644 index 00000000000..d0816558314 --- /dev/null +++ b/extern/libmv/third_party/ssba/Geometry/v3d_distortion.h @@ -0,0 +1,97 @@ +// -*- C++ -*- +/* +Copyright (c) 2008 University of North Carolina at Chapel Hill + +This file is part of SSBA (Simple Sparse Bundle Adjustment). + +SSBA is free software: you can redistribute it and/or modify it under the +terms of the GNU Lesser General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your option) any +later version. + +SSBA 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 Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License along +with SSBA. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef V3D_DISTORTION_H +#define V3D_DISTORTION_H + +#include "Math/v3d_linear.h" +#include "Math/v3d_linear_utils.h" + +namespace V3D +{ + + struct StdDistortionFunction + { + double k1, k2, p1, p2; + + StdDistortionFunction() + : k1(0), k2(0), p1(0), p2(0) + { } + + Vector2d operator()(Vector2d const& xu) const + { + double const r2 = xu[0]*xu[0] + xu[1]*xu[1]; + double const r4 = r2*r2; + double const kr = 1 + k1*r2 + k2*r4; + + Vector2d xd; + xd[0] = kr * xu[0] + 2*p1*xu[0]*xu[1] + p2*(r2 + 2*xu[0]*xu[0]); + xd[1] = kr * xu[1] + 2*p2*xu[0]*xu[1] + p1*(r2 + 2*xu[1]*xu[1]); + return xd; + } + + Matrix2x2d derivativeWrtRadialParameters(Vector2d const& xu) const + { + double const r2 = xu[0]*xu[0] + xu[1]*xu[1]; + double const r4 = r2*r2; + //double const kr = 1 + k1*r2 + k2*r4; + + Matrix2x2d deriv; + + deriv[0][0] = xu[0] * r2; // d xd/d k1 + deriv[0][1] = xu[0] * r4; // d xd/d k2 + deriv[1][0] = xu[1] * r2; // d yd/d k1 + deriv[1][1] = xu[1] * r4; // d yd/d k2 + return deriv; + } + + Matrix2x2d derivativeWrtTangentialParameters(Vector2d const& xu) const + { + double const r2 = xu[0]*xu[0] + xu[1]*xu[1]; + //double const r4 = r2*r2; + //double const kr = 1 + k1*r2 + k2*r4; + + Matrix2x2d deriv; + deriv[0][0] = 2*xu[0]*xu[1]; // d xd/d p1 + deriv[0][1] = r2 + 2*xu[0]*xu[0]; // d xd/d p2 + deriv[1][0] = r2 + 2*xu[1]*xu[1]; // d yd/d p1 + deriv[1][1] = deriv[0][0]; // d yd/d p2 + return deriv; + } + + Matrix2x2d derivativeWrtUndistortedPoint(Vector2d const& xu) const + { + double const r2 = xu[0]*xu[0] + xu[1]*xu[1]; + double const r4 = r2*r2; + double const kr = 1 + k1*r2 + k2*r4; + double const dkr = 2*k1 + 4*k2*r2; + + Matrix2x2d deriv; + deriv[0][0] = kr + xu[0] * xu[0] * dkr + 2*p1*xu[1] + 6*p2*xu[0]; // d xd/d xu + deriv[0][1] = xu[0] * xu[1] * dkr + 2*p1*xu[0] + 2*p2*xu[1]; // d xd/d yu + deriv[1][0] = deriv[0][1]; // d yd/d xu + deriv[1][1] = kr + xu[1] * xu[1] * dkr + 6*p1*xu[1] + 2*p2*xu[0]; // d yd/d yu + return deriv; + } + }; // end struct StdDistortionFunction + +} // end namespace V3D + +#endif diff --git a/extern/libmv/third_party/ssba/Geometry/v3d_metricbundle.cpp b/extern/libmv/third_party/ssba/Geometry/v3d_metricbundle.cpp new file mode 100644 index 00000000000..1c1f0cb2627 --- /dev/null +++ b/extern/libmv/third_party/ssba/Geometry/v3d_metricbundle.cpp @@ -0,0 +1,365 @@ +/* +Copyright (c) 2008 University of North Carolina at Chapel Hill + +This file is part of SSBA (Simple Sparse Bundle Adjustment). + +SSBA is free software: you can redistribute it and/or modify it under the +terms of the GNU Lesser General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your option) any +later version. + +SSBA 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 Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License along +with SSBA. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "Geometry/v3d_metricbundle.h" + +#if defined(V3DLIB_ENABLE_SUITESPARSE) + +namespace +{ + + typedef V3D::InlineMatrix<double, 2, 4> Matrix2x4d; + typedef V3D::InlineMatrix<double, 4, 2> Matrix4x2d; + typedef V3D::InlineMatrix<double, 2, 6> Matrix2x6d; + +} // end namespace <> + +namespace V3D +{ + + void + MetricBundleOptimizerBase::updateParametersA(VectorArray<double> const& deltaAi) + { + Vector3d T, omega; + Matrix3x3d R0, dR; + + for (int i = _nNonvaryingA; i < _nParametersA; ++i) + { + T = _cams[i].getTranslation(); + T[0] += deltaAi[i][0]; + T[1] += deltaAi[i][1]; + T[2] += deltaAi[i][2]; + _cams[i].setTranslation(T); + + // Create incremental rotation using Rodriguez formula. + R0 = _cams[i].getRotation(); + omega[0] = deltaAi[i][3]; + omega[1] = deltaAi[i][4]; + omega[2] = deltaAi[i][5]; + createRotationMatrixRodriguez(omega, dR); + _cams[i].setRotation(dR * R0); + } // end for (i) + } // end MetricBundleOptimizerBase::updateParametersA() + + void + MetricBundleOptimizerBase::updateParametersB(VectorArray<double> const& deltaBj) + { + for (int j = _nNonvaryingB; j < _nParametersB; ++j) + { + _Xs[j][0] += deltaBj[j][0]; + _Xs[j][1] += deltaBj[j][1]; + _Xs[j][2] += deltaBj[j][2]; + } + } // end MetricBundleOptimizerBase::updateParametersB() + + void + MetricBundleOptimizerBase::poseDerivatives(int i, int j, Vector3d& XX, + Matrix3x6d& d_dRT, Matrix3x3d& d_dX) const + { + XX = _cams[i].transformPointIntoCameraSpace(_Xs[j]); + + // See Frank Dellaerts bundle adjustment tutorial. + // d(dR * R0 * X + t)/d omega = -[R0 * X]_x + Matrix3x3d J; + makeCrossProductMatrix(XX - _cams[i].getTranslation(), J); + scaleMatrixIP(-1.0, J); + + // Now the transformation from world coords into camera space is xx = Rx + T + // Hence the derivative of x wrt. T is just the identity matrix. + makeIdentityMatrix(d_dRT); + copyMatrixSlice(J, 0, 0, 3, 3, d_dRT, 0, 3); + + // The derivative of Rx+T wrt x is just R. + copyMatrix(_cams[i].getRotation(), d_dX); + } // end MetricBundleOptimizerBase::poseDerivatives() + + +//---------------------------------------------------------------------- + + void + StdMetricBundleOptimizer::fillJacobians(Matrix<double>& Ak, + Matrix<double>& Bk, + Matrix<double>& Ck, + int i, int j, int k) + { + Vector3d XX; + Matrix3x6d d_dRT; + Matrix3x3d d_dX; + this->poseDerivatives(i, j, XX, d_dRT, d_dX); + + double const f = _cams[i].getFocalLength(); + double const ar = _cams[i].getAspectRatio(); + + Matrix2x3d dp_dX; + double const bx = f / (XX[2] * XX[2]); + double const by = ar * bx; + dp_dX[0][0] = bx * XX[2]; dp_dX[0][1] = 0; dp_dX[0][2] = -bx * XX[0]; + dp_dX[1][0] = 0; dp_dX[1][1] = by * XX[2]; dp_dX[1][2] = -by * XX[1]; + + multiply_A_B(dp_dX, d_dRT, Ak); + multiply_A_B(dp_dX, d_dX, Bk); + } // end StdMetricBundleOptimizer::fillJacobians() + + //---------------------------------------------------------------------- + + void + CommonInternalsMetricBundleOptimizer::fillJacobians(Matrix<double>& Ak, + Matrix<double>& Bk, + Matrix<double>& Ck, + int i, int j, int k) + { + double const focalLength = _K[0][0]; + + Vector3d XX; + Matrix3x6d dXX_dRT; + Matrix3x3d dXX_dX; + this->poseDerivatives(i, j, XX, dXX_dRT, dXX_dX); + + Vector2d xu; // undistorted image point + xu[0] = XX[0] / XX[2]; + xu[1] = XX[1] / XX[2]; + + Vector2d const xd = _distortion(xu); // distorted image point + + Matrix2x2d dp_dxd; + dp_dxd[0][0] = focalLength; dp_dxd[0][1] = 0; + dp_dxd[1][0] = 0; dp_dxd[1][1] = _cachedAspectRatio * focalLength; + + { + // First, lets do the derivative wrt the structure and motion parameters. + Matrix2x3d dxu_dXX; + dxu_dXX[0][0] = 1.0f / XX[2]; dxu_dXX[0][1] = 0; dxu_dXX[0][2] = -XX[0]/(XX[2]*XX[2]); + dxu_dXX[1][0] = 0; dxu_dXX[1][1] = 1.0f / XX[2]; dxu_dXX[1][2] = -XX[1]/(XX[2]*XX[2]); + + Matrix2x2d dxd_dxu = _distortion.derivativeWrtUndistortedPoint(xu); + + Matrix2x2d dp_dxu = dp_dxd * dxd_dxu; + Matrix2x3d dp_dXX = dp_dxu * dxu_dXX; + + multiply_A_B(dp_dXX, dXX_dRT, Ak); + multiply_A_B(dp_dXX, dXX_dX, Bk); + } // end scope + + switch (_mode) + { + case FULL_BUNDLE_RADIAL_TANGENTIAL: + { + Matrix2x2d dxd_dp1p2 = _distortion.derivativeWrtTangentialParameters(xu); + Matrix2x2d d_dp1p2 = dp_dxd * dxd_dp1p2; + copyMatrixSlice(d_dp1p2, 0, 0, 2, 2, Ck, 0, 5); + // No break here! + } + case FULL_BUNDLE_RADIAL: + { + Matrix2x2d dxd_dk1k2 = _distortion.derivativeWrtRadialParameters(xu); + Matrix2x2d d_dk1k2 = dp_dxd * dxd_dk1k2; + copyMatrixSlice(d_dk1k2, 0, 0, 2, 2, Ck, 0, 3); + // No break here! + } + case FULL_BUNDLE_FOCAL_LENGTH_PP: + { + Ck[0][1] = 1; Ck[0][2] = 0; + Ck[1][1] = 0; Ck[1][2] = 1; + // No break here! + } + case FULL_BUNDLE_FOCAL_LENGTH: + { + Ck[0][0] = xd[0]; + Ck[1][0] = xd[1]; + } + case FULL_BUNDLE_METRIC: + { + } + } // end switch + } // end CommonInternalsMetricBundleOptimizer::fillJacobians() + + void + CommonInternalsMetricBundleOptimizer::updateParametersC(Vector<double> const& deltaC) + { + switch (_mode) + { + case FULL_BUNDLE_RADIAL_TANGENTIAL: + { + _distortion.p1 += deltaC[5]; + _distortion.p2 += deltaC[6]; + // No break here! + } + case FULL_BUNDLE_RADIAL: + { + _distortion.k1 += deltaC[3]; + _distortion.k2 += deltaC[4]; + // No break here! + } + case FULL_BUNDLE_FOCAL_LENGTH_PP: + { + _K[0][2] += deltaC[1]; + _K[1][2] += deltaC[2]; + // No break here! + } + case FULL_BUNDLE_FOCAL_LENGTH: + { + _K[0][0] += deltaC[0]; + _K[1][1] = _cachedAspectRatio * _K[0][0]; + } + case FULL_BUNDLE_METRIC: + { + } + } // end switch + } // end CommonInternalsMetricBundleOptimizer::updateParametersC() + + //---------------------------------------------------------------------- + + void + VaryingInternalsMetricBundleOptimizer::fillJacobians(Matrix<double>& Ak, + Matrix<double>& Bk, + Matrix<double>& Ck, + int i, int j, int k) + { + Vector3d XX; + Matrix3x6d dXX_dRT; + Matrix3x3d dXX_dX; + this->poseDerivatives(i, j, XX, dXX_dRT, dXX_dX); + + Vector2d xu; // undistorted image point + xu[0] = XX[0] / XX[2]; + xu[1] = XX[1] / XX[2]; + + Vector2d const xd = _distortions[i](xu); // distorted image point + + double const focalLength = _cams[i].getFocalLength(); + double const aspectRatio = _cams[i].getAspectRatio(); + + Matrix2x2d dp_dxd; + dp_dxd[0][0] = focalLength; dp_dxd[0][1] = 0; + dp_dxd[1][0] = 0; dp_dxd[1][1] = aspectRatio * focalLength; + + { + // First, lets do the derivative wrt the structure and motion parameters. + Matrix2x3d dxu_dXX; + dxu_dXX[0][0] = 1.0f / XX[2]; dxu_dXX[0][1] = 0; dxu_dXX[0][2] = -XX[0]/(XX[2]*XX[2]); + dxu_dXX[1][0] = 0; dxu_dXX[1][1] = 1.0f / XX[2]; dxu_dXX[1][2] = -XX[1]/(XX[2]*XX[2]); + + Matrix2x2d dxd_dxu = _distortions[i].derivativeWrtUndistortedPoint(xu); + + Matrix2x2d dp_dxu = dp_dxd * dxd_dxu; + Matrix2x3d dp_dXX = dp_dxu * dxu_dXX; + + Matrix2x6d dp_dRT; + + multiply_A_B(dp_dXX, dXX_dRT, dp_dRT); + copyMatrixSlice(dp_dRT, 0, 0, 2, 6, Ak, 0, 0); + multiply_A_B(dp_dXX, dXX_dX, Bk); + } // end scope + + switch (_mode) + { + case FULL_BUNDLE_RADIAL_TANGENTIAL: + { + Matrix2x2d dxd_dp1p2 = _distortions[i].derivativeWrtTangentialParameters(xu); + Matrix2x2d d_dp1p2 = dp_dxd * dxd_dp1p2; + copyMatrixSlice(d_dp1p2, 0, 0, 2, 2, Ak, 0, 11); + // No break here! + } + case FULL_BUNDLE_RADIAL: + { + Matrix2x2d dxd_dk1k2 = _distortions[i].derivativeWrtRadialParameters(xu); + Matrix2x2d d_dk1k2 = dp_dxd * dxd_dk1k2; + copyMatrixSlice(d_dk1k2, 0, 0, 2, 2, Ak, 0, 9); + // No break here! + } + case FULL_BUNDLE_FOCAL_LENGTH_PP: + { + Ak[0][7] = 1; Ak[0][8] = 0; + Ak[1][7] = 0; Ak[1][8] = 1; + // No break here! + } + case FULL_BUNDLE_FOCAL_LENGTH: + { + Ak[0][6] = xd[0]; + Ak[1][6] = xd[1]; + } + case FULL_BUNDLE_METRIC: + { + } + } // end switch + } // end VaryingInternalsMetricBundleOptimizer::fillJacobians() + + void + VaryingInternalsMetricBundleOptimizer::updateParametersA(VectorArray<double> const& deltaAi) + { + Vector3d T, omega; + Matrix3x3d R0, dR, K; + + for (int i = _nNonvaryingA; i < _nParametersA; ++i) + { + Vector<double> const& deltaA = deltaAi[i]; + + T = _cams[i].getTranslation(); + T[0] += deltaA[0]; + T[1] += deltaA[1]; + T[2] += deltaA[2]; + _cams[i].setTranslation(T); + + // Create incremental rotation using Rodriguez formula. + R0 = _cams[i].getRotation(); + omega[0] = deltaA[3]; + omega[1] = deltaA[4]; + omega[2] = deltaA[5]; + createRotationMatrixRodriguez(omega, dR); + _cams[i].setRotation(dR * R0); + + K = _cams[i].getIntrinsic(); + + switch (_mode) + { + case FULL_BUNDLE_RADIAL_TANGENTIAL: + { + _distortions[i].p1 += deltaA[11]; + _distortions[i].p2 += deltaA[12]; + // No break here! + } + case FULL_BUNDLE_RADIAL: + { + _distortions[i].k1 += deltaA[9]; + _distortions[i].k2 += deltaA[10]; + // No break here! + } + case FULL_BUNDLE_FOCAL_LENGTH_PP: + { + K[0][2] += deltaA[7]; + K[1][2] += deltaA[8]; + // No break here! + } + case FULL_BUNDLE_FOCAL_LENGTH: + { + double const ar = K[1][1] / K[0][0]; + K[0][0] += deltaA[6]; + K[1][1] = ar * K[0][0]; + } + case FULL_BUNDLE_METRIC: + { + } + } // end switch + _cams[i].setIntrinsic(K); + } // end for (i) + } // end VaryingInternalsMetricBundleOptimizer::updateParametersC() + +} // end namespace V3D + +#endif // defined(V3DLIB_ENABLE_SUITESPARSE) diff --git a/extern/libmv/third_party/ssba/Geometry/v3d_metricbundle.h b/extern/libmv/third_party/ssba/Geometry/v3d_metricbundle.h new file mode 100644 index 00000000000..076a9e64346 --- /dev/null +++ b/extern/libmv/third_party/ssba/Geometry/v3d_metricbundle.h @@ -0,0 +1,346 @@ +// -*- C++ -*- +/* +Copyright (c) 2008 University of North Carolina at Chapel Hill + +This file is part of SSBA (Simple Sparse Bundle Adjustment). + +SSBA is free software: you can redistribute it and/or modify it under the +terms of the GNU Lesser General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your option) any +later version. + +SSBA 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 Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License along +with SSBA. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef V3D_METRICBUNDLE_H +#define V3D_METRICBUNDLE_H + +# if defined(V3DLIB_ENABLE_SUITESPARSE) + +#include "Math/v3d_optimization.h" +#include "Math/v3d_linear.h" +#include "Math/v3d_linear_utils.h" +#include "Geometry/v3d_cameramatrix.h" +#include "Geometry/v3d_distortion.h" + +namespace V3D +{ + + // This structure provides some helper functions common to all metric BAs + struct MetricBundleOptimizerBase : public SparseLevenbergOptimizer + { + typedef SparseLevenbergOptimizer Base; + + MetricBundleOptimizerBase(double inlierThreshold, + vector<CameraMatrix>& cams, + vector<Vector3d >& Xs, + vector<Vector2d > const& measurements, + vector<int> const& corrspondingView, + vector<int> const& corrspondingPoint, + int nAddParamsA, int nParamsC) + : SparseLevenbergOptimizer(2, cams.size(), 6+nAddParamsA, Xs.size(), 3, nParamsC, + corrspondingView, corrspondingPoint), + _cams(cams), _Xs(Xs), _measurements(measurements), + _savedTranslations(cams.size()), _savedRotations(cams.size()), + _savedXs(Xs.size()), + _inlierThreshold(inlierThreshold), _cachedParamLength(0.0) + { + // Since we assume that BA does not alter the inputs too much, + // we compute the overall length of the parameter vector in advance + // and return that value as the result of getParameterLength(). + for (int i = _nNonvaryingA; i < _nParametersA; ++i) + { + _cachedParamLength += sqrNorm_L2(_cams[i].getTranslation()); + _cachedParamLength += 3.0; // Assume eye(3) for R. + } + for (int j = _nNonvaryingB; j < _nParametersB; ++j) + _cachedParamLength += sqrNorm_L2(_Xs[j]); + + _cachedParamLength = sqrt(_cachedParamLength); + } + + // Huber robust cost function. + virtual void fillWeights(VectorArray<double> const& residual, Vector<double>& w) + { + for (unsigned int k = 0; k < w.size(); ++k) + { + Vector<double> const& r = residual[k]; + double const e = norm_L2(r); + w[k] = (e < _inlierThreshold) ? 1.0 : sqrt(_inlierThreshold / e); + } // end for (k) + } + + virtual double getParameterLength() const + { + return _cachedParamLength; + } + + virtual void updateParametersA(VectorArray<double> const& deltaAi); + virtual void updateParametersB(VectorArray<double> const& deltaBj); + virtual void updateParametersC(Vector<double> const& deltaC) + { + (void)deltaC; + } + + virtual void saveAllParameters() + { + for (int i = _nNonvaryingA; i < _nParametersA; ++i) + { + _savedTranslations[i] = _cams[i].getTranslation(); + _savedRotations[i] = _cams[i].getRotation(); + } + _savedXs = _Xs; + } + + virtual void restoreAllParameters() + { + for (int i = _nNonvaryingA; i < _nParametersA; ++i) + { + _cams[i].setTranslation(_savedTranslations[i]); + _cams[i].setRotation(_savedRotations[i]); + } + _Xs = _savedXs; + } + + protected: + typedef InlineMatrix<double, 3, 6> Matrix3x6d; + + void poseDerivatives(int i, int j, Vector3d& XX, + Matrix3x6d& d_dRT, Matrix3x3d& d_dX) const; + + vector<CameraMatrix>& _cams; + vector<Vector3d>& _Xs; + + vector<Vector2d> const& _measurements; + + vector<Vector3d> _savedTranslations; + vector<Matrix3x3d> _savedRotations; + vector<Vector3d> _savedXs; + + double const _inlierThreshold; + double _cachedParamLength; + }; // end struct MetricBundleOptimizerBase + + struct StdMetricBundleOptimizer : public MetricBundleOptimizerBase + { + typedef MetricBundleOptimizerBase Base; + + StdMetricBundleOptimizer(double inlierThreshold, + vector<CameraMatrix>& cams, + vector<Vector3d >& Xs, + vector<Vector2d > const& measurements, + vector<int> const& corrspondingView, + vector<int> const& corrspondingPoint) + : MetricBundleOptimizerBase(inlierThreshold, cams, Xs, measurements, + corrspondingView, corrspondingPoint, 0, 0) + { } + + virtual void evalResidual(VectorArray<double>& e) + { + for (unsigned int k = 0; k < e.count(); ++k) + { + int const i = _correspondingParamA[k]; + int const j = _correspondingParamB[k]; + + Vector2d const q = _cams[i].projectPoint(_Xs[j]); + e[k][0] = q[0] - _measurements[k][0]; + e[k][1] = q[1] - _measurements[k][1]; + } + } + + virtual void fillJacobians(Matrix<double>& Ak, Matrix<double>& Bk, Matrix<double>& Ck, + int i, int j, int k); + }; // end struct StdMetricBundleOptimizer + +//---------------------------------------------------------------------- + + enum + { + FULL_BUNDLE_METRIC = 0, + FULL_BUNDLE_FOCAL_LENGTH = 1, // f + FULL_BUNDLE_FOCAL_LENGTH_PP = 2, // f, cx, cy + FULL_BUNDLE_RADIAL = 3, // f, cx, cy, k1, k2 + FULL_BUNDLE_RADIAL_TANGENTIAL = 4 // f, cx, cy, k1, k2, p1, p2 + }; + + struct CommonInternalsMetricBundleOptimizer : public MetricBundleOptimizerBase + { + static int globalParamDimensionFromMode(int mode) + { + switch (mode) + { + case FULL_BUNDLE_METRIC: return 0; + case FULL_BUNDLE_FOCAL_LENGTH: return 1; + case FULL_BUNDLE_FOCAL_LENGTH_PP: return 3; + case FULL_BUNDLE_RADIAL: return 5; + case FULL_BUNDLE_RADIAL_TANGENTIAL: return 7; + } + return 0; + } + + typedef MetricBundleOptimizerBase Base; + + CommonInternalsMetricBundleOptimizer(int mode, + double inlierThreshold, + Matrix3x3d& K, + StdDistortionFunction& distortion, + vector<CameraMatrix>& cams, + vector<Vector3d >& Xs, + vector<Vector2d > const& measurements, + vector<int> const& corrspondingView, + vector<int> const& corrspondingPoint) + : MetricBundleOptimizerBase(inlierThreshold, cams, Xs, measurements, + corrspondingView, corrspondingPoint, + 0, globalParamDimensionFromMode(mode)), + _mode(mode), _K(K), _distortion(distortion) + { + _cachedAspectRatio = K[1][1] / K[0][0]; + } + + Vector2d projectPoint(Vector3d const& X, int i) const + { + Vector3d const XX = _cams[i].transformPointIntoCameraSpace(X); + Vector2d p; + p[0] = XX[0] / XX[2]; + p[1] = XX[1] / XX[2]; + p = _distortion(p); + Vector2d res; + res[0] = _K[0][0] * p[0] + _K[0][1] * p[1] + _K[0][2]; + res[1] = _K[1][1] * p[1] + _K[1][2]; + return res; + } + + virtual void evalResidual(VectorArray<double>& e) + { + for (unsigned int k = 0; k < e.count(); ++k) + { + int const i = _correspondingParamA[k]; + int const j = _correspondingParamB[k]; + + Vector2d const q = this->projectPoint(_Xs[j], i); + e[k][0] = q[0] - _measurements[k][0]; + e[k][1] = q[1] - _measurements[k][1]; + } + } + + virtual void fillJacobians(Matrix<double>& Ak, Matrix<double>& Bk, Matrix<double>& Ck, + int i, int j, int k); + + virtual void updateParametersC(Vector<double> const& deltaC); + + virtual void saveAllParameters() + { + Base::saveAllParameters(); + _savedK = _K; + _savedDistortion = _distortion; + } + + virtual void restoreAllParameters() + { + Base::restoreAllParameters(); + _K = _savedK; + _distortion = _savedDistortion; + } + + protected: + int _mode; + Matrix3x3d& _K; + StdDistortionFunction& _distortion; + + Matrix3x3d _savedK; + StdDistortionFunction _savedDistortion; + double _cachedAspectRatio; + }; // end struct CommonInternalsMetricBundleOptimizer + +//---------------------------------------------------------------------- + + struct VaryingInternalsMetricBundleOptimizer : public MetricBundleOptimizerBase + { + static int extParamDimensionFromMode(int mode) + { + switch (mode) + { + case FULL_BUNDLE_METRIC: return 0; + case FULL_BUNDLE_FOCAL_LENGTH: return 1; + case FULL_BUNDLE_FOCAL_LENGTH_PP: return 3; + case FULL_BUNDLE_RADIAL: return 5; + case FULL_BUNDLE_RADIAL_TANGENTIAL: return 7; + } + return 0; + } + + typedef MetricBundleOptimizerBase Base; + + VaryingInternalsMetricBundleOptimizer(int mode, + double inlierThreshold, + std::vector<StdDistortionFunction>& distortions, + vector<CameraMatrix>& cams, + vector<Vector3d >& Xs, + vector<Vector2d > const& measurements, + vector<int> const& corrspondingView, + vector<int> const& corrspondingPoint) + : MetricBundleOptimizerBase(inlierThreshold, cams, Xs, measurements, + corrspondingView, corrspondingPoint, + extParamDimensionFromMode(mode), 0), + _mode(mode), _distortions(distortions), + _savedKs(cams.size()), _savedDistortions(cams.size()) + { } + + Vector2d projectPoint(Vector3d const& X, int i) const + { + return _cams[i].projectPoint(_distortions[i], X); + } + + virtual void evalResidual(VectorArray<double>& e) + { + for (unsigned int k = 0; k < e.count(); ++k) + { + int const i = _correspondingParamA[k]; + int const j = _correspondingParamB[k]; + + Vector2d const q = this->projectPoint(_Xs[j], i); + e[k][0] = q[0] - _measurements[k][0]; + e[k][1] = q[1] - _measurements[k][1]; + } + } + + virtual void fillJacobians(Matrix<double>& Ak, Matrix<double>& Bk, Matrix<double>& Ck, + int i, int j, int k); + + virtual void updateParametersA(VectorArray<double> const& deltaAi); + + virtual void saveAllParameters() + { + Base::saveAllParameters(); + for (int i = _nNonvaryingA; i < _nParametersA; ++i) + _savedKs[i] = _cams[i].getIntrinsic(); + std::copy(_distortions.begin(), _distortions.end(), _savedDistortions.begin()); + } + + virtual void restoreAllParameters() + { + Base::restoreAllParameters(); + for (int i = _nNonvaryingA; i < _nParametersA; ++i) + _cams[i].setIntrinsic(_savedKs[i]); + std::copy(_savedDistortions.begin(), _savedDistortions.end(), _distortions.begin()); + } + + protected: + int _mode; + std::vector<StdDistortionFunction>& _distortions; + + std::vector<Matrix3x3d> _savedKs; + std::vector<StdDistortionFunction> _savedDistortions; + }; // end struct VaryingInternalsMetricBundleOptimizer + +} // end namespace V3D + +# endif + +#endif diff --git a/extern/libmv/third_party/ssba/Math/v3d_linear.h b/extern/libmv/third_party/ssba/Math/v3d_linear.h new file mode 100644 index 00000000000..7d6e898169c --- /dev/null +++ b/extern/libmv/third_party/ssba/Math/v3d_linear.h @@ -0,0 +1,923 @@ +// -*- C++ -*- +/* +Copyright (c) 2008 University of North Carolina at Chapel Hill + +This file is part of SSBA (Simple Sparse Bundle Adjustment). + +SSBA is free software: you can redistribute it and/or modify it under the +terms of the GNU Lesser General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your option) any +later version. + +SSBA 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 Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License along +with SSBA. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef V3D_LINEAR_H +#define V3D_LINEAR_H + +#include <cassert> +#include <algorithm> +#include <vector> +#include <cmath> + +namespace V3D +{ + using namespace std; + + //! Unboxed vector type + template <typename Elem, int Size> + struct InlineVectorBase + { + typedef Elem value_type; + typedef Elem element_type; + + typedef Elem const * const_iterator; + typedef Elem * iterator; + + static unsigned int size() { return Size; } + + Elem& operator[](unsigned int i) { return _vec[i]; } + Elem operator[](unsigned int i) const { return _vec[i]; } + + Elem& operator()(unsigned int i) { return _vec[i-1]; } + Elem operator()(unsigned int i) const { return _vec[i-1]; } + + const_iterator begin() const { return _vec; } + iterator begin() { return _vec; } + const_iterator end() const { return _vec + Size; } + iterator end() { return _vec + Size; } + + void newsize(unsigned int sz) const + { + assert(sz == Size); + } + + protected: + Elem _vec[Size]; + }; + + //! Boxed (heap allocated) vector. + template <typename Elem> + struct VectorBase + { + typedef Elem value_type; + typedef Elem element_type; + + typedef Elem const * const_iterator; + typedef Elem * iterator; + + VectorBase() + : _size(0), _ownsVec(true), _vec(0) + { } + + VectorBase(unsigned int size) + : _size(size), _ownsVec(true), _vec(0) + { + if (size > 0) _vec = new Elem[size]; + } + + VectorBase(unsigned int size, Elem * values) + : _size(size), _ownsVec(false), _vec(values) + { } + + VectorBase(VectorBase<Elem> const& a) + : _size(0), _ownsVec(true), _vec(0) + { + _size = a._size; + if (_size == 0) return; + _vec = new Elem[_size]; + std::copy(a._vec, a._vec + _size, _vec); + } + + ~VectorBase() { if (_ownsVec && _vec != 0) delete [] _vec; } + + VectorBase& operator=(VectorBase<Elem> const& a) + { + if (this == &a) return *this; + + this->newsize(a._size); + std::copy(a._vec, a._vec + _size, _vec); + return *this; + } + + unsigned int size() const { return _size; } + + VectorBase<Elem>& newsize(unsigned int sz) + { + if (sz == _size) return *this; + assert(_ownsVec); + + __destroy(); + _size = sz; + if (_size > 0) _vec = new Elem[_size]; + + return *this; + } + + + Elem& operator[](unsigned int i) { return _vec[i]; } + Elem operator[](unsigned int i) const { return _vec[i]; } + + Elem& operator()(unsigned int i) { return _vec[i-1]; } + Elem operator()(unsigned int i) const { return _vec[i-1]; } + + const_iterator begin() const { return _vec; } + iterator begin() { return _vec; } + const_iterator end() const { return _vec + _size; } + iterator end() { return _vec + _size; } + + protected: + void __destroy() + { + assert(_ownsVec); + + if (_vec != 0) delete [] _vec; + _size = 0; + _vec = 0; + } + + unsigned int _size; + bool _ownsVec; + Elem * _vec; + }; + + template <typename Elem, int Rows, int Cols> + struct InlineMatrixBase + { + typedef Elem value_type; + typedef Elem element_type; + + typedef Elem * iterator; + typedef Elem const * const_iterator; + + static unsigned int num_rows() { return Rows; } + static unsigned int num_cols() { return Cols; } + + Elem * operator[](unsigned int row) { return _m[row]; } + Elem const * operator[](unsigned int row) const { return _m[row]; } + + Elem& operator()(unsigned int row, unsigned int col) { return _m[row-1][col-1]; } + Elem operator()(unsigned int row, unsigned int col) const { return _m[row-1][col-1]; } + + template <typename Vec> + void getRowSlice(unsigned int row, unsigned int first, unsigned int last, Vec& dst) const + { + for (unsigned int c = first; c < last; ++c) dst[c-first] = _m[row][c]; + } + + template <typename Vec> + void getColumnSlice(unsigned int first, unsigned int len, unsigned int col, Vec& dst) const + { + for (unsigned int r = 0; r < len; ++r) dst[r] = _m[r+first][col]; + } + + void newsize(unsigned int rows, unsigned int cols) const + { + assert(rows == Rows && cols == Cols); + } + + const_iterator begin() const { return &_m[0][0]; } + iterator begin() { return &_m[0][0]; } + const_iterator end() const { return &_m[0][0] + Rows*Cols; } + iterator end() { return &_m[0][0] + Rows*Cols; } + + protected: + Elem _m[Rows][Cols]; + }; + + template <typename Elem> + struct MatrixBase + { + typedef Elem value_type; + typedef Elem element_type; + + typedef Elem const * const_iterator; + typedef Elem * iterator; + + MatrixBase() + : _rows(0), _cols(0), _ownsData(true), _m(0) + { } + + MatrixBase(unsigned int rows, unsigned int cols) + : _rows(rows), _cols(cols), _ownsData(true), _m(0) + { + if (_rows * _cols == 0) return; + _m = new Elem[rows*cols]; + } + + MatrixBase(unsigned int rows, unsigned int cols, Elem * values) + : _rows(rows), _cols(cols), _ownsData(false), _m(values) + { } + + MatrixBase(MatrixBase<Elem> const& a) + : _ownsData(true), _m(0) + { + _rows = a._rows; _cols = a._cols; + if (_rows * _cols == 0) return; + _m = new Elem[_rows*_cols]; + std::copy(a._m, a._m+_rows*_cols, _m); + } + + ~MatrixBase() + { + if (_ownsData && _m != 0) delete [] _m; + } + + MatrixBase& operator=(MatrixBase<Elem> const& a) + { + if (this == &a) return *this; + + this->newsize(a.num_rows(), a.num_cols()); + + std::copy(a._m, a._m+_rows*_cols, _m); + return *this; + } + + void newsize(unsigned int rows, unsigned int cols) + { + if (rows == _rows && cols == _cols) return; + + assert(_ownsData); + + __destroy(); + + _rows = rows; + _cols = cols; + if (_rows * _cols == 0) return; + _m = new Elem[rows*cols]; + } + + unsigned int num_rows() const { return _rows; } + unsigned int num_cols() const { return _cols; } + + Elem * operator[](unsigned int row) { return _m + row*_cols; } + Elem const * operator[](unsigned int row) const { return _m + row*_cols; } + + Elem& operator()(unsigned int row, unsigned int col) { return _m[(row-1)*_cols + col-1]; } + Elem operator()(unsigned int row, unsigned int col) const { return _m[(row-1)*_cols + col-1]; } + + const_iterator begin() const { return _m; } + iterator begin() { return _m; } + const_iterator end() const { return _m + _rows*_cols; } + iterator end() { return _m + _rows*_cols; } + + template <typename Vec> + void getRowSlice(unsigned int row, unsigned int first, unsigned int last, Vec& dst) const + { + Elem const * v = (*this)[row]; + for (unsigned int c = first; c < last; ++c) dst[c-first] = v[c]; + } + + template <typename Vec> + void getColumnSlice(unsigned int first, unsigned int len, unsigned int col, Vec& dst) const + { + for (unsigned int r = 0; r < len; ++r) dst[r] = _m[r+first][col]; + } + + protected: + void __destroy() + { + assert(_ownsData); + if (_m != 0) delete [] _m; + _m = 0; + _rows = _cols = 0; + } + + unsigned int _rows, _cols; + bool _ownsData; + Elem * _m; + }; + + template <typename T> + struct CCS_Matrix + { + CCS_Matrix() + : _rows(0), _cols(0) + { } + + CCS_Matrix(int const rows, int const cols, vector<pair<int, int> > const& nonZeros) + : _rows(rows), _cols(cols) + { + this->initialize(nonZeros); + } + + CCS_Matrix(CCS_Matrix const& b) + : _rows(b._rows), _cols(b._cols), + _colStarts(b._colStarts), _rowIdxs(b._rowIdxs), _destIdxs(b._destIdxs), _values(b._values) + { } + + CCS_Matrix& operator=(CCS_Matrix const& b) + { + if (this == &b) return *this; + _rows = b._rows; + _cols = b._cols; + _colStarts = b._colStarts; + _rowIdxs = b._rowIdxs; + _destIdxs = b._destIdxs; + _values = b._values; + return *this; + } + + void create(int const rows, int const cols, vector<pair<int, int> > const& nonZeros) + { + _rows = rows; + _cols = cols; + this->initialize(nonZeros); + } + + unsigned int num_rows() const { return _rows; } + unsigned int num_cols() const { return _cols; } + + int getNonzeroCount() const { return _values.size(); } + + T const * getValues() const { return &_values[0]; } + T * getValues() { return &_values[0]; } + + int const * getDestIndices() const { return &_destIdxs[0]; } + int const * getColumnStarts() const { return &_colStarts[0]; } + int const * getRowIndices() const { return &_rowIdxs[0]; } + + void getRowRange(unsigned int col, unsigned int& firstRow, unsigned int& lastRow) const + { + firstRow = _rowIdxs[_colStarts[col]]; + lastRow = _rowIdxs[_colStarts[col+1]-1]+1; + } + + template <typename Vec> + void getColumnSlice(unsigned int first, unsigned int len, unsigned int col, Vec& dst) const + { + unsigned int const last = first + len; + + for (int r = 0; r < len; ++r) dst[r] = 0; // Fill vector with zeros + + int const colStart = _colStarts[col]; + int const colEnd = _colStarts[col+1]; + + int i = colStart; + int r; + // Skip rows less than the given start row + while (i < colEnd && (r = _rowIdxs[i]) < first) ++i; + + // Copy elements until the final row + while (i < colEnd && (r = _rowIdxs[i]) < last) + { + dst[r-first] = _values[i]; + ++i; + } + } // end getColumnSlice() + + int getColumnNonzeroCount(unsigned int col) const + { + int const colStart = _colStarts[col]; + int const colEnd = _colStarts[col+1]; + return colEnd - colStart; + } + + template <typename VecA, typename VecB> + void getSparseColumn(unsigned int col, VecA& rows, VecB& values) const + { + int const colStart = _colStarts[col]; + int const colEnd = _colStarts[col+1]; + int const nnz = colEnd - colStart; + + for (int i = 0; i < nnz; ++i) + { + rows[i] = _rowIdxs[colStart + i]; + values[i] = _values[colStart + i]; + } + } + + protected: + struct NonzeroInfo + { + int row, col, serial; + + // Sort wrt the column first + bool operator<(NonzeroInfo const& rhs) const + { + if (col < rhs.col) return true; + if (col > rhs.col) return false; + return row < rhs.row; + } + }; + + void initialize(std::vector<std::pair<int, int> > const& nonZeros) + { + using namespace std; + + int const nnz = nonZeros.size(); + + _colStarts.resize(_cols + 1); + _rowIdxs.resize(nnz); + + vector<NonzeroInfo> nz(nnz); + for (int k = 0; k < nnz; ++k) + { + nz[k].row = nonZeros[k].first; + nz[k].col = nonZeros[k].second; + nz[k].serial = k; + } + + // Sort in column major order + std::sort(nz.begin(), nz.end()); + + for (size_t k = 0; k < nnz; ++k) _rowIdxs[k] = nz[k].row; + + int curCol = -1; + for (int k = 0; k < nnz; ++k) + { + NonzeroInfo const& el = nz[k]; + if (el.col != curCol) + { + // Update empty cols between + for (int c = curCol+1; c < el.col; ++c) _colStarts[c] = k; + + curCol = el.col; + _colStarts[curCol] = k; + } // end if + } // end for (k) + + // Update remaining columns + for (int c = curCol+1; c <= _cols; ++c) _colStarts[c] = nnz; + + _destIdxs.resize(nnz); + for (int k = 0; k < nnz; ++k) _destIdxs[nz[k].serial] = k; + + _values.resize(nnz); + } // end initialize() + + int _rows, _cols; + std::vector<int> _colStarts; + std::vector<int> _rowIdxs; + std::vector<int> _destIdxs; + std::vector<T> _values; + }; // end struct CCS_Matrix + +//---------------------------------------------------------------------- + + template <typename Vec, typename Elem> + inline void + fillVector(Vec& v, Elem val) + { + // We do not use std::fill since we rely only on size() and operator[] member functions. + for (unsigned int i = 0; i < v.size(); ++i) v[i] = val; + } + + template <typename Vec> + inline void + makeZeroVector(Vec& v) + { + fillVector(v, 0); + } + + template <typename VecA, typename VecB> + inline void + copyVector(VecA const& src, VecB& dst) + { + assert(src.size() == dst.size()); + // We do not use std::fill since we rely only on size() and operator[] member functions. + for (unsigned int i = 0; i < src.size(); ++i) dst[i] = src[i]; + } + + template <typename VecA, typename VecB> + inline void + copyVectorSlice(VecA const& src, unsigned int srcStart, unsigned int srcLen, + VecB& dst, unsigned int dstStart) + { + unsigned int const end = std::min(srcStart + srcLen, src.size()); + unsigned int const sz = dst.size(); + unsigned int i0, i1; + for (i0 = srcStart, i1 = dstStart; i0 < end && i1 < sz; ++i0, ++i1) dst[i1] = src[i0]; + } + + template <typename Vec> + inline typename Vec::value_type + norm_L1(Vec const& v) + { + typename Vec::value_type res(0); + for (unsigned int i = 0; i < v.size(); ++i) res += fabs(v[i]); + return res; + } + + template <typename Vec> + inline typename Vec::value_type + norm_Linf(Vec const& v) + { + typename Vec::value_type res(0); + for (unsigned int i = 0; i < v.size(); ++i) res = std::max(res, fabs(v[i])); + return res; + } + + template <typename Vec> + inline typename Vec::value_type + norm_L2(Vec const& v) + { + typename Vec::value_type res(0); + for (unsigned int i = 0; i < v.size(); ++i) res += v[i]*v[i]; + return sqrt((double)res); + } + + template <typename Vec> + inline typename Vec::value_type + sqrNorm_L2(Vec const& v) + { + typename Vec::value_type res(0); + for (unsigned int i = 0; i < v.size(); ++i) res += v[i]*v[i]; + return res; + } + + template <typename Vec> + inline void + normalizeVector(Vec& v) + { + typename Vec::value_type norm(norm_L2(v)); + for (unsigned int i = 0; i < v.size(); ++i) v[i] /= norm; + } + + template<typename VecA, typename VecB> + inline typename VecA::value_type + innerProduct(VecA const& a, VecB const& b) + { + assert(a.size() == b.size()); + typename VecA::value_type res(0); + for (unsigned int i = 0; i < a.size(); ++i) res += a[i] * b[i]; + return res; + } + + template <typename Elem, typename VecA, typename VecB> + inline void + scaleVector(Elem s, VecA const& v, VecB& dst) + { + for (unsigned int i = 0; i < v.size(); ++i) dst[i] = s * v[i]; + } + + template <typename Elem, typename Vec> + inline void + scaleVectorIP(Elem s, Vec& v) + { + typedef typename Vec::value_type Elem2; + for (unsigned int i = 0; i < v.size(); ++i) + v[i] = (Elem2)(v[i] * s); + } + + template <typename VecA, typename VecB, typename VecC> + inline void + makeCrossProductVector(VecA const& v, VecB const& w, VecC& dst) + { + assert(v.size() == 3); + assert(w.size() == 3); + assert(dst.size() == 3); + dst[0] = v[1]*w[2] - v[2]*w[1]; + dst[1] = v[2]*w[0] - v[0]*w[2]; + dst[2] = v[0]*w[1] - v[1]*w[0]; + } + + template <typename VecA, typename VecB, typename VecC> + inline void + addVectors(VecA const& v, VecB const& w, VecC& dst) + { + assert(v.size() == w.size()); + assert(v.size() == dst.size()); + for (unsigned int i = 0; i < v.size(); ++i) dst[i] = v[i] + w[i]; + } + + template <typename VecA, typename VecB, typename VecC> + inline void + subtractVectors(VecA const& v, VecB const& w, VecC& dst) + { + assert(v.size() == w.size()); + assert(v.size() == dst.size()); + for (unsigned int i = 0; i < v.size(); ++i) dst[i] = v[i] - w[i]; + } + + template <typename MatA, typename MatB> + inline void + copyMatrix(MatA const& src, MatB& dst) + { + unsigned int const rows = src.num_rows(); + unsigned int const cols = src.num_cols(); + assert(dst.num_rows() == rows); + assert(dst.num_cols() == cols); + for (unsigned int c = 0; c < cols; ++c) + for (unsigned int r = 0; r < rows; ++r) dst[r][c] = src[r][c]; + } + + template <typename MatA, typename MatB> + inline void + copyMatrixSlice(MatA const& src, unsigned int rowStart, unsigned int colStart, unsigned int rowLen, unsigned int colLen, + MatB& dst, unsigned int dstRow, unsigned int dstCol) + { + unsigned int const rows = dst.num_rows(); + unsigned int const cols = dst.num_cols(); + + unsigned int const rowEnd = std::min(rowStart + rowLen, src.num_rows()); + unsigned int const colEnd = std::min(colStart + colLen, src.num_cols()); + + unsigned int c0, c1, r0, r1; + + for (c0 = colStart, c1 = dstCol; c0 < colEnd && c1 < cols; ++c0, ++c1) + for (r0 = rowStart, r1 = dstRow; r0 < rowEnd && r1 < rows; ++r0, ++r1) + dst[r1][c1] = src[r0][c0]; + } + + template <typename MatA, typename MatB> + inline void + makeTransposedMatrix(MatA const& src, MatB& dst) + { + unsigned int const rows = src.num_rows(); + unsigned int const cols = src.num_cols(); + assert(dst.num_cols() == rows); + assert(dst.num_rows() == cols); + for (unsigned int c = 0; c < cols; ++c) + for (unsigned int r = 0; r < rows; ++r) dst[c][r] = src[r][c]; + } + + template <typename Mat> + inline void + fillMatrix(Mat& m, typename Mat::value_type val) + { + unsigned int const rows = m.num_rows(); + unsigned int const cols = m.num_cols(); + for (unsigned int c = 0; c < cols; ++c) + for (unsigned int r = 0; r < rows; ++r) m[r][c] = val; + } + + template <typename Mat> + inline void + makeZeroMatrix(Mat& m) + { + fillMatrix(m, 0); + } + + template <typename Mat> + inline void + makeIdentityMatrix(Mat& m) + { + makeZeroMatrix(m); + unsigned int const rows = m.num_rows(); + unsigned int const cols = m.num_cols(); + unsigned int n = std::min(rows, cols); + for (unsigned int i = 0; i < n; ++i) + m[i][i] = 1; + } + + template <typename Mat, typename Vec> + inline void + makeCrossProductMatrix(Vec const& v, Mat& m) + { + assert(v.size() == 3); + assert(m.num_rows() == 3); + assert(m.num_cols() == 3); + m[0][0] = 0; m[0][1] = -v[2]; m[0][2] = v[1]; + m[1][0] = v[2]; m[1][1] = 0; m[1][2] = -v[0]; + m[2][0] = -v[1]; m[2][1] = v[0]; m[2][2] = 0; + } + + template <typename Mat, typename Vec> + inline void + makeOuterProductMatrix(Vec const& v, Mat& m) + { + assert(m.num_cols() == m.num_rows()); + assert(v.size() == m.num_cols()); + unsigned const sz = v.size(); + for (unsigned r = 0; r < sz; ++r) + for (unsigned c = 0; c < sz; ++c) m[r][c] = v[r]*v[c]; + } + + template <typename Mat, typename VecA, typename VecB> + inline void + makeOuterProductMatrix(VecA const& u, VecB const& v, Mat& m) + { + assert(m.num_cols() == m.num_rows()); + assert(u.size() == m.num_cols()); + assert(v.size() == m.num_cols()); + unsigned const sz = u.size(); + for (unsigned r = 0; r < sz; ++r) + for (unsigned c = 0; c < sz; ++c) m[r][c] = u[r]*v[c]; + } + + template <typename MatA, typename MatB, typename MatC> + void addMatrices(MatA const& a, MatB const& b, MatC& dst) + { + assert(a.num_cols() == b.num_cols()); + assert(a.num_rows() == b.num_rows()); + assert(dst.num_cols() == a.num_cols()); + assert(dst.num_rows() == a.num_rows()); + + unsigned int const rows = a.num_rows(); + unsigned int const cols = a.num_cols(); + + for (unsigned r = 0; r < rows; ++r) + for (unsigned c = 0; c < cols; ++c) dst[r][c] = a[r][c] + b[r][c]; + } + + template <typename MatA, typename MatB> + void addMatricesIP(MatA const& a, MatB& dst) + { + assert(dst.num_cols() == a.num_cols()); + assert(dst.num_rows() == a.num_rows()); + + unsigned int const rows = a.num_rows(); + unsigned int const cols = a.num_cols(); + + for (unsigned r = 0; r < rows; ++r) + for (unsigned c = 0; c < cols; ++c) dst[r][c] += a[r][c]; + } + + template <typename MatA, typename MatB, typename MatC> + void subtractMatrices(MatA const& a, MatB const& b, MatC& dst) + { + assert(a.num_cols() == b.num_cols()); + assert(a.num_rows() == b.num_rows()); + assert(dst.num_cols() == a.num_cols()); + assert(dst.num_rows() == a.num_rows()); + + unsigned int const rows = a.num_rows(); + unsigned int const cols = a.num_cols(); + + for (unsigned r = 0; r < rows; ++r) + for (unsigned c = 0; c < cols; ++c) dst[r][c] = a[r][c] - b[r][c]; + } + + template <typename MatA, typename Elem, typename MatB> + inline void + makeScaledMatrix(MatA const& m, Elem scale, MatB& dst) + { + unsigned int const rows = m.num_rows(); + unsigned int const cols = m.num_cols(); + for (unsigned int c = 0; c < cols; ++c) + for (unsigned int r = 0; r < rows; ++r) dst[r][c] = m[r][c] * scale; + } + + template <typename Mat, typename Elem> + inline void + scaleMatrixIP(Elem scale, Mat& m) + { + unsigned int const rows = m.num_rows(); + unsigned int const cols = m.num_cols(); + for (unsigned int c = 0; c < cols; ++c) + for (unsigned int r = 0; r < rows; ++r) m[r][c] *= scale; + } + + template <typename Mat, typename VecA, typename VecB> + inline void + multiply_A_v(Mat const& m, VecA const& in, VecB& dst) + { + unsigned int const rows = m.num_rows(); + unsigned int const cols = m.num_cols(); + assert(in.size() == cols); + assert(dst.size() == rows); + + makeZeroVector(dst); + + for (unsigned int r = 0; r < rows; ++r) + for (unsigned int c = 0; c < cols; ++c) dst[r] += m[r][c] * in[c]; + } + + template <typename Mat, typename VecA, typename VecB> + inline void + multiply_A_v_projective(Mat const& m, VecA const& in, VecB& dst) + { + unsigned int const rows = m.num_rows(); + unsigned int const cols = m.num_cols(); + assert(in.size() == cols-1); + assert(dst.size() == rows-1); + + typename VecB::value_type w = m(rows-1, cols-1); + unsigned int r, i; + for (i = 0; i < cols-1; ++i) w += m(rows-1, i) * in[i]; + for (r = 0; r < rows-1; ++r) dst[r] = m(r, cols-1); + for (r = 0; r < rows-1; ++r) + for (unsigned int c = 0; c < cols-1; ++c) dst[r] += m[r][c] * in[c]; + for (i = 0; i < rows-1; ++i) dst[i] /= w; + } + + template <typename Mat, typename VecA, typename VecB> + inline void + multiply_A_v_affine(Mat const& m, VecA const& in, VecB& dst) + { + unsigned int const rows = m.num_rows(); + unsigned int const cols = m.num_cols(); + assert(in.size() == cols-1); + assert(dst.size() == rows); + + unsigned int r; + + for (r = 0; r < rows; ++r) dst[r] = m(r, cols-1); + for (r = 0; r < rows; ++r) + for (unsigned int c = 0; c < cols-1; ++c) dst[r] += m[r][c] * in[c]; + } + + template <typename Mat, typename VecA, typename VecB> + inline void + multiply_At_v(Mat const& m, VecA const& in, VecB& dst) + { + unsigned int const rows = m.num_rows(); + unsigned int const cols = m.num_cols(); + assert(in.size() == rows); + assert(dst.size() == cols); + + makeZeroVector(dst); + for (unsigned int c = 0; c < cols; ++c) + for (unsigned int r = 0; r < rows; ++r) dst[c] += m[r][c] * in[r]; + } + + template <typename MatA, typename MatB> + inline void + multiply_At_A(MatA const& a, MatB& dst) + { + assert(dst.num_rows() == a.num_cols()); + assert(dst.num_cols() == a.num_cols()); + + typedef typename MatB::value_type Elem; + + Elem accum; + for (unsigned int r = 0; r < a.num_cols(); ++r) + for (unsigned int c = 0; c < a.num_cols(); ++c) + { + accum = 0; + for (unsigned int k = 0; k < a.num_rows(); ++k) accum += a[k][r] * a[k][c]; + dst[r][c] = accum; + } + } + + template <typename MatA, typename MatB, typename MatC> + inline void + multiply_A_B(MatA const& a, MatB const& b, MatC& dst) + { + assert(a.num_cols() == b.num_rows()); + assert(dst.num_rows() == a.num_rows()); + assert(dst.num_cols() == b.num_cols()); + + typedef typename MatC::value_type Elem; + + Elem accum; + for (unsigned int r = 0; r < a.num_rows(); ++r) + for (unsigned int c = 0; c < b.num_cols(); ++c) + { + accum = 0; + for (unsigned int k = 0; k < a.num_cols(); ++k) accum += a[r][k] * b[k][c]; + dst[r][c] = accum; + } + } + + template <typename MatA, typename MatB, typename MatC> + inline void + multiply_At_B(MatA const& a, MatB const& b, MatC& dst) + { + assert(a.num_rows() == b.num_rows()); + assert(dst.num_rows() == a.num_cols()); + assert(dst.num_cols() == b.num_cols()); + + typedef typename MatC::value_type Elem; + + Elem accum; + for (unsigned int r = 0; r < a.num_cols(); ++r) + for (unsigned int c = 0; c < b.num_cols(); ++c) + { + accum = 0; + for (unsigned int k = 0; k < a.num_rows(); ++k) accum += a[k][r] * b[k][c]; + dst[r][c] = accum; + } + } + + template <typename MatA, typename MatB, typename MatC> + inline void + multiply_A_Bt(MatA const& a, MatB const& b, MatC& dst) + { + assert(a.num_cols() == b.num_cols()); + assert(dst.num_rows() == a.num_rows()); + assert(dst.num_cols() == b.num_rows()); + + typedef typename MatC::value_type Elem; + + Elem accum; + for (unsigned int r = 0; r < a.num_rows(); ++r) + for (unsigned int c = 0; c < b.num_rows(); ++c) + { + accum = 0; + for (unsigned int k = 0; k < a.num_cols(); ++k) accum += a[r][k] * b[c][k]; + dst[r][c] = accum; + } + } + + template <typename Mat> + inline void + transposeMatrixIP(Mat& a) + { + assert(a.num_rows() == a.num_cols()); + + for (unsigned int r = 0; r < a.num_rows(); ++r) + for (unsigned int c = 0; c < r; ++c) + std::swap(a[r][c], a[c][r]); + } + +} // end namespace V3D + +#endif diff --git a/extern/libmv/third_party/ssba/Math/v3d_linear_utils.h b/extern/libmv/third_party/ssba/Math/v3d_linear_utils.h new file mode 100644 index 00000000000..969ec99694f --- /dev/null +++ b/extern/libmv/third_party/ssba/Math/v3d_linear_utils.h @@ -0,0 +1,391 @@ +// -*- C++ -*- +/* +Copyright (c) 2008 University of North Carolina at Chapel Hill + +This file is part of SSBA (Simple Sparse Bundle Adjustment). + +SSBA is free software: you can redistribute it and/or modify it under the +terms of the GNU Lesser General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your option) any +later version. + +SSBA 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 Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License along +with SSBA. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef V3D_LINEAR_UTILS_H +#define V3D_LINEAR_UTILS_H + +#include "Math/v3d_linear.h" + +#include <iostream> + +namespace V3D +{ + + template <typename Elem, int Size> + struct InlineVector : public InlineVectorBase<Elem, Size> + { + }; // end struct InlineVector + + template <typename Elem> + struct Vector : public VectorBase<Elem> + { + Vector() + : VectorBase<Elem>() + { } + + Vector(unsigned int size) + : VectorBase<Elem>(size) + { } + + Vector(unsigned int size, Elem * values) + : VectorBase<Elem>(size, values) + { } + + Vector(Vector<Elem> const& a) + : VectorBase<Elem>(a) + { } + + Vector<Elem>& operator=(Vector<Elem> const& a) + { + (VectorBase<Elem>::operator=)(a); + return *this; + } + + Vector<Elem>& operator+=(Vector<Elem> const& rhs) + { + addVectorsIP(rhs, *this); + return *this; + } + + Vector<Elem>& operator*=(Elem scale) + { + scaleVectorsIP(scale, *this); + return *this; + } + + Vector<Elem> operator+(Vector<Elem> const& rhs) const + { + Vector<Elem> res(this->size()); + addVectors(*this, rhs, res); + return res; + } + + Vector<Elem> operator-(Vector<Elem> const& rhs) const + { + Vector<Elem> res(this->size()); + subtractVectors(*this, rhs, res); + return res; + } + + Elem operator*(Vector<Elem> const& rhs) const + { + return innerProduct(*this, rhs); + } + + }; // end struct Vector + + template <typename Elem, int Rows, int Cols> + struct InlineMatrix : public InlineMatrixBase<Elem, Rows, Cols> + { + }; // end struct InlineMatrix + + template <typename Elem> + struct Matrix : public MatrixBase<Elem> + { + Matrix() + : MatrixBase<Elem>() + { } + + Matrix(unsigned int rows, unsigned int cols) + : MatrixBase<Elem>(rows, cols) + { } + + Matrix(unsigned int rows, unsigned int cols, Elem * values) + : MatrixBase<Elem>(rows, cols, values) + { } + + Matrix(Matrix<Elem> const& a) + : MatrixBase<Elem>(a) + { } + + Matrix<Elem>& operator=(Matrix<Elem> const& a) + { + (MatrixBase<Elem>::operator=)(a); + return *this; + } + + Matrix<Elem>& operator+=(Matrix<Elem> const& rhs) + { + addMatricesIP(rhs, *this); + return *this; + } + + Matrix<Elem>& operator*=(Elem scale) + { + scaleMatrixIP(scale, *this); + return *this; + } + + Matrix<Elem> operator+(Matrix<Elem> const& rhs) const + { + Matrix<Elem> res(this->num_rows(), this->num_cols()); + addMatrices(*this, rhs, res); + return res; + } + + Matrix<Elem> operator-(Matrix<Elem> const& rhs) const + { + Matrix<Elem> res(this->num_rows(), this->num_cols()); + subtractMatrices(*this, rhs, res); + return res; + } + + }; // end struct Matrix + +//---------------------------------------------------------------------- + + typedef InlineVector<float, 2> Vector2f; + typedef InlineVector<double, 2> Vector2d; + typedef InlineVector<float, 3> Vector3f; + typedef InlineVector<double, 3> Vector3d; + typedef InlineVector<float, 4> Vector4f; + typedef InlineVector<double, 4> Vector4d; + + typedef InlineMatrix<float, 2, 2> Matrix2x2f; + typedef InlineMatrix<double, 2, 2> Matrix2x2d; + typedef InlineMatrix<float, 3, 3> Matrix3x3f; + typedef InlineMatrix<double, 3, 3> Matrix3x3d; + typedef InlineMatrix<float, 4, 4> Matrix4x4f; + typedef InlineMatrix<double, 4, 4> Matrix4x4d; + + typedef InlineMatrix<float, 2, 3> Matrix2x3f; + typedef InlineMatrix<double, 2, 3> Matrix2x3d; + typedef InlineMatrix<float, 3, 4> Matrix3x4f; + typedef InlineMatrix<double, 3, 4> Matrix3x4d; + + template <typename Elem> + struct VectorArray + { + VectorArray(unsigned count, unsigned size) + : _count(count), _size(size), _values(0), _vectors(0) + { + unsigned const nTotal = _count * _size; + if (count > 0) _vectors = new Vector<Elem>[count]; + if (nTotal > 0) _values = new Elem[nTotal]; + for (unsigned i = 0; i < _count; ++i) new (&_vectors[i]) Vector<Elem>(_size, _values + i*_size); + } + + VectorArray(unsigned count, unsigned size, Elem initVal) + : _count(count), _size(size), _values(0), _vectors(0) + { + unsigned const nTotal = _count * _size; + if (count > 0) _vectors = new Vector<Elem>[count]; + if (nTotal > 0) _values = new Elem[nTotal]; + for (unsigned i = 0; i < _count; ++i) new (&_vectors[i]) Vector<Elem>(_size, _values + i*_size); + std::fill(_values, _values + nTotal, initVal); + } + + ~VectorArray() + { + delete [] _values; + delete [] _vectors; + } + + unsigned count() const { return _count; } + unsigned size() const { return _size; } + + //! Get the submatrix at position ix + Vector<Elem> const& operator[](unsigned ix) const + { + return _vectors[ix]; + } + + //! Get the submatrix at position ix + Vector<Elem>& operator[](unsigned ix) + { + return _vectors[ix]; + } + + protected: + unsigned _count, _size; + Elem * _values; + Vector<Elem> * _vectors; + + private: + VectorArray(VectorArray const&); + void operator=(VectorArray const&); + }; + + template <typename Elem> + struct MatrixArray + { + MatrixArray(unsigned count, unsigned nRows, unsigned nCols) + : _count(count), _rows(nRows), _columns(nCols), _values(0), _matrices(0) + { + unsigned const nTotal = _count * _rows * _columns; + if (count > 0) _matrices = new Matrix<Elem>[count]; + if (nTotal > 0) _values = new double[nTotal]; + for (unsigned i = 0; i < _count; ++i) + new (&_matrices[i]) Matrix<Elem>(_rows, _columns, _values + i*(_rows*_columns)); + } + + ~MatrixArray() + { + delete [] _matrices; + delete [] _values; + } + + //! Get the submatrix at position ix + Matrix<Elem> const& operator[](unsigned ix) const + { + return _matrices[ix]; + } + + //! Get the submatrix at position ix + Matrix<Elem>& operator[](unsigned ix) + { + return _matrices[ix]; + } + + unsigned count() const { return _count; } + unsigned num_rows() const { return _rows; } + unsigned num_cols() const { return _columns; } + + protected: + unsigned _count, _rows, _columns; + double * _values; + Matrix<Elem> * _matrices; + + private: + MatrixArray(MatrixArray const&); + void operator=(MatrixArray const&); + }; + +//---------------------------------------------------------------------- + + template <typename Elem, int Size> + inline InlineVector<Elem, Size> + operator+(InlineVector<Elem, Size> const& v, InlineVector<Elem, Size> const& w) + { + InlineVector<Elem, Size> res; + addVectors(v, w, res); + return res; + } + + template <typename Elem, int Size> + inline InlineVector<Elem, Size> + operator-(InlineVector<Elem, Size> const& v, InlineVector<Elem, Size> const& w) + { + InlineVector<Elem, Size> res; + subtractVectors(v, w, res); + return res; + } + + template <typename Elem, int Size> + inline InlineVector<Elem, Size> + operator*(Elem scale, InlineVector<Elem, Size> const& v) + { + InlineVector<Elem, Size> res; + scaleVector(scale, v, res); + return res; + } + + template <typename Elem, int Rows, int Cols> + inline InlineVector<Elem, Rows> + operator*(InlineMatrix<Elem, Rows, Cols> const& A, InlineVector<Elem, Cols> const& v) + { + InlineVector<Elem, Rows> res; + multiply_A_v(A, v, res); + return res; + } + + template <typename Elem, int RowsA, int ColsA, int ColsB> + inline InlineMatrix<Elem, RowsA, ColsB> + operator*(InlineMatrix<Elem, RowsA, ColsA> const& A, InlineMatrix<Elem, ColsA, ColsB> const& B) + { + InlineMatrix<Elem, RowsA, ColsB> res; + multiply_A_B(A, B, res); + return res; + } + + template <typename Elem, int Rows, int Cols> + inline InlineMatrix<Elem, Cols, Rows> + transposedMatrix(InlineMatrix<Elem, Rows, Cols> const& A) + { + InlineMatrix<Elem, Cols, Rows> At; + makeTransposedMatrix(A, At); + return At; + } + + template <typename Elem> + inline InlineMatrix<Elem, 3, 3> + invertedMatrix(InlineMatrix<Elem, 3, 3> const& A) + { + Elem a = A[0][0], b = A[0][1], c = A[0][2]; + Elem d = A[1][0], e = A[1][1], f = A[1][2]; + Elem g = A[2][0], h = A[2][1], i = A[2][2]; + + Elem const det = a*e*i + b*f*g + c*d*h - c*e*g - b*d*i - a*f*h; + + InlineMatrix<Elem, 3, 3> res; + res[0][0] = e*i-f*h; res[0][1] = c*h-b*i; res[0][2] = b*f-c*e; + res[1][0] = f*g-d*i; res[1][1] = a*i-c*g; res[1][2] = c*d-a*f; + res[2][0] = d*h-e*g; res[2][1] = b*g-a*h; res[2][2] = a*e-b*d; + + scaleMatrixIP(1.0/det, res); + return res; + } + + template <typename Elem> + inline InlineVector<Elem, 2> + makeVector2(Elem a, Elem b) + { + InlineVector<Elem, 2> res; + res[0] = a; res[1] = b; + return res; + } + + template <typename Elem> + inline InlineVector<Elem, 3> + makeVector3(Elem a, Elem b, Elem c) + { + InlineVector<Elem, 3> res; + res[0] = a; res[1] = b; res[2] = c; + return res; + } + + template <typename Vec> + inline void + displayVector(Vec const& v) + { + using namespace std; + + for (int r = 0; r < v.size(); ++r) + cout << v[r] << " "; + cout << endl; + } + + template <typename Mat> + inline void + displayMatrix(Mat const& A) + { + using namespace std; + + for (int r = 0; r < A.num_rows(); ++r) + { + for (int c = 0; c < A.num_cols(); ++c) + cout << A[r][c] << " "; + cout << endl; + } + } + +} // end namespace V3D + +#endif diff --git a/extern/libmv/third_party/ssba/Math/v3d_mathutilities.h b/extern/libmv/third_party/ssba/Math/v3d_mathutilities.h new file mode 100644 index 00000000000..9e38b92a94b --- /dev/null +++ b/extern/libmv/third_party/ssba/Math/v3d_mathutilities.h @@ -0,0 +1,59 @@ +// -*- C++ -*- +/* +Copyright (c) 2008 University of North Carolina at Chapel Hill + +This file is part of SSBA (Simple Sparse Bundle Adjustment). + +SSBA is free software: you can redistribute it and/or modify it under the +terms of the GNU Lesser General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your option) any +later version. + +SSBA 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 Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License along +with SSBA. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef V3D_MATH_UTILITIES_H +#define V3D_MATH_UTILITIES_H + +#include "Math/v3d_linear.h" +#include "Math/v3d_linear_utils.h" + +#include <vector> + +namespace V3D +{ + + template <typename Vec, typename Mat> + inline void + createRotationMatrixRodriguez(Vec const& omega, Mat& R) + { + assert(omega.size() == 3); + assert(R.num_rows() == 3); + assert(R.num_cols() == 3); + + double const theta = norm_L2(omega); + makeIdentityMatrix(R); + if (fabs(theta) > 1e-6) + { + Matrix3x3d J, J2; + makeCrossProductMatrix(omega, J); + multiply_A_B(J, J, J2); + double const c1 = sin(theta)/theta; + double const c2 = (1-cos(theta))/(theta*theta); + for (int i = 0; i < 3; ++i) + for (int j = 0; j < 3; ++j) + R[i][j] += c1*J[i][j] + c2*J2[i][j]; + } + } // end createRotationMatrixRodriguez() + + template <typename T> inline double sqr(T x) { return x*x; } + +} // namespace V3D + +#endif diff --git a/extern/libmv/third_party/ssba/Math/v3d_optimization.cpp b/extern/libmv/third_party/ssba/Math/v3d_optimization.cpp new file mode 100644 index 00000000000..234815fcd1f --- /dev/null +++ b/extern/libmv/third_party/ssba/Math/v3d_optimization.cpp @@ -0,0 +1,955 @@ +/* +Copyright (c) 2008 University of North Carolina at Chapel Hill + +This file is part of SSBA (Simple Sparse Bundle Adjustment). + +SSBA is free software: you can redistribute it and/or modify it under the +terms of the GNU Lesser General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your option) any +later version. + +SSBA 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 Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License along +with SSBA. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "Math/v3d_optimization.h" + +#if defined(V3DLIB_ENABLE_SUITESPARSE) +//# include "COLAMD/Include/colamd.h" +# include "colamd.h" +extern "C" +{ +//# include "LDL/Include/ldl.h" +# include "ldl.h" +} +#endif + +#include <iostream> +#include <map> + +#define USE_BLOCK_REORDERING 1 +#define USE_MULTIPLICATIVE_UPDATE 1 + +using namespace std; + +namespace +{ + + using namespace V3D; + + inline double + squaredResidual(VectorArray<double> const& e) + { + int const N = e.count(); + int const M = e.size(); + + double res = 0.0; + + for (int n = 0; n < N; ++n) + for (int m = 0; m < M; ++m) + res += e[n][m] * e[n][m]; + + return res; + } // end squaredResidual() + +} // end namespace <> + +namespace V3D +{ + + int optimizerVerbosenessLevel = 0; + +#if defined(V3DLIB_ENABLE_SUITESPARSE) + + void + SparseLevenbergOptimizer::setupSparseJtJ() + { + int const nVaryingA = _nParametersA - _nNonvaryingA; + int const nVaryingB = _nParametersB - _nNonvaryingB; + int const nVaryingC = _paramDimensionC - _nNonvaryingC; + + int const bColumnStart = nVaryingA*_paramDimensionA; + int const cColumnStart = bColumnStart + nVaryingB*_paramDimensionB; + int const nColumns = cColumnStart + nVaryingC; + + _jointNonzerosW.clear(); + _jointIndexW.resize(_nMeasurements); +#if 1 + { + map<pair<int, int>, int> jointNonzeroMap; + for (size_t k = 0; k < _nMeasurements; ++k) + { + int const i = _correspondingParamA[k] - _nNonvaryingA; + int const j = _correspondingParamB[k] - _nNonvaryingB; + if (i >= 0 && j >= 0) + { + map<pair<int, int>, int>::const_iterator p = jointNonzeroMap.find(make_pair(i, j)); + if (p == jointNonzeroMap.end()) + { + jointNonzeroMap.insert(make_pair(make_pair(i, j), _jointNonzerosW.size())); + _jointIndexW[k] = _jointNonzerosW.size(); + _jointNonzerosW.push_back(make_pair(i, j)); + } + else + { + _jointIndexW[k] = (*p).second; + } // end if + } // end if + } // end for (k) + } // end scope +#else + for (size_t k = 0; k < _nMeasurements; ++k) + { + int const i = _correspondingParamA[k] - _nNonvaryingA; + int const j = _correspondingParamB[k] - _nNonvaryingB; + if (i >= 0 && j >= 0) + { + _jointIndexW[k] = _jointNonzerosW.size(); + _jointNonzerosW.push_back(make_pair(i, j)); + } + } // end for (k) +#endif + +#if defined(USE_BLOCK_REORDERING) + int const bBlockColumnStart = nVaryingA; + int const cBlockColumnStart = bBlockColumnStart + nVaryingB; + + int const nBlockColumns = cBlockColumnStart + ((nVaryingC > 0) ? 1 : 0); + + //cout << "nBlockColumns = " << nBlockColumns << endl; + + // For the column reordering we treat the columns belonging to one set + // of parameters as one (logical) column. + + // Determine non-zeros of JtJ (we forget about the non-zero diagonal for now) + // Only consider nonzeros of Ai^t * Bj induced by the measurements. + vector<pair<int, int> > nz_blockJtJ(_jointNonzerosW.size()); + for (int k = 0; k < _jointNonzerosW.size(); ++k) + { + nz_blockJtJ[k].first = _jointNonzerosW[k].second + bBlockColumnStart; + nz_blockJtJ[k].second = _jointNonzerosW[k].first; + } + + if (nVaryingC > 0) + { + // We assume, that the global unknowns are linked to every other variable. + for (int i = 0; i < nVaryingA; ++i) + nz_blockJtJ.push_back(make_pair(cBlockColumnStart, i)); + for (int j = 0; j < nVaryingB; ++j) + nz_blockJtJ.push_back(make_pair(cBlockColumnStart, j + bBlockColumnStart)); + } // end if + + int const nnzBlock = nz_blockJtJ.size(); + + vector<int> permBlockJtJ(nBlockColumns + 1); + + if (nnzBlock > 0) + { +// cout << "nnzBlock = " << nnzBlock << endl; + + CCS_Matrix<int> blockJtJ(nBlockColumns, nBlockColumns, nz_blockJtJ); + +// cout << " nz_blockJtJ: " << endl; +// for (size_t k = 0; k < nz_blockJtJ.size(); ++k) +// cout << " " << nz_blockJtJ[k].first << ":" << nz_blockJtJ[k].second << endl; +// cout << endl; + + int * colStarts = (int *)blockJtJ.getColumnStarts(); + int * rowIdxs = (int *)blockJtJ.getRowIndices(); + +// cout << "blockJtJ_colStarts = "; +// for (int k = 0; k <= nBlockColumns; ++k) cout << colStarts[k] << " "; +// cout << endl; + +// cout << "blockJtJ_rowIdxs = "; +// for (int k = 0; k < nnzBlock; ++k) cout << rowIdxs[k] << " "; +// cout << endl; + + int stats[COLAMD_STATS]; + symamd(nBlockColumns, rowIdxs, colStarts, &permBlockJtJ[0], (double *) NULL, stats, &calloc, &free); + if (optimizerVerbosenessLevel >= 2) symamd_report(stats); + } + else + { + for (int k = 0; k < permBlockJtJ.size(); ++k) permBlockJtJ[k] = k; + } // end if + +// cout << "permBlockJtJ = "; +// for (int k = 0; k < permBlockJtJ.size(); ++k) +// cout << permBlockJtJ[k] << " "; +// cout << endl; + + // From the determined symbolic permutation with logical variables, determine the actual ordering + _perm_JtJ.resize(nVaryingA*_paramDimensionA + nVaryingB*_paramDimensionB + nVaryingC + 1); + + int curDstCol = 0; + for (int k = 0; k < permBlockJtJ.size()-1; ++k) + { + int const srcCol = permBlockJtJ[k]; + if (srcCol < nVaryingA) + { + for (int n = 0; n < _paramDimensionA; ++n) + _perm_JtJ[curDstCol + n] = srcCol*_paramDimensionA + n; + curDstCol += _paramDimensionA; + } + else if (srcCol >= bBlockColumnStart && srcCol < cBlockColumnStart) + { + int const bStart = nVaryingA*_paramDimensionA; + int const j = srcCol - bBlockColumnStart; + + for (int n = 0; n < _paramDimensionB; ++n) + _perm_JtJ[curDstCol + n] = bStart + j*_paramDimensionB + n; + curDstCol += _paramDimensionB; + } + else if (srcCol == cBlockColumnStart) + { + int const cStart = nVaryingA*_paramDimensionA + nVaryingB*_paramDimensionB; + + for (int n = 0; n < nVaryingC; ++n) + _perm_JtJ[curDstCol + n] = cStart + n; + curDstCol += nVaryingC; + } + else + { + cerr << "Should not reach " << __LINE__ << ":" << __LINE__ << "!" << endl; + assert(false); + } + } +#else + vector<pair<int, int> > nz, nzL; + this->serializeNonZerosJtJ(nz); + + for (int k = 0; k < nz.size(); ++k) + { + // Swap rows and columns, since serializeNonZerosJtJ() generates the + // upper triangular part but symamd wants the lower triangle. + nzL.push_back(make_pair(nz[k].second, nz[k].first)); + } + + _perm_JtJ.resize(nColumns+1); + + if (nzL.size() > 0) + { + CCS_Matrix<int> symbJtJ(nColumns, nColumns, nzL); + + int * colStarts = (int *)symbJtJ.getColumnStarts(); + int * rowIdxs = (int *)symbJtJ.getRowIndices(); + +// cout << "symbJtJ_colStarts = "; +// for (int k = 0; k <= nColumns; ++k) cout << colStarts[k] << " "; +// cout << endl; + +// cout << "symbJtJ_rowIdxs = "; +// for (int k = 0; k < nzL.size(); ++k) cout << rowIdxs[k] << " "; +// cout << endl; + + int stats[COLAMD_STATS]; + symamd(nColumns, rowIdxs, colStarts, &_perm_JtJ[0], (double *) NULL, stats, &calloc, &free); + if (optimizerVerbosenessLevel >= 2) symamd_report(stats); + } + else + { + for (int k = 0; k < _perm_JtJ.size(); ++k) _perm_JtJ[k] = k; + } //// end if +#endif + _perm_JtJ.back() = _perm_JtJ.size() - 1; + +// cout << "_perm_JtJ = "; +// for (int k = 0; k < _perm_JtJ.size(); ++k) cout << _perm_JtJ[k] << " "; +// cout << endl; + + // Finally, compute the inverse of the full permutation. + _invPerm_JtJ.resize(_perm_JtJ.size()); + for (size_t k = 0; k < _perm_JtJ.size(); ++k) + _invPerm_JtJ[_perm_JtJ[k]] = k; + + vector<pair<int, int> > nz_JtJ; + this->serializeNonZerosJtJ(nz_JtJ); + + for (int k = 0; k < nz_JtJ.size(); ++k) + { + int const i = nz_JtJ[k].first; + int const j = nz_JtJ[k].second; + + int pi = _invPerm_JtJ[i]; + int pj = _invPerm_JtJ[j]; + // Swap values if in lower triangular part + if (pi > pj) std::swap(pi, pj); + nz_JtJ[k].first = pi; + nz_JtJ[k].second = pj; + } + + int const nnz = nz_JtJ.size(); + +// cout << "nz_JtJ = "; +// for (int k = 0; k < nnz; ++k) cout << nz_JtJ[k].first << ":" << nz_JtJ[k].second << " "; +// cout << endl; + + _JtJ.create(nColumns, nColumns, nz_JtJ); + +// cout << "_colStart_JtJ = "; +// for (int k = 0; k < _JtJ.num_cols(); ++k) cout << _JtJ.getColumnStarts()[k] << " "; +// cout << endl; + +// cout << "_rowIdxs_JtJ = "; +// for (int k = 0; k < nnz; ++k) cout << _JtJ.getRowIndices()[k] << " "; +// cout << endl; + + vector<int> workFlags(nColumns); + + _JtJ_Lp.resize(nColumns+1); + _JtJ_Parent.resize(nColumns); + _JtJ_Lnz.resize(nColumns); + + ldl_symbolic(nColumns, (int *)_JtJ.getColumnStarts(), (int *)_JtJ.getRowIndices(), + &_JtJ_Lp[0], &_JtJ_Parent[0], &_JtJ_Lnz[0], + &workFlags[0], NULL, NULL); + + if (optimizerVerbosenessLevel >= 1) + cout << "SparseLevenbergOptimizer: Nonzeros in LDL decomposition: " << _JtJ_Lp[nColumns] << endl; + + } // end SparseLevenbergOptimizer::setupSparseJtJ() + + void + SparseLevenbergOptimizer::serializeNonZerosJtJ(vector<pair<int, int> >& dst) const + { + int const nVaryingA = _nParametersA - _nNonvaryingA; + int const nVaryingB = _nParametersB - _nNonvaryingB; + int const nVaryingC = _paramDimensionC - _nNonvaryingC; + + int const bColumnStart = nVaryingA*_paramDimensionA; + int const cColumnStart = bColumnStart + nVaryingB*_paramDimensionB; + + dst.clear(); + + // Add the diagonal block matrices (only the upper triangular part). + + // Ui submatrices of JtJ + for (int i = 0; i < nVaryingA; ++i) + { + int const i0 = i * _paramDimensionA; + + for (int c = 0; c < _paramDimensionA; ++c) + for (int r = 0; r <= c; ++r) + dst.push_back(make_pair(i0 + r, i0 + c)); + } + + // Vj submatrices of JtJ + for (int j = 0; j < nVaryingB; ++j) + { + int const j0 = j*_paramDimensionB + bColumnStart; + + for (int c = 0; c < _paramDimensionB; ++c) + for (int r = 0; r <= c; ++r) + dst.push_back(make_pair(j0 + r, j0 + c)); + } + + // Z submatrix of JtJ + for (int c = 0; c < nVaryingC; ++c) + for (int r = 0; r <= c; ++r) + dst.push_back(make_pair(cColumnStart + r, cColumnStart + c)); + + // Add the elements i and j linked by an observation k + // W submatrix of JtJ + for (size_t n = 0; n < _jointNonzerosW.size(); ++n) + { + int const i0 = _jointNonzerosW[n].first; + int const j0 = _jointNonzerosW[n].second; + int const r0 = i0*_paramDimensionA; + int const c0 = j0*_paramDimensionB + bColumnStart; + + for (int r = 0; r < _paramDimensionA; ++r) + for (int c = 0; c < _paramDimensionB; ++c) + dst.push_back(make_pair(r0 + r, c0 + c)); + } // end for (n) + + if (nVaryingC > 0) + { + // Finally, add the dense columns linking i (resp. j) with the global parameters. + // X submatrix of JtJ + for (int i = 0; i < nVaryingA; ++i) + { + int const i0 = i*_paramDimensionA; + + for (int r = 0; r < _paramDimensionA; ++r) + for (int c = 0; c < nVaryingC; ++c) + dst.push_back(make_pair(i0 + r, cColumnStart + c)); + } + + // Y submatrix of JtJ + for (int j = 0; j < nVaryingB; ++j) + { + int const j0 = j*_paramDimensionB + bColumnStart; + + for (int r = 0; r < _paramDimensionB; ++r) + for (int c = 0; c < nVaryingC; ++c) + dst.push_back(make_pair(j0 + r, cColumnStart + c)); + } + } // end if + } // end SparseLevenbergOptimizer::serializeNonZerosJtJ() + + void + SparseLevenbergOptimizer::fillSparseJtJ(MatrixArray<double> const& Ui, + MatrixArray<double> const& Vj, + MatrixArray<double> const& Wn, + Matrix<double> const& Z, + Matrix<double> const& X, + Matrix<double> const& Y) + { + int const nVaryingA = _nParametersA - _nNonvaryingA; + int const nVaryingB = _nParametersB - _nNonvaryingB; + int const nVaryingC = _paramDimensionC - _nNonvaryingC; + + int const bColumnStart = nVaryingA*_paramDimensionA; + int const cColumnStart = bColumnStart + nVaryingB*_paramDimensionB; + + int const nCols = _JtJ.num_cols(); + int const nnz = _JtJ.getNonzeroCount(); + + // The following has to replicate the procedure as in serializeNonZerosJtJ() + + int serial = 0; + + double * values = _JtJ.getValues(); + int const * destIdxs = _JtJ.getDestIndices(); + + // Add the diagonal block matrices (only the upper triangular part). + + // Ui submatrices of JtJ + for (int i = 0; i < nVaryingA; ++i) + { + int const i0 = i * _paramDimensionA; + + for (int c = 0; c < _paramDimensionA; ++c) + for (int r = 0; r <= c; ++r, ++serial) + values[destIdxs[serial]] = Ui[i][r][c]; + } + + // Vj submatrices of JtJ + for (int j = 0; j < nVaryingB; ++j) + { + int const j0 = j*_paramDimensionB + bColumnStart; + + for (int c = 0; c < _paramDimensionB; ++c) + for (int r = 0; r <= c; ++r, ++serial) + values[destIdxs[serial]] = Vj[j][r][c]; + } + + // Z submatrix of JtJ + for (int c = 0; c < nVaryingC; ++c) + for (int r = 0; r <= c; ++r, ++serial) + values[destIdxs[serial]] = Z[r][c]; + + // Add the elements i and j linked by an observation k + // W submatrix of JtJ + for (size_t n = 0; n < _jointNonzerosW.size(); ++n) + { + for (int r = 0; r < _paramDimensionA; ++r) + for (int c = 0; c < _paramDimensionB; ++c, ++serial) + values[destIdxs[serial]] = Wn[n][r][c]; + } // end for (k) + + if (nVaryingC > 0) + { + // Finally, add the dense columns linking i (resp. j) with the global parameters. + // X submatrix of JtJ + for (int i = 0; i < nVaryingA; ++i) + { + int const r0 = i * _paramDimensionA; + for (int r = 0; r < _paramDimensionA; ++r) + for (int c = 0; c < nVaryingC; ++c, ++serial) + values[destIdxs[serial]] = X[r0+r][c]; + } + + // Y submatrix of JtJ + for (int j = 0; j < nVaryingB; ++j) + { + int const r0 = j * _paramDimensionB; + for (int r = 0; r < _paramDimensionB; ++r) + for (int c = 0; c < nVaryingC; ++c, ++serial) + values[destIdxs[serial]] = Y[r0+r][c]; + } + } // end if + } // end SparseLevenbergOptimizer::fillSparseJtJ() + + void + SparseLevenbergOptimizer::minimize() + { + status = LEVENBERG_OPTIMIZER_TIMEOUT; + bool computeDerivatives = true; + + int const nVaryingA = _nParametersA - _nNonvaryingA; + int const nVaryingB = _nParametersB - _nNonvaryingB; + int const nVaryingC = _paramDimensionC - _nNonvaryingC; + + if (nVaryingA == 0 && nVaryingB == 0 && nVaryingC == 0) + { + // No degrees of freedom, nothing to optimize. + status = LEVENBERG_OPTIMIZER_CONVERGED; + return; + } + + this->setupSparseJtJ(); + + Vector<double> weights(_nMeasurements); + + MatrixArray<double> Ak(_nMeasurements, _measurementDimension, _paramDimensionA); + MatrixArray<double> Bk(_nMeasurements, _measurementDimension, _paramDimensionB); + MatrixArray<double> Ck(_nMeasurements, _measurementDimension, _paramDimensionC); + + MatrixArray<double> Ui(nVaryingA, _paramDimensionA, _paramDimensionA); + MatrixArray<double> Vj(nVaryingB, _paramDimensionB, _paramDimensionB); + + // Wn = Ak^t*Bk + MatrixArray<double> Wn(_jointNonzerosW.size(), _paramDimensionA, _paramDimensionB); + + Matrix<double> Z(nVaryingC, nVaryingC); + + // X = A^t*C + Matrix<double> X(nVaryingA*_paramDimensionA, nVaryingC); + // Y = B^t*C + Matrix<double> Y(nVaryingB*_paramDimensionB, nVaryingC); + + VectorArray<double> residuals(_nMeasurements, _measurementDimension); + VectorArray<double> residuals2(_nMeasurements, _measurementDimension); + + VectorArray<double> diagUi(nVaryingA, _paramDimensionA); + VectorArray<double> diagVj(nVaryingB, _paramDimensionB); + Vector<double> diagZ(nVaryingC); + + VectorArray<double> At_e(nVaryingA, _paramDimensionA); + VectorArray<double> Bt_e(nVaryingB, _paramDimensionB); + Vector<double> Ct_e(nVaryingC); + + Vector<double> Jt_e(nVaryingA*_paramDimensionA + nVaryingB*_paramDimensionB + nVaryingC); + + Vector<double> delta(nVaryingA*_paramDimensionA + nVaryingB*_paramDimensionB + nVaryingC); + Vector<double> deltaPerm(nVaryingA*_paramDimensionA + nVaryingB*_paramDimensionB + nVaryingC); + + VectorArray<double> deltaAi(_nParametersA, _paramDimensionA); + VectorArray<double> deltaBj(_nParametersB, _paramDimensionB); + Vector<double> deltaC(_paramDimensionC); + + double err = 0.0; + + for (currentIteration = 0; currentIteration < maxIterations; ++currentIteration) + { + if (optimizerVerbosenessLevel >= 2) + cout << "SparseLevenbergOptimizer: currentIteration: " << currentIteration << endl; + if (computeDerivatives) + { + this->evalResidual(residuals); + this->fillWeights(residuals, weights); + for (int k = 0; k < _nMeasurements; ++k) + scaleVectorIP(weights[k], residuals[k]); + + err = squaredResidual(residuals); + + if (optimizerVerbosenessLevel >= 1) cout << "SparseLevenbergOptimizer: |residual|^2 = " << err << endl; + if (optimizerVerbosenessLevel >= 2) cout << "SparseLevenbergOptimizer: lambda = " << lambda << endl; + + for (int k = 0; k < residuals.count(); ++k) scaleVectorIP(-1.0, residuals[k]); + + this->setupJacobianGathering(); + this->fillAllJacobians(weights, Ak, Bk, Ck); + + // Compute the different parts of J^t*e + if (nVaryingA > 0) + { + for (int i = 0; i < nVaryingA; ++i) makeZeroVector(At_e[i]); + + Vector<double> tmp(_paramDimensionA); + + for (int k = 0; k < _nMeasurements; ++k) + { + int const i = _correspondingParamA[k] - _nNonvaryingA; + if (i < 0) continue; + multiply_At_v(Ak[k], residuals[k], tmp); + addVectors(tmp, At_e[i], At_e[i]); + } // end for (k) + } // end if + + if (nVaryingB > 0) + { + for (int j = 0; j < nVaryingB; ++j) makeZeroVector(Bt_e[j]); + + Vector<double> tmp(_paramDimensionB); + + for (int k = 0; k < _nMeasurements; ++k) + { + int const j = _correspondingParamB[k] - _nNonvaryingB; + if (j < 0) continue; + multiply_At_v(Bk[k], residuals[k], tmp); + addVectors(tmp, Bt_e[j], Bt_e[j]); + } // end for (k) + } // end if + + if (nVaryingC > 0) + { + makeZeroVector(Ct_e); + + Vector<double> tmp(_paramDimensionC); + + for (int k = 0; k < _nMeasurements; ++k) + { + multiply_At_v(Ck[k], residuals[k], tmp); + for (int l = 0; l < nVaryingC; ++l) Ct_e[l] += tmp[_nNonvaryingC + l]; + } + } // end if + + int pos = 0; + for (int i = 0; i < nVaryingA; ++i) + for (int l = 0; l < _paramDimensionA; ++l, ++pos) + Jt_e[pos] = At_e[i][l]; + for (int j = 0; j < nVaryingB; ++j) + for (int l = 0; l < _paramDimensionB; ++l, ++pos) + Jt_e[pos] = Bt_e[j][l]; + for (int l = 0; l < nVaryingC; ++l, ++pos) + Jt_e[pos] = Ct_e[l]; + +// cout << "Jt_e = "; +// for (int k = 0; k < Jt_e.size(); ++k) cout << Jt_e[k] << " "; +// cout << endl; + + if (this->applyGradientStoppingCriteria(norm_Linf(Jt_e))) + { + status = LEVENBERG_OPTIMIZER_CONVERGED; + goto end; + } + + // The lhs J^t*J consists of several parts: + // [ U W X ] + // J^t*J = [ W^t V Y ] + // [ X^t Y^t Z ], + // where U, V and W are block-sparse matrices (due to the sparsity of A and B). + // X, Y and Z contain only a few columns (the number of global parameters). + + if (nVaryingA > 0) + { + // Compute Ui + Matrix<double> U(_paramDimensionA, _paramDimensionA); + + for (int i = 0; i < nVaryingA; ++i) makeZeroMatrix(Ui[i]); + + for (int k = 0; k < _nMeasurements; ++k) + { + int const i = _correspondingParamA[k] - _nNonvaryingA; + if (i < 0) continue; + multiply_At_A(Ak[k], U); + addMatricesIP(U, Ui[i]); + } // end for (k) + } // end if + + if (nVaryingB > 0) + { + // Compute Vj + Matrix<double> V(_paramDimensionB, _paramDimensionB); + + for (int j = 0; j < nVaryingB; ++j) makeZeroMatrix(Vj[j]); + + for (int k = 0; k < _nMeasurements; ++k) + { + int const j = _correspondingParamB[k] - _nNonvaryingB; + if (j < 0) continue; + multiply_At_A(Bk[k], V); + addMatricesIP(V, Vj[j]); + } // end for (k) + } // end if + + if (nVaryingC > 0) + { + Matrix<double> ZZ(_paramDimensionC, _paramDimensionC); + Matrix<double> Zsum(_paramDimensionC, _paramDimensionC); + + makeZeroMatrix(Zsum); + + for (int k = 0; k < _nMeasurements; ++k) + { + multiply_At_A(Ck[k], ZZ); + addMatricesIP(ZZ, Zsum); + } // end for (k) + + // Ignore the non-varying parameters + for (int i = 0; i < nVaryingC; ++i) + for (int j = 0; j < nVaryingC; ++j) + Z[i][j] = Zsum[i+_nNonvaryingC][j+_nNonvaryingC]; + } // end if + + if (nVaryingA > 0 && nVaryingB > 0) + { + for (int n = 0; n < Wn.count(); ++n) makeZeroMatrix(Wn[n]); + + Matrix<double> W(_paramDimensionA, _paramDimensionB); + + for (int k = 0; k < _nMeasurements; ++k) + { + int const n = _jointIndexW[k]; + if (n >= 0) + { + int const i0 = _jointNonzerosW[n].first; + int const j0 = _jointNonzerosW[n].second; + + multiply_At_B(Ak[k], Bk[k], W); + addMatricesIP(W, Wn[n]); + } // end if + } // end for (k) + } // end if + + if (nVaryingA > 0 && nVaryingC > 0) + { + Matrix<double> XX(_paramDimensionA, _paramDimensionC); + + makeZeroMatrix(X); + + for (int k = 0; k < _nMeasurements; ++k) + { + int const i = _correspondingParamA[k] - _nNonvaryingA; + // Ignore the non-varying parameters + if (i < 0) continue; + + multiply_At_B(Ak[k], Ck[k], XX); + + for (int r = 0; r < _paramDimensionA; ++r) + for (int c = 0; c < nVaryingC; ++c) + X[r+i*_paramDimensionA][c] += XX[r][c+_nNonvaryingC]; + } // end for (k) + } // end if + + if (nVaryingB > 0 && nVaryingC > 0) + { + Matrix<double> YY(_paramDimensionB, _paramDimensionC); + + makeZeroMatrix(Y); + + for (int k = 0; k < _nMeasurements; ++k) + { + int const j = _correspondingParamB[k] - _nNonvaryingB; + // Ignore the non-varying parameters + if (j < 0) continue; + + multiply_At_B(Bk[k], Ck[k], YY); + + for (int r = 0; r < _paramDimensionB; ++r) + for (int c = 0; c < nVaryingC; ++c) + Y[r+j*_paramDimensionB][c] += YY[r][c+_nNonvaryingC]; + } // end for (k) + } // end if + + if (currentIteration == 0) + { + // Initialize lambda as tau*max(JtJ[i][i]) + double maxEl = -1e30; + if (nVaryingA > 0) + { + for (int i = 0; i < nVaryingA; ++i) + for (int l = 0; l < _paramDimensionA; ++l) + maxEl = std::max(maxEl, Ui[i][l][l]); + } + if (nVaryingB > 0) + { + for (int j = 0; j < nVaryingB; ++j) + for (int l = 0; l < _paramDimensionB; ++l) + maxEl = std::max(maxEl, Vj[j][l][l]); + } + if (nVaryingC > 0) + { + for (int l = 0; l < nVaryingC; ++l) + maxEl = std::max(maxEl, Z[l][l]); + } + + lambda = tau * maxEl; + if (optimizerVerbosenessLevel >= 2) + cout << "SparseLevenbergOptimizer: initial lambda = " << lambda << endl; + } // end if (currentIteration == 0) + } // end if (computeDerivatives) + + for (int i = 0; i < nVaryingA; ++i) + { + for (int l = 0; l < _paramDimensionA; ++l) diagUi[i][l] = Ui[i][l][l]; + } // end for (i) + + for (int j = 0; j < nVaryingB; ++j) + { + for (int l = 0; l < _paramDimensionB; ++l) diagVj[j][l] = Vj[j][l][l]; + } // end for (j) + + for (int l = 0; l < nVaryingC; ++l) diagZ[l] = Z[l][l]; + + // Augment the diagonals with lambda (either by the standard additive update or by multiplication). +#if !defined(USE_MULTIPLICATIVE_UPDATE) + for (int i = 0; i < nVaryingA; ++i) + for (unsigned l = 0; l < _paramDimensionA; ++l) + Ui[i][l][l] += lambda; + + for (int j = 0; j < nVaryingB; ++j) + for (unsigned l = 0; l < _paramDimensionB; ++l) + Vj[j][l][l] += lambda; + + for (unsigned l = 0; l < nVaryingC; ++l) + Z[l][l] += lambda; +#else + for (int i = 0; i < nVaryingA; ++i) + for (unsigned l = 0; l < _paramDimensionA; ++l) + Ui[i][l][l] = std::max(Ui[i][l][l] * (1.0 + lambda), 1e-15); + + for (int j = 0; j < nVaryingB; ++j) + for (unsigned l = 0; l < _paramDimensionB; ++l) + Vj[j][l][l] = std::max(Vj[j][l][l] * (1.0 + lambda), 1e-15); + + for (unsigned l = 0; l < nVaryingC; ++l) + Z[l][l] = std::max(Z[l][l] * (1.0 + lambda), 1e-15); +#endif + + this->fillSparseJtJ(Ui, Vj, Wn, Z, X, Y); + + bool success = true; + double rho = 0.0; + { + int const nCols = _JtJ_Parent.size(); + int const nnz = _JtJ.getNonzeroCount(); + int const lnz = _JtJ_Lp.back(); + + vector<int> Li(lnz); + vector<double> Lx(lnz); + vector<double> D(nCols), Y(nCols); + vector<int> workPattern(nCols), workFlag(nCols); + + int * colStarts = (int *)_JtJ.getColumnStarts(); + int * rowIdxs = (int *)_JtJ.getRowIndices(); + double * values = _JtJ.getValues(); + + int const d = ldl_numeric(nCols, colStarts, rowIdxs, values, + &_JtJ_Lp[0], &_JtJ_Parent[0], &_JtJ_Lnz[0], + &Li[0], &Lx[0], &D[0], + &Y[0], &workPattern[0], &workFlag[0], + NULL, NULL); + + if (d == nCols) + { + ldl_perm(nCols, &deltaPerm[0], &Jt_e[0], &_perm_JtJ[0]); + ldl_lsolve(nCols, &deltaPerm[0], &_JtJ_Lp[0], &Li[0], &Lx[0]); + ldl_dsolve(nCols, &deltaPerm[0], &D[0]); + ldl_ltsolve(nCols, &deltaPerm[0], &_JtJ_Lp[0], &Li[0], &Lx[0]); + ldl_permt(nCols, &delta[0], &deltaPerm[0], &_perm_JtJ[0]); + } + else + { + if (optimizerVerbosenessLevel >= 2) + cout << "SparseLevenbergOptimizer: LDL decomposition failed. Increasing lambda." << endl; + success = false; + } + } + + if (success) + { + double const deltaSqrLength = sqrNorm_L2(delta); + + if (optimizerVerbosenessLevel >= 2) + cout << "SparseLevenbergOptimizer: ||delta||^2 = " << deltaSqrLength << endl; + + double const paramLength = this->getParameterLength(); + if (this->applyUpdateStoppingCriteria(paramLength, sqrt(deltaSqrLength))) + { + status = LEVENBERG_OPTIMIZER_SMALL_UPDATE; + goto end; + } + + // Copy the updates from delta to the respective arrays + int pos = 0; + + for (int i = 0; i < _nNonvaryingA; ++i) makeZeroVector(deltaAi[i]); + for (int i = _nNonvaryingA; i < _nParametersA; ++i) + for (int l = 0; l < _paramDimensionA; ++l, ++pos) + deltaAi[i][l] = delta[pos]; + + for (int j = 0; j < _nNonvaryingB; ++j) makeZeroVector(deltaBj[j]); + for (int j = _nNonvaryingB; j < _nParametersB; ++j) + for (int l = 0; l < _paramDimensionB; ++l, ++pos) + deltaBj[j][l] = delta[pos]; + + makeZeroVector(deltaC); + for (int l = _nNonvaryingC; l < _paramDimensionC; ++l, ++pos) + deltaC[l] = delta[pos]; + + saveAllParameters(); + if (nVaryingA > 0) updateParametersA(deltaAi); + if (nVaryingB > 0) updateParametersB(deltaBj); + if (nVaryingC > 0) updateParametersC(deltaC); + + this->evalResidual(residuals2); + for (int k = 0; k < _nMeasurements; ++k) + scaleVectorIP(weights[k], residuals2[k]); + + double const newErr = squaredResidual(residuals2); + rho = err - newErr; + if (optimizerVerbosenessLevel >= 2) + cout << "SparseLevenbergOptimizer: |new residual|^2 = " << newErr << endl; + +#if !defined(USE_MULTIPLICATIVE_UPDATE) + double const denom1 = lambda * deltaSqrLength; +#else + double denom1 = 0.0f; + for (int i = _nNonvaryingA; i < _nParametersA; ++i) + for (int l = 0; l < _paramDimensionA; ++l) + denom1 += deltaAi[i][l] * deltaAi[i][l] * diagUi[i-_nNonvaryingA][l]; + + for (int j = _nNonvaryingB; j < _nParametersB; ++j) + for (int l = 0; l < _paramDimensionB; ++l) + denom1 += deltaBj[j][l] * deltaBj[j][l] * diagVj[j-_nNonvaryingB][l]; + + for (int l = _nNonvaryingC; l < _paramDimensionC; ++l) + denom1 += deltaC[l] * deltaC[l] * diagZ[l-_nNonvaryingC]; + + denom1 *= lambda; +#endif + double const denom2 = innerProduct(delta, Jt_e); + rho = rho / (denom1 + denom2); + if (optimizerVerbosenessLevel >= 2) + cout << "SparseLevenbergOptimizer: rho = " << rho + << " denom1 = " << denom1 << " denom2 = " << denom2 << endl; + } // end if (success) + + if (success && rho > 0) + { + if (optimizerVerbosenessLevel >= 2) + cout << "SparseLevenbergOptimizer: Improved solution - decreasing lambda." << endl; + // Improvement in the new solution + decreaseLambda(rho); + computeDerivatives = true; + } + else + { + if (optimizerVerbosenessLevel >= 2) + cout << "SparseLevenbergOptimizer: Inferior solution - increasing lambda." << endl; + restoreAllParameters(); + increaseLambda(); + computeDerivatives = false; + + // Restore diagonal elements in Ui, Vj and Z. + for (int i = 0; i < nVaryingA; ++i) + { + for (int l = 0; l < _paramDimensionA; ++l) Ui[i][l][l] = diagUi[i][l]; + } // end for (i) + + for (int j = 0; j < nVaryingB; ++j) + { + for (int l = 0; l < _paramDimensionB; ++l) Vj[j][l][l] = diagVj[j][l]; + } // end for (j) + + for (int l = 0; l < nVaryingC; ++l) Z[l][l] = diagZ[l]; + } // end if + } // end for + + end:; + if (optimizerVerbosenessLevel >= 2) + cout << "Leaving SparseLevenbergOptimizer::minimize()." << endl; + } // end SparseLevenbergOptimizer::minimize() + +#endif // defined(V3DLIB_ENABLE_SUITESPARSE) + +} // end namespace V3D diff --git a/extern/libmv/third_party/ssba/Math/v3d_optimization.h b/extern/libmv/third_party/ssba/Math/v3d_optimization.h new file mode 100644 index 00000000000..27d2e12287f --- /dev/null +++ b/extern/libmv/third_party/ssba/Math/v3d_optimization.h @@ -0,0 +1,273 @@ +// -*- C++ -*- +/* +Copyright (c) 2008 University of North Carolina at Chapel Hill + +This file is part of SSBA (Simple Sparse Bundle Adjustment). + +SSBA is free software: you can redistribute it and/or modify it under the +terms of the GNU Lesser General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your option) any +later version. + +SSBA 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 Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License along +with SSBA. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef V3D_OPTIMIZATION_H +#define V3D_OPTIMIZATION_H + +#include "Math/v3d_linear.h" +#include "Math/v3d_mathutilities.h" + +#include <vector> +#include <iostream> + +namespace V3D +{ + + enum + { + LEVENBERG_OPTIMIZER_TIMEOUT = 0, + LEVENBERG_OPTIMIZER_SMALL_UPDATE = 1, + LEVENBERG_OPTIMIZER_CONVERGED = 2 + }; + + extern int optimizerVerbosenessLevel; + + struct LevenbergOptimizerCommon + { + LevenbergOptimizerCommon() + : status(LEVENBERG_OPTIMIZER_TIMEOUT), currentIteration(0), maxIterations(50), + tau(1e-3), lambda(1e-3), + gradientThreshold(1e-10), updateThreshold(1e-10), + _nu(2.0) + { } + virtual ~LevenbergOptimizerCommon() {} + + // See Madsen et al., "Methods for non-linear least squares problems." + virtual void increaseLambda() + { + lambda *= _nu; _nu *= 2.0; + } + + virtual void decreaseLambda(double const rho) + { + double const r = 2*rho - 1.0; + lambda *= std::max(1.0/3.0, 1 - r*r*r); + if (lambda < 1e-10) lambda = 1e-10; + _nu = 2; + } + + bool applyGradientStoppingCriteria(double maxGradient) const + { + return maxGradient < gradientThreshold; + } + + bool applyUpdateStoppingCriteria(double paramLength, double updateLength) const + { + return updateLength < updateThreshold * (paramLength + updateThreshold); + } + + int status; + int currentIteration, maxIterations; + double tau, lambda; + double gradientThreshold, updateThreshold; + + protected: + double _nu; + }; // end struct LevenbergOptimizerCommon + +# if defined(V3DLIB_ENABLE_SUITESPARSE) + + struct SparseLevenbergOptimizer : public LevenbergOptimizerCommon + { + SparseLevenbergOptimizer(int measurementDimension, + int nParametersA, int paramDimensionA, + int nParametersB, int paramDimensionB, + int paramDimensionC, + std::vector<int> const& correspondingParamA, + std::vector<int> const& correspondingParamB) + : LevenbergOptimizerCommon(), + _nMeasurements(correspondingParamA.size()), + _measurementDimension(measurementDimension), + _nParametersA(nParametersA), _paramDimensionA(paramDimensionA), + _nParametersB(nParametersB), _paramDimensionB(paramDimensionB), + _paramDimensionC(paramDimensionC), + _nNonvaryingA(0), _nNonvaryingB(0), _nNonvaryingC(0), + _correspondingParamA(correspondingParamA), + _correspondingParamB(correspondingParamB) + { + assert(correspondingParamA.size() == correspondingParamB.size()); + } + + ~SparseLevenbergOptimizer() { } + + void setNonvaryingCounts(int nNonvaryingA, int nNonvaryingB, int nNonvaryingC) + { + _nNonvaryingA = nNonvaryingA; + _nNonvaryingB = nNonvaryingB; + _nNonvaryingC = nNonvaryingC; + } + + void getNonvaryingCounts(int& nNonvaryingA, int& nNonvaryingB, int& nNonvaryingC) const + { + nNonvaryingA = _nNonvaryingA; + nNonvaryingB = _nNonvaryingB; + nNonvaryingC = _nNonvaryingC; + } + + void minimize(); + + virtual void evalResidual(VectorArray<double>& residuals) = 0; + + virtual void fillWeights(VectorArray<double> const& residuals, Vector<double>& w) + { + (void)residuals; + std::fill(w.begin(), w.end(), 1.0); + } + + void fillAllJacobians(Vector<double> const& w, + MatrixArray<double>& Ak, + MatrixArray<double>& Bk, + MatrixArray<double>& Ck) + { + int const nVaryingA = _nParametersA - _nNonvaryingA; + int const nVaryingB = _nParametersB - _nNonvaryingB; + int const nVaryingC = _paramDimensionC - _nNonvaryingC; + + for (unsigned k = 0; k < _nMeasurements; ++k) + { + int const i = _correspondingParamA[k]; + int const j = _correspondingParamB[k]; + + if (i < _nNonvaryingA && j < _nNonvaryingB) continue; + + fillJacobians(Ak[k], Bk[k], Ck[k], i, j, k); + } // end for (k) + + if (nVaryingA > 0) + { + for (unsigned k = 0; k < _nMeasurements; ++k) + scaleMatrixIP(w[k], Ak[k]); + } + if (nVaryingB > 0) + { + for (unsigned k = 0; k < _nMeasurements; ++k) + scaleMatrixIP(w[k], Bk[k]); + } + if (nVaryingC > 0) + { + for (unsigned k = 0; k < _nMeasurements; ++k) + scaleMatrixIP(w[k], Ck[k]); + } + } // end fillAllJacobians() + + virtual void setupJacobianGathering() { } + + virtual void fillJacobians(Matrix<double>& Ak, Matrix<double>& Bk, Matrix<double>& Ck, + int i, int j, int k) = 0; + + virtual double getParameterLength() const = 0; + + virtual void updateParametersA(VectorArray<double> const& deltaAi) = 0; + virtual void updateParametersB(VectorArray<double> const& deltaBj) = 0; + virtual void updateParametersC(Vector<double> const& deltaC) = 0; + virtual void saveAllParameters() = 0; + virtual void restoreAllParameters() = 0; + + int currentIteration, maxIterations; + + protected: + void serializeNonZerosJtJ(std::vector<std::pair<int, int> >& dst) const; + void setupSparseJtJ(); + void fillSparseJtJ(MatrixArray<double> const& Ui, MatrixArray<double> const& Vj, MatrixArray<double> const& Wk, + Matrix<double> const& Z, Matrix<double> const& X, Matrix<double> const& Y); + + int const _nMeasurements, _measurementDimension; + int const _nParametersA, _paramDimensionA; + int const _nParametersB, _paramDimensionB; + int const _paramDimensionC; + + int _nNonvaryingA, _nNonvaryingB, _nNonvaryingC; + + std::vector<int> const& _correspondingParamA; + std::vector<int> const& _correspondingParamB; + + std::vector<pair<int, int> > _jointNonzerosW; + std::vector<int> _jointIndexW; + + std::vector<int> _JtJ_Lp, _JtJ_Parent, _JtJ_Lnz; + std::vector<int> _perm_JtJ, _invPerm_JtJ; + + CCS_Matrix<double> _JtJ; + }; // end struct SparseLevenbergOptimizer + + struct StdSparseLevenbergOptimizer : public SparseLevenbergOptimizer + { + StdSparseLevenbergOptimizer(int measurementDimension, + int nParametersA, int paramDimensionA, + int nParametersB, int paramDimensionB, + int paramDimensionC, + std::vector<int> const& correspondingParamA, + std::vector<int> const& correspondingParamB) + : SparseLevenbergOptimizer(measurementDimension, nParametersA, paramDimensionA, + nParametersB, paramDimensionB, paramDimensionC, + correspondingParamA, correspondingParamB), + curParametersA(nParametersA, paramDimensionA), savedParametersA(nParametersA, paramDimensionA), + curParametersB(nParametersB, paramDimensionB), savedParametersB(nParametersB, paramDimensionB), + curParametersC(paramDimensionC), savedParametersC(paramDimensionC) + { } + + virtual double getParameterLength() const + { + double res = 0.0; + for (int i = 0; i < _nParametersA; ++i) res += sqrNorm_L2(curParametersA[i]); + for (int j = 0; j < _nParametersB; ++j) res += sqrNorm_L2(curParametersB[j]); + res += sqrNorm_L2(curParametersC); + return sqrt(res); + } + + virtual void updateParametersA(VectorArray<double> const& deltaAi) + { + for (int i = 0; i < _nParametersA; ++i) addVectors(deltaAi[i], curParametersA[i], curParametersA[i]); + } + + virtual void updateParametersB(VectorArray<double> const& deltaBj) + { + for (int j = 0; j < _nParametersB; ++j) addVectors(deltaBj[j], curParametersB[j], curParametersB[j]); + } + + virtual void updateParametersC(Vector<double> const& deltaC) + { + addVectors(deltaC, curParametersC, curParametersC); + } + + virtual void saveAllParameters() + { + for (int i = 0; i < _nParametersA; ++i) savedParametersA[i] = curParametersA[i]; + for (int j = 0; j < _nParametersB; ++j) savedParametersB[j] = curParametersB[j]; + savedParametersC = curParametersC; + } + + virtual void restoreAllParameters() + { + for (int i = 0; i < _nParametersA; ++i) curParametersA[i] = savedParametersA[i]; + for (int j = 0; j < _nParametersB; ++j) curParametersB[j] = savedParametersB[j]; + curParametersC = savedParametersC; + } + + VectorArray<double> curParametersA, savedParametersA; + VectorArray<double> curParametersB, savedParametersB; + Vector<double> curParametersC, savedParametersC; + }; // end struct StdSparseLevenbergOptimizer + +# endif + +} // end namespace V3D + +#endif diff --git a/extern/libmv/third_party/ssba/README.TXT b/extern/libmv/third_party/ssba/README.TXT new file mode 100644 index 00000000000..734962b1df8 --- /dev/null +++ b/extern/libmv/third_party/ssba/README.TXT @@ -0,0 +1,92 @@ +Description + +This is an implementation of a sparse Levenberg-Marquardt optimization +procedure and several bundle adjustment modules based on it. There are three +versions of bundle adjustment: +1) Pure metric adjustment. Camera poses have 6 dof and 3D points have 3 dof. +2) Common, but adjustable intrinsic and distortion parameters. This is useful, + if the set of images are taken with the same camera under constant zoom + settings. +3) Variable intrinsics and distortion parameters for each view. This addresses + the "community photo collection" setting, where each image is captured with + a different camera and/or with varying zoom setting. + +There are two demo applications in the Apps directory, bundle_common and +bundle_varying, which correspond to item 2) and 3) above. + +The input data file for both applications is a text file with the following +numerical values: + +First, the number of 3D points, views and 2D measurements: +<M> <N> <K> +Then, the values of the intrinsic matrix + [ fx skew cx ] +K = [ 0 fy cy ] + [ 0 0 1 ], +and the distortion parameters according to the convention of the Bouget +toolbox: + + <fx> <skew> <cx> <fy> <cy> <k1> <k2> <p1> <p2> + +For the bundle_varying application this is given <N> times, one for each +camera/view. +Then the <M> 3D point positions are given: + + <point-id> <X> <Y> <Z> + +Note: the point-ids need not to be exactly from 0 to M-1, any (unique) ids +will do. +The camera poses are given subsequently: + + <view-id> <12 entries of the RT matrix> + +There is a lot of confusion how to specify the orientation of cameras. We use +projection matrix notation, i.e. P = K [R|T], and a 3D point X in world +coordinates is transformed into the camera coordinate system by XX=R*X+T. + +Finally, the <K> 2d image measurements (given in pixels) are provided: + + <view-id> <point-id> <x> <y> 1 + +See the example in the Dataset folder. + + +Performance + +This software is able to perform successful loop closing for a video sequence +containing 1745 views, 37920 3D points and 627228 image measurements in about +16min on a 2.2 GHz Core 2. The footprint in memory was <700MB. + + +Requirements + +Solving the augmented normal equation in the LM optimizer is done with LDL, a +Cholsky like decomposition method for sparse matrices (see +http://www.cise.ufl.edu/research/sparse/ldl). The appropriate column +reordering is done with COLAMD (see +http://www.cise.ufl.edu/research/sparse/colamd). Both packages are licensed +under the GNU LGPL. + +This software was developed under Linux, but should compile equally well on +other operating systems. + +-Christopher Zach (cmzach@cs.unc.edu) + +/* +Copyright (c) 2008 University of North Carolina at Chapel Hill + +This file is part of SSBA (Simple Sparse Bundle Adjustment). + +SSBA is free software: you can redistribute it and/or modify it under the +terms of the GNU Lesser General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your option) any +later version. + +SSBA 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 Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License along +with SSBA. If not, see <http://www.gnu.org/licenses/>. +*/ diff --git a/extern/libmv/third_party/ssba/README.libmv b/extern/libmv/third_party/ssba/README.libmv new file mode 100755 index 00000000000..45e0a31f6fc --- /dev/null +++ b/extern/libmv/third_party/ssba/README.libmv @@ -0,0 +1,23 @@ +Project: SSBA +URL: http://www.cs.unc.edu/~cmzach/opensource.html +License: LGPL3 +Upstream version: 1.0 + +Local modifications: + + * Added + SET(CMAKE_CXX_FLAGS "") + to CMakeLists.txt to prevent warnings from being treated as errors. + * Fixed "unused variable" in the header files. Warnings in the cpps files + are still there. + * Fixed a bug in CameraMatrix::opticalAxis() in file + Geometry/v3d_cameramatrix.h + * Deleted the Dataset directory. + * Added '#include <string>' to ssba/Apps/bundle_common.cpp and + ssba/Apps/bundle_varying.cpp to stop undefined references to strcmp + * Removed unnecessary elements from the CMakeLists.txt file, including the + obsoleted local_config.cmake and friends. + * Added a virtual destructor to V3D::LevenbergOptimizerCommon in + Math/v3d_optimization.h + * Added /EHsc WIN32-specific flag to CMakeLists.txt + * Remove unused variable Vector3d np in bundle_common.cpp and bundle_varying (in main() function). diff --git a/po/POTFILES.in b/po/POTFILES.in deleted file mode 100644 index 5a4ba6a9cb2..00000000000 --- a/po/POTFILES.in +++ /dev/null @@ -1,201 +0,0 @@ -release/scripts/modules/rna_prop_ui.py - -release/scripts/startup/bl_operators/object.py -release/scripts/startup/bl_operators/object_align.py -release/scripts/startup/bl_operators/object_quick_effects.py -release/scripts/startup/bl_operators/object_randomize_transform.py -release/scripts/startup/bl_operators/presets.py -release/scripts/startup/bl_operators/screen_play_rendered_anim.py -release/scripts/startup/bl_operators/sequencer.py -release/scripts/startup/bl_operators/wm.py - -release/scripts/startup/bl_ui/properties_animviz.py -release/scripts/startup/bl_ui/properties_data_armature.py -release/scripts/startup/bl_ui/properties_data_bone.py -release/scripts/startup/bl_ui/properties_data_camera.py -release/scripts/startup/bl_ui/properties_data_curve.py -release/scripts/startup/bl_ui/properties_data_empty.py -release/scripts/startup/bl_ui/properties_data_lamp.py -release/scripts/startup/bl_ui/properties_data_lattice.py -release/scripts/startup/bl_ui/properties_data_mesh.py -release/scripts/startup/bl_ui/properties_data_metaball.py -release/scripts/startup/bl_ui/properties_data_modifier.py -release/scripts/startup/bl_ui/properties_game.py -release/scripts/startup/bl_ui/properties_material.py -release/scripts/startup/bl_ui/properties_object_constraint.py -release/scripts/startup/bl_ui/properties_object.py -release/scripts/startup/bl_ui/properties_particle.py -release/scripts/startup/bl_ui/properties_physics_cloth.py -release/scripts/startup/bl_ui/properties_physics_common.py -release/scripts/startup/bl_ui/properties_physics_field.py -release/scripts/startup/bl_ui/properties_physics_fluid.py -release/scripts/startup/bl_ui/properties_physics_smoke.py -release/scripts/startup/bl_ui/properties_physics_softbody.py -release/scripts/startup/bl_ui/properties_render.py -release/scripts/startup/bl_ui/properties_scene.py -release/scripts/startup/bl_ui/properties_texture.py -release/scripts/startup/bl_ui/properties_world.py - -release/scripts/startup/bl_ui/space_console.py -release/scripts/startup/bl_ui/space_dopesheet.py -release/scripts/startup/bl_ui/space_graph.py -release/scripts/startup/bl_ui/space_image.py -release/scripts/startup/bl_ui/space_info.py -release/scripts/startup/bl_ui/space_logic.py -release/scripts/startup/bl_ui/space_nla.py -release/scripts/startup/bl_ui/space_node.py -release/scripts/startup/bl_ui/space_outliner.py -release/scripts/startup/bl_ui/space_sequencer.py -release/scripts/startup/bl_ui/space_text.py -release/scripts/startup/bl_ui/space_time.py -release/scripts/startup/bl_ui/space_userpref.py -release/scripts/startup/bl_ui/space_userpref_keymap.py -release/scripts/startup/bl_ui/space_view3d.py -release/scripts/startup/bl_ui/space_view3d_toolbar.py - -source/blender/editors/animation/anim_channels_edit.c -source/blender/editors/animation/anim_markers.c -source/blender/editors/animation/anim_ops.c -source/blender/editors/animation/drivers.c -source/blender/editors/animation/keyframing.c -source/blender/editors/animation/keyingsets.c - -source/blender/editors/armature/armature_ops.c -source/blender/editors/armature/editarmature.c -source/blender/editors/armature/editarmature_sketch.c -source/blender/editors/armature/poselib.c -source/blender/editors/armature/poseobject.c -source/blender/editors/armature/poseSlide.c - -source/blender/editors/curve/editcurve.c -source/blender/editors/curve/editfont.c - -source/blender/editors/gpencil/gpencil_paint.c - -source/blender/editors/interface/interface_layout.c -source/blender/editors/interface/interface_ops.c -source/blender/editors/interface/interface_regions.c -source/blender/editors/interface/interface_templates.c -source/blender/editors/interface/interface_utils.c -source/blender/editors/interface/view2d_ops.c - -source/blender/editors/mesh/editmesh.c -source/blender/editors/mesh/editmesh_add.c -source/blender/editors/mesh/editmesh_loop.c -source/blender/editors/mesh/editmesh_mods.c -source/blender/editors/mesh/editmesh_tools.c -source/blender/editors/mesh/loopcut.c -source/blender/editors/mesh/mesh_data.c -source/blender/editors/mesh/mesh_ops.c - -source/blender/editors/metaball/mball_edit.c - -source/blender/editors/object/object_add.c -source/blender/editors/object/object_constraint.c -source/blender/editors/object/object_edit.c -source/blender/editors/object/object_group.c -source/blender/editors/object/object_lattice.c -source/blender/editors/object/object_modifier.c -source/blender/editors/object/object_ops.c -source/blender/editors/object/object_relations.c -source/blender/editors/object/object_select.c -source/blender/editors/object/object_shapekey.c -source/blender/editors/object/object_transform.c -source/blender/editors/object/object_vgroup.c - -source/blender/editors/physics/particle_edit.c -source/blender/editors/physics/particle_object.c -source/blender/editors/physics/physics_pointcache.c - -source/blender/editors/render/render_internal.c -source/blender/editors/render/render_opengl.c -source/blender/editors/render/render_shading.c -source/blender/editors/render/render_view.c - -source/blender/editors/screen/area.c -source/blender/editors/screen/screendump.c -source/blender/editors/screen/screen_ops.c - -source/blender/editors/sculpt_paint/paint_ops.c -source/blender/editors/sculpt_paint/paint_image.c -source/blender/editors/sculpt_paint/paint_utils.c -source/blender/editors/sculpt_paint/paint_vertex.c -source/blender/editors/sculpt_paint/sculpt.c - -source/blender/editors/sound/sound_ops.c - -source/blender/editors/space_action/action_edit.c -source/blender/editors/space_action/action_ops.c -source/blender/editors/space_action/action_select.c - -source/blender/editors/space_buttons/buttons_header.c -source/blender/editors/space_buttons/buttons_ops.c - -source/blender/editors/space_console/console_ops.c - -source/blender/editors/space_file/file_draw.c -source/blender/editors/space_file/file_ops.c -source/blender/editors/space_file/file_panels.c - -source/blender/editors/space_graph/graph_buttons.c -source/blender/editors/space_graph/graph_edit.c -source/blender/editors/space_graph/graph_ops.c -source/blender/editors/space_graph/graph_select.c - -source/blender/editors/space_image/image_buttons.c -source/blender/editors/space_image/image_ops.c - -source/blender/editors/space_info/info_ops.c -source/blender/editors/space_info/info_report.c -source/blender/editors/space_info/space_info.c - -source/blender/editors/space_logic/logic_buttons.c - -source/blender/editors/space_nla/nla_buttons.c -source/blender/editors/space_nla/nla_channels.c -source/blender/editors/space_nla/nla_edit.c -source/blender/editors/space_nla/nla_select.c - -source/blender/editors/space_node/node_buttons.c -source/blender/editors/space_node/node_edit.c -source/blender/editors/space_node/node_header.c -source/blender/editors/space_node/node_ops.c -source/blender/editors/space_node/node_select.c -source/blender/editors/space_node/node_state.c - -source/blender/editors/space_script/script_edit.c - -source/blender/editors/space_sequencer/sequencer_add.c -source/blender/editors/space_sequencer/sequencer_buttons.c -source/blender/editors/space_sequencer/sequencer_edit.c -source/blender/editors/space_sequencer/sequencer_select.c - -source/blender/editors/space_text/text_header.c -source/blender/editors/space_text/text_ops.c -source/blender/editors/space_time/time_ops.c - -source/blender/editors/space_view3d/view3d_buttons.c -source/blender/editors/space_view3d/view3d_draw.c -source/blender/editors/space_view3d/view3d_edit.c -source/blender/editors/space_view3d/view3d_fly.c -source/blender/editors/space_view3d/view3d_header.c -source/blender/editors/space_view3d/view3d_select.c -source/blender/editors/space_view3d/view3d_view.c -source/blender/editors/space_view3d/view3d_toolbar.c - -source/blender/editors/transform/transform.c -source/blender/editors/transform/transform_ops.c -source/blender/editors/transform/transform_orientations.c - -source/blender/editors/util/undo.c - -source/blender/editors/uvedit/uvedit_ops.c -source/blender/editors/uvedit/uvedit_unwrap_ops.c - -source/blender/makesrna/intern/rna_userdef.c - -source/blender/windowmanager/intern/wm_files.c -source/blender/windowmanager/intern/wm_operators.c -source/blender/windowmanager/intern/wm_window.c - - diff --git a/po/README.txt b/po/README.txt deleted file mode 100644 index 6e634ae5ee3..00000000000 --- a/po/README.txt +++ /dev/null @@ -1,81 +0,0 @@ -Blender translation HOWTO -========================= - -I'll try briefly explain how translation works and how to update translation files. - -1. How it works ---------------- - -This folder contains source files for translation system. These source files have -got .po extension and they've got pretty simple syntax: - -msgid "some message id" -msgstr "translation for this message" - -This means when string "some message id" is used as operator name, tooltip, menu -and so it'll be displayed on the screen as "translation for this message". -Pretty simple. - -This source files are pre-compiled into ../release/datafiles/locale/<language>/LC_MESSAGES/blender.mo, -so they aren't getting compiled every time Blender is compiling to save some time and prevent -failure on systems which don't have needed tools for compiling .po files. - -2. How to update translations ------------------------------ - -It's also pretty simple. If you can find string you want to translate in <language>.po -file as msgid, just write correct msgstr string for it. If msgid is marked as fuzzy, -i.e. - -#, fuzzy -msgid "some message id" -msgstr "translation for this message" - -it means translation used to exist for this message, but message was changed, so translation -also have to be updated (it's easier to make new translation based on previous translation). -When translation was updated, remove line with '#, fuzzy' and it'll work. - -If there's no message in .po file you want to translate, probably .po file should be updated. -Use the following steps for this: -- With newly compiled blender run: - `blender --background --factory-startup --python update_msg.py` - to update messages.txt file (this file contains strings collected - automatically from RNA system and python UI scripts) -- Run update_pot.py script which will update blender.pot file. This file contains all - strings which should be transated. -- Run update_po.py script to merge all .po files with blender.pot (so all .po files - will contain all msgid-s declared in blender.pot) or update_po.py <language> to - update only needed .po file(s) to save time when you're busy with translation. - But before commit all .po files better be updated. - -When you've finished with translation, you should re-compile .po file into .mo file. -It's also pretty simple: just run update_mo.py script to recompile all languages or -just update_mo.py <language> to re-compile only needed language(s). - -NOTE: msgfmt, msgmerge and xgettext tools should be available in your PATH. - -These steps to update template, translation files and compile them can be made in "batch" mode -using GNUMakefile: - -make -f GNUMakefile translations - -NOTE: Blender has to be compiled using GNUMakefile first. - - -3. Note for Windows users -------------------------- -You can find compiled builds of gettext in the lib folder under "binaries\gettext\" for both windows and win64. -In order to run the scripts you will need to replace the location of the GETTEXT_..._EXECUTABLE. - -For example in update_pot.py: --GETTEXT_XGETTEXT_EXECUTABLE = "xgettext" -+GETTEXT_XGETTEXT_EXECUTABLE = "C:\\Blender\\lib\\\windows\\\binaries\\\gettext\\xgettext.exe" - -4. Other scripts ----------------- - -- check_po.py: this script checks if all messages declared in blender.pot exists in.po files - and that no extra messages are declared in .po files -- clean_po.py: this script removes all commented messages which aren't required by .pot file anymore. -- merge_po.py: this script accepts two files as arguments and copies translations from second file - into first file. diff --git a/po/check_po.py b/po/check_po.py deleted file mode 100755 index a2b19d57428..00000000000 --- a/po/check_po.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python - -# ***** 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. -# -# ***** END GPL LICENSE BLOCK ***** - -# <pep8 compliant> - -# update the pot file according the POTFILES.in - -import os -import sys -from codecs import open - -CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) - -FILE_NAME_POT = os.path.join(CURRENT_DIR, "blender.pot") - - -def read_messages(fname): - def stripeol(s): - return s.rstrip("\n\r") - - messages = {} - reading_message = False - message = "" - with open(fname, 'r', "utf-8") as handle: - while True: - line = handle.readline() - - if not line: - break - - line = stripeol(line) - if line.startswith("msgid"): - reading_message = True - message = line[7:-1] - elif line.startswith("msgstr"): - reading_message = False - messages[message] = True - elif reading_message: - message += line[1:-1] - return messages - - -def main(): - pot_messages = read_messages(FILE_NAME_POT) - - if len(sys.argv) > 1: - for lang in sys.argv[1:]: - po = os.path.join(CURRENT_DIR, lang + '.po') - - if os.path.exists(po): - po_messages = read_messages(po) - for msgid in po_messages: - if not pot_messages.get(msgid): - print('Unneeded message id \'%s\'' % (msgid)) - - for msgid in pot_messages: - if not po_messages.get(msgid): - print('Missed message id \'%s\'' % (msgid)) - else: - for po in os.listdir(CURRENT_DIR): - if po.endswith('.po'): - print('Processing %s...' % (po)) - po_messages = read_messages(po) - for msgid in po_messages: - if not pot_messages.get(msgid): - print(' Unneeded message id \'%s\'' % (msgid)) - - for msgid in pot_messages: - if not po_messages.get(msgid): - print(' Missed message id \'%s\'' % (msgid)) - - -if __name__ == "__main__": - print("\n\n *** Running %r *** \n" % __file__) - main() diff --git a/po/clean_po.py b/po/clean_po.py deleted file mode 100755 index 95bac39b42e..00000000000 --- a/po/clean_po.py +++ /dev/null @@ -1,189 +0,0 @@ -#!/usr/bin/env python - -# ***** 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. -# -# ***** END GPL LICENSE BLOCK ***** - -# <pep8 compliant> - -# update the pot file according the POTFILES.in - -import os -import sys -import collections - -from codecs import open - -CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) - -FILE_NAME_POT = os.path.join(CURRENT_DIR, "blender.pot") - - -def read_messages(fname): - def stripeol(s): - return s.rstrip("\n\r") - - last_message = None - - if hasattr(collections, 'OrderedDict'): - messages = collections.OrderedDict() - commented_messages = collections.OrderedDict() - else: - messages = {} - commented_messages = {} - - reading_message = False - reading_translation = False - commented = False - message = "" - translation = "" - message_lines = [] - translation_lines = [] - comment_lines = [] - with open(fname, 'r', "utf-8") as handle: - while True: - line = handle.readline() - - if not line: - break - - line = stripeol(line) - if line.startswith("msgid") or line.startswith("#~ msgid"): - if reading_translation: - last_message['translation'] = translation - translation_lines = [] - - reading_message = True - reading_translation = False - - if line.startswith('#~'): - message = line[10:-1] - commented = True - else: - message = line[7:-1] - commented = False - - message_lines.append(message) - elif line.startswith("msgstr") or line.startswith("#~ msgstr"): - reading_message = False - reading_translation = True - last_message = {'comment_lines': comment_lines, - 'message_lines': message_lines, - 'translation_lines': translation_lines} - - if commented: - translation = line[11:-1] - commented_messages[message] = last_message - else: - translation = line[8:-1] - messages[message] = last_message - - message_lines = [] - comment_lines = [] - translation_lines.append(translation) - elif not line.startswith('"') and not line.startswith('#~ "'): - if reading_translation: - last_message['translation'] = translation - else: - comment_lines.append(line) - - reading_message = False - reading_translation = False - message_lines = [] - translation_lines = [] - elif reading_message: - if line.startswith('#~ "'): - m = line[4:-1] - else: - m = line[1:-1] - - message += m - message_lines.append(m) - elif reading_translation: - if line.startswith('#~ "'): - t = line[4:-1] - else: - t = line[1:-1] - - translation += t - translation_lines.append(t) - - return (messages, commented_messages) - - -def do_clean(po, pot_messages): - po_messages, commented_messages = read_messages(po) - - for msgid in commented_messages: - if pot_messages.get(msgid): - t = po_messages.get(msgid) - if not t: - print("Reusing full item from commented " - "lines for msgid '%s'" % msgid) - po_messages[msgid] = commented_messages[msgid] - elif not t['translation']: - print("Reusing translation from commented " - "lines for msgid '%s'" % msgid) - m = commented_messages[msgid] - t['translation'] = m['translation'] - t['translation_lines'] = m['translation_lines'] - - with open(po, 'w', 'utf-8') as handle: - for msgid in po_messages: - item = po_messages[msgid] - - for x in item['comment_lines']: - handle.write(x + "\n") - - first = True - for x in item['message_lines']: - if first: - handle.write("msgid \"%s\"\n" % x) - else: - handle.write("\"%s\"\n" % x) - first = False - - first = True - for x in item['translation_lines']: - if first: - handle.write("msgstr \"%s\"\n" % x) - else: - handle.write("\"%s\"\n" % x) - first = False - - handle.write("\n") - - -def main(): - pot_messages, commented_messages = read_messages(FILE_NAME_POT) - - if len(sys.argv) > 1: - for lang in sys.argv[1:]: - po = os.path.join(CURRENT_DIR, lang + '.po') - - if os.path.exists(po): - do_clean(po, pot_messages) - else: - for po in os.listdir(CURRENT_DIR): - if po.endswith('.po'): - print('Processing %s...' % (po)) - do_clean(po, pot_messages) - - -if __name__ == "__main__": - print("\n\n *** Running %r *** \n" % __file__) - main() diff --git a/po/merge_po.py b/po/merge_po.py deleted file mode 100755 index dcbe9fc9890..00000000000 --- a/po/merge_po.py +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/env python - -# ***** 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. -# -# ***** END GPL LICENSE BLOCK ***** - -# <pep8 compliant> - -# update the pot file according the POTFILES.in - -import sys -import collections - -from codecs import open - - -def read_messages(fname): - def stripeol(s): - return s.rstrip("\n\r") - - last_message = None - - if hasattr(collections, 'OrderedDict'): - messages = collections.OrderedDict() - commented_messages = collections.OrderedDict() - else: - messages = {} - commented_messages = {} - - reading_message = False - reading_translation = False - commented = False - message = "" - translation = "" - message_lines = [] - translation_lines = [] - comment_lines = [] - with open(fname, 'r', "utf-8") as handle: - while True: - line = handle.readline() - - if not line: - break - - line = stripeol(line) - if line.startswith("msgid") or line.startswith("#~ msgid"): - if reading_translation: - last_message['translation'] = translation - translation_lines = [] - - reading_message = True - reading_translation = False - - if line.startswith('#~'): - message = line[10:-1] - commented = True - else: - message = line[7:-1] - commented = False - - message_lines.append(message) - elif line.startswith("msgstr") or line.startswith("#~ msgstr"): - reading_message = False - reading_translation = True - last_message = {'comment_lines': comment_lines, - 'message_lines': message_lines, - 'translation_lines': translation_lines} - - if commented: - translation = line[11:-1] - commented_messages[message] = last_message - else: - translation = line[8:-1] - messages[message] = last_message - - message_lines = [] - comment_lines = [] - translation_lines.append(translation) - elif not line.startswith('"') and not line.startswith('#~ "'): - if reading_translation: - last_message['translation'] = translation - else: - comment_lines.append(line) - - reading_message = False - reading_translation = False - message_lines = [] - translation_lines = [] - elif reading_message: - if line.startswith('#~ "'): - m = line[4:-1] - else: - m = line[1:-1] - - message += m - message_lines.append(m) - elif reading_translation: - if line.startswith('#~ "'): - t = line[4:-1] - else: - t = line[1:-1] - - translation += t - translation_lines.append(t) - - return (messages, commented_messages) - - -def main(): - if len(sys.argv) == 3: - dst_messages, tmp = read_messages(sys.argv[1]) - from_messages, tmp = read_messages(sys.argv[2]) - - for msgid in dst_messages: - msg = dst_messages.get(msgid) - from_msg = from_messages.get(msgid) - - if from_msg and from_msg['translation']: - msg['translation'] = from_msg['translation'] - msg['translation_lines'] = from_msg['translation_lines'] - - with open(sys.argv[1], 'w', 'utf-8') as handle: - for msgid in dst_messages: - item = dst_messages[msgid] - - for x in item['comment_lines']: - handle.write(x + "\n") - - first = True - for x in item['message_lines']: - if first: - handle.write("msgid \"%s\"\n" % x) - else: - handle.write("\"%s\"\n" % x) - first = False - - first = True - for x in item['translation_lines']: - if first: - handle.write("msgstr \"%s\"\n" % x) - else: - handle.write("\"%s\"\n" % x) - first = False - - handle.write("\n") - else: - print('Usage: %s <destination-po> <source-po>' % (sys.argv[0])) - - -if __name__ == "__main__": - print("\n\n *** Running %r *** \n" % __file__) - main() diff --git a/po/update_mo.py b/po/update_mo.py deleted file mode 100755 index 50e99c7eeaa..00000000000 --- a/po/update_mo.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python - -# ***** 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. -# -# ***** END GPL LICENSE BLOCK ***** - -# <pep8 compliant> - -# update all mo files in the LANGS - -import subprocess -import os -import sys - -GETTEXT_MSGFMT_EXECUTABLE = "msgfmt" -CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) -SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(CURRENT_DIR, ".."))) -LOCALE_DIR = os.path.join(SOURCE_DIR, "release", "datafiles", "locale") - -DOMAIN = "blender" - - -def process_po(po): - lang = os.path.basename(po)[:-3] - - # show stats - cmd = (GETTEXT_MSGFMT_EXECUTABLE, - "--statistics", - os.path.join(CURRENT_DIR, "%s.po" % lang), - "-o", - os.path.join(LOCALE_DIR, lang, "LC_MESSAGES", "%s.mo" % DOMAIN), - ) - - print(" ".join(cmd)) - process = subprocess.Popen(cmd) - process.wait() - - -def main(): - if len(sys.argv) > 1: - for lang in sys.argv[1:]: - po = os.path.join(CURRENT_DIR, lang + '.po') - - if os.path.exists(po): - process_po(po) - else: - for po in os.listdir(CURRENT_DIR): - if po.endswith(".po"): - process_po(po) - -if __name__ == "__main__": - print("\n\n *** Running %r *** \n" % __file__) - main() diff --git a/po/update_msg.py b/po/update_msg.py deleted file mode 100644 index 21d727922d4..00000000000 --- a/po/update_msg.py +++ /dev/null @@ -1,380 +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. -# -# ***** END GPL LICENSE BLOCK ***** - -# <pep8-80 compliant> - -# Write out messages.txt from blender - -# Execite: -# blender --background --python po/update_msg.py - -import os - -CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) -SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(CURRENT_DIR, ".."))) - -FILE_NAME_MESSAGES = os.path.join(CURRENT_DIR, "messages.txt") -COMMENT_PREFIX = "#~ " - - -def dump_messages_rna(messages): - import bpy - - def classBlackList(): - blacklist_rna_class = [ - # core classes - "Context", "Event", "Function", "UILayout", - "BlendData", - # registerable classes - "Panel", "Menu", "Header", "RenderEngine", - "Operator", "OperatorMacro", "Macro", - "KeyingSetInfo", "UnknownType", - # window classes - "WindowManager", "Window" - ] - - # --------------------------------------------------------------------- - # Collect internal operators - - # extend with all internal operators - # note that this uses internal api introspection functions - # all possible operator names - op_names = list(sorted(set( - [cls.bl_rna.identifier for cls in - bpy.types.OperatorProperties.__subclasses__()] + - [cls.bl_rna.identifier for cls in - bpy.types.Operator.__subclasses__()] + - [cls.bl_rna.identifier for cls in - bpy.types.OperatorMacro.__subclasses__()] - ))) - - get_inatance = __import__("_bpy").ops.get_instance - path_resolve = type(bpy.context).__base__.path_resolve - for idname in op_names: - op = get_inatance(idname) - if 'INTERNAL' in path_resolve(op, "bl_options"): - blacklist_rna_class.append(idname) - - # --------------------------------------------------------------------- - # Collect builtin classes we dont need to doc - blacklist_rna_class.append("Property") - blacklist_rna_class.extend( - [cls.__name__ for cls in - bpy.types.Property.__subclasses__()]) - - # --------------------------------------------------------------------- - # Collect classes which are attached to collections, these are api - # access only. - collection_props = set() - for cls_id in dir(bpy.types): - cls = getattr(bpy.types, cls_id) - for prop in cls.bl_rna.properties: - if prop.type == 'COLLECTION': - prop_cls = prop.srna - if prop_cls is not None: - collection_props.add(prop_cls.identifier) - blacklist_rna_class.extend(sorted(collection_props)) - - return blacklist_rna_class - - blacklist_rna_class = classBlackList() - - def filterRNA(bl_rna): - id = bl_rna.identifier - if id in blacklist_rna_class: - print(" skipping", id) - return True - return False - - # ------------------------------------------------------------------------- - # Function definitions - - def walkProperties(bl_rna): - import bpy - - # get our parents properties not to export them multiple times - bl_rna_base = bl_rna.base - if bl_rna_base: - bl_rna_base_props = bl_rna_base.properties.values() - else: - bl_rna_base_props = () - - for prop in bl_rna.properties: - # only write this property is our parent hasn't got it. - if prop in bl_rna_base_props: - continue - if prop.identifier == "rna_type": - continue - - msgsrc = "bpy.types.%s.%s" % (bl_rna.identifier, prop.identifier) - if prop.name and prop.name != prop.identifier: - messages.setdefault(prop.name, []).append(msgsrc) - if prop.description: - messages.setdefault(prop.description, []).append(msgsrc) - - if isinstance(prop, bpy.types.EnumProperty): - for item in prop.enum_items: - msgsrc = "bpy.types.%s.%s, '%s'" % (bl_rna.identifier, - prop.identifier, - item.identifier, - ) - # Here identifier and name can be the same! - if item.name: # and item.name != item.identifier: - messages.setdefault(item.name, - []).append(msgsrc) - if item.description: - messages.setdefault(item.description, - []).append(msgsrc) - - def walkRNA(bl_rna): - - if filterRNA(bl_rna): - return - - msgsrc = "bpy.types.%s" % bl_rna.identifier - - if bl_rna.name and bl_rna.name != bl_rna.identifier: - messages.setdefault(bl_rna.name, []).append(msgsrc) - - if bl_rna.description: - messages.setdefault(bl_rna.description, []).append(msgsrc) - - if hasattr(bl_rna, 'bl_label') and bl_rna.bl_label: - messages.setdefault(bl_rna.bl_label, []).append(msgsrc) - - walkProperties(bl_rna) - - def walkClass(cls): - walkRNA(cls.bl_rna) - - def walk_keymap_hierarchy(hier, msgsrc_prev): - for lvl in hier: - msgsrc = "%s.%s" % (msgsrc_prev, lvl[1]) - messages.setdefault(lvl[0], []).append(msgsrc) - - if lvl[3]: - walk_keymap_hierarchy(lvl[3], msgsrc) - - # ------------------------------------------------------------------------- - # Dump Messages - - def full_class_id(cls): - """ gives us 'ID.Lamp.AreaLamp' which is best for sorting. - """ - cls_id = "" - bl_rna = cls.bl_rna - while bl_rna: - cls_id = "%s.%s" % (bl_rna.identifier, cls_id) - bl_rna = bl_rna.base - return cls_id - - cls_list = type(bpy.context).__base__.__subclasses__() - cls_list.sort(key=full_class_id) - for cls in cls_list: - walkClass(cls) - - cls_list = bpy.types.Space.__subclasses__() - cls_list.sort(key=full_class_id) - for cls in cls_list: - walkClass(cls) - - cls_list = bpy.types.Operator.__subclasses__() - cls_list.sort(key=full_class_id) - for cls in cls_list: - walkClass(cls) - - cls_list = bpy.types.OperatorProperties.__subclasses__() - cls_list.sort(key=full_class_id) - for cls in cls_list: - walkClass(cls) - - cls_list = bpy.types.Menu.__subclasses__() - cls_list.sort(key=full_class_id) - for cls in cls_list: - walkClass(cls) - - from bpy_extras.keyconfig_utils import KM_HIERARCHY - - walk_keymap_hierarchy(KM_HIERARCHY, "KM_HIERARCHY") - - -def dump_messages_pytext(messages): - """ dumps text inlined in the python user interface: eg. - - layout.prop("someprop", text="My Name") - """ - import ast - - # ------------------------------------------------------------------------- - # Gather function names - - import bpy - # key: func_id - # val: [(arg_kw, arg_pos), (arg_kw, arg_pos), ...] - func_translate_args = {} - - # so far only 'text' keywords, but we may want others translated later - translate_kw = ("text", ) - - for func_id, func in bpy.types.UILayout.bl_rna.functions.items(): - # check it has a 'text' argument - for (arg_pos, (arg_kw, arg)) in enumerate(func.parameters.items()): - if ((arg_kw in translate_kw) and - (arg.is_output == False) and - (arg.type == 'STRING')): - - func_translate_args.setdefault(func_id, []).append((arg_kw, - arg_pos)) - # print(func_translate_args) - - # ------------------------------------------------------------------------- - # Function definitions - - def extract_strings(fp_rel, node_container): - """ Recursively get strings, needed incase we have "Blah" + "Blah", - passed as an argument in that case it wont evaluate to a string. - """ - - for node in ast.walk(node_container): - if type(node) == ast.Str: - eval_str = ast.literal_eval(node) - if eval_str: - # print("%s:%d: %s" % (fp, node.lineno, eval_str)) - msgsrc = "%s:%s" % (fp_rel, node.lineno) - messages.setdefault(eval_str, []).append(msgsrc) - - def extract_strings_from_file(fp): - filedata = open(fp, 'r', encoding="utf8") - root_node = ast.parse(filedata.read(), fp, 'exec') - filedata.close() - - fp_rel = os.path.relpath(fp, SOURCE_DIR) - - for node in ast.walk(root_node): - if type(node) == ast.Call: - # print("found function at") - # print("%s:%d" % (fp, node.lineno)) - - # lambda's - if type(node.func) == ast.Name: - continue - - # getattr(self, con.type)(context, box, con) - if not hasattr(node.func, "attr"): - continue - - translate_args = func_translate_args.get(node.func.attr, ()) - - # do nothing if not found - for arg_kw, arg_pos in translate_args: - if arg_pos < len(node.args): - extract_strings(fp_rel, node.args[arg_pos]) - else: - for kw in node.keywords: - if kw.arg == arg_kw: - extract_strings(fp_rel, kw.value) - - # ------------------------------------------------------------------------- - # Dump Messages - - mod_dir = os.path.join(SOURCE_DIR, - "release", - "scripts", - "startup", - "bl_ui") - - files = [os.path.join(mod_dir, fn) - for fn in sorted(os.listdir(mod_dir)) - if not fn.startswith("_") - if fn.endswith("py") - ] - - for fp in files: - extract_strings_from_file(fp) - - -def dump_messages(): - - def filter_message(msg): - - # check for strings like ": %d" - msg_test = msg - for ignore in ("%d", "%s", "%r", # string formatting - "*", ".", "(", ")", "-", "/", "\\", "+", ":", "#", "%" - "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", - "x", # used on its own eg: 100x200 - "X", "Y", "Z", # used alone. no need to include - ): - msg_test = msg_test.replace(ignore, "") - msg_test = msg_test.strip() - if not msg_test: - # print("Skipping: '%s'" % msg) - return True - - # we could filter out different strings here - - return False - - if 1: - import collections - messages = collections.OrderedDict() - else: - messages = {} - - messages[""] = [] - - # get strings from RNA - dump_messages_rna(messages) - - # get strings from UI layout definitions text="..." args - dump_messages_pytext(messages) - - del messages[""] - - message_file = open(FILE_NAME_MESSAGES, 'w', encoding="utf8") - # message_file.writelines("\n".join(sorted(messages))) - - for key, value in messages.items(): - - # filter out junk values - if filter_message(key): - continue - - for msgsrc in value: - message_file.write("%s%s\n" % (COMMENT_PREFIX, msgsrc)) - message_file.write("%s\n" % key) - - message_file.close() - - print("Written %d messages to: %r" % (len(messages), FILE_NAME_MESSAGES)) - - -def main(): - - try: - import bpy - except ImportError: - print("This script must run from inside blender") - return - - dump_messages() - - -if __name__ == "__main__": - print("\n\n *** Running %r *** \n" % __file__) - main() diff --git a/po/update_po.py b/po/update_po.py deleted file mode 100755 index 0aab8c75646..00000000000 --- a/po/update_po.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python - -# ***** 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. -# -# ***** END GPL LICENSE BLOCK ***** - -# <pep8 compliant> - -# update all po files in the LANGS - -import subprocess -import os -import sys - -GETTEXT_MSGMERGE_EXECUTABLE = "msgmerge" -CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) -DOMAIN = "blender" - - -def process_po(po): - lang = os.path.basename(po)[:-3] - - # update po file - cmd = (GETTEXT_MSGMERGE_EXECUTABLE, - "--update", - "--backup=none", - "--lang=%s" % lang, - os.path.join(CURRENT_DIR, "%s.po" % lang), - os.path.join(CURRENT_DIR, "%s.pot" % DOMAIN), - ) - - print(" ".join(cmd)) - process = subprocess.Popen(cmd) - process.wait() - - -def main(): - if len(sys.argv) > 1: - for lang in sys.argv[1:]: - po = os.path.join(CURRENT_DIR, lang + '.po') - - if os.path.exists(po): - process_po(po) - else: - for po in os.listdir(CURRENT_DIR): - if po.endswith(".po"): - process_po(po) - - -if __name__ == "__main__": - print("\n\n *** Running %r *** \n" % __file__) - main() diff --git a/po/update_pot.py b/po/update_pot.py deleted file mode 100755 index c5f9acb9f42..00000000000 --- a/po/update_pot.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python - -# ***** 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. -# -# ***** END GPL LICENSE BLOCK ***** - -# <pep8 compliant> - -# update the pot file according the POTFILES.in - -import subprocess -import os -from codecs import open - -GETTEXT_XGETTEXT_EXECUTABLE = "xgettext" -CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) -SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(CURRENT_DIR, ".."))) -DOMAIN = "blender" -COMMENT_PREFIX = "#~ " # from update_msg.py - -FILE_NAME_POT = os.path.join(CURRENT_DIR, "blender.pot") -FILE_NAME_MESSAGES = os.path.join(CURRENT_DIR, "messages.txt") - - -def main(): - cmd = (GETTEXT_XGETTEXT_EXECUTABLE, - "--files-from=%s" % os.path.join(SOURCE_DIR, "po", "POTFILES.in"), - "--keyword=_", - "--keyword=N_", - "--directory=%s" % SOURCE_DIR, - "--output=%s" % os.path.join(SOURCE_DIR, "po", "%s.pot" % DOMAIN), - "--from-code=utf-8", - ) - - print(" ".join(cmd)) - process = subprocess.Popen(cmd) - process.wait() - - def stripeol(s): - return s.rstrip("\n\r") - - pot_messages = {} - reading_message = False - message = "" - with open(FILE_NAME_POT, 'r', "utf-8") as handle: - while True: - line = handle.readline() - - if not line: - break - - line = stripeol(line) - if line.startswith("msgid"): - reading_message = True - message = line[7:-1] - elif line.startswith("msgstr"): - reading_message = False - pot_messages[message] = True - elif reading_message: - message += line[1:-1] - - # add messages collected automatically from RNA - with open(FILE_NAME_POT, "a", "utf-8") as pot_handle: - with open(FILE_NAME_MESSAGES, 'r', "utf-8") as handle: - msgsrc_ls = [] - while True: - line = handle.readline() - - if not line: - break - - line = stripeol(line) - - # COMMENT_PREFIX - if line.startswith(COMMENT_PREFIX): - msgsrc_ls.append(line[len(COMMENT_PREFIX):].strip()) - else: - line = line.replace("\\", "\\\\") - line = line.replace("\"", "\\\"") - line = line.replace("\t", "\\t") - - if not pot_messages.get(line): - for msgsrc in msgsrc_ls: - pot_handle.write("#: %s\n" % msgsrc) - pot_handle.write("msgid \"%s\"\n" % line) - pot_handle.write("msgstr \"\"\n\n") - msgsrc_ls[:] = [] - - -if __name__ == "__main__": - print("\n\n *** Running %r *** \n" % __file__) - main() diff --git a/release/datafiles/blender_icons.png b/release/datafiles/blender_icons.png Binary files differindex c4fd5aaa93d..caff03b107b 100644 --- a/release/datafiles/blender_icons.png +++ b/release/datafiles/blender_icons.png diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py index 6eb19c0ff05..fab6886b314 100644 --- a/release/scripts/modules/bpy_extras/keyconfig_utils.py +++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py @@ -92,6 +92,10 @@ KM_HIERARCHY = [ ('Script', 'SCRIPTS_WINDOW', 'WINDOW', []), ('Text', 'TEXT_EDITOR', 'WINDOW', []), ('Console', 'CONSOLE', 'WINDOW', []), + ('Clip', 'CLIP_EDITOR', 'WINDOW', [ + ('Clip Editor', 'CLIP_EDITOR', 'WINDOW', []), + ('Clip Graph Editor', 'CLIP_EDITOR', 'WINDOW', []), + ]), ('View3D Gesture Circle', 'EMPTY', 'WINDOW', []), ('Gesture Border', 'EMPTY', 'WINDOW', []), diff --git a/release/scripts/presets/tracking_camera/Blender.py b/release/scripts/presets/tracking_camera/Blender.py new file mode 100644 index 00000000000..507cedac4fc --- /dev/null +++ b/release/scripts/presets/tracking_camera/Blender.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 32.0 +camera.units = 'MILLIMETERS' +camera.focal_length = 35.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_1100D.py b/release/scripts/presets/tracking_camera/Canon_1100D.py new file mode 100644 index 00000000000..7ea78412f40 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_1100D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.2 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_1D.py b/release/scripts/presets/tracking_camera/Canon_1D.py new file mode 100644 index 00000000000..89590d3cc19 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_1D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 27.9 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_1DS.py b/release/scripts/presets/tracking_camera/Canon_1DS.py new file mode 100644 index 00000000000..7d9b6c8b390 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_1DS.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 36.0 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_500D.py b/release/scripts/presets/tracking_camera/Canon_500D.py new file mode 100644 index 00000000000..3dd66c5b609 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_500D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.3 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_550D.py b/release/scripts/presets/tracking_camera/Canon_550D.py new file mode 100644 index 00000000000..3dd66c5b609 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_550D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.3 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_5D.py b/release/scripts/presets/tracking_camera/Canon_5D.py new file mode 100644 index 00000000000..7d9b6c8b390 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_5D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 36.0 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_600D.py b/release/scripts/presets/tracking_camera/Canon_600D.py new file mode 100644 index 00000000000..3dd66c5b609 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_600D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.3 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_60D.py b/release/scripts/presets/tracking_camera/Canon_60D.py new file mode 100644 index 00000000000..3dd66c5b609 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_60D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.3 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_7D.py b/release/scripts/presets/tracking_camera/Canon_7D.py new file mode 100644 index 00000000000..3dd66c5b609 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_7D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.3 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D300S.py b/release/scripts/presets/tracking_camera/Nikon_D300S.py new file mode 100644 index 00000000000..8db89189cd7 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D300S.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 23.6 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D3100.py b/release/scripts/presets/tracking_camera/Nikon_D3100.py new file mode 100644 index 00000000000..a112dd22dd2 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D3100.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 23.1 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D35.py b/release/scripts/presets/tracking_camera/Nikon_D35.py new file mode 100644 index 00000000000..7d9b6c8b390 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D35.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 36.0 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D5000.py b/release/scripts/presets/tracking_camera/Nikon_D5000.py new file mode 100644 index 00000000000..8db89189cd7 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D5000.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 23.6 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D5100.py b/release/scripts/presets/tracking_camera/Nikon_D5100.py new file mode 100644 index 00000000000..8db89189cd7 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D5100.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 23.6 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D7000.py b/release/scripts/presets/tracking_camera/Nikon_D7000.py new file mode 100644 index 00000000000..8db89189cd7 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D7000.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 23.6 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D90.py b/release/scripts/presets/tracking_camera/Nikon_D90.py new file mode 100644 index 00000000000..8db89189cd7 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D90.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 23.6 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Red_Epic.py b/release/scripts/presets/tracking_camera/Red_Epic.py new file mode 100644 index 00000000000..913b507d296 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Red_Epic.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 30.0 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Red_One_2K.py b/release/scripts/presets/tracking_camera/Red_One_2K.py new file mode 100644 index 00000000000..0a52b377959 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Red_One_2K.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 11.1 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Red_One_3K.py b/release/scripts/presets/tracking_camera/Red_One_3K.py new file mode 100644 index 00000000000..88c232bb944 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Red_One_3K.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 16.65 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Red_One_4K.py b/release/scripts/presets/tracking_camera/Red_One_4K.py new file mode 100644 index 00000000000..7ea78412f40 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Red_One_4K.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.2 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_track_color/default.py b/release/scripts/presets/tracking_track_color/default.py new file mode 100644 index 00000000000..3213d6e0c83 --- /dev/null +++ b/release/scripts/presets/tracking_track_color/default.py @@ -0,0 +1,5 @@ +import bpy +track = bpy.context.edit_movieclip.tracking.tracks.active + +track.color = (0.0, 0.0, 0.0) +track.use_custom_color = False diff --git a/release/scripts/presets/tracking_track_color/far_plane.py b/release/scripts/presets/tracking_track_color/far_plane.py new file mode 100644 index 00000000000..579d5562642 --- /dev/null +++ b/release/scripts/presets/tracking_track_color/far_plane.py @@ -0,0 +1,5 @@ +import bpy +track = bpy.context.edit_movieclip.tracking.tracks.active + +track.color = (0.0, 0.0, 1.0) +track.use_custom_color = True diff --git a/release/scripts/presets/tracking_track_color/near_plane.py b/release/scripts/presets/tracking_track_color/near_plane.py new file mode 100644 index 00000000000..790429ce7a1 --- /dev/null +++ b/release/scripts/presets/tracking_track_color/near_plane.py @@ -0,0 +1,5 @@ +import bpy +track = bpy.context.edit_movieclip.tracking.tracks.active + +track.color = (0.0, 1.0, 0.0) +track.use_custom_color = True diff --git a/release/scripts/startup/bl_operators/__init__.py b/release/scripts/startup/bl_operators/__init__.py index c0e83cee9d6..06b4429d25c 100644 --- a/release/scripts/startup/bl_operators/__init__.py +++ b/release/scripts/startup/bl_operators/__init__.py @@ -25,6 +25,7 @@ if "bpy" in locals(): _modules = ( "add_mesh_torus", "anim", + "clip", "console", "image", "mesh", diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py new file mode 100644 index 00000000000..d085b7ea105 --- /dev/null +++ b/release/scripts/startup/bl_operators/clip.py @@ -0,0 +1,318 @@ +# ##### 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. +# +# ##### END GPL LICENSE BLOCK ##### + +# <pep8 compliant> +import bpy +import os +import shutil +from bpy.types import Operator +from bpy_extras.io_utils import unpack_list + + +class CLIP_OT_track_to_empty(Operator): + """Create an Empty object which will be copying movement of active track""" + + bl_idname = "clip.track_to_empty" + bl_label = "2D Track to Empty" + bl_options = {'UNDO', 'REGISTER'} + + @classmethod + def poll(cls, context): + if context.space_data.type != 'CLIP_EDITOR': + return False + + sc = context.space_data + clip = sc.clip + + return clip and clip.tracking.tracks.active + + def execute(self, context): + sc = context.space_data + clip = sc.clip + track = clip.tracking.tracks.active + constraint = None + ob = None + + ob = bpy.data.objects.new(name=track.name, object_data=None) + ob.select = True + bpy.context.scene.objects.link(ob) + bpy.context.scene.objects.active = ob + + for con in ob.constraints: + if con.type == 'FOLLOW_TRACK': + constraint = con + break + + if constraint is None: + constraint = ob.constraints.new(type='FOLLOW_TRACK') + + constraint.clip = sc.clip + constraint.track = track.name + constraint.reference = 'TRACK' + + return {'FINISHED'} + + +class CLIP_OT_bundles_to_mesh(Operator): + """Create vertex cloud using coordinates of bundles""" + + bl_idname = "clip.bundles_to_mesh" + bl_label = "Bundles to Mesh" + bl_options = {'UNDO', 'REGISTER'} + + @classmethod + def poll(cls, context): + if context.space_data.type != 'CLIP_EDITOR': + return False + + sc = context.space_data + clip = sc.clip + + return clip + + def execute(self, context): + sc = context.space_data + clip = sc.clip + + new_verts = [] + + mesh = bpy.data.meshes.new(name="Bundles") + for track in clip.tracking.tracks: + if track.has_bundle: + new_verts.append(track.bundle) + + if new_verts: + mesh.vertices.add(len(new_verts)) + mesh.vertices.foreach_set("co", unpack_list(new_verts)) + + ob = bpy.data.objects.new(name="Bundles", object_data=mesh) + + bpy.context.scene.objects.link(ob) + + return {'FINISHED'} + + +class CLIP_OT_delete_proxy(Operator): + """Delete movie clip proxy files from the hard drive""" + + bl_idname = "clip.delete_proxy" + bl_label = "Delete Proxy" + bl_options = {'UNDO', 'REGISTER'} + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.clip + + def invoke(self, context, event): + wm = context.window_manager + + return wm.invoke_confirm(self, event) + + def _rmproxy(self, abspath): + if not os.path.exists(abspath): + return + + if os.path.isdir(abspath): + shutil.rmtree(abspath) + else: + os.remove(abspath) + + def execute(self, context): + sc = context.space_data + clip = sc.clip + if clip.use_proxy_custom_directory: + proxydir = clip.proxy.directory + else: + clipdir = os.path.dirname(clip.filepath) + proxydir = os.path.join(clipdir, 'BL_proxy') + + clipfile = os.path.basename(clip.filepath) + proxy = os.path.join(proxydir, clipfile) + absproxy = bpy.path.abspath(proxy) + + # proxy_<quality>[_undostorted] + for x in (25, 50, 75, 100): + d = os.path.join(absproxy, 'proxy_' + str(x)) + + self._rmproxy(d) + self._rmproxy(d + '_undistorted') + self._rmproxy(os.path.join(absproxy, 'proxy_' + str(x) + '.avi')) + + tc = ('free_run.blen_tc', 'interp_free_run.blen_tc', \ + 'record_run.blen_tc') + + for x in tc: + self._rmproxy(os.path.join(absproxy, x)) + + # remove proxy per-clip directory + try: + os.rmdir(absproxy) + except OSError: + pass + + # remove [custom] proxy directory if empty + try: + absdir = bpy.path.abspath(proxydir) + os.rmdir(absdir) + except OSError: + pass + + return {'FINISHED'} + + +class CLIP_OT_set_viewport_background(Operator): + """Set current movie clip as a camera background in 3D viewport""" + + bl_idname = "clip.set_viewport_background" + bl_label = "Set as Background" + bl_options = {'UNDO', 'REGISTER'} + + @classmethod + def poll(cls, context): + if context.space_data.type != 'CLIP_EDITOR': + return False + + sc = context.space_data + + return sc.clip + + def _set_background(self, space_v3d, clip, user): + bgpic = None + + for x in space_v3d.background_images: + if x.source == 'MOVIE': + bgpic = x + break + + if not bgpic: + bgpic = space_v3d.background_images.add() + + bgpic.source = 'MOVIE' + bgpic.clip = clip + bgpic.clip_user.proxy_render_size = user.proxy_render_size + bgpic.clip_user.use_render_undistorted = user.use_render_undistorted + bgpic.use_camera_clip = False + bgpic.view_axis = 'CAMERA' + + space_v3d.show_background_images = True + + def execute(self, context): + sc = context.space_data + clip = sc.clip + + for area in context.window.screen.areas: + if area.type == 'VIEW_3D': + for space in area.spaces: + if space.type == 'VIEW_3D': + self._set_background(space, clip, sc.clip_user) + + return {'FINISHED'} + + +class CLIP_OT_constraint_to_fcurve(Operator): + """Create F-Curves for object which will copy object's movement caused by this constraint""" + + bl_idname = "clip.constraint_to_fcurve" + bl_label = "Constraint to F-Curve" + bl_options = {'UNDO', 'REGISTER'} + + def _bake_object(self, scene, ob): + con = None + clip = None + sfra = None + efra = None + frame_current = scene.frame_current + matrices = [] + + # Find constraint which would eb converting + # TODO: several camera solvers and track followers would fail, + # but can't think about eal workflow where it'll be useful + for x in ob.constraints: + if x.type in ('CAMERA_SOLVER', 'FOLLOW_TRACK'): + con = x + + if not con: + return + + if con.type == 'FOLLOW_TRACK' and con.reference == 'BUNDLE': + mat = ob.matrix_world.copy() + ob.constraints.remove(con) + ob.matrix_world = mat + + return + + # Get clip used for parenting + if con.use_active_clip: + clip = scene.active_clip + else: + clip = con.clip + + if not clip: + return + + # Find start and end frames + for track in clip.tracking.tracks: + if sfra is None: + sfra = track.markers[0].frame + else: + sfra = min(sfra, track.markers[0].frame) + + if efra is None: + efra = track.markers[-1].frame + else: + efra = max(efra, track.markers[-1].frame) + + if sfra is None or efra is None: + return + + # Store object matrices + for x in range(sfra, efra+1): + scene.frame_set(x) + matrices.append(ob.matrix_world.copy()) + + ob.animation_data_create() + + # Apply matrices on object and insert keyframes + i = 0 + for x in range(sfra, efra+1): + scene.frame_set(x) + ob.matrix_world = matrices[i] + + ob.keyframe_insert("location") + + if ob.rotation_mode == 'QUATERNION': + ob.keyframe_insert("rotation_quaternion") + else: + ob.keyframe_insert("rotation_euler") + + i += 1 + + ob.constraints.remove(con) + + scene.frame_set(frame_current) + + def execute(self, context): + scene = context.scene + + for ob in scene.objects: + if ob.select: + self._bake_object(scene, ob) + + return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index 21ac128f177..ac19bab4c66 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -319,6 +319,47 @@ class AddPresetInteraction(AddPresetBase, Operator): preset_subdir = "interaction" +class AddPresetTrackingCamera(AddPresetBase, Operator): + '''Add a Tracking Camera Intrinsics Preset''' + bl_idname = "clip.camera_preset_add" + bl_label = "Add Camera Preset" + preset_menu = "CLIP_MT_camera_presets" + + preset_defines = [ + "camera = bpy.context.edit_movieclip.tracking.camera" + ] + + preset_values = [ + "camera.sensor_width", + "camera.units", + "camera.focal_length", + "camera.pixel_aspect", + "camera.k1", + "camera.k2", + "camera.k3" + ] + + preset_subdir = "tracking_camera" + + +class AddPresetTrackingTrackColor(AddPresetBase, Operator): + '''Add a Clip Track Color Preset''' + bl_idname = "clip.track_color_preset_add" + bl_label = "Add Track Color Preset" + preset_menu = "CLIP_MT_track_color_presets" + + preset_defines = [ + "track = bpy.context.edit_movieclip.tracking.tracks" + ] + + preset_values = [ + "track.color", + "track.use_custom_color" + ] + + preset_subdir = "tracking_track_color" + + class AddPresetKeyconfig(AddPresetBase, Operator): '''Add a Keyconfig Preset''' bl_idname = "wm.keyconfig_preset_add" diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 0e816241b46..3db768f73fe 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -53,6 +53,7 @@ _modules = ( "properties_scene", "properties_texture", "properties_world", + "space_clip", "space_console", "space_dopesheet", "space_filebrowser", diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 0779debb102..a359d58b59e 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -257,10 +257,8 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel): layout.prop(ob, "dupli_group", text="Group") -# XXX: the following options are all quite buggy, ancient hacks that should be dropped - -class OBJECT_PT_animation(ObjectButtonsPanel, Panel): - bl_label = "Animation Hacks" +class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel): + bl_label = "Relations Extras" bl_options = {'DEFAULT_CLOSED'} def draw(self, context): @@ -269,23 +267,17 @@ class OBJECT_PT_animation(ObjectButtonsPanel, Panel): ob = context.object split = layout.split() - - col = split.column() - col.label(text="Time Offset:") - col.prop(ob, "use_time_offset_edit", text="Edit") - row = col.row() - row.prop(ob, "use_time_offset_parent", text="Parent") - row.active = (ob.parent is not None) - row = col.row() - row.prop(ob, "use_slow_parent") - row.active = (ob.parent is not None) - col.prop(ob, "time_offset", text="Offset") - - # XXX: these are still used for a few curve-related tracking features + col = split.column() col.label(text="Tracking Axes:") col.prop(ob, "track_axis", text="Axis") col.prop(ob, "up_axis", text="Up Axis") + + col = split.column() + col.prop(ob, "use_slow_parent") + row = col.row() + row.active = ((ob.parent is not None) and (ob.use_slow_parent)) + row.prop(ob, "slow_parent_offset", text="Offset") from bl_ui.properties_animviz import ( diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py index dc19f58ca35..c493124c5bb 100644 --- a/release/scripts/startup/bl_ui/properties_object_constraint.py +++ b/release/scripts/startup/bl_ui/properties_object_constraint.py @@ -753,6 +753,26 @@ class ConstraintButtonsPanel(): col = layout.column() col.prop(con, "rotation_range", text="Pivot When") + def FOLLOW_TRACK(self, context, layout, con): + layout.prop(con, "use_active_clip") + + if not con.use_active_clip: + layout.prop(con, "clip") + + layout.prop(con, "track") + + layout.row().prop(con, "reference", expand=True) + + layout.operator("clip.constraint_to_fcurve") + + def CAMERA_SOLVER(self, context, layout, con): + layout.prop(con, "use_active_clip") + + if not con.use_active_clip: + layout.prop(con, "clip") + + layout.operator("clip.constraint_to_fcurve") + def SCRIPT(self, context, layout, con): layout.label("Blender 2.5 has no py-constraints") diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index d3859a78bea..86880b9ddec 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -42,6 +42,7 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel): layout.prop(scene, "camera") layout.prop(scene, "background_set", text="Background") + layout.prop(scene, "active_clip", text="Active Clip") class SCENE_PT_audio(SceneButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py new file mode 100644 index 00000000000..09209017823 --- /dev/null +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -0,0 +1,885 @@ +# ##### 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. +# +# ##### END GPL LICENSE BLOCK ##### + +# <pep8 compliant> +import bpy +from bpy.types import Panel, Header, Menu + + +class CLIP_HT_header(Header): + bl_space_type = 'CLIP_EDITOR' + + def draw(self, context): + layout = self.layout + + sc = context.space_data + clip = sc.clip + + row = layout.row(align=True) + row.template_header() + + if context.area.show_menus: + sub = row.row(align=True) + sub.menu("CLIP_MT_view") + + if clip: + sub.menu("CLIP_MT_select") + + sub.menu("CLIP_MT_clip") + + if clip: + sub.menu("CLIP_MT_track") + sub.menu("CLIP_MT_reconstruction") + + if clip: + layout.prop(sc, "mode", text="") + layout.prop(sc, "view", text="", expand=True) + + if sc.view == 'GRAPH': + row = layout.row(align=True) + + if sc.show_filters: + row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_DOWN', text="Filters") + row.prop(sc, "show_graph_frames", icon='SEQUENCE', text="") + row.prop(sc, "show_graph_tracks", icon='ANIM', text="") + else: + row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_RIGHT', text="Filters") + + row = layout.row() + row.template_ID(sc, "clip", open='clip.open') + + if clip: + r = clip.tracking.reconstruction + + if r.is_valid: + layout.label(text="Average solve error: %.4f" % + (r.average_error)) + + layout.template_running_jobs() + + +class CLIP_PT_tools_marker(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Marker" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'TRACKING' + + def draw(self, context): + layout = self.layout + + col = layout.column(align=True) + col.operator("clip.add_marker_move") + col.operator("clip.detect_features") + col.operator("clip.delete_track") + + +class CLIP_PT_tools_tracking(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Track" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'TRACKING' + + def draw(self, context): + layout = self.layout + clip = context.space_data.clip + settings = clip.tracking.settings + + row = layout.row(align=True) + + props = row.operator("clip.track_markers", text="", icon='FRAME_PREV') + props.backwards = True + props = row.operator("clip.track_markers", text="", + icon='PLAY_REVERSE') + props.backwards = True + props.sequence = True + props = row.operator("clip.track_markers", text="", icon='PLAY') + props.sequence = True + row.operator("clip.track_markers", text="", icon='FRAME_NEXT') + + col = layout.column(align=True) + props = col.operator("clip.clear_track_path", text="Clear After") + props.action = 'REMAINED' + + props = col.operator("clip.clear_track_path", text="Clear Before") + props.action = 'UPTO' + + props = col.operator("clip.clear_track_path", text="Clear Track Path") + props.action = 'ALL' + + layout.operator("clip.join_tracks") + + +class CLIP_PT_tools_solving(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Solving" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'TRACKING' + + def draw(self, context): + layout = self.layout + clip = context.space_data.clip + settings = clip.tracking.settings + + col = layout.column(align=True) + col.operator("clip.solve_camera") + col.operator("clip.clear_solution") + + col = layout.column(align=True) + col.prop(settings, "keyframe_a") + col.prop(settings, "keyframe_b") + + +class CLIP_PT_tools_cleanup(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Clean up" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'TRACKING' + + def draw(self, context): + layout = self.layout + clip = context.space_data.clip + settings = clip.tracking.settings + + layout.operator("clip.clean_tracks") + + layout.prop(settings, 'clean_frames', text="Frames") + layout.prop(settings, 'clean_error', text="Error") + layout.prop(settings, 'clean_action', text="") + + +class CLIP_PT_tools_geometry(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Geometry" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'RECONSTRUCTION' + + def draw(self, context): + layout = self.layout + + layout.operator("clip.bundles_to_mesh") + layout.operator("clip.track_to_empty") + + +class CLIP_PT_tools_orientation(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Orientation" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'RECONSTRUCTION' + + def draw(self, context): + sc = context.space_data + layout = self.layout + settings = sc.clip.tracking.settings + + col = layout.column(align=True) + col.label(text="Scene Orientation:") + col.operator("clip.set_floor") + col.operator("clip.set_origin") + + row = col.row() + row.operator("clip.set_axis", text="Set X Axis").axis = 'X' + row.operator("clip.set_axis", text="Set Y Axis").axis = 'Y' + + layout.separator() + + col = layout.column() + col.operator("clip.set_scale") + col.prop(settings, "distance") + + +class CLIP_PT_tools_grease_pencil(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Grease Pencil" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'DISTORTION' + + def draw(self, context): + layout = self.layout + + col = layout.column(align=True) + + row = col.row(align=True) + row.operator("gpencil.draw", text="Draw").mode = 'DRAW' + row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT' + + row = col.row(align=True) + row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY' + row.operator("gpencil.draw", text="Erase").mode = 'ERASER' + + row = col.row() + row.prop(context.tool_settings, "use_grease_pencil_sessions") + + +class CLIP_PT_track(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Track" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return sc.mode == 'TRACKING' and clip + + def draw(self, context): + layout = self.layout + sc = context.space_data + clip = context.space_data.clip + act_track = clip.tracking.tracks.active + + if not act_track: + layout.active = False + layout.label(text="No active track") + return + + row = layout.row() + row.prop(act_track, "name", text="") + + sub = row.row(align=True) + + sub.template_marker(sc, "clip", sc.clip_user, act_track, True) + + icon = 'LOCKED' if act_track.lock else 'UNLOCKED' + sub.prop(act_track, "lock", text="", icon=icon) + + layout.template_track(sc, "scopes") + + row = layout.row(align=True) + row.prop(act_track, "use_red_channel", text="R", toggle=True) + row.prop(act_track, "use_green_channel", text="G", toggle=True) + row.prop(act_track, "use_blue_channel", text="B", toggle=True) + + layout.separator() + + row = layout.row(align=True) + label = bpy.types.CLIP_MT_track_color_presets.bl_label + row.menu('CLIP_MT_track_color_presets', text=label) + row.menu('CLIP_MT_track_color_specials', text="", icon="DOWNARROW_HLT") + row.operator("clip.track_color_preset_add", text="", icon="ZOOMIN") + props = row.operator("clip.track_color_preset_add", + text="", icon="ZOOMOUT") + props.remove_active = True + + row = layout.row() + row.prop(act_track, "use_custom_color") + if act_track.use_custom_color: + row.prop(act_track, "color", text="") + + if act_track.has_bundle: + label_text = "Average Error: %.4f" % (act_track.average_error) + layout.label(text=label_text) + + +class CLIP_PT_tracking_camera(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Camera Data" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.mode in ['TRACKING', 'DISTORTION'] and sc.clip + + def draw(self, context): + layout = self.layout + + sc = context.space_data + clip = sc.clip + + row = layout.row(align=True) + label = bpy.types.CLIP_MT_camera_presets.bl_label + row.menu('CLIP_MT_camera_presets', text=label) + row.operator("clip.camera_preset_add", text="", icon="ZOOMIN") + props = row.operator("clip.camera_preset_add", text="", icon="ZOOMOUT") + props.remove_active = True + + row = layout.row(align=True) + sub = row.split(percentage=0.65) + if clip.tracking.camera.units == 'MILLIMETERS': + sub.prop(clip.tracking.camera, "focal_length") + else: + sub.prop(clip.tracking.camera, "focal_length_pixels") + sub.prop(clip.tracking.camera, "units", text="") + + col = layout.column(align=True) + col.label(text="Sensor:") + col.prop(clip.tracking.camera, "sensor_width", text="Width") + col.prop(clip.tracking.camera, "pixel_aspect") + + col = layout.column() + col.label(text="Principal Point") + row = col.row() + row.prop(clip.tracking.camera, "principal", text="") + col.operator("clip.set_center_principal", text="Center") + + col = layout.column(align=True) + col.label(text="Undistortion:") + col.prop(clip.tracking.camera, "k1") + col.prop(clip.tracking.camera, "k2") + col.prop(clip.tracking.camera, "k3") + + +class CLIP_PT_display(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Display" + + def draw(self, context): + layout = self.layout + sc = context.space_data + + col = layout.column(align=True) + + col.prop(sc, "show_marker_pattern", text="Pattern") + col.prop(sc, "show_marker_search", text="Search") + col.prop(sc, "show_pyramid_levels", text="Pyramid") + + col.prop(sc, "show_track_path", text="Track Path") + row = col.row() + row.active = sc.show_track_path + row.prop(sc, "path_length", text="Length") + + col.prop(sc, "show_disabled", "Disabled Tracks") + col.prop(sc, "show_bundles", text="Bundles") + + col.prop(sc, "show_names", text="Track Names") + col.prop(sc, "show_tiny_markers", text="Tiny Markers") + + col.prop(sc, "show_grease_pencil", text="Grease Pencil") + col.prop(sc, "use_mute_footage", text="Mute") + + if sc.mode == 'DISTORTION': + col.prop(sc, "show_grid", text="Grid") + col.prop(sc, "use_manual_calibration") + elif sc.mode == 'RECONSTRUCTION': + col.prop(sc, "show_stable", text="Stable") + + col.prop(sc, "lock_selection") + + clip = sc.clip + if clip: + col.label(text="Display Aspect:") + col.prop(clip, "display_aspect", text="") + + +class CLIP_PT_track_settings(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Tracking Settings" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.mode == 'TRACKING' and sc.clip + + def draw(self, context): + layout = self.layout + clip = context.space_data.clip + settings = clip.tracking.settings + + active = clip.tracking.tracks.active + if active: + layout.prop(active, "tracker") + if active.tracker == "KLT": + layout.prop(active, "pyramid_levels") + if active.tracker == "SAD": + layout.prop(active, "correlation_min") + + layout.prop(settings, "frames_adjust") + layout.prop(settings, "speed") + layout.prop(settings, "frames_limit") + layout.prop(settings, "margin") + + +class CLIP_PT_stabilization(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "2D Stabilization" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.mode == 'RECONSTRUCTION' and sc.clip + + def draw_header(self, context): + sc = context.space_data + tracking = sc.clip.tracking + stab = tracking.stabilization + + self.layout.prop(stab, "use_2d_stabilization", text="") + + def draw(self, context): + layout = self.layout + sc = context.space_data + tracking = sc.clip.tracking + stab = tracking.stabilization + + layout.active = stab.use_2d_stabilization + + row = layout.row() + row.template_list(stab, "tracks", stab, "active_track_index", rows=3) + + sub = row.column(align=True) + + sub.operator("clip.stabilize_2d_add", icon='ZOOMIN', text="") + sub.operator("clip.stabilize_2d_remove", icon='ZOOMOUT', text="") + + sub.menu('CLIP_MT_stabilize_2d_specials', text="", + icon="DOWNARROW_HLT") + + layout.prop(stab, "influence_location") + + layout.separator() + + layout.prop(stab, "use_autoscale") + col = layout.column() + col.active = stab.use_autoscale + col.prop(stab, "scale_max") + col.prop(stab, "influence_scale") + + layout.separator() + + layout.label(text="Rotation:") + + row = layout.row(align=True) + row.prop_search(stab, "rotation_track", tracking, "tracks", text="") + row.operator("clip.stabilize_2d_set_rotation", text="", icon='ZOOMIN') + + row = layout.row() + row.active = stab.rotation_track is not None + row.prop(stab, "influence_rotation") + + +class CLIP_PT_marker(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Marker" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return sc.mode == 'TRACKING' and clip + + def draw(self, context): + layout = self.layout + sc = context.space_data + clip = context.space_data.clip + act_track = clip.tracking.tracks.active + + if act_track: + layout.template_marker(sc, "clip", sc.clip_user, act_track, False) + else: + layout.active = False + layout.label(text="No active track") + + +class CLIP_PT_proxy(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Proxy / Timecode" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.clip + + def draw_header(self, context): + sc = context.space_data + + self.layout.prop(sc.clip, "use_proxy", text="") + + def draw(self, context): + layout = self.layout + sc = context.space_data + clip = sc.clip + + layout.active = clip.use_proxy + + layout.label(text="Build Sizes:") + + row = layout.row() + row.prop(clip.proxy, "build_25") + row.prop(clip.proxy, "build_50") + + row = layout.row() + row.prop(clip.proxy, "build_75") + row.prop(clip.proxy, "build_100") + + layout.prop(clip.proxy, "build_undistorted") + + layout.prop(clip.proxy, "quality") + + layout.prop(clip, 'use_proxy_custom_directory') + if clip.use_proxy_custom_directory: + layout.prop(clip.proxy, "directory") + + layout.operator("clip.rebuild_proxy", text="Rebuild Proxy") + + if clip.source == 'MOVIE': + col = layout.column() + + col.label(text="Use timecode index:") + col.prop(clip.proxy, "timecode", text="") + + col = layout.column() + col.label(text="Proxy render size:") + + col.prop(sc.clip_user, "proxy_render_size", text="") + col.prop(sc.clip_user, "use_render_undistorted") + + +class CLIP_PT_footage(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Footage Settings" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.clip + + def draw(self, context): + layout = self.layout + + sc = context.space_data + clip = sc.clip + + if clip: + layout.template_movieclip(sc, "clip", compact=True) + else: + layout.operator("clip.open", icon='FILESEL') + + +class CLIP_PT_tools_clip(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Clip" + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.clip + + def draw(self, context): + layout = self.layout + clip = context.space_data.clip + + layout.operator("clip.set_viewport_background") + + +class CLIP_MT_view(Menu): + bl_label = "View" + + def draw(self, context): + layout = self.layout + + layout.operator("clip.properties", icon='MENU_PANEL') + layout.operator("clip.tools", icon='MENU_PANEL') + layout.separator() + + layout.operator("clip.view_selected") + layout.operator("clip.view_all") + + layout.separator() + layout.operator("clip.view_zoom_in") + layout.operator("clip.view_zoom_out") + + layout.separator() + + ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1)) + + for a, b in ratios: + text = "Zoom %d:%d" % (a, b) + layout.operator("clip.view_zoom_ratio", text=text).ratio = a / b + + layout.separator() + layout.operator("screen.area_dupli") + layout.operator("screen.screen_full_area") + + +class CLIP_MT_clip(Menu): + bl_label = "Clip" + + def draw(self, context): + layout = self.layout + + sc = context.space_data + clip = sc.clip + + layout.operator("clip.open") + + if clip: + layout.operator("clip.reload") + layout.menu("CLIP_MT_proxy") + + +class CLIP_MT_proxy(Menu): + bl_label = "Proxy" + + def draw(self, context): + layout = self.layout + + sc = context.space_data + clip = sc.clip + + layout.operator("clip.rebuild_proxy") + layout.operator("clip.delete_proxy") + + +class CLIP_MT_track(Menu): + bl_label = "Track" + + def draw(self, context): + layout = self.layout + + layout.operator("clip.clear_solution") + layout.operator("clip.solve_camera") + + layout.separator() + props = layout.operator("clip.clear_track_path", text="Clear After") + props.action = 'REMAINED' + + props = layout.operator("clip.clear_track_path", text="Clear Before") + props.action = 'UPTO' + + props = layout.operator("clip.clear_track_path", text="Clear Track Path") + props.action = 'ALL' + + layout.separator() + layout.operator("clip.join_tracks") + + layout.separator() + layout.operator("clip.clean_tracks") + + layout.separator() + props = layout.operator("clip.track_markers", + text="Track Frame Backwards") + props.backwards = True + + props = layout.operator("clip.track_markers", text="Track Backwards") + props.backwards = True + props.sequence = True + + props = layout.operator("clip.track_markers", text="Track Forwards") + props.sequence = True + layout.operator("clip.track_markers", text="Track Frame Forwards") + + layout.separator() + layout.operator("clip.delete_track") + layout.operator("clip.delete_marker") + + layout.separator() + layout.operator("clip.add_marker_move") + + layout.separator() + layout.menu("CLIP_MT_track_visibility") + layout.menu("CLIP_MT_track_transform") + + +class CLIP_MT_reconstruction(Menu): + bl_label = "Reconstruction" + + def draw(self, context): + layout = self.layout + + layout.operator("clip.set_origin") + layout.operator("clip.set_floor") + + layout.operator("clip.set_axis", text="Set X Asix").axis = "X" + layout.operator("clip.set_axis", text="Set Y Asix").axis = "Y" + + layout.operator("clip.set_scale") + + layout.separator() + + layout.operator("clip.track_to_empty") + layout.operator("clip.bundles_to_mesh") + + +class CLIP_MT_track_visibility(Menu): + bl_label = "Show/Hide" + + def draw(self, context): + layout = self.layout + + layout.operator("clip.hide_tracks_clear", text="Show Hidden") + layout.operator("clip.hide_tracks", text="Hide Selected") + + props = layout.operator("clip.hide_tracks", text="Hide Unselected") + props.unselected = True + + +class CLIP_MT_track_transform(Menu): + bl_label = "Transform" + + def draw(self, context): + layout = self.layout + + layout.operator("transform.translate") + layout.operator("transform.resize") + + +class CLIP_MT_select(Menu): + bl_label = "Select" + + def draw(self, context): + layout = self.layout + + sc = context.space_data + + layout.operator("clip.select_border") + layout.operator("clip.select_circle") + + layout.separator() + + layout.operator("clip.select_all", text="Select/Deselect all") + layout.operator("clip.select_all", text="Inverse").action = 'INVERT' + + layout.menu("CLIP_MT_select_grouped") + + +class CLIP_MT_select_grouped(Menu): + bl_label = "Select Grouped" + + def draw(self, context): + layout = self.layout + + layout.operator_enum("clip.select_grouped", "group") + + +class CLIP_MT_tracking_specials(Menu): + bl_label = "Specials" + + @classmethod + def poll(cls, context): + return context.space_data.clip + + def draw(self, context): + layout = self.layout + + props = layout.operator("clip.disable_markers", text="Enable Markers") + props.action = 'ENABLE' + + props = layout.operator("clip.disable_markers", text="Disable markers") + props.action = 'DISABLE' + + layout.separator() + layout.operator("clip.set_origin") + + layout.separator() + layout.operator("clip.hide_tracks") + layout.operator("clip.hide_tracks_clear", text="Show Tracks") + + layout.separator() + props = layout.operator("clip.lock_tracks", text="Lock Tracks") + props.action = 'LOCK' + + props = layout.operator("clip.lock_tracks", text="Unlock Tracks") + props.action = 'UNLOCK' + + +class CLIP_MT_camera_presets(Menu): + bl_label = "Camera Presets" + preset_subdir = "tracking_camera" + preset_operator = "script.execute_preset" + draw = bpy.types.Menu.draw_preset + + +class CLIP_MT_track_color_presets(Menu): + bl_label = "Color Presets" + preset_subdir = "tracking_track_color" + preset_operator = "script.execute_preset" + draw = bpy.types.Menu.draw_preset + + +class CLIP_MT_track_color_specials(Menu): + bl_label = "Track Color Specials" + + def draw(self, context): + layout = self.layout + + layout.operator('clip.track_copy_color', icon='COPY_ID') + + +class CLIP_MT_stabilize_2d_specials(Menu): + bl_label = "Track Color Specials" + + def draw(self, context): + layout = self.layout + + layout.operator('clip.stabilize_2d_select') + +if __name__ == "__main__": # only for live edit. + bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index cf0d10c5844..435b968f243 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -62,7 +62,7 @@ class FILEBROWSER_HT_header(Header): row.prop(params, "use_filter_folder", text="") if params.filter_glob: - #if st.operator and hasattr(st.operator, "filter_glob"): + #if st.active_operator and hasattr(st.active_operator, "filter_glob"): # row.prop(params, "filter_glob", text="") row.label(params.filter_glob) else: diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index 72846a27690..0ce2df0e47e 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -178,6 +178,7 @@ class TIME_MT_playback(Menu): layout.prop(screen, "use_play_image_editors") layout.prop(screen, "use_play_sequence_editors") layout.prop(screen, "use_play_node_editors") + layout.prop(screen, "use_play_clip_editors") layout.separator() diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 3f5b7b86e89..9edb1ea1197 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2063,7 +2063,22 @@ class VIEW3D_PT_view3d_properties(Panel): subcol.label(text="Local Camera:") subcol.prop(view, "camera", text="") - layout.column().prop(view, "cursor_location") + +class VIEW3D_PT_view3d_cursor(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'UI' + bl_label = "3D Cursor" + + @classmethod + def poll(cls, context): + view = context.space_data + return (view) + + def draw(self, context): + layout = self.layout + + view = context.space_data + layout.column().prop(view, "cursor_location", text="Location") class VIEW3D_PT_view3d_name(Panel): @@ -2149,6 +2164,16 @@ class VIEW3D_PT_view3d_display(Panel): layout.separator() + layout.prop(view, "show_reconstruction") + if view.show_reconstruction: + layout.label(text="Bundle type:") + layout.prop(view, "bundle_draw_type", text="") + layout.prop(view, "bundle_draw_size") + layout.prop(view, "show_bundle_name") + layout.prop(view, "show_camera_path") + + layout.separator() + region = view.region_quadview layout.operator("screen.region_quadview", text="Toggle Quad View") @@ -2254,8 +2279,10 @@ class VIEW3D_PT_background_image(Panel): box = layout.box() row = box.row(align=True) row.prop(bg, "show_expanded", text="", emboss=False) - if bg.image: + if bg.source == 'IMAGE' and bg.image: row.prop(bg.image, "name", text="", emboss=False) + if bg.source == 'MOVIE' and bg.clip: + row.prop(bg.clip, "name", text="", emboss=False) else: row.label(text="Not Set") row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i @@ -2264,10 +2291,36 @@ class VIEW3D_PT_background_image(Panel): if bg.show_expanded: row = box.row() - row.template_ID(bg, "image", open="image.open") - if (bg.image): - box.template_image(bg, "image", bg.image_user, compact=True) + row.prop(bg, "source", expand=True) + + hasbg = False + if bg.source == 'IMAGE': + row = box.row() + row.template_ID(bg, "image", open="image.open") + if (bg.image): + box.template_image(bg, "image", bg.image_user, compact=True) + hasbg = True + + elif bg.source == 'MOVIE': + has_clip = False + box.prop(bg, 'use_camera_clip') + + column = box.column() + column.active = not bg.use_camera_clip + column.template_ID(bg, "clip", open="clip.open") + + if bg.clip: + column.template_movieclip(bg, "clip", compact=True) + + if bg.use_camera_clip or bg.clip: + hasbg = True + + column = box.column() + column.active = hasbg + column.prop(bg.clip_user, "proxy_render_size", text="") + column.prop(bg.clip_user, "use_render_undistorted") + if hasbg: box.prop(bg, "opacity", slider=True) if bg.view_axis != 'CAMERA': box.prop(bg, "size") diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 96201a4b960..332577a7902 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -172,25 +172,31 @@ class VIEW3D_PT_tools_meshedit(View3DPanel, Panel): class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel): bl_context = "mesh_edit" bl_label = "Mesh Options" + + @classmethod + def poll(cls, context): + return context.active_object def draw(self, context): layout = self.layout ob = context.active_object - if ob: - mesh = ob.data - col = layout.column(align=True) - col.prop(mesh, "use_mirror_x") - sub = col.column() - sub.active = ob.data.use_mirror_x - sub.prop(mesh, "use_mirror_topology") + tool_settings = context.tool_settings + mesh = ob.data - ts = context.tool_settings + col = layout.column(align=True) + col.active = tool_settings.proportional_edit == 'DISABLED' + col.prop(mesh, "use_mirror_x") - col.label("Edge Select Mode") - col.prop(ts, "edge_path_mode", text="") - col.prop(context.tool_settings, "edge_path_live_unwrap") + row = col.row() + row.active = ob.data.use_mirror_x + row.prop(mesh, "use_mirror_topology") + + col = layout.column(align=True) + col.label("Edge Select Mode:") + col.prop(tool_settings, "edge_path_mode", text="") + col.prop(tool_settings, "edge_path_live_unwrap") # ********** default tools for editmode_curve **************** diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index e111e804804..e52b5b89aa0 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -83,6 +83,8 @@ set(SRC_DNA_INC ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_view3d_types.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_windowmanager_types.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_world_types.h + ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_movieclip_types.h + ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_tracking_types.h ) add_subdirectory(editors) diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index cba6b0ef257..8e5b313b919 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -105,10 +105,10 @@ void BKE_keyingsets_free(struct ListBase *list); /* Path Fixing API */ /* Fix all the paths for the given ID+AnimData */ -void BKE_animdata_fix_paths_rename(struct ID *owner_id, struct AnimData *adt, const char *prefix, char *oldName, char *newName, int oldSubscript, int newSubscript, int verify_paths); +void BKE_animdata_fix_paths_rename(struct ID *owner_id, struct AnimData *adt, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, int verify_paths); /* Fix all the paths for the entire database... */ -void BKE_all_animdata_fix_paths_rename(char *prefix, char *oldName, char *newName); +void BKE_all_animdata_fix_paths_rename(const char *prefix, const char *oldName, const char *newName); /* -------------------------------------- */ diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 9b28f083a24..7033a2e0cce 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -87,7 +87,7 @@ extern int BKE_undo_valid(const char *name); extern void BKE_reset_undo(void); extern char *BKE_undo_menu_string(void); extern void BKE_undo_number(struct bContext *C, int nr); -extern char *BKE_undo_get_name(int nr, int *active); +extern const char *BKE_undo_get_name(int nr, int *active); extern void BKE_undo_save_quit(void); extern struct Main *BKE_undo_get_main(struct Scene **scene); diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h index 2ab8ea21d0b..07f0c2fef7c 100644 --- a/source/blender/blenkernel/BKE_bvhutils.h +++ b/source/blender/blenkernel/BKE_bvhutils.h @@ -108,8 +108,8 @@ void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data); /* * Math functions used by callbacks */ -float bvhtree_ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2); -float nearest_point_in_tri_surface(const float *v0,const float *v1,const float *v2,const float *p, int *v, int *e, float *nearest); +float bvhtree_ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float v0[3], const float v1[3], const float v2[3]); +float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const float v2[3], const float p[3], int *v, int *e, float nearest[3]); /* * BVHCache diff --git a/source/blender/blenkernel/BKE_camera.h b/source/blender/blenkernel/BKE_camera.h new file mode 100644 index 00000000000..d21c1092922 --- /dev/null +++ b/source/blender/blenkernel/BKE_camera.h @@ -0,0 +1,71 @@ +/* + * ***** 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) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BKE_CAMERA_H +#define BKE_CAMERA_H + +/** \file BKE_camera.h + * \ingroup bke + * \brief Camera datablock and utility functions. + */ +#ifdef __cplusplus +extern "C" { +#endif + +struct Camera; +struct Object; +struct RenderData; +struct Scene; +struct rctf; + +void *add_camera(const char *name); +struct Camera *copy_camera(struct Camera *cam); +void make_local_camera(struct Camera *cam); +void free_camera(struct Camera *ca); + +float dof_camera(struct Object *ob); + +void object_camera_mode(struct RenderData *rd, struct Object *camera); +void object_camera_intrinsics(struct Object *camera, struct Camera **cam_r, short *is_ortho, float *shiftx, float *shifty, + float *clipsta, float *clipend, float *lens, float *sensor_x, float *sensor_y, short *sensor_fit); +void object_camera_matrix( + struct RenderData *rd, struct Object *camera, int winx, int winy, short field_second, + float winmat[][4], struct rctf *viewplane, float *clipsta, float *clipend, float *lens, + float *sensor_x, float *sensor_y, short *sensor_fit, float *ycor, + float *viewdx, float *viewdy); + +void camera_view_frame_ex(struct Scene *scene, struct Camera *camera, float drawsize, const short do_clip, const float scale[3], + float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]); + +void camera_view_frame(struct Scene *scene, struct Camera *camera, float r_vec[4][3]); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h index c065a210a98..0aefe2231a5 100644 --- a/source/blender/blenkernel/BKE_context.h +++ b/source/blender/blenkernel/BKE_context.h @@ -61,6 +61,7 @@ struct wmWindow; struct wmWindowManager; struct SpaceText; struct SpaceImage; +struct SpaceClip; struct ID; /* Structs */ @@ -158,6 +159,7 @@ struct SpaceIpo *CTX_wm_space_graph(const bContext *C); struct SpaceAction *CTX_wm_space_action(const bContext *C); struct SpaceInfo *CTX_wm_space_info(const bContext *C); struct SpaceUserPref *CTX_wm_space_userpref(const bContext *C); +struct SpaceClip *CTX_wm_space_clip(const bContext *C); void CTX_wm_manager_set(bContext *C, struct wmWindowManager *wm); void CTX_wm_window_set(bContext *C, struct wmWindow *win); @@ -252,6 +254,7 @@ struct Object *CTX_data_edit_object(const bContext *C); struct Image *CTX_data_edit_image(const bContext *C); struct Text *CTX_data_edit_text(const bContext *C); +struct MovieClip *CTX_data_edit_movieclip(const bContext *C); int CTX_data_selected_nodes(const bContext *C, ListBase *list); diff --git a/source/blender/blenkernel/BKE_customdata_file.h b/source/blender/blenkernel/BKE_customdata_file.h index f32a4b1e6a8..be7aaa70188 100644 --- a/source/blender/blenkernel/BKE_customdata_file.h +++ b/source/blender/blenkernel/BKE_customdata_file.h @@ -40,22 +40,22 @@ void cdf_free(CDataFile *cdf); /* File read/write/remove */ -int cdf_read_open(CDataFile *cdf, char *filename); +int cdf_read_open(CDataFile *cdf, const char *filename); int cdf_read_layer(CDataFile *cdf, CDataFileLayer *blay); int cdf_read_data(CDataFile *cdf, unsigned int size, void *data); void cdf_read_close(CDataFile *cdf); -int cdf_write_open(CDataFile *cdf, char *filename); +int cdf_write_open(CDataFile *cdf, const char *filename); int cdf_write_layer(CDataFile *cdf, CDataFileLayer *blay); int cdf_write_data(CDataFile *cdf, unsigned int size, void *data); void cdf_write_close(CDataFile *cdf); -void cdf_remove(char *filename); +void cdf_remove(const char *filename); /* Layers */ -CDataFileLayer *cdf_layer_find(CDataFile *cdf, int type, char *name); -CDataFileLayer *cdf_layer_add(CDataFile *cdf, int type, char *name, size_t datasize); +CDataFileLayer *cdf_layer_find(CDataFile *cdf, int type, const char *name); +CDataFileLayer *cdf_layer_add(CDataFile *cdf, int type, const char *name, size_t datasize); #endif /* BKE_CUSTOMDATA_FILE_H */ diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h index 59a361c010d..7f4e809718c 100644 --- a/source/blender/blenkernel/BKE_effect.h +++ b/source/blender/blenkernel/BKE_effect.h @@ -129,7 +129,7 @@ void pd_point_from_soft(struct Scene *scene, float *loc, float *vel, int index, /* needed for boids */ float effector_falloff(struct EffectorCache *eff, struct EffectorData *efd, struct EffectedPoint *point, struct EffectorWeights *weights); -int closest_point_on_surface(struct SurfaceModifierData *surmd, float *co, float *surface_co, float *surface_nor, float *surface_vel); +int closest_point_on_surface(SurfaceModifierData *surmd, const float co[3], float surface_co[3], float surface_nor[3], float surface_vel[3]); int get_effector_data(struct EffectorCache *eff, struct EffectorData *efd, struct EffectedPoint *point, int real_velocity); /* required for particle_system.c */ diff --git a/source/blender/blenkernel/BKE_lamp.h b/source/blender/blenkernel/BKE_lamp.h new file mode 100644 index 00000000000..cc9452ae155 --- /dev/null +++ b/source/blender/blenkernel/BKE_lamp.h @@ -0,0 +1,51 @@ +/* + * ***** 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) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BKE_LAMP_H +#define BKE_LAMP_H + +/** \file BKE_lamp.h + * \ingroup bke + * \brief General operations, lookup, etc. for blender lamps. + */ +#ifdef __cplusplus +extern "C" { +#endif + +struct Lamp; + +void *add_lamp(const char *name); +struct Lamp *copy_lamp(struct Lamp *la); +struct Lamp *localize_lamp(struct Lamp *la); +void make_local_lamp(struct Lamp *la); +void free_lamp(struct Lamp *la); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h index 57c05637d50..dcca857179c 100644 --- a/source/blender/blenkernel/BKE_lattice.h +++ b/source/blender/blenkernel/BKE_lattice.h @@ -55,19 +55,19 @@ void end_latt_deform(struct Object *); int object_deform_mball(struct Object *ob, struct ListBase *dispbase); void outside_lattice(struct Lattice *lt); -void curve_deform_verts(struct Scene *scene, struct Object *cuOb, struct Object *target, - struct DerivedMesh *dm, float (*vertexCos)[3], - int numVerts, char *vgroup, short defaxis); -void curve_deform_vector(struct Scene *scene, struct Object *cuOb, struct Object *target, - float *orco, float *vec, float mat[][3], int no_rot_axis); +void curve_deform_verts(struct Scene *scene, struct Object *cuOb, struct Object *target, + struct DerivedMesh *dm, float (*vertexCos)[3], + int numVerts, const char *vgroup, short defaxis); +void curve_deform_vector(struct Scene *scene, struct Object *cuOb, struct Object *target, + float *orco, float *vec, float mat[][3], int no_rot_axis); void lattice_deform_verts(struct Object *laOb, struct Object *target, - struct DerivedMesh *dm, float (*vertexCos)[3], - int numVerts, char *vgroup); + struct DerivedMesh *dm, float (*vertexCos)[3], + int numVerts, const char *vgroup); void armature_deform_verts(struct Object *armOb, struct Object *target, - struct DerivedMesh *dm, float (*vertexCos)[3], - float (*defMats)[3][3], int numVerts, int deformflag, - float (*prevCos)[3], const char *defgrp_name); + struct DerivedMesh *dm, float (*vertexCos)[3], + float (*defMats)[3][3], int numVerts, int deformflag, + float (*prevCos)[3], const char *defgrp_name); float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3]; void lattice_applyVertexCos(struct Object *ob, float (*vertexCos)[3]); diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index 9130cac6cd6..ade055ac457 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -46,7 +46,7 @@ struct PointerRNA; struct PropertyRNA; void *alloc_libblock(struct ListBase *lb, short type, const char *name); -void *copy_libblock(void *rt); +void *copy_libblock(struct ID *id); void copy_libblock_data(struct ID *id, const struct ID *id_from, const short do_action); void BKE_id_lib_local_paths(struct Main *bmain, struct ID *id); @@ -64,7 +64,7 @@ void id_clear_lib_data(struct Main *bmain, struct ID *id); struct ListBase *which_libbase(struct Main *mainlib, short type); -#define MAX_LIBARRAY 39 +#define MAX_LIBARRAY 40 int set_listbasepointers(struct Main *main, struct ListBase **lb); void free_libblock(struct ListBase *lb, void *idv); diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h index 2f587d3b29c..28eb59ebdb6 100644 --- a/source/blender/blenkernel/BKE_main.h +++ b/source/blender/blenkernel/BKE_main.h @@ -85,6 +85,7 @@ typedef struct Main { ListBase particle; ListBase wm; ListBase gpencil; + ListBase movieclip; char id_tag_update[256]; } Main; diff --git a/source/blender/blenkernel/BKE_movieclip.h b/source/blender/blenkernel/BKE_movieclip.h new file mode 100644 index 00000000000..4d16df8afa3 --- /dev/null +++ b/source/blender/blenkernel/BKE_movieclip.h @@ -0,0 +1,70 @@ +/* + * ***** 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 ***** + */ + +#ifndef BKE_MOVIECLIP_H +#define BKE_MOVIECLIP_H + +/** \file BKE_movieclip.h + * \ingroup bke + * \author Sergey Sharybin + */ + +struct ImBuf; +struct Main; +struct MovieClip; +struct MovieClipScopes; +struct MovieClipUser; +struct MovieTrackingTrack; +struct MovieDistortion; + +void free_movieclip(struct MovieClip *clip); +void unlink_movieclip(struct Main *bmain, struct MovieClip *clip); + +struct MovieClip *BKE_add_movieclip_file(const char *name); +void BKE_movieclip_reload(struct MovieClip *clip); + +struct ImBuf *BKE_movieclip_get_ibuf(struct MovieClip *clip, struct MovieClipUser *user); +struct ImBuf *BKE_movieclip_get_stable_ibuf(struct MovieClip *clip, struct MovieClipUser *user, float loc[2], float *scale, float *angle); +struct ImBuf *BKE_movieclip_get_ibuf_flag(struct MovieClip *clip, struct MovieClipUser *user, int flag); +void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height); +void BKE_movieclip_aspect(struct MovieClip *clip, float *aspx, float *aspy); +int BKE_movieclip_has_frame(struct MovieClip *clip, struct MovieClipUser *user); +void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr); + +void BKE_movieclip_select_track(struct MovieClip *clip, struct MovieTrackingTrack *track, int area, int extend); + +void BKE_movieclip_update_scopes(struct MovieClip *clip, struct MovieClipUser *user, struct MovieClipScopes *scopes); + +void BKE_movieclip_get_cache_segments(struct MovieClip *clip, struct MovieClipUser *user, int *totseg_r, int **points_r); + +void BKE_movieclip_build_proxy_frame(struct MovieClip *clip, struct MovieDistortion *distortion, + int cfra, int *build_sizes, int build_count, int undistorted); + +#define TRACK_CLEAR_UPTO 0 +#define TRACK_CLEAR_REMAINED 1 +#define TRACK_CLEAR_ALL 2 + +#endif diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 7509205e968..278e57125c5 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -567,6 +567,10 @@ void ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMaterial *mat); #define CMP_NODE_COLOR_MATTE 259 #define CMP_NODE_COLORBALANCE 260 #define CMP_NODE_HUECORRECT 261 +#define CMP_NODE_MOVIECLIP 262 +#define CMP_NODE_STABILIZE2D 263 +#define CMP_NODE_TRANSFORM 264 +#define CMP_NODE_MOVIEDISTORTION 265 #define CMP_NODE_GLARE 301 #define CMP_NODE_TONEMAP 302 diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index c5a24c1e5e9..2ef942a2e09 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -48,6 +48,7 @@ struct Group; struct bAction; struct RenderData; struct rctf; +struct MovieClip; void clear_workob(struct Object *workob); void what_does_parent(struct Scene *scene, struct Object *ob, struct Object *workob); @@ -74,18 +75,7 @@ void object_copy_proxy_drivers(struct Object *ob, struct Object *target); void unlink_object(struct Object *ob); int exist_object(struct Object *obtest); -void *add_camera(const char *name); -struct Camera *copy_camera(struct Camera *cam); -void make_local_camera(struct Camera *cam); -float dof_camera(struct Object *ob); -void *add_lamp(const char *name); -struct Lamp *copy_lamp(struct Lamp *la); -struct Lamp *localize_lamp(struct Lamp *la); -void make_local_lamp(struct Lamp *la); -void free_camera(struct Camera *ca); -void free_lamp(struct Lamp *la); - struct Object *add_only_object(int type, const char *name); struct Object *add_object(struct Scene *scene, int type); @@ -97,7 +87,6 @@ void set_mblur_offs(float blur); void set_field_offs(float field); void disable_speed_curve(int val); -float bsystem_time(struct Scene *scene, struct Object *ob, float cfra, float ofs); void object_scale_to_mat3(struct Object *ob, float mat[][3]); void object_rot_to_mat3(struct Object *ob, float mat[][3]); void object_mat3_to_rot(struct Object *ob, float mat[][3], short use_compat); @@ -111,6 +100,7 @@ struct Object *object_pose_armature_get(struct Object *ob); void where_is_object_time(struct Scene *scene, struct Object *ob, float ctime); void where_is_object(struct Scene *scene, struct Object *ob); void where_is_object_simul(struct Scene *scene, struct Object *ob); +void where_is_object_mat(struct Scene *scene, struct Object *ob, float obmat[4][4]); struct BoundBox *unit_boundbox(void); void boundbox_set_from_min_max(struct BoundBox *bb, float min[3], float max[3]); @@ -118,7 +108,7 @@ struct BoundBox *object_get_boundbox(struct Object *ob); void object_get_dimensions(struct Object *ob, float *value); void object_set_dimensions(struct Object *ob, const float *value); void object_boundbox_flag(struct Object *ob, int flag, int set); -void minmax_object(struct Object *ob, float *min, float *max); +void minmax_object(struct Object *ob, float min[3], float max[3]); int minmax_object_duplis(struct Scene *scene, struct Object *ob, float *min, float *max); void solve_tracking (struct Object *ob, float targetmat[][4]); int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3]); @@ -129,7 +119,6 @@ void object_tfm_restore(struct Object *ob, void *obtfm_pt); void object_handle_update(struct Scene *scene, struct Object *ob); void object_sculpt_modifiers_changed(struct Object *ob); -float give_timeoffset(struct Object *ob); int give_obdata_texspace(struct Object *ob, short **texflag, float **loc, float **size, float **rot); int object_insert_ptcache(struct Object *ob); @@ -138,22 +127,10 @@ struct KeyBlock *object_insert_shape_key(struct Scene *scene, struct Object *ob, int object_is_modified(struct Scene *scene, struct Object *ob); -void object_camera_mode(struct RenderData *rd, struct Object *camera); -void object_camera_intrinsics(struct Object *camera, struct Camera **cam_r, short *is_ortho, float *shiftx, float *shifty, - float *clipsta, float *clipend, float *lens, float *sensor_x, float *sensor_y, short *sensor_fit); -void object_camera_matrix( - struct RenderData *rd, struct Object *camera, int winx, int winy, short field_second, - float winmat[][4], struct rctf *viewplane, float *clipsta, float *clipend, float *lens, - float *sensor_x, float *sensor_y, short *sensor_fit, float *ycor, - float *viewdx, float *viewdy); - -void camera_view_frame_ex(struct Scene *scene, struct Camera *camera, float drawsize, const short do_clip, const float scale[3], - float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]); - -void camera_view_frame(struct Scene *scene, struct Camera *camera, float r_vec[4][3]); - void object_relink(struct Object *ob); +struct MovieClip *object_get_movieclip(struct Scene *scene, struct Object *ob, int use_default); + #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index c4284d2cf0a..c66e49f2906 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -254,8 +254,8 @@ void psys_render_restore(struct Object *ob, struct ParticleSystem *psys); int psys_render_simplify_distribution(struct ParticleThreadContext *ctx, int tot); int psys_render_simplify_params(struct ParticleSystem *psys, struct ChildParticle *cpa, float *params); -void psys_interpolate_uvs(struct MTFace *tface, int quad, float *uv, float *uvco); -void psys_interpolate_mcol(struct MCol *mcol, int quad, float *uv, struct MCol *mc); +void psys_interpolate_uvs(const struct MTFace *tface, int quad, const float w[4], float uvco[2]); +void psys_interpolate_mcol(const struct MCol *mcol, int quad, const float w[4], struct MCol *mc); void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int time); @@ -335,12 +335,12 @@ void psys_get_from_key(struct ParticleKey *key, float *loc, float *vel, float *r /* BLI_bvhtree_ray_cast callback */ void BKE_psys_collision_neartest_cb(void *userdata, int index, const struct BVHTreeRay *ray, struct BVHTreeRayHit *hit); -void psys_particle_on_dm(struct DerivedMesh *dm, int from, int index, int index_dmcache, float *fw, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor); +void psys_particle_on_dm(struct DerivedMesh *dm, int from, int index, int index_dmcache, const float fw[4], float foffset, float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3], float ornor[3]); /* particle_system.c */ void initialize_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, int p); void psys_calc_dmcache(struct Object *ob, struct DerivedMesh *dm, struct ParticleSystem *psys); -int psys_particle_dm_face_lookup(struct Object *ob, struct DerivedMesh *dm, int index, float *fw, struct LinkNode *node); +int psys_particle_dm_face_lookup(struct Object *ob, struct DerivedMesh *dm, int index, const float fw[4], struct LinkNode *node); void reset_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, float dtime, float cfra); diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index d57196d4e4e..9f4fae7dc2e 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -326,7 +326,7 @@ void BKE_ptcache_mem_to_disk(struct PTCacheID *pid); void BKE_ptcache_toggle_disk_cache(struct PTCacheID *pid); /* Rename all disk cache files with a new name. Doesn't touch the actual content of the files. */ -void BKE_ptcache_disk_cache_rename(struct PTCacheID *pid, char *from, char *to); +void BKE_ptcache_disk_cache_rename(struct PTCacheID *pid, const char *name_src, const char *name_dst); /* Loads simulation from external (disk) cache files. */ void BKE_ptcache_load_external(struct PTCacheID *pid); diff --git a/source/blender/blenkernel/BKE_property.h b/source/blender/blenkernel/BKE_property.h index ce0ea3dcc9a..779c83acf21 100644 --- a/source/blender/blenkernel/BKE_property.h +++ b/source/blender/blenkernel/BKE_property.h @@ -44,11 +44,10 @@ struct bProperty *new_property(int type); void unique_property(struct bProperty *first, struct bProperty *prop, int force); struct bProperty *get_ob_property(struct Object *ob, const char *name); void set_ob_property(struct Object *ob, struct bProperty *propc); -int compare_property(struct bProperty *prop, char *str); -void set_property(struct bProperty *prop, char *str); -void add_property(struct bProperty *prop, char *str); +int compare_property(struct bProperty *prop, const char *str); +void set_property(struct bProperty *prop, const char *str); +void add_property(struct bProperty *prop, const char *str); void set_property_valstr(struct bProperty *prop, char *str); void cp_property(struct bProperty *prop1, struct bProperty *prop2); #endif - diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 4806a288cee..ad394f9fb1a 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -86,6 +86,7 @@ void scene_select_base(struct Scene *sce, struct Base *selbase); int scene_check_setscene(struct Main *bmain, struct Scene *sce); float BKE_curframe(struct Scene *scene); +float BKE_frame_to_ctime(struct Scene *scene, const float frame); void scene_update_tagged(struct Main *bmain, struct Scene *sce); void scene_clear_tagged(struct Main *bmain, struct Scene *sce); diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 917b62c27cf..a16e55ce8ff 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -274,7 +274,7 @@ struct Sequence *seq_metastrip( struct Sequence * meta /* = NULL */, struct Sequence *seq); void seq_offset_animdata(struct Scene *scene, struct Sequence *seq, int ofs); -void seq_dupe_animdata(struct Scene *scene, char *name_from, char *name_to); +void seq_dupe_animdata(struct Scene *scene, const char *name_src, const char *name_dst); int shuffle_seq(struct ListBase * seqbasep, struct Sequence *test, struct Scene *evil_scene); int shuffle_seq_time(ListBase * seqbasep, struct Scene *evil_scene); int seqbase_isolated_sel_check(struct ListBase *seqbase); diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h index 2a613522686..a951347d946 100644 --- a/source/blender/blenkernel/BKE_text.h +++ b/source/blender/blenkernel/BKE_text.h @@ -56,7 +56,7 @@ void write_text(struct Text *text, const char *str); char* txt_to_buf (struct Text *text); void txt_clean_text (struct Text *text); void txt_order_cursors (struct Text *text); -int txt_find_string (struct Text *text, char *findstr, int wrap, int match_case); +int txt_find_string (struct Text *text, const char *findstr, int wrap, int match_case); int txt_has_sel (struct Text *text); int txt_get_span (struct TextLine *from, struct TextLine *to); void txt_move_up (struct Text *text, short sel); diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h new file mode 100644 index 00000000000..a8fb2c836de --- /dev/null +++ b/source/blender/blenkernel/BKE_tracking.h @@ -0,0 +1,145 @@ +/* + * ***** 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 ***** + */ + +#ifndef BKE_TRACKING_H +#define BKE_TRACKING_H + +/** \file BKE_trackingp.h + * \ingroup bke + * \author Sergey Sharybin + */ + +struct bGPDlayer; +struct ImBuf; +struct MovieTrackingTrack; +struct MovieTrackingMarker; +struct MovieTracking; +struct MovieTrackingContext; +struct MovieClipUser; +struct MovieDistortion; +struct Camera; +struct Object; +struct Scene; + +void BKE_tracking_clamp_track(struct MovieTrackingTrack *track, int event); +void BKE_tracking_track_flag(struct MovieTrackingTrack *track, int area, int flag, int clear); + +struct MovieTrackingTrack *BKE_tracking_add_track(struct MovieTracking *tracking, float x, float y, + int framenr, int width, int height); +void BKE_tracking_insert_marker(struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker); +void BKE_tracking_delete_marker(struct MovieTrackingTrack *track, int framenr); + +struct MovieTrackingMarker *BKE_tracking_get_marker(struct MovieTrackingTrack *track, int framenr); +struct MovieTrackingMarker *BKE_tracking_ensure_marker(struct MovieTrackingTrack *track, int framenr); +struct MovieTrackingMarker *BKE_tracking_exact_marker(struct MovieTrackingTrack *track, int framenr); +int BKE_tracking_has_marker(struct MovieTrackingTrack *track, int framenr); + +void BKE_tracking_free_track(struct MovieTrackingTrack *track); +struct MovieTrackingTrack *BKE_tracking_copy_track(struct MovieTrackingTrack *track); + +void BKE_tracking_clear_path(struct MovieTrackingTrack *track, int ref_frame, int action); + +int BKE_tracking_test_join_tracks(struct MovieTrackingTrack *dst_track, struct MovieTrackingTrack *src_track); +void BKE_tracking_join_tracks(struct MovieTrackingTrack *dst_track, struct MovieTrackingTrack *src_track); +void BKE_tracking_free(struct MovieTracking *tracking); + +struct ImBuf *BKE_tracking_get_pattern_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track, + struct MovieTrackingMarker *marker, int margin, int anchored, float pos[2], int origin[2]); +struct ImBuf *BKE_tracking_get_search_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track, + struct MovieTrackingMarker *marker, int margin, int anchored, float pos[2], int origin[2]); + +void BKE_track_unique_name(struct MovieTracking *tracking, struct MovieTrackingTrack *track); + +struct MovieTrackingTrack *BKE_tracking_named_track(struct MovieTracking *tracking, const char *name); +struct MovieTrackingTrack *BKE_tracking_indexed_track(struct MovieTracking *tracking, int tracknr); + +void BKE_tracking_camera_shift(struct MovieTracking *tracking, int winx, int winy, float *shiftx, float *shifty); +void BKE_tracking_camera_to_blender(struct MovieTracking *tracking, struct Scene *scene, struct Camera *camera, int width, int height); + +void BKE_get_tracking_mat(struct Scene *scene, struct Object *ob, float mat[4][4]); +void BKE_tracking_projection_matrix(struct MovieTracking *tracking, int framenr, int winx, int winy, float mat[4][4]); + +/* 2D tracking */ +struct MovieTrackingContext *BKE_tracking_context_new(struct MovieClip *clip, struct MovieClipUser *user, + short backwards, short disable_failed); +void BKE_tracking_context_free(struct MovieTrackingContext *context); +void BKE_tracking_sync(struct MovieTrackingContext *context); +void BKE_tracking_sync_user(struct MovieClipUser *user, struct MovieTrackingContext *context); +int BKE_tracking_next(struct MovieTrackingContext *context); + +/* Camera solving */ +float BKE_tracking_solve_reconstruction(struct MovieTracking *tracking, int width, int height); + +struct MovieReconstructedCamera *BKE_tracking_get_reconstructed_camera(struct MovieTracking *tracking, int framenr); +void BKE_tracking_get_interpolated_camera(struct MovieTracking *tracking, int framenr, float mat[4][4]); + +/* Feature detection */ +void BKE_tracking_detect_fast(struct MovieTracking *tracking, struct ImBuf *imbuf, + int framenr, int margin, int min_trackness, int min_distance, struct bGPDlayer *layer, + int place_outside_layer); + +/* 2D stabilization */ +void BKE_tracking_stabilization_data(struct MovieTracking *tracking, int framenr, int width, int height, float loc[2], float *scale, float *angle); +struct ImBuf *BKE_tracking_stabilize(struct MovieTracking *tracking, int framenr, struct ImBuf *ibuf, float loc[2], float *scale, float *angle); +void BKE_tracking_stabdata_to_mat4(int width, int height, float loc[2], float scale, float angle, float mat[4][4]); + +/* Distortion/Undistortion */ +void BKE_tracking_apply_intrinsics(struct MovieTracking *tracking, float co[2], float nco[2]); +void BKE_tracking_invert_intrinsics(struct MovieTracking *tracking, float co[2], float nco[2]); + +struct MovieDistortion *BKE_tracking_distortion_create(void); +struct MovieDistortion *BKE_tracking_distortion_copy(struct MovieDistortion *distortion); +struct ImBuf *BKE_tracking_distortion_exec(struct MovieDistortion *distortion, struct MovieTracking *tracking, + struct ImBuf *ibuf, int width, int height, float overscan, int undistort); +void BKE_tracking_distortion_destroy(struct MovieDistortion *distortion); + +struct ImBuf *BKE_tracking_undistort(struct MovieTracking *tracking, struct ImBuf *ibuf, int width, int height, float overscan); +struct ImBuf *BKE_tracking_distort(struct MovieTracking *tracking, struct ImBuf *ibuf, int width, int height, float overscan); + +/* Select */ +void BKE_tracking_select_track(struct MovieTracking *tracking, struct MovieTrackingTrack *track, int area, int extend); +void BKE_tracking_deselect_track(struct MovieTrackingTrack *track, int area); + +#define TRACK_SELECTED(track) ((((track)->flag&TRACK_HIDDEN)==0) && ((track)->flag&SELECT || (track)->pat_flag&SELECT || (track)->search_flag&SELECT)) +#define TRACK_AREA_SELECTED(track, area) ((((track)->flag&TRACK_HIDDEN)==0) && ((area)==TRACK_AREA_POINT?(track)->flag&SELECT : ((area)==TRACK_AREA_PAT?(track)->pat_flag&SELECT:(track)->search_flag&SELECT))) +#define TRACK_VIEW_SELECTED(sc, track) ((TRACK_AREA_SELECTED(track, TRACK_AREA_POINT) || (((sc)->flag&SC_SHOW_MARKER_PATTERN && TRACK_AREA_SELECTED(track, TRACK_AREA_PAT))) || (((sc)->flag&SC_SHOW_MARKER_SEARCH && TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH))))) + +#define MARKER_VISIBLE(sc, marker) (((marker)->flag&MARKER_DISABLED)==0 || ((sc)->flag&SC_HIDE_DISABLED)==0) + +#define CLAMP_PAT_DIM 1 +#define CLAMP_PAT_POS 2 +#define CLAMP_SEARCH_DIM 3 +#define CLAMP_SEARCH_POS 4 +#define CLAMP_PYRAMID_LEVELS 5 + +#define TRACK_AREA_NONE -1 +#define TRACK_AREA_POINT 1 +#define TRACK_AREA_PAT 2 +#define TRACK_AREA_SEARCH 4 + +#define TRACK_AREA_ALL (TRACK_AREA_POINT|TRACK_AREA_PAT|TRACK_AREA_SEARCH) + +#endif diff --git a/source/blender/blenkernel/BKE_unit.h b/source/blender/blenkernel/BKE_unit.h index 1f54e4eeef0..db586f6d262 100644 --- a/source/blender/blenkernel/BKE_unit.h +++ b/source/blender/blenkernel/BKE_unit.h @@ -37,10 +37,10 @@ extern "C" { void bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, int pad); /* replace units with values, used before python button evaluation */ -int bUnit_ReplaceString(char *str, int len_max, char *str_prev, double scale_pref, int system, int type); +int bUnit_ReplaceString(char *str, int len_max, const char *str_prev, double scale_pref, int system, int type); /* make string keyboard-friendly: 10µm --> 10um */ -void bUnit_ToUnitAltName(char *str, int len_max, char *orig_str, int system, int type); +void bUnit_ToUnitAltName(char *str, int len_max, const char *orig_str, int system, int type); /* the size of the unit used for this value (used for calculating the ckickstep) */ double bUnit_ClosestScalar(double value, int system, int type); diff --git a/source/blender/blenkernel/BKE_writeffmpeg.h b/source/blender/blenkernel/BKE_writeffmpeg.h index 2b10f1b246c..3263a1659f3 100644 --- a/source/blender/blenkernel/BKE_writeffmpeg.h +++ b/source/blender/blenkernel/BKE_writeffmpeg.h @@ -74,7 +74,7 @@ void filepath_ffmpeg(char* string, struct RenderData* rd); extern void ffmpeg_set_preset(struct RenderData *rd, int preset); extern void ffmpeg_verify_image_type(struct RenderData *rd); -extern struct IDProperty *ffmpeg_property_add(struct RenderData *Rd, char *type, int opt_index, int parent_index); +extern struct IDProperty *ffmpeg_property_add(struct RenderData *Rd, const char *type, int opt_index, int parent_index); extern int ffmpeg_property_add_string(struct RenderData *rd, const char *type, const char *str); extern void ffmpeg_property_del(struct RenderData *rd, void *type, void *prop_); diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 290dce96828..bb94cb933c0 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -76,6 +76,7 @@ set(SRC intern/brush.c intern/bullet.c intern/bvhutils.c + intern/camera.c intern/cdderivedmesh.c intern/cloth.c intern/collision.c @@ -104,6 +105,7 @@ set(SRC intern/implicit.c intern/ipo.c intern/key.c + intern/lamp.c intern/lattice.c intern/library.c intern/material.c @@ -111,6 +113,7 @@ set(SRC intern/mesh.c intern/mesh_validate.c intern/modifier.c + intern/movieclip.c intern/multires.c intern/nla.c intern/node.c @@ -139,6 +142,7 @@ set(SRC intern/suggestions.c intern/text.c intern/texture.c + intern/tracking.c intern/unit.c intern/world.c intern/writeavi.c @@ -161,6 +165,7 @@ set(SRC BKE_brush.h BKE_bullet.h BKE_bvhutils.h + BKE_camera.h BKE_cdderivedmesh.h BKE_cloth.h BKE_collision.h @@ -186,6 +191,7 @@ set(SRC BKE_image.h BKE_ipo.h BKE_key.h + BKE_lamp.h BKE_lattice.h BKE_library.h BKE_main.h @@ -193,6 +199,7 @@ set(SRC BKE_mball.h BKE_mesh.h BKE_modifier.h + BKE_movieclip.h BKE_multires.h BKE_nla.h BKE_node.h @@ -219,6 +226,7 @@ set(SRC BKE_suggestions.h BKE_text.h BKE_texture.h + BKE_tracking.h BKE_unit.h BKE_utildefines.h BKE_world.h @@ -362,6 +370,11 @@ if(WITH_GAMEENGINE) add_definitions(-DWITH_GAMEENGINE) endif() +if(WITH_LIBMV) + list(APPEND INC ../../../extern/libmv) + add_definitions(-DWITH_LIBMV) +endif() + ## Warnings as errors, this is too strict! #if(MSVC) # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index ebb09352a55..48a68c433a6 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -96,6 +96,10 @@ if env['WITH_BF_GAMEENGINE']: else: sources.remove('intern' + os.sep + 'navmesh_conversion.c') +if env['WITH_BF_LIBMV']: + incs += ' #/extern/libmv' + defs.append('WITH_LIBMV') + if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 9023a444b7b..5c447d1a7f6 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -292,7 +292,7 @@ void DM_to_meshkey(DerivedMesh *dm, Mesh *me, KeyBlock *kb) mvert=dm->getVertDataArray(dm, CD_MVERT); for(a=0; a<kb->totelem; a++, fp+=3, mvert++) { - VECCOPY(fp, mvert->co); + copy_v3_v3(fp, mvert->co); } } @@ -604,12 +604,12 @@ static void emDM_drawUVEdges(DerivedMesh *dm) static void emDM__calcFaceCent(EditFace *efa, float cent[3], float (*vertexCos)[3]) { if (vertexCos) { - VECCOPY(cent, vertexCos[(int) efa->v1->tmp.l]); + copy_v3_v3(cent, vertexCos[(int) efa->v1->tmp.l]); add_v3_v3(cent, vertexCos[(int) efa->v2->tmp.l]); add_v3_v3(cent, vertexCos[(int) efa->v3->tmp.l]); if (efa->v4) add_v3_v3(cent, vertexCos[(int) efa->v4->tmp.l]); } else { - VECCOPY(cent, efa->v1->co); + copy_v3_v3(cent, efa->v1->co); add_v3_v3(cent, efa->v2->co); add_v3_v3(cent, efa->v3->co); if (efa->v4) add_v3_v3(cent, efa->v4->co); @@ -1184,7 +1184,7 @@ static void emDM_getVert(DerivedMesh *dm, int index, MVert *vert_r) for(i = 0; i < index; ++i) ev = ev->next; - VECCOPY(vert_r->co, ev->co); + copy_v3_v3(vert_r->co, ev->co); normal_float_to_short_v3(vert_r->no, ev->no); @@ -1539,8 +1539,9 @@ static float *get_editmesh_orco_verts(EditMesh *em) orco = MEM_mallocN(sizeof(float)*3*totvert, "EditMesh Orco"); - for(a=0, eve=em->verts.first; eve; eve=eve->next, a+=3) - VECCOPY(orco+a, eve->co); + for(a=0, eve=em->verts.first; eve; eve=eve->next, a+=3) { + copy_v3_v3(orco+a, eve->co); + } return orco; } @@ -2151,7 +2152,7 @@ float (*editmesh_get_vertex_cos(EditMesh *em, int *numVerts_r))[3] cos = MEM_mallocN(sizeof(*cos)*numVerts, "vertexcos"); for (i=0,eve=em->verts.first; i<numVerts; i++,eve=eve->next) { - VECCOPY(cos[i], eve->co); + copy_v3_v3(cos[i], eve->co); } return cos; @@ -2659,7 +2660,7 @@ static void GetPosition(const SMikkTSpaceContext * pContext, float fPos[], const //assert(vert_index>=0 && vert_index<4); SGLSLMeshToTangent * pMesh = (SGLSLMeshToTangent *) pContext->m_pUserData; const float *co= pMesh->mvert[(&pMesh->mface[face_num].v1)[vert_index]].co; - VECCOPY(fPos, co); + copy_v3_v3(fPos, co); } static void GetTextureCoordinate(const SMikkTSpaceContext * pContext, float fUV[], const int face_num, const int vert_index) @@ -2685,7 +2686,7 @@ static void GetNormal(const SMikkTSpaceContext * pContext, float fNorm[], const const int smoothnormal = (pMesh->mface[face_num].flag & ME_SMOOTH); if(!smoothnormal) { // flat if(pMesh->precomputedFaceNormals) { - VECCOPY(fNorm, &pMesh->precomputedFaceNormals[3*face_num]); + copy_v3_v3(fNorm, &pMesh->precomputedFaceNormals[3*face_num]); } else { MFace *mf= &pMesh->mface[face_num]; @@ -2712,7 +2713,7 @@ static void SetTSpace(const SMikkTSpaceContext * pContext, const float fvTangent //assert(vert_index>=0 && vert_index<4); SGLSLMeshToTangent * pMesh = (SGLSLMeshToTangent *) pContext->m_pUserData; float * pRes = pMesh->tangent[4*face_num+iVert]; - VECCOPY(pRes, fvTangent); + copy_v3_v3(pRes, fvTangent); pRes[3]=fSign; } diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 944f7c6a0b6..5fb03b7bbd0 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -185,7 +185,7 @@ bAction *copy_action (bAction *src) if (src == NULL) return NULL; - dst= copy_libblock(src); + dst= copy_libblock(&src->id); /* duplicate the lists of groups and markers */ BLI_duplicatelist(&dst->groups, &src->groups); diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index f939c168f51..c1f294fb102 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1230,7 +1230,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p if(G.rendering == 0) no_draw_flag |= PARS_NO_DISP; - ctime = bsystem_time(scene, par, (float)scene->r.cfra, 0.0); + ctime = BKE_curframe(scene); /* NOTE: in old animsys, used parent object's timeoffset... */ totpart = psys->totpart; totchild = psys->totchild; diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 6d94b42a7ac..63ab74fc105 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -545,7 +545,7 @@ void BKE_animdata_separate_by_basepath (ID *srcID, ID *dstID, ListBase *basepath /* Path Validation -------------------------------------------- */ /* Check if a given RNA Path is valid, by tracing it from the given ID, and seeing if we can resolve it */ -static short check_rna_path_is_valid (ID *owner_id, char *path) +static short check_rna_path_is_valid (ID *owner_id, const char *path) { PointerRNA id_ptr, ptr; PropertyRNA *prop=NULL; @@ -560,7 +560,7 @@ static short check_rna_path_is_valid (ID *owner_id, char *path) /* Check if some given RNA Path needs fixing - free the given path and set a new one as appropriate * NOTE: we assume that oldName and newName have [" "] padding around them */ -static char *rna_path_rename_fix (ID *owner_id, const char *prefix, char *oldName, char *newName, char *oldpath, int verify_paths) +static char *rna_path_rename_fix (ID *owner_id, const char *prefix, const char *oldName, const char *newName, char *oldpath, int verify_paths) { char *prefixPtr= strstr(oldpath, prefix); char *oldNamePtr= strstr(oldpath, oldName); @@ -631,7 +631,7 @@ static void fcurves_path_rename_fix (ID *owner_id, const char *prefix, char *old } /* Check RNA-Paths for a list of Drivers */ -static void drivers_path_rename_fix (ID *owner_id, const char *prefix, char *oldName, char *newName, char *oldKey, char *newKey, ListBase *curves, int verify_paths) +static void drivers_path_rename_fix (ID *owner_id, const char *prefix, const char *oldName, const char *newName, const char *oldKey, const char *newKey, ListBase *curves, int verify_paths) { FCurve *fcu; @@ -691,7 +691,7 @@ static void nlastrips_path_rename_fix (ID *owner_id, const char *prefix, char *o * NOTE: it is assumed that the structure we're replacing is <prefix><["><name><"]> * i.e. pose.bones["Bone"] */ -void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, const char *prefix, char *oldName, char *newName, int oldSubscript, int newSubscript, int verify_paths) +void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, int verify_paths) { NlaTrack *nlt; char *oldN, *newN; @@ -808,7 +808,7 @@ void BKE_animdata_main_cb (Main *mainptr, ID_AnimData_Edit_Callback func, void * * i.e. pose.bones["Bone"] */ /* TODO: use BKE_animdata_main_cb for looping over all data */ -void BKE_all_animdata_fix_paths_rename (char *prefix, char *oldName, char *newName) +void BKE_all_animdata_fix_paths_rename (const char *prefix, const char *oldName, const char *newName) { Main *mainptr= G.main; ID *id; diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index e9a19b50a81..a9c29728650 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -68,6 +68,7 @@ #include "BKE_lattice.h" #include "BKE_main.h" #include "BKE_object.h" +#include "BKE_scene.h" #include "BIK_api.h" #include "BKE_sketch.h" @@ -203,7 +204,7 @@ bArmature *copy_armature(bArmature *arm) Bone *oldBone, *newBone; Bone *newActBone= NULL; - newArm= copy_libblock (arm); + newArm= copy_libblock(&arm->id); BLI_duplicatelist(&newArm->bonebase, &arm->bonebase); /* Duplicate the childrens' lists*/ @@ -1817,7 +1818,7 @@ static void splineik_init_tree_from_pchan(Scene *scene, Object *UNUSED(ob), bPos tree->ikData= ikData; /* AND! link the tree to the root */ - BLI_addtail(&pchanRoot->iktree, tree); + BLI_addtail(&pchanRoot->siktree, tree); } /* mark root channel having an IK tree */ @@ -2044,27 +2045,24 @@ static void splineik_execute_tree(Scene *scene, Object *ob, bPoseChannel *pchan_ tSplineIK_Tree *tree; /* for each pose-tree, execute it if it is spline, otherwise just free it */ - for (tree= pchan_root->iktree.first; tree; tree= pchan_root->iktree.first) { - /* only evaluate if tagged for Spline IK */ - if (tree->type == CONSTRAINT_TYPE_SPLINEIK) { - int i; - - /* walk over each bone in the chain, calculating the effects of spline IK - * - the chain is traversed in the opposite order to storage order (i.e. parent to children) - * so that dependencies are correct - */ - for (i= tree->chainlen-1; i >= 0; i--) { - bPoseChannel *pchan= tree->chain[i]; - splineik_evaluate_bone(tree, scene, ob, pchan, i, ctime); - } - - /* free the tree info specific to SplineIK trees now */ - if (tree->chain) MEM_freeN(tree->chain); - if (tree->free_points) MEM_freeN(tree->points); + while ((tree = pchan_root->siktree.first) != NULL) { + int i; + + /* walk over each bone in the chain, calculating the effects of spline IK + * - the chain is traversed in the opposite order to storage order (i.e. parent to children) + * so that dependencies are correct + */ + for (i= tree->chainlen-1; i >= 0; i--) { + bPoseChannel *pchan= tree->chain[i]; + splineik_evaluate_bone(tree, scene, ob, pchan, i, ctime); } + /* free the tree info specific to SplineIK trees now */ + if (tree->chain) MEM_freeN(tree->chain); + if (tree->free_points) MEM_freeN(tree->points); + /* free this tree */ - BLI_freelinkN(&pchan_root->iktree, tree); + BLI_freelinkN(&pchan_root->siktree, tree); } } @@ -2406,7 +2404,7 @@ void where_is_pose (Scene *scene, Object *ob) if((ob->pose==NULL) || (ob->pose->flag & POSE_RECALC)) armature_rebuild_pose(ob, arm); - ctime= bsystem_time(scene, ob, (float)scene->r.cfra, 0.0); /* not accurate... */ + ctime= BKE_curframe(scene); /* not accurate... */ /* In editmode or restposition we read the data from the bones */ if(arm->edbo || (arm->flag & ARM_RESTPOS)) { diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index d68b0b361d1..0e8d598da3d 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -663,7 +663,7 @@ int BKE_undo_valid(const char *name) /* get name of undo item, return null if no item with this index */ /* if active pointer, set it to 1 if true */ -char *BKE_undo_get_name(int nr, int *active) +const char *BKE_undo_get_name(int nr, int *active) { UndoElem *uel= BLI_findlink(&undobase, nr); diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index 3ae81c70d4f..c9868bd900f 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -162,7 +162,7 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, negate_v3_v3(efd.vec_to_point, bpa->gravity); } - VECCOPY(bbd->wanted_co, efd.vec_to_point); + copy_v3_v3(bbd->wanted_co, efd.vec_to_point); mul_v3_fl(bbd->wanted_co, mul); bbd->wanted_speed = val->max_speed * priority; @@ -204,7 +204,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues * BVHTreeRayHit hit; float radius = val->personal_space * pa->size, ray_dir[3]; - VECCOPY(col.co1, pa->prev_state.co); + copy_v3_v3(col.co1, pa->prev_state.co); add_v3_v3v3(col.co2, pa->prev_state.co, pa->prev_state.vel); sub_v3_v3v3(ray_dir, col.co2, col.co1); mul_v3_fl(ray_dir, acbr->look_ahead); @@ -254,10 +254,10 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues * { neighbors = BLI_kdtree_range_search(bbd->sim->psys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn); if(neighbors > 1) for(n=1; n<neighbors; n++) { - VECCOPY(co1, pa->prev_state.co); - VECCOPY(vel1, pa->prev_state.vel); - VECCOPY(co2, (bbd->sim->psys->particles + ptn[n].index)->prev_state.co); - VECCOPY(vel2, (bbd->sim->psys->particles + ptn[n].index)->prev_state.vel); + copy_v3_v3(co1, pa->prev_state.co); + copy_v3_v3(vel1, pa->prev_state.vel); + copy_v3_v3(co2, (bbd->sim->psys->particles + ptn[n].index)->prev_state.co); + copy_v3_v3(vel2, (bbd->sim->psys->particles + ptn[n].index)->prev_state.vel); sub_v3_v3v3(loc, co1, co2); @@ -270,8 +270,8 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues * t = -dot_v3v3(loc, vec)/inp; /* cpa is not too far in the future so investigate further */ if(t > 0.0f && t < t_min) { - VECADDFAC(co1, co1, vel1, t); - VECADDFAC(co2, co2, vel2, t); + madd_v3_v3fl(co1, vel1, t); + madd_v3_v3fl(co2, vel2, t); sub_v3_v3v3(vec, co2, co1); @@ -300,10 +300,10 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues * if(epsys) { neighbors = BLI_kdtree_range_search(epsys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn); if(neighbors > 0) for(n=0; n<neighbors; n++) { - VECCOPY(co1, pa->prev_state.co); - VECCOPY(vel1, pa->prev_state.vel); - VECCOPY(co2, (epsys->particles + ptn[n].index)->prev_state.co); - VECCOPY(vel2, (epsys->particles + ptn[n].index)->prev_state.vel); + copy_v3_v3(co1, pa->prev_state.co); + copy_v3_v3(vel1, pa->prev_state.vel); + copy_v3_v3(co2, (epsys->particles + ptn[n].index)->prev_state.co); + copy_v3_v3(vel2, (epsys->particles + ptn[n].index)->prev_state.vel); sub_v3_v3v3(loc, co1, co2); @@ -316,8 +316,8 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues * t = -dot_v3v3(loc, vec)/inp; /* cpa is not too far in the future so investigate further */ if(t > 0.0f && t < t_min) { - VECADDFAC(co1, co1, vel1, t); - VECADDFAC(co2, co2, vel2, t); + madd_v3_v3fl(co1, vel1, t); + madd_v3_v3fl(co2, vel2, t); sub_v3_v3v3(vec, co2, co1); @@ -439,7 +439,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va len = len_v3(loc); /* too close to leader */ if(len < 2.0f * val->personal_space * pa->size) { - VECCOPY(bbd->wanted_co, loc); + copy_v3_v3(bbd->wanted_co, loc); bbd->wanted_speed = val->max_speed; return 1; } @@ -449,7 +449,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va /* possible blocking of leader in near future */ if(t > 0.0f && t < 3.0f) { - VECCOPY(vec2, vec); + copy_v3_v3(vec2, vec); mul_v3_fl(vec2, t); sub_v3_v3v3(vec2, loc, vec2); @@ -457,7 +457,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va len = len_v3(vec2); if(len < 2.0f * val->personal_space * pa->size) { - VECCOPY(bbd->wanted_co, vec2); + copy_v3_v3(bbd->wanted_co, vec2); bbd->wanted_speed = val->max_speed * (3.0f - t)/3.0f; return 1; } @@ -466,17 +466,17 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va /* not blocking so try to follow leader */ if(p && flbr->options & BRULE_LEADER_IN_LINE) { - VECCOPY(vec, bbd->sim->psys->particles[p-1].prev_state.vel); - VECCOPY(loc, bbd->sim->psys->particles[p-1].prev_state.co); + copy_v3_v3(vec, bbd->sim->psys->particles[p-1].prev_state.vel); + copy_v3_v3(loc, bbd->sim->psys->particles[p-1].prev_state.co); } else { - VECCOPY(loc, flbr->oloc); + copy_v3_v3(loc, flbr->oloc); sub_v3_v3v3(vec, flbr->loc, flbr->oloc); mul_v3_fl(vec, 1.0f/bbd->timestep); } /* fac is seconds behind leader */ - VECADDFAC(loc, loc, vec, -flbr->distance); + madd_v3_v3fl(loc, vec, -flbr->distance); sub_v3_v3v3(bbd->wanted_co, loc, pa->prev_state.co); bbd->wanted_speed = len_v3(bbd->wanted_co); @@ -488,7 +488,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va /* first check we're not blocking any leaders */ for(i = 0; i< bbd->sim->psys->totpart; i+=n){ - VECCOPY(vec, bbd->sim->psys->particles[i].prev_state.vel); + copy_v3_v3(vec, bbd->sim->psys->particles[i].prev_state.vel); sub_v3_v3v3(loc, pa->prev_state.co, bbd->sim->psys->particles[i].prev_state.co); @@ -499,7 +499,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va len = len_v3(loc); /* too close to leader */ if(len < 2.0f * val->personal_space * pa->size) { - VECCOPY(bbd->wanted_co, loc); + copy_v3_v3(bbd->wanted_co, loc); bbd->wanted_speed = val->max_speed; return 1; } @@ -509,7 +509,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va /* possible blocking of leader in near future */ if(t > 0.0f && t < t_min) { - VECCOPY(vec2, vec); + copy_v3_v3(vec2, vec); mul_v3_fl(vec2, t); sub_v3_v3v3(vec2, loc, vec2); @@ -518,7 +518,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va if(len < 2.0f * val->personal_space * pa->size) { t_min = t; - VECCOPY(bbd->wanted_co, loc); + copy_v3_v3(bbd->wanted_co, loc); bbd->wanted_speed = val->max_speed * (3.0f - t)/3.0f; ret = 1; } @@ -530,16 +530,16 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va /* not blocking so try to follow leader */ if(flbr->options & BRULE_LEADER_IN_LINE) { - VECCOPY(vec, bbd->sim->psys->particles[p-1].prev_state.vel); - VECCOPY(loc, bbd->sim->psys->particles[p-1].prev_state.co); + copy_v3_v3(vec, bbd->sim->psys->particles[p-1].prev_state.vel); + copy_v3_v3(loc, bbd->sim->psys->particles[p-1].prev_state.co); } else { - VECCOPY(vec, bbd->sim->psys->particles[p - p%n].prev_state.vel); - VECCOPY(loc, bbd->sim->psys->particles[p - p%n].prev_state.co); + copy_v3_v3(vec, bbd->sim->psys->particles[p - p%n].prev_state.vel); + copy_v3_v3(loc, bbd->sim->psys->particles[p - p%n].prev_state.co); } /* fac is seconds behind leader */ - VECADDFAC(loc, loc, vec, -flbr->distance); + madd_v3_v3fl(loc, vec, -flbr->distance); sub_v3_v3v3(bbd->wanted_co, loc, pa->prev_state.co); bbd->wanted_speed = len_v3(bbd->wanted_co); @@ -563,11 +563,11 @@ static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *va normalize_v3(bpa->wander); - VECCOPY(vec, bpa->wander); + copy_v3_v3(vec, bpa->wander); mul_qt_v3(pa->prev_state.rot, vec); - VECCOPY(bbd->wanted_co, pa->prev_state.ave); + copy_v3_v3(bbd->wanted_co, pa->prev_state.ave); mul_v3_fl(bbd->wanted_co, 1.1f); @@ -581,7 +581,7 @@ static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *va } } else { - VECCOPY(bbd->wanted_co, pa->prev_state.ave); + copy_v3_v3(bbd->wanted_co, pa->prev_state.ave); /* may happen at birth */ if(dot_v2v2(bbd->wanted_co,bbd->wanted_co)==0.0f) { @@ -643,7 +643,7 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti health += bpa->data.health; if(n==0 && pt->mode==PTARGET_MODE_ENEMY && ptn[n].dist < closest_dist) { - VECCOPY(closest_enemy, ptn[n].co); + copy_v3_v3(closest_enemy, ptn[n].co); closest_dist = ptn[n].dist; enemy_pa = epars + ptn[n].index; } @@ -741,7 +741,7 @@ static void set_boid_values(BoidValues *val, BoidSettings *boids, ParticleData * } } -static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *ground_co, float *ground_nor) +static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float ground_co[3], float ground_nor[3]) { BoidParticle *bpa = pa->boid; @@ -820,7 +820,7 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *gro } /* default to z=0 */ - VECCOPY(ground_co, pa->state.co); + copy_v3_v3(ground_co, pa->state.co); ground_co[2] = 0; ground_nor[0] = ground_nor[1] = 0.0f; ground_nor[2] = 1.0f; @@ -853,8 +853,8 @@ void boids_precalc_rules(ParticleSettings *part, float cfra) if(flbr->ob && flbr->cfra != cfra) { /* save object locations for velocity calculations */ - VECCOPY(flbr->oloc, flbr->loc); - VECCOPY(flbr->loc, flbr->ob->obmat[3]); + copy_v3_v3(flbr->oloc, flbr->loc); + copy_v3_v3(flbr->loc, flbr->ob->obmat[3]); flbr->cfra = cfra; } } @@ -868,7 +868,7 @@ static void boid_climb(BoidSettings *boids, ParticleData *pa, float *surface_co, copy_v3_v3(nor, surface_nor); /* gather apparent gravity */ - VECADDFAC(bpa->gravity, bpa->gravity, surface_nor, -1.0f); + madd_v3_v3fl(bpa->gravity, surface_nor, -1.0f); normalize_v3(bpa->gravity); /* raise boid it's size from surface */ @@ -997,7 +997,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) wanted_speed /= (float)n; } - VECCOPY(bbd->wanted_co, wanted_co); + copy_v3_v3(bbd->wanted_co, wanted_co); bbd->wanted_speed = wanted_speed; break; } @@ -1012,10 +1012,10 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) if(boids->options & BOID_ALLOW_FLIGHT && bbd->wanted_co[2] > 0.0f) { float cvel[3], dir[3]; - VECCOPY(dir, pa->prev_state.ave); + copy_v3_v3(dir, pa->prev_state.ave); normalize_v2(dir); - VECCOPY(cvel, bbd->wanted_co); + copy_v3_v3(cvel, bbd->wanted_co); normalize_v2(cvel); if(dot_v2v2(cvel, dir) > 0.95f / mul) @@ -1031,10 +1031,10 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) float z_v, ground_v, cur_v; float len; - VECCOPY(dir, pa->prev_state.ave); + copy_v3_v3(dir, pa->prev_state.ave); normalize_v2(dir); - VECCOPY(cvel, bbd->wanted_co); + copy_v3_v3(cvel, bbd->wanted_co); normalize_v2(cvel); len = len_v2(pa->prev_state.vel); @@ -1054,7 +1054,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) len = MIN2(len, val.jump_speed); - VECCOPY(jump_v, dir); + copy_v3_v3(jump_v, dir); jump_v[2] = z_v; mul_v3_fl(jump_v, ground_v); @@ -1071,7 +1071,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) } if(jump) { - VECCOPY(pa->prev_state.vel, jump_v); + copy_v3_v3(pa->prev_state.vel, jump_v); bpa->data.mode = eBoidMode_Falling; } } @@ -1143,12 +1143,12 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) } } - VECCOPY(old_dir, pa->prev_state.ave); + copy_v3_v3(old_dir, pa->prev_state.ave); new_speed = normalize_v3_v3(wanted_dir, bbd->wanted_co); /* first check if we have valid direction we want to go towards */ if(new_speed == 0.0f) { - VECCOPY(new_dir, old_dir); + copy_v3_v3(new_dir, old_dir); } else { float old_dir2[2], wanted_dir2[2], nor[3], angle; @@ -1172,13 +1172,13 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) cross_v3_v3v3(nor, old_dir, wanted_dir); axis_angle_to_quat( q,nor, angle); - VECCOPY(new_dir, old_dir); + copy_v3_v3(new_dir, old_dir); mul_qt_v3(q, new_dir); normalize_v3(new_dir); /* save direction in case resulting velocity too small */ axis_angle_to_quat( q,nor, angle*dtime); - VECCOPY(pa->state.ave, old_dir); + copy_v3_v3(pa->state.ave, old_dir); mul_qt_v3(q, pa->state.ave); normalize_v3(pa->state.ave); } @@ -1192,7 +1192,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) new_speed = MIN2(bbd->wanted_speed, old_speed + val.max_acc); /* combine direction and speed */ - VECCOPY(new_vel, new_dir); + copy_v3_v3(new_vel, new_dir); mul_v3_fl(new_vel, new_speed); /* maintain minimum flying velocity if not landing */ @@ -1236,7 +1236,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) add_v3_v3(acc, force); /* store smoothed acceleration for nice banking etc. */ - VECADDFAC(bpa->data.acc, bpa->data.acc, acc, dtime); + madd_v3_v3fl(bpa->data.acc, acc, dtime); mul_v3_fl(bpa->data.acc, 1.0f / (1.0f + dtime)); /* integrate new location & velocity */ @@ -1245,15 +1245,15 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) /* can get better control allthough it's a bit unphysical */ mul_v3_fl(acc, 1.0f/pa_mass); - VECCOPY(dvec, acc); + copy_v3_v3(dvec, acc); mul_v3_fl(dvec, dtime*dtime*0.5f); - VECCOPY(bvec, pa->prev_state.vel); + copy_v3_v3(bvec, pa->prev_state.vel); mul_v3_fl(bvec, dtime); add_v3_v3(dvec, bvec); add_v3_v3(pa->state.co, dvec); - VECADDFAC(pa->state.vel, pa->state.vel, acc, dtime); + madd_v3_v3fl(pa->state.vel, acc, dtime); //if(bpa->data.mode != eBoidMode_InAir) bpa->ground = boid_find_ground(bbd, pa, ground_co, ground_nor); @@ -1274,11 +1274,11 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) sub_v3_v3v3(dvec, bpa->data.acc, dvec); } else { - VECCOPY(dvec, bpa->data.acc); + copy_v3_v3(dvec, bpa->data.acc); } /* gather apparent gravity */ - VECADDFAC(bpa->gravity, grav, dvec, -boids->banking); + madd_v3_v3v3fl(bpa->gravity, grav, dvec, -boids->banking); normalize_v3(bpa->gravity); /* stick boid on goal when close enough */ @@ -1313,7 +1313,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) /* gather apparent gravity */ - VECADDFAC(bpa->gravity, bpa->gravity, grav, dtime); + madd_v3_v3fl(bpa->gravity, grav, dtime); normalize_v3(bpa->gravity); if(boids->options & BOID_ALLOW_LAND) { @@ -1345,7 +1345,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) //copy_v3_v3(nor, ground_nor); ///* gather apparent gravity to r_ve */ - //VECADDFAC(pa->r_ve, pa->r_ve, ground_nor, -1.0); + //madd_v3_v3fl(pa->r_ve, ground_nor, -1.0); //normalize_v3(pa->r_ve); ///* raise boid it's size from surface */ @@ -1385,12 +1385,12 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) sub_v3_v3v3(dvec, bpa->data.acc, dvec); /* gather apparent gravity */ - VECADDFAC(bpa->gravity, grav, dvec, -boids->banking); + madd_v3_v3v3fl(bpa->gravity, grav, dvec, -boids->banking); normalize_v3(bpa->gravity); } else { /* gather negative surface normal */ - VECADDFAC(bpa->gravity, bpa->gravity, ground_nor, -1.0f); + madd_v3_v3fl(bpa->gravity, ground_nor, -1.0f); normalize_v3(bpa->gravity); } break; @@ -1411,7 +1411,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) /* calculate rotation matrix based on forward & down vectors */ if(bpa->data.mode == eBoidMode_InAir) { - VECCOPY(mat[0], pa->state.ave); + copy_v3_v3(mat[0], pa->state.ave); project_v3_v3v3(dvec, bpa->gravity, pa->state.ave); sub_v3_v3v3(mat[2], bpa->gravity, dvec); @@ -1422,7 +1422,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) sub_v3_v3v3(mat[0], pa->state.ave, dvec); normalize_v3(mat[0]); - VECCOPY(mat[2], bpa->gravity); + copy_v3_v3(mat[2], bpa->gravity); } negate_v3(mat[2]); cross_v3_v3v3(mat[1], mat[2], mat[0]); diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index e78b89441c9..09021e71025 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -144,7 +144,7 @@ Brush *copy_brush(Brush *brush) { Brush *brushn; - brushn= copy_libblock(brush); + brushn= copy_libblock(&brush->id); if (brush->mtex.tex) id_us_plus((ID*)brush->mtex.tex); diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 96278e2ddd8..1100c1c0ef5 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -48,27 +48,27 @@ /* Math stuff for ray casting on mesh faces and for nearest surface */ -float bvhtree_ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_dist), const float *v0, const float *v1, const float *v2) +float bvhtree_ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_dist), const float v0[3], const float v1[3], const float v2[3]) { float dist; - if(isect_ray_tri_v3((float*)ray->origin, (float*)ray->direction, (float*)v0, (float*)v1, (float*)v2, &dist, NULL)) + if(isect_ray_tri_v3(ray->origin, ray->direction, v0, v1, v2, &dist, NULL)) return dist; return FLT_MAX; } -static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, const float m_dist, const float *v0, const float *v1, const float *v2) +static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, const float m_dist, const float v0[3], const float v1[3], const float v2[3]) { float idist; float p1[3]; float plane_normal[3], hit_point[3]; - normal_tri_v3( plane_normal,(float*)v0, (float*)v1, (float*)v2); + normal_tri_v3(plane_normal, v0, v1, v2); - VECADDFAC( p1, ray->origin, ray->direction, m_dist); - if(isect_sweeping_sphere_tri_v3((float*)ray->origin, p1, radius, (float*)v0, (float*)v1, (float*)v2, &idist, hit_point)) + madd_v3_v3v3fl(p1, ray->origin, ray->direction, m_dist); + if(isect_sweeping_sphere_tri_v3(ray->origin, p1, radius, v0, v1, v2, &idist, hit_point)) { return idist * m_dist; } @@ -81,7 +81,7 @@ static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, con * Function adapted from David Eberly's distance tools (LGPL) * http://www.geometrictools.com/LibFoundation/Distance/Distance.html */ -float nearest_point_in_tri_surface(const float *v0,const float *v1,const float *v2,const float *p, int *v, int *e, float *nearest ) +float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const float v2[3], const float p[3], int *v, int *e, float nearest[3]) { float diff[3]; float e0[3]; @@ -98,16 +98,16 @@ float nearest_point_in_tri_surface(const float *v0,const float *v1,const float * float sqrDist; int lv = -1, le = -1; - VECSUB(diff, v0, p); - VECSUB(e0, v1, v0); - VECSUB(e1, v2, v0); + sub_v3_v3v3(diff, v0, p); + sub_v3_v3v3(e0, v1, v0); + sub_v3_v3v3(e1, v2, v0); - A00 = INPR ( e0, e0 ); - A01 = INPR( e0, e1 ); - A11 = INPR ( e1, e1 ); - B0 = INPR( diff, e0 ); - B1 = INPR( diff, e1 ); - C = INPR( diff, diff ); + A00 = dot_v3v3(e0, e0); + A01 = dot_v3v3(e0, e1 ); + A11 = dot_v3v3(e1, e1 ); + B0 = dot_v3v3(diff, e0 ); + B1 = dot_v3v3(diff, e1 ); + C = dot_v3v3(diff, diff ); Det = fabs( A00 * A11 - A01 * A01 ); S = A01 * B1 - A11 * B0; T = A01 * B0 - A00 * B1; @@ -123,7 +123,7 @@ float nearest_point_in_tri_surface(const float *v0,const float *v1,const float * T = 0.0f; if ( -B0 >= A00 ) { - S = (float)1.0; + S = 1.0f; sqrDist = A00 + 2.0f * B0 + C; lv = 1; } @@ -379,15 +379,15 @@ float nearest_point_in_tri_surface(const float *v0,const float *v1,const float * { float w[3], x[3], y[3], z[3]; - VECCOPY(w, v0); - VECCOPY(x, e0); + copy_v3_v3(w, v0); + copy_v3_v3(x, e0); mul_v3_fl(x, S); - VECCOPY(y, e1); + copy_v3_v3(y, e1); mul_v3_fl(y, T); - VECADD(z, w, x); - VECADD(z, z, y); - //VECSUB(d, p, z); - VECCOPY(nearest, z); + add_v3_v3v3(z, w, x); + add_v3_v3v3(z, z, y); + //sub_v3_v3v3(d, p, z); + copy_v3_v3(nearest, z); // d = p - ( v0 + S * e0 + T * e1 ); } *v = lv; @@ -403,7 +403,7 @@ float nearest_point_in_tri_surface(const float *v0,const float *v1,const float * // Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_faces. // userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. -static void mesh_faces_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest) +static void mesh_faces_nearest_point(void *userdata, int index, const float co[3], BVHTreeNearest *nearest) { const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; MVert *vert = data->vert; @@ -426,7 +426,7 @@ static void mesh_faces_nearest_point(void *userdata, int index, const float *co, { nearest->index = index; nearest->dist = dist; - VECCOPY(nearest->co, nearest_tmp); + copy_v3_v3(nearest->co, nearest_tmp); normal_tri_v3( nearest->no,t0, t1, t2); } @@ -464,7 +464,7 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r { hit->index = index; hit->dist = dist; - VECADDFAC(hit->co, ray->origin, ray->direction, dist); + madd_v3_v3v3fl(hit->co, ray->origin, ray->direction, dist); normal_tri_v3( hit->no,t0, t1, t2); } @@ -478,7 +478,7 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r // Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_edges. // userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. -static void mesh_edges_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest) +static void mesh_edges_nearest_point(void *userdata, int index, const float co[3], BVHTreeNearest *nearest) { const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; MVert *vert = data->vert; @@ -488,16 +488,15 @@ static void mesh_edges_nearest_point(void *userdata, int index, const float *co, float *t0, *t1; t0 = vert[ edge->v1 ].co; t1 = vert[ edge->v2 ].co; - - // NOTE: casts to "float*" here are due to co being "const float*" - closest_to_line_segment_v3(nearest_tmp, (float*)co, t0, t1); - dist = len_squared_v3v3(nearest_tmp, (float*)co); + + closest_to_line_segment_v3(nearest_tmp, co, t0, t1); + dist = len_squared_v3v3(nearest_tmp, co); if(dist < nearest->dist) { nearest->index = index; nearest->dist = dist; - VECCOPY(nearest->co, nearest_tmp); + copy_v3_v3(nearest->co, nearest_tmp); sub_v3_v3v3(nearest->no, t0, t1); normalize_v3(nearest->no); } @@ -590,11 +589,11 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float for(i = 0; i < numFaces; i++, efa= efa->next) { if(!(efa->f & 1) && efa->h==0 && !((efa->v1->f&1)+(efa->v2->f&1)+(efa->v3->f&1)+(efa->v4?efa->v4->f&1:0))) { float co[4][3]; - VECCOPY(co[0], vert[ face[i].v1 ].co); - VECCOPY(co[1], vert[ face[i].v2 ].co); - VECCOPY(co[2], vert[ face[i].v3 ].co); + copy_v3_v3(co[0], vert[ face[i].v1 ].co); + copy_v3_v3(co[1], vert[ face[i].v2 ].co); + copy_v3_v3(co[2], vert[ face[i].v3 ].co); if(face[i].v4) - VECCOPY(co[3], vert[ face[i].v4 ].co); + copy_v3_v3(co[3], vert[ face[i].v4 ].co); BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3); } @@ -603,11 +602,11 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float else { for(i = 0; i < numFaces; i++) { float co[4][3]; - VECCOPY(co[0], vert[ face[i].v1 ].co); - VECCOPY(co[1], vert[ face[i].v2 ].co); - VECCOPY(co[2], vert[ face[i].v3 ].co); + copy_v3_v3(co[0], vert[ face[i].v1 ].co); + copy_v3_v3(co[1], vert[ face[i].v2 ].co); + copy_v3_v3(co[2], vert[ face[i].v3 ].co); if(face[i].v4) - VECCOPY(co[3], vert[ face[i].v4 ].co); + copy_v3_v3(co[3], vert[ face[i].v4 ].co); BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3); } @@ -669,8 +668,8 @@ BVHTree* bvhtree_from_mesh_edges(BVHTreeFromMesh *data, DerivedMesh *mesh, float for(i = 0; i < numEdges; i++) { float co[4][3]; - VECCOPY(co[0], vert[ edge[i].v1 ].co); - VECCOPY(co[1], vert[ edge[i].v2 ].co); + copy_v3_v3(co[0], vert[ edge[i].v1 ].co); + copy_v3_v3(co[1], vert[ edge[i].v2 ].co); BLI_bvhtree_insert(tree, i, co[0], 2); } diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c new file mode 100644 index 00000000000..145eb9363e9 --- /dev/null +++ b/source/blender/blenkernel/intern/camera.c @@ -0,0 +1,396 @@ +/* + * ***** 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) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/blenkernel/intern/camera.c + * \ingroup bke + */ + +#include <stdlib.h> + +#include "DNA_camera_types.h" +#include "DNA_lamp_types.h" +#include "DNA_object_types.h" +#include "DNA_scene_types.h" + +#include "BLI_math.h" +#include "BLI_utildefines.h" + +#include "BKE_animsys.h" +#include "BKE_camera.h" +#include "BKE_global.h" +#include "BKE_library.h" +#include "BKE_main.h" + +void *add_camera(const char *name) +{ + Camera *cam; + + cam= alloc_libblock(&G.main->camera, ID_CA, name); + + cam->lens= 35.0f; + cam->sensor_x= 32.0f; + cam->sensor_y= 18.0f; + cam->clipsta= 0.1f; + cam->clipend= 100.0f; + cam->drawsize= 0.5f; + cam->ortho_scale= 6.0; + cam->flag |= CAM_SHOWPASSEPARTOUT; + cam->passepartalpha = 0.5f; + + return cam; +} + +Camera *copy_camera(Camera *cam) +{ + Camera *camn; + + camn= copy_libblock(&cam->id); + + return camn; +} + +void make_local_camera(Camera *cam) +{ + Main *bmain= G.main; + Object *ob; + int is_local= FALSE, is_lib= FALSE; + + /* - only lib users: do nothing + * - only local users: set flag + * - mixed: make copy + */ + + if(cam->id.lib==NULL) return; + if(cam->id.us==1) { + id_clear_lib_data(bmain, &cam->id); + return; + } + + for(ob= bmain->object.first; ob && ELEM(0, is_lib, is_local); ob= ob->id.next) { + if(ob->data==cam) { + if(ob->id.lib) is_lib= TRUE; + else is_local= TRUE; + } + } + + if(is_local && is_lib == FALSE) { + id_clear_lib_data(bmain, &cam->id); + } + else if(is_local && is_lib) { + Camera *camn= copy_camera(cam); + + camn->id.us= 0; + + /* Remap paths of new ID using old library as base. */ + BKE_id_lib_local_paths(bmain, &camn->id); + + for(ob= bmain->object.first; ob; ob= ob->id.next) { + if(ob->data == cam) { + if(ob->id.lib==NULL) { + ob->data= camn; + camn->id.us++; + cam->id.us--; + } + } + } + } +} + +/* get the camera's dof value, takes the dof object into account */ +float dof_camera(Object *ob) +{ + Camera *cam = (Camera *)ob->data; + if (ob->type != OB_CAMERA) + return 0.0f; + if (cam->dof_ob) { + /* too simple, better to return the distance on the view axis only + * return len_v3v3(ob->obmat[3], cam->dof_ob->obmat[3]); */ + float mat[4][4], imat[4][4], obmat[4][4]; + + copy_m4_m4(obmat, ob->obmat); + normalize_m4(obmat); + invert_m4_m4(imat, obmat); + mul_m4_m4m4(mat, cam->dof_ob->obmat, imat); + return (float)fabs(mat[3][2]); + } + return cam->YF_dofdist; +} + +void free_camera(Camera *ca) +{ + BKE_free_animdata((ID *)ca); +} + +void object_camera_mode(RenderData *rd, Object *camera) +{ + rd->mode &= ~(R_ORTHO|R_PANORAMA); + if(camera && camera->type==OB_CAMERA) { + Camera *cam= camera->data; + if(cam->type == CAM_ORTHO) rd->mode |= R_ORTHO; + if(cam->flag & CAM_PANORAMA) rd->mode |= R_PANORAMA; + } +} + +void object_camera_intrinsics(Object *camera, Camera **cam_r, short *is_ortho, float *shiftx, float *shifty, + float *clipsta, float *clipend, float *lens, float *sensor_x, float *sensor_y, short *sensor_fit) +{ + Camera *cam= NULL; + + (*shiftx)= 0.0f; + (*shifty)= 0.0f; + + (*sensor_x)= DEFAULT_SENSOR_WIDTH; + (*sensor_y)= DEFAULT_SENSOR_HEIGHT; + (*sensor_fit)= CAMERA_SENSOR_FIT_AUTO; + + if(camera->type==OB_CAMERA) { + cam= camera->data; + + if(cam->type == CAM_ORTHO) { + *is_ortho= TRUE; + } + + /* solve this too... all time depending stuff is in convertblender.c? + * Need to update the camera early because it's used for projection matrices + * and other stuff BEFORE the animation update loop is done + * */ +#if 0 // XXX old animation system + if(cam->ipo) { + calc_ipo(cam->ipo, frame_to_float(re->scene, re->r.cfra)); + execute_ipo(&cam->id, cam->ipo); + } +#endif // XXX old animation system + (*shiftx)=cam->shiftx; + (*shifty)=cam->shifty; + (*lens)= cam->lens; + (*sensor_x)= cam->sensor_x; + (*sensor_y)= cam->sensor_y; + (*clipsta)= cam->clipsta; + (*clipend)= cam->clipend; + (*sensor_fit)= cam->sensor_fit; + } + else if(camera->type==OB_LAMP) { + Lamp *la= camera->data; + float fac= cosf((float)M_PI*la->spotsize/360.0f); + float phi= acos(fac); + + (*lens)= 16.0f*fac/sinf(phi); + if((*lens)==0.0f) + (*lens)= 35.0f; + (*clipsta)= la->clipsta; + (*clipend)= la->clipend; + } + else { /* envmap exception... */; + if((*lens)==0.0f) /* is this needed anymore? */ + (*lens)= 16.0f; + + if((*clipsta)==0.0f || (*clipend)==0.0f) { + (*clipsta)= 0.1f; + (*clipend)= 1000.0f; + } + } + + (*cam_r)= cam; +} + +/* 'lens' may be set for envmap only */ +void object_camera_matrix( + RenderData *rd, Object *camera, int winx, int winy, short field_second, + float winmat[][4], rctf *viewplane, float *clipsta, float *clipend, float *lens, + float *sensor_x, float *sensor_y, short *sensor_fit, float *ycor, + float *viewdx, float *viewdy) +{ + Camera *cam=NULL; + float pixsize; + float shiftx=0.0, shifty=0.0, winside, viewfac; + short is_ortho= FALSE; + + /* question mark */ + (*ycor)= rd->yasp / rd->xasp; + if(rd->mode & R_FIELDS) + (*ycor) *= 2.0f; + + object_camera_intrinsics(camera, &cam, &is_ortho, &shiftx, &shifty, clipsta, clipend, lens, sensor_x, sensor_y, sensor_fit); + + /* ortho only with camera available */ + if(cam && is_ortho) { + if((*sensor_fit)==CAMERA_SENSOR_FIT_AUTO) { + if(rd->xasp*winx >= rd->yasp*winy) viewfac= winx; + else viewfac= (*ycor) * winy; + } + else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) { + viewfac= winx; + } + else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */ + viewfac= (*ycor) * winy; + } + + /* ortho_scale == 1.0 means exact 1 to 1 mapping */ + pixsize= cam->ortho_scale/viewfac; + } + else { + if((*sensor_fit)==CAMERA_SENSOR_FIT_AUTO) { + if(rd->xasp*winx >= rd->yasp*winy) viewfac= ((*lens) * winx) / (*sensor_x); + else viewfac= (*ycor) * ((*lens) * winy) / (*sensor_x); + } + else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) { + viewfac= ((*lens) * winx) / (*sensor_x); + } + else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */ + viewfac= ((*lens) * winy) / (*sensor_y); + } + + pixsize= (*clipsta) / viewfac; + } + + /* viewplane fully centered, zbuffer fills in jittered between -.5 and +.5 */ + winside= MAX2(winx, winy); + + if(cam) { + if(cam->sensor_fit==CAMERA_SENSOR_FIT_HOR) + winside= winx; + else if(cam->sensor_fit==CAMERA_SENSOR_FIT_VERT) + winside= winy; + } + + viewplane->xmin= -0.5f*(float)winx + shiftx*winside; + viewplane->ymin= -0.5f*(*ycor)*(float)winy + shifty*winside; + viewplane->xmax= 0.5f*(float)winx + shiftx*winside; + viewplane->ymax= 0.5f*(*ycor)*(float)winy + shifty*winside; + + if(field_second) { + if(rd->mode & R_ODDFIELD) { + viewplane->ymin-= 0.5f * (*ycor); + viewplane->ymax-= 0.5f * (*ycor); + } + else { + viewplane->ymin+= 0.5f * (*ycor); + viewplane->ymax+= 0.5f * (*ycor); + } + } + /* the window matrix is used for clipping, and not changed during OSA steps */ + /* using an offset of +0.5 here would give clip errors on edges */ + viewplane->xmin *= pixsize; + viewplane->xmax *= pixsize; + viewplane->ymin *= pixsize; + viewplane->ymax *= pixsize; + + (*viewdx)= pixsize; + (*viewdy)= (*ycor) * pixsize; + + if(is_ortho) + orthographic_m4(winmat, viewplane->xmin, viewplane->xmax, viewplane->ymin, viewplane->ymax, *clipsta, *clipend); + else + perspective_m4(winmat, viewplane->xmin, viewplane->xmax, viewplane->ymin, viewplane->ymax, *clipsta, *clipend); + +} + +void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const short do_clip, const float scale[3], + float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]) +{ + float facx, facy; + float depth; + + /* aspect correcton */ + if (scene) { + float aspx= (float) scene->r.xsch*scene->r.xasp; + float aspy= (float) scene->r.ysch*scene->r.yasp; + + if(camera->sensor_fit==CAMERA_SENSOR_FIT_AUTO) { + if(aspx < aspy) { + r_asp[0]= aspx / aspy; + r_asp[1]= 1.0; + } + else { + r_asp[0]= 1.0; + r_asp[1]= aspy / aspx; + } + } + else if(camera->sensor_fit==CAMERA_SENSOR_FIT_AUTO) { + r_asp[0]= aspx / aspy; + r_asp[1]= 1.0; + } + else { + r_asp[0]= 1.0; + r_asp[1]= aspy / aspx; + } + } + else { + r_asp[0]= 1.0f; + r_asp[1]= 1.0f; + } + + if(camera->type==CAM_ORTHO) { + facx= 0.5f * camera->ortho_scale * r_asp[0] * scale[0]; + facy= 0.5f * camera->ortho_scale * r_asp[1] * scale[1]; + r_shift[0]= camera->shiftx * camera->ortho_scale * scale[0]; + r_shift[1]= camera->shifty * camera->ortho_scale * scale[1]; + depth= do_clip ? -((camera->clipsta * scale[2]) + 0.1f) : - drawsize * camera->ortho_scale * scale[2]; + + *r_drawsize= 0.5f * camera->ortho_scale; + } + else { + /* that way it's always visible - clipsta+0.1 */ + float fac; + float half_sensor= 0.5f*((camera->sensor_fit==CAMERA_SENSOR_FIT_VERT) ? (camera->sensor_y) : (camera->sensor_x)); + + *r_drawsize= drawsize / ((scale[0] + scale[1] + scale[2]) / 3.0f); + + if(do_clip) { + /* fixed depth, variable size (avoids exceeding clipping range) */ + depth = -(camera->clipsta + 0.1f); + fac = depth / (camera->lens/(-half_sensor) * scale[2]); + } + else { + /* fixed size, variable depth (stays a reasonable size in the 3D view) */ + depth= *r_drawsize * camera->lens/(-half_sensor) * scale[2]; + fac= *r_drawsize; + } + + facx= fac * r_asp[0] * scale[0]; + facy= fac * r_asp[1] * scale[1]; + r_shift[0]= camera->shiftx*fac*2 * scale[0]; + r_shift[1]= camera->shifty*fac*2 * scale[1]; + } + + r_vec[0][0]= r_shift[0] + facx; r_vec[0][1]= r_shift[1] + facy; r_vec[0][2]= depth; + r_vec[1][0]= r_shift[0] + facx; r_vec[1][1]= r_shift[1] - facy; r_vec[1][2]= depth; + r_vec[2][0]= r_shift[0] - facx; r_vec[2][1]= r_shift[1] - facy; r_vec[2][2]= depth; + r_vec[3][0]= r_shift[0] - facx; r_vec[3][1]= r_shift[1] + facy; r_vec[3][2]= depth; +} + +void camera_view_frame(Scene *scene, Camera *camera, float r_vec[4][3]) +{ + float dummy_asp[2]; + float dummy_shift[2]; + float dummy_drawsize; + const float dummy_scale[3]= {1.0f, 1.0f, 1.0f}; + + camera_view_frame_ex(scene, camera, FALSE, 1.0, dummy_scale, + dummy_asp, dummy_shift, &dummy_drawsize, r_vec); +} + diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index eb4133e37fa..2b0c65a7db5 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -152,7 +152,7 @@ static void cdDM_getVertCo(DerivedMesh *dm, int index, float co_r[3]) { CDDerivedMesh *cddm = (CDDerivedMesh*) dm; - VECCOPY(co_r, cddm->mvert[index].co); + copy_v3_v3(co_r, cddm->mvert[index].co); } static void cdDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3]) @@ -161,7 +161,7 @@ static void cdDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3]) int i; for(i = 0; i < dm->numVertData; i++, mv++) - VECCOPY(cos_r[i], mv->co); + copy_v3_v3(cos_r[i], mv->co); } static void cdDM_getVertNo(DerivedMesh *dm, int index, float no_r[3]) @@ -1248,39 +1248,39 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo if( numdata != 0 ) { offset = 0; if(attribs.totorco) { - VECCOPY((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v1]); - VECCOPY((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v2]); - VECCOPY((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v3]); + copy_v3_v3((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v1]); + copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v2]); + copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v3]); offset += sizeof(float)*3; } for(b = 0; b < attribs.tottface; b++) { MTFace *tf = &attribs.tface[b].array[a]; - VECCOPY2D((float *)&varray[elementsize*curface*3+offset],tf->uv[0]); - VECCOPY2D((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[1]); + copy_v2_v2((float *)&varray[elementsize*curface*3+offset],tf->uv[0]); + copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[1]); - VECCOPY2D((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[2]); + copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[2]); offset += sizeof(float)*2; } for(b = 0; b < attribs.totmcol; b++) { MCol *cp = &attribs.mcol[b].array[a*4 + 0]; GLubyte col[4]; col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; - QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset], col); + copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset], (char *)col); cp = &attribs.mcol[b].array[a*4 + 1]; col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; - QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset+elementsize], col); + copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize], (char *)col); cp = &attribs.mcol[b].array[a*4 + 2]; col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; - QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset+elementsize*2], col); + copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize*2], (char *)col); offset += sizeof(unsigned char)*4; } if(attribs.tottang) { float *tang = attribs.tang.array[a*4 + 0]; - QUATCOPY((float *)&varray[elementsize*curface*3+offset], tang); + copy_v4_v4((float *)&varray[elementsize*curface*3+offset], tang); tang = attribs.tang.array[a*4 + 1]; - QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize], tang); + copy_v4_v4((float *)&varray[elementsize*curface*3+offset+elementsize], tang); tang = attribs.tang.array[a*4 + 2]; - QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang); + copy_v4_v4((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang); offset += sizeof(float)*4; } (void)offset; @@ -1290,38 +1290,38 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo if( numdata != 0 ) { offset = 0; if(attribs.totorco) { - VECCOPY((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v3]); - VECCOPY((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v4]); - VECCOPY((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v1]); + copy_v3_v3((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v3]); + copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v4]); + copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v1]); offset += sizeof(float)*3; } for(b = 0; b < attribs.tottface; b++) { MTFace *tf = &attribs.tface[b].array[a]; - VECCOPY2D((float *)&varray[elementsize*curface*3+offset],tf->uv[2]); - VECCOPY2D((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[3]); - VECCOPY2D((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[0]); + copy_v2_v2((float *)&varray[elementsize*curface*3+offset],tf->uv[2]); + copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[3]); + copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[0]); offset += sizeof(float)*2; } for(b = 0; b < attribs.totmcol; b++) { MCol *cp = &attribs.mcol[b].array[a*4 + 2]; GLubyte col[4]; col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; - QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset], col); + copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset], (char *)col); cp = &attribs.mcol[b].array[a*4 + 3]; col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; - QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset+elementsize], col); + copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize], (char *)col); cp = &attribs.mcol[b].array[a*4 + 0]; col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; - QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset+elementsize*2], col); + copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize*2], (char *)col); offset += sizeof(unsigned char)*4; } if(attribs.tottang) { float *tang = attribs.tang.array[a*4 + 2]; - QUATCOPY((float *)&varray[elementsize*curface*3+offset], tang); + copy_v4_v4((float *)&varray[elementsize*curface*3+offset], tang); tang = attribs.tang.array[a*4 + 3]; - QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize], tang); + copy_v4_v4((float *)&varray[elementsize*curface*3+offset+elementsize], tang); tang = attribs.tang.array[a*4 + 0]; - QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang); + copy_v4_v4((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang); offset += sizeof(float)*4; } (void)offset; @@ -1441,7 +1441,7 @@ static void cdDM_foreachMappedFaceCenter( else orig = i; - VECCOPY(cent, mv[mf->v1].co); + copy_v3_v3(cent, mv[mf->v1].co); add_v3_v3(cent, mv[mf->v2].co); add_v3_v3(cent, mv[mf->v3].co); @@ -1627,7 +1627,7 @@ DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *UNUSED(me)) i++, eve = eve->next, index++) { MVert *mv = &mvert[i]; - VECCOPY(mv->co, eve->co); + copy_v3_v3(mv->co, eve->co); normal_float_to_short_v3(mv->no, eve->no); mv->bweight = (unsigned char) (eve->bweight * 255.0f); @@ -1795,7 +1795,7 @@ void CDDM_apply_vert_coords(DerivedMesh *dm, float (*vertCoords)[3]) cddm->mvert = vert; for(i = 0; i < dm->numVertData; ++i, ++vert) - VECCOPY(vert->co, vertCoords[i]); + copy_v3_v3(vert->co, vertCoords[i]); } void CDDM_apply_vert_normals(DerivedMesh *dm, short (*vertNormals)[3]) diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 444d17ad004..ae6a6ec012a 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -190,7 +190,7 @@ static BVHTree *bvhselftree_build_from_cloth (ClothModifierData *clmd, float eps // fill tree for(i = 0; i < cloth->numverts; i++, verts++) { - VECCOPY(&co[0*3], verts->xold); + copy_v3_v3(&co[0*3], verts->xold); BLI_bvhtree_insert(bvhtree, i, co, 1); } @@ -231,12 +231,12 @@ static BVHTree *bvhtree_build_from_cloth (ClothModifierData *clmd, float epsilon // fill tree for(i = 0; i < cloth->numfaces; i++, mfaces++) { - VECCOPY(&co[0*3], verts[mfaces->v1].xold); - VECCOPY(&co[1*3], verts[mfaces->v2].xold); - VECCOPY(&co[2*3], verts[mfaces->v3].xold); + copy_v3_v3(&co[0*3], verts[mfaces->v1].xold); + copy_v3_v3(&co[1*3], verts[mfaces->v2].xold); + copy_v3_v3(&co[2*3], verts[mfaces->v3].xold); if(mfaces->v4) - VECCOPY(&co[3*3], verts[mfaces->v4].xold); + copy_v3_v3(&co[3*3], verts[mfaces->v4].xold); BLI_bvhtree_insert(bvhtree, i, co, (mfaces->v4 ? 4 : 3)); } @@ -267,23 +267,23 @@ void bvhtree_update_from_cloth(ClothModifierData *clmd, int moving) { for(i = 0; i < cloth->numfaces; i++, mfaces++) { - VECCOPY(&co[0*3], verts[mfaces->v1].txold); - VECCOPY(&co[1*3], verts[mfaces->v2].txold); - VECCOPY(&co[2*3], verts[mfaces->v3].txold); + copy_v3_v3(&co[0*3], verts[mfaces->v1].txold); + copy_v3_v3(&co[1*3], verts[mfaces->v2].txold); + copy_v3_v3(&co[2*3], verts[mfaces->v3].txold); if(mfaces->v4) - VECCOPY(&co[3*3], verts[mfaces->v4].txold); + copy_v3_v3(&co[3*3], verts[mfaces->v4].txold); // copy new locations into array if(moving) { // update moving positions - VECCOPY(&co_moving[0*3], verts[mfaces->v1].tx); - VECCOPY(&co_moving[1*3], verts[mfaces->v2].tx); - VECCOPY(&co_moving[2*3], verts[mfaces->v3].tx); + copy_v3_v3(&co_moving[0*3], verts[mfaces->v1].tx); + copy_v3_v3(&co_moving[1*3], verts[mfaces->v2].tx); + copy_v3_v3(&co_moving[2*3], verts[mfaces->v3].tx); if(mfaces->v4) - VECCOPY(&co_moving[3*3], verts[mfaces->v4].tx); + copy_v3_v3(&co_moving[3*3], verts[mfaces->v4].tx); ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, (mfaces->v4 ? 4 : 3)); } @@ -321,13 +321,13 @@ void bvhselftree_update_from_cloth(ClothModifierData *clmd, int moving) { for(i = 0; i < cloth->numverts; i++, verts++) { - VECCOPY(&co[0*3], verts->txold); + copy_v3_v3(&co[0*3], verts->txold); // copy new locations into array if(moving) { // update moving positions - VECCOPY(&co_moving[0*3], verts->tx); + copy_v3_v3(&co_moving[0*3], verts->tx); ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, 1); } @@ -399,11 +399,11 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul /* force any pinned verts to their constrained location. */ for(i = 0; i < clmd->clothObject->numverts; i++, verts++) { /* save the previous position. */ - VECCOPY(verts->xold, verts->xconst); - VECCOPY(verts->txold, verts->x); + copy_v3_v3(verts->xold, verts->xconst); + copy_v3_v3(verts->txold, verts->x); /* Get the current position. */ - VECCOPY(verts->xconst, mvert[i].co); + copy_v3_v3(verts->xconst, mvert[i].co); mul_m4_v3(ob->obmat, verts->xconst); } @@ -712,7 +712,7 @@ static void cloth_to_object (Object *ob, ClothModifierData *clmd, DerivedMesh * for (i = 0; i < numverts; i++) { - VECCOPY (mvert[i].co, cloth->verts[i].x); + copy_v3_v3 (mvert[i].co, cloth->verts[i].x); mul_m4_v3(ob->imat, mvert[i].co); /* cloth is in global coords */ } } @@ -880,14 +880,14 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d verts->goal= 0.0f; verts->flags = 0; - VECCOPY ( verts->xold, verts->x ); - VECCOPY ( verts->xconst, verts->x ); - VECCOPY ( verts->txold, verts->x ); - VECCOPY ( verts->tx, verts->x ); + copy_v3_v3 ( verts->xold, verts->x ); + copy_v3_v3 ( verts->xconst, verts->x ); + copy_v3_v3 ( verts->txold, verts->x ); + copy_v3_v3 ( verts->tx, verts->x ); mul_v3_fl( verts->v, 0.0f ); verts->impulse_count = 0; - VECCOPY ( verts->impulse, tnull ); + copy_v3_v3 ( verts->impulse, tnull ); } // apply / set vertex groups @@ -1053,7 +1053,6 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm ) LinkNode **edgelist = NULL; EdgeHash *edgehash = NULL; LinkNode *search = NULL, *search2 = NULL; - float temp[3]; // error handling if ( numedges==0 ) @@ -1086,8 +1085,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm ) { spring->ij = MIN2(medge[i].v1, medge[i].v2); spring->kl = MAX2(medge[i].v2, medge[i].v1); - VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest ); - spring->restlen = sqrt ( INPR ( temp, temp ) ); + spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest); clmd->sim_parms->avg_spring_len += spring->restlen; cloth->verts[spring->ij].avg_spring_len += spring->restlen; cloth->verts[spring->kl].avg_spring_len += spring->restlen; @@ -1132,8 +1130,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm ) spring->ij = MIN2(mface[i].v1, mface[i].v3); spring->kl = MAX2(mface[i].v3, mface[i].v1); - VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest ); - spring->restlen = sqrt ( INPR ( temp, temp ) ); + spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest); spring->type = CLOTH_SPRING_TYPE_SHEAR; spring->stiffness = (cloth->verts[spring->kl].shear_stiff + cloth->verts[spring->ij].shear_stiff) / 2.0; @@ -1155,8 +1152,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm ) spring->ij = MIN2(mface[i].v2, mface[i].v4); spring->kl = MAX2(mface[i].v4, mface[i].v2); - VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest ); - spring->restlen = sqrt ( INPR ( temp, temp ) ); + spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest); spring->type = CLOTH_SPRING_TYPE_SHEAR; spring->stiffness = (cloth->verts[spring->kl].shear_stiff + cloth->verts[spring->ij].shear_stiff) / 2.0; @@ -1197,8 +1193,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm ) spring->ij = MIN2(tspring2->ij, index2); spring->kl = MAX2(tspring2->ij, index2); - VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest ); - spring->restlen = sqrt ( INPR ( temp, temp ) ); + spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest); spring->type = CLOTH_SPRING_TYPE_BENDING; spring->stiffness = (cloth->verts[spring->kl].bend_stiff + cloth->verts[spring->ij].bend_stiff) / 2.0; BLI_edgehash_insert ( edgehash, spring->ij, spring->kl, NULL ); @@ -1237,8 +1232,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm ) spring->ij = tspring2->ij; spring->kl = tspring->kl; - VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest ); - spring->restlen = sqrt ( INPR ( temp, temp ) ); + spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest); spring->type = CLOTH_SPRING_TYPE_BENDING; spring->stiffness = (cloth->verts[spring->kl].bend_stiff + cloth->verts[spring->ij].bend_stiff) / 2.0; bend_springs++; diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 98a434a7d8b..2f568aa01eb 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -501,7 +501,7 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr) hlen= len_v3v3(bezt[0].vec[1], bezt[0].vec[2]); /* original handle length */ /* clip handle point */ - VECCOPY(vec, bezt[1].vec[0]); + copy_v3_v3(vec, bezt[1].vec[0]); if(vec[0] < bezt[0].vec[1][0]) vec[0]= bezt[0].vec[1][0]; @@ -518,7 +518,7 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr) hlen= len_v3v3(bezt[a].vec[1], bezt[a].vec[0]); /* original handle length */ /* clip handle point */ - VECCOPY(vec, bezt[a-1].vec[2]); + copy_v3_v3(vec, bezt[a-1].vec[2]); if(vec[0] > bezt[a].vec[1][0]) vec[0]= bezt[a].vec[1][0]; diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 8b5cf3bd196..f904d6e66df 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -44,6 +44,7 @@ #include "BLI_utildefines.h" #include "DNA_armature_types.h" +#include "DNA_camera_types.h" #include "DNA_constraint_types.h" #include "DNA_modifier_types.h" #include "DNA_object_types.h" @@ -51,15 +52,19 @@ #include "DNA_curve_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" + #include "DNA_lattice_types.h" #include "DNA_scene_types.h" #include "DNA_text_types.h" +#include "DNA_tracking_types.h" +#include "DNA_movieclip_types.h" #include "BKE_action.h" #include "BKE_anim.h" /* for the curve calculation part */ #include "BKE_armature.h" #include "BKE_blender.h" +#include "BKE_camera.h" #include "BKE_constraint.h" #include "BKE_displist.h" #include "BKE_deform.h" @@ -72,6 +77,8 @@ #include "BKE_idprop.h" #include "BKE_shrinkwrap.h" #include "BKE_mesh.h" +#include "BKE_tracking.h" +#include "BKE_movieclip.h" #ifdef WITH_PYTHON #include "BPY_extern.h" @@ -3924,6 +3931,203 @@ static bConstraintTypeInfo CTI_PIVOT = { pivotcon_evaluate /* evaluate */ }; +/* ----------- Follow Track ------------- */ + +static void followtrack_new_data (void *cdata) +{ + bFollowTrackConstraint *data= (bFollowTrackConstraint *)cdata; + + data->clip= NULL; + data->flag|= FOLLOWTRACK_ACTIVECLIP; + data->reference= FOLLOWTRACK_TRACK; +} + +static void followtrack_id_looper (bConstraint *con, ConstraintIDFunc func, void *userdata) +{ + bFollowTrackConstraint *data= con->data; + + func(con, (ID**)&data->clip, userdata); +} + +static void followtrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets)) +{ + Scene *scene= cob->scene; + bFollowTrackConstraint *data= con->data; + MovieClip *clip= data->clip; + MovieTrackingTrack *track; + + if(data->flag&FOLLOWTRACK_ACTIVECLIP) + clip= scene->clip; + + if(!clip || !data->track[0]) + return; + + track= BKE_tracking_named_track(&clip->tracking, data->track); + + if(!track) + return; + + if(data->reference==FOLLOWTRACK_BUNDLE) { + if(track->flag&TRACK_HAS_BUNDLE) { + float pos[3], mat[4][4], obmat[4][4]; + + copy_m4_m4(obmat, cob->matrix); + + BKE_get_tracking_mat(cob->scene, NULL, mat); + mul_v3_m4v3(pos, mat, track->bundle_pos); + + cob->matrix[3][0]+= pos[0]; + cob->matrix[3][1]+= pos[1]; + cob->matrix[3][2]+= pos[2]; + } + } else { + Object *camob= cob->scene->camera; + + if(camob) { + MovieClipUser user; + MovieTrackingMarker *marker; + float vec[3], disp[3], axis[3], mat[4][4]; + float aspect= (scene->r.xsch*scene->r.xasp) / (scene->r.ysch*scene->r.yasp); + float sensor_x, sensor_y, lens, len, d, ortho_scale= 1.f; + + where_is_object_mat(scene, camob, mat); + + /* camera axis */ + vec[0]= 0.f; + vec[1]= 0.f; + vec[2]= 1.f; + mul_v3_m4v3(axis, mat, vec); + + /* distance to projection plane */ + copy_v3_v3(vec, cob->matrix[3]); + sub_v3_v3(vec, mat[3]); + project_v3_v3v3(disp, vec, axis); + + len= len_v3(disp); + + if(len>FLT_EPSILON) { + float pos[2], rmat[4][4], shiftx= 0.0f, shifty= 0.0f, clipsta= 0.0f, clipend= 0.0f; + short is_ortho= 0, sensor_fit= CAMERA_SENSOR_FIT_AUTO; + Camera *cam= NULL; + + user.framenr= scene->r.cfra; + marker= BKE_tracking_get_marker(track, user.framenr); + + add_v2_v2v2(pos, marker->pos, track->offset); + + object_camera_intrinsics(camob, &cam, &is_ortho, &shiftx, &shifty, &clipsta, &clipend, &lens, &sensor_x, &sensor_y, &sensor_fit); + + if(is_ortho) { + if(cam) + ortho_scale= cam->ortho_scale; + + vec[0]= ortho_scale * (pos[0]-0.5f+shiftx); + vec[1]= ortho_scale * (pos[1]-0.5f+shifty); + vec[2]= -len; + + if(aspect>1.f) vec[1]/= aspect; + else vec[0]*= aspect; + + mul_v3_m4v3(disp, camob->obmat, vec); + + copy_m4_m4(rmat, camob->obmat); + zero_v3(rmat[3]); + mul_m4_m4m4(cob->matrix, rmat, cob->matrix); + + copy_v3_v3(cob->matrix[3], disp); + } + else { + d= (len*sensor_x) / (2.f*lens); + + vec[0]= d*(2.f*(pos[0]+shiftx)-1.f); + vec[1]= d*(2.f*(pos[1]+shifty)-1.f); + vec[2]= -len; + + if(aspect>1.f) vec[1]/= aspect; + else vec[0]*= aspect; + + mul_v3_m4v3(disp, camob->obmat, vec); + + /* apply camera rotation so Z-axis would be co-linear */ + copy_m4_m4(rmat, camob->obmat); + zero_v3(rmat[3]); + mul_m4_m4m4(cob->matrix, rmat, cob->matrix); + + copy_v3_v3(cob->matrix[3], disp); + } + } + } + } +} + +static bConstraintTypeInfo CTI_FOLLOWTRACK = { + CONSTRAINT_TYPE_FOLLOWTRACK, /* type */ + sizeof(bFollowTrackConstraint), /* size */ + "Follow Track", /* name */ + "bFollowTrackConstraint", /* struct name */ + NULL, /* free data */ + NULL, /* relink data */ + followtrack_id_looper, /* id looper */ + NULL, /* copy data */ + followtrack_new_data, /* new data */ + NULL, /* get constraint targets */ + NULL, /* flush constraint targets */ + NULL, /* get target matrix */ + followtrack_evaluate /* evaluate */ +}; + +/* ----------- Camre Solver ------------- */ + +static void camerasolver_new_data (void *cdata) +{ + bCameraSolverConstraint *data= (bCameraSolverConstraint *)cdata; + + data->clip= NULL; + data->flag|= CAMERASOLVER_ACTIVECLIP; +} + +static void camerasolver_id_looper (bConstraint *con, ConstraintIDFunc func, void *userdata) +{ + bCameraSolverConstraint *data= con->data; + + func(con, (ID**)&data->clip, userdata); +} + +static void camerasolver_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets)) +{ + Scene *scene= cob->scene; + bCameraSolverConstraint *data= con->data; + MovieClip *clip= data->clip; + + if(data->flag&CAMERASOLVER_ACTIVECLIP) + clip= scene->clip; + + if(clip) { + float mat[4][4], obmat[4][4]; + + BKE_tracking_get_interpolated_camera(&clip->tracking, scene->r.cfra, mat); + + copy_m4_m4(obmat, cob->matrix); + mul_m4_m4m4(cob->matrix, mat, obmat); + } +} + +static bConstraintTypeInfo CTI_CAMERASOLVER = { + CONSTRAINT_TYPE_CAMERASOLVER, /* type */ + sizeof(bCameraSolverConstraint), /* size */ + "Camera Solver", /* name */ + "bCameraSolverConstraint", /* struct name */ + NULL, /* free data */ + NULL, /* relink data */ + camerasolver_id_looper, /* id looper */ + NULL, /* copy data */ + camerasolver_new_data, /* new data */ + NULL, /* get constraint targets */ + NULL, /* flush constraint targets */ + NULL, /* get target matrix */ + camerasolver_evaluate /* evaluate */ +}; + /* ************************* Constraints Type-Info *************************** */ /* All of the constraints api functions use bConstraintTypeInfo structs to carry out * and operations that involve constraint specific code. @@ -3962,6 +4166,8 @@ static void constraints_init_typeinfo (void) constraintsTypeInfo[23]= &CTI_TRANSLIKE; /* Copy Transforms Constraint */ constraintsTypeInfo[24]= &CTI_SAMEVOL; /* Maintain Volume Constraint */ constraintsTypeInfo[25]= &CTI_PIVOT; /* Pivot Constraint */ + constraintsTypeInfo[26]= &CTI_FOLLOWTRACK; /* Follow Track Constraint */ + constraintsTypeInfo[27]= &CTI_CAMERASOLVER; /* Camera Solver Constraint */ } /* This function should be used for getting the appropriate type-info when only diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 18c08b617de..9e9a0ca2d54 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -361,6 +361,13 @@ struct SpaceUserPref *CTX_wm_space_userpref(const bContext *C) return NULL; } +struct SpaceClip *CTX_wm_space_clip(const bContext *C) +{ + if(C->wm.area && C->wm.area->spacetype==SPACE_CLIP) + return C->wm.area->spacedata.first; + return NULL; +} + void CTX_wm_manager_set(bContext *C, wmWindowManager *wm) { C->wm.manager= wm; @@ -882,6 +889,11 @@ struct Text *CTX_data_edit_text(const bContext *C) return ctx_data_pointer_get(C, "edit_text"); } +struct MovieClip *CTX_data_edit_movieclip(const bContext *C) +{ + return ctx_data_pointer_get(C, "edit_movieclip"); +} + struct EditBone *CTX_data_active_bone(const bContext *C) { return ctx_data_pointer_get(C, "active_bone"); diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index adc08f5cd9f..160f5703a01 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -192,7 +192,7 @@ Curve *copy_curve(Curve *cu) Curve *cun; int a; - cun= copy_libblock(cu); + cun= copy_libblock(&cu->id); cun->nurb.first= cun->nurb.last= NULL; duplicateNurblist( &(cun->nurb), &(cu->nurb)); diff --git a/source/blender/blenkernel/intern/customdata_file.c b/source/blender/blenkernel/intern/customdata_file.c index d65f08ed7a3..75898018a2b 100644 --- a/source/blender/blenkernel/intern/customdata_file.c +++ b/source/blender/blenkernel/intern/customdata_file.c @@ -273,7 +273,7 @@ static int cdf_write_header(CDataFile *cdf) return 1; } -int cdf_read_open(CDataFile *cdf, char *filename) +int cdf_read_open(CDataFile *cdf, const char *filename) { FILE *f; @@ -341,7 +341,7 @@ void cdf_read_close(CDataFile *cdf) } } -int cdf_write_open(CDataFile *cdf, char *filename) +int cdf_write_open(CDataFile *cdf, const char *filename) { CDataFileHeader *header; CDataFileImageHeader *image; @@ -405,14 +405,14 @@ void cdf_write_close(CDataFile *cdf) } } -void cdf_remove(char *filename) +void cdf_remove(const char *filename) { BLI_delete(filename, 0, 0); } /********************************** Layers ***********************************/ -CDataFileLayer *cdf_layer_find(CDataFile *cdf, int type, char *name) +CDataFileLayer *cdf_layer_find(CDataFile *cdf, int type, const char *name) { CDataFileLayer *layer; int a; @@ -427,7 +427,7 @@ CDataFileLayer *cdf_layer_find(CDataFile *cdf, int type, char *name) return NULL; } -CDataFileLayer *cdf_layer_add(CDataFile *cdf, int type, char *name, size_t datasize) +CDataFileLayer *cdf_layer_add(CDataFile *cdf, int type, const char *name, size_t datasize) { CDataFileLayer *newlayer, *layer; diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 51edee9ea71..79930fdd8bf 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -50,6 +50,7 @@ #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_windowmanager_types.h" +#include "DNA_movieclip_types.h" #include "BKE_animsys.h" #include "BKE_action.h" @@ -639,7 +640,26 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O ListBase targets = {NULL, NULL}; bConstraintTarget *ct; - if (cti && cti->get_constraint_targets) { + if(!cti) + continue; + + /* special case for camera tracking -- it doesn't use targets to define relations */ + if(ELEM(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER)) { + if(cti->type==CONSTRAINT_TYPE_FOLLOWTRACK) { + bFollowTrackConstraint *data= (bFollowTrackConstraint *)con->data; + + if((data->clip || data->flag&FOLLOWTRACK_ACTIVECLIP) && data->track[0]) { + if(scene->camera) { + node2 = dag_get_node(dag, scene->camera); + dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, cti->name); + } + } + } + + dag_add_relation(dag,scenenode,node,DAG_RL_SCENE, "Scene Relation"); + addtoroot = 0; + } + else if (cti->get_constraint_targets) { cti->get_constraint_targets(con, &targets); for (ct= targets.first; ct; ct= ct->next) { @@ -2127,18 +2147,25 @@ static void dag_object_time_update_flags(Object *ob) ListBase targets = {NULL, NULL}; bConstraintTarget *ct; - if (cti && cti->get_constraint_targets) { - cti->get_constraint_targets(con, &targets); - - for (ct= targets.first; ct; ct= ct->next) { - if (ct->tar) { - ob->recalc |= OB_RECALC_OB; - break; + if (cti) { + /* special case for camera tracking -- it doesn't use targets to define relations */ + if(ELEM(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER)) { + ob->recalc |= OB_RECALC_OB; + } + else if (cti->get_constraint_targets) { + cti->get_constraint_targets(con, &targets); + + for (ct= targets.first; ct; ct= ct->next) { + if (ct->tar) { + ob->recalc |= OB_RECALC_OB; + break; + } } + + if (cti->flush_constraint_targets) + cti->flush_constraint_targets(con, &targets, 1); } - if (cti->flush_constraint_targets) - cti->flush_constraint_targets(con, &targets, 1); } } } @@ -2511,6 +2538,36 @@ static void dag_id_flush_update(Scene *sce, ID *id) BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH); } + if(idtype == ID_MC) { + for(obt=bmain->object.first; obt; obt= obt->id.next){ + bConstraint *con; + for (con = obt->constraints.first; con; con=con->next) { + bConstraintTypeInfo *cti= constraint_get_typeinfo(con); + if(ELEM(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER)) { + obt->recalc |= OB_RECALC_OB; + break; + } + } + } + + if(sce->nodetree) { + bNode *node; + + for(node= sce->nodetree->nodes.first; node; node= node->next) { + if(node->id==id) { + nodeUpdate(sce->nodetree, node); + } + } + } + } + + /* camera's matrix is used to orient reconstructed stuff, + so it should happen tracking-related constraints recalculation + when camera is changing (sergey) */ + if(sce->camera && &sce->camera->id == id && object_get_movieclip(sce, sce->camera, 1)) { + dag_id_flush_update(sce, &sce->clip->id); + } + /* update editors */ dag_editors_update(bmain, id); } diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 6ae556874bb..a5be056bc16 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -346,7 +346,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i if(a==0 && dl->type== DL_POLY) bezt= nu->bezt; if(prevbezt->h2==HD_VECT && bezt->h1==HD_VECT) { - VECCOPY(data, prevbezt->vec[1]); + copy_v3_v3(data, prevbezt->vec[1]); data+= 3; } else { @@ -363,7 +363,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i } if(a==0 && dl->type==DL_SEGM) { - VECCOPY(data, bezt->vec[1]); + copy_v3_v3(data, bezt->vec[1]); } prevbezt= bezt; @@ -404,7 +404,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i a= len; bp= nu->bp; while(a--) { - VECCOPY(data, bp->vec); + copy_v3_v3(data, bp->vec); bp++; data+= 3; } @@ -486,7 +486,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal) totvert= 0; eve= fillvertbase.first; while(eve) { - VECCOPY(f1, eve->co); + copy_v3_v3(f1, eve->co); f1+= 3; /* index number */ @@ -559,7 +559,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase) a= dl->parts; while(a--) { - VECCOPY(fp1, fp); + copy_v3_v3(fp1, fp); fp1+= 3; fp+= dpoly; } @@ -579,7 +579,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase) a= dl->parts; while(a--) { - VECCOPY(fp1, fp); + copy_v3_v3(fp1, fp); fp1+= 3; fp+= dpoly; } diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index bb14a1ddeaf..7b58c0bc00b 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -555,7 +555,7 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *UNU if(falloff == 0.0f) break; - VECADDFAC(temp, efd->vec_to_point, efd->nor, -fac); + madd_v3_v3v3fl(temp, efd->vec_to_point, efd->nor, -fac); r_fac= len_v3(temp); falloff*= falloff_func_rad(eff->pd, r_fac); break; @@ -573,7 +573,7 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *UNU return falloff; } -int closest_point_on_surface(SurfaceModifierData *surmd, float *co, float *surface_co, float *surface_nor, float *surface_vel) +int closest_point_on_surface(SurfaceModifierData *surmd, const float co[3], float surface_co[3], float surface_nor[3], float surface_vel[3]) { BVHTreeNearest nearest; @@ -797,7 +797,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP if(eff->pd->flag & PFIELD_TEX_2D) { float fac=-dot_v3v3(tex_co, efd->nor); - VECADDFAC(tex_co, tex_co, efd->nor, fac); + madd_v3_v3fl(tex_co, efd->nor, fac); } if(eff->pd->flag & PFIELD_TEX_OBJECT) { @@ -848,7 +848,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP if(eff->pd->flag & PFIELD_TEX_2D){ float fac = -dot_v3v3(force, efd->nor); - VECADDFAC(force, force, efd->nor, fac); + madd_v3_v3fl(force, efd->nor, fac); } add_v3_v3(total_force, force); @@ -897,7 +897,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected cross_v3_v3v3(force, efd->nor2, temp); mul_v3_fl(force, strength * efd->falloff); - VECADDFAC(temp, temp, point->vel, -point->vel_to_sec); + madd_v3_v3fl(temp, point->vel, -point->vel_to_sec); add_v3_v3(force, temp); } break; @@ -940,7 +940,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected copy_v3_v3(temp, point->loc); } else { - VECADD(temp, efd->vec_to_point2, efd->nor2); + add_v3_v3v3(temp, efd->vec_to_point2, efd->nor2); } force[0] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[0], temp[1], temp[2], 2,0,2); force[1] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[1], temp[2], temp[0], 2,0,2); @@ -959,10 +959,10 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected } if(pd->flag & PFIELD_DO_LOCATION) { - VECADDFAC(total_force, total_force, force, 1.0f/point->vel_to_sec); + madd_v3_v3fl(total_force, force, 1.0f/point->vel_to_sec); if(ELEM(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG)==0 && pd->f_flow != 0.0f) { - VECADDFAC(total_force, total_force, point->vel, -pd->f_flow * efd->falloff); + madd_v3_v3fl(total_force, point->vel, -pd->f_flow * efd->falloff); } } @@ -972,7 +972,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected mul_qt_v3(point->rot, xvec); cross_v3_v3v3(dave, xvec, force); if(pd->f_flow != 0.0f) { - VECADDFAC(dave, dave, point->ave, -pd->f_flow * efd->falloff); + madd_v3_v3fl(dave, point->ave, -pd->f_flow * efd->falloff); } add_v3_v3(point->ave, dave); } @@ -1038,14 +1038,14 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we // for softbody backward compatibility if(point->flag & PE_WIND_AS_SPEED && impulse){ - VECSUB(temp2, force, temp1); - VECSUB(impulse, impulse, temp2); + sub_v3_v3v3(temp2, force, temp1); + sub_v3_v3v3(impulse, impulse, temp2); } } } else if(eff->flag & PE_VELOCITY_TO_IMPULSE && impulse) { /* special case for harmonic effector */ - VECADD(impulse, impulse, efd.vel); + add_v3_v3v3(impulse, impulse, efd.vel); } } } diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 474b3a5ce63..5ab997d2c54 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -184,7 +184,7 @@ FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *pro char *path; if(driven) - *driven = 0; + *driven = FALSE; /* only use the current action ??? */ if (ELEM(NULL, adt, adt->action)) @@ -205,7 +205,7 @@ FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *pro if ((fcu == NULL) && (adt->drivers.first)) { fcu= list_find_fcurve(&adt->drivers, path, index); if(fcu && driven) - *driven = 1; + *driven = TRUE; fcu = NULL; } diff --git a/source/blender/blenkernel/intern/fluidsim.c b/source/blender/blenkernel/intern/fluidsim.c index bf432785064..cdb2b194b43 100644 --- a/source/blender/blenkernel/intern/fluidsim.c +++ b/source/blender/blenkernel/intern/fluidsim.c @@ -92,7 +92,7 @@ void initElbeemMesh(struct Scene *scene, struct Object *ob, *numVertices = totvert; verts = MEM_callocN( totvert*3*sizeof(float), "elbeemmesh_vertices"); for(i=0; i<totvert; i++) { - VECCOPY( &verts[i*3], mvert[i].co); + copy_v3_v3(&verts[i*3], mvert[i].co); if(useGlobalCoords) { mul_m4_v3(ob->obmat, &verts[i*3]); } } *vertices = verts; diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index cd025ecb559..76c3e6e5502 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -276,8 +276,9 @@ void group_tag_recalc(Group *group) int group_is_animated(Object *parent, Group *group) { GroupObject *go; - - if(give_timeoffset(parent) != 0.0f || parent->nlastrips.first) + + // XXX: old animsys depreceated... + if(parent->nlastrips.first) return 1; for(go= group->gobject.first; go; go= go->next) @@ -343,12 +344,11 @@ void group_handle_recalc_and_update(Scene *scene, Object *UNUSED(parent), Group * but when its enabled at some point it will need to be changed so as not to update so much - campbell */ /* if animated group... */ - if(give_timeoffset(parent) != 0.0f || parent->nlastrips.first) { + if(parent->nlastrips.first) { int cfrao; /* switch to local time */ cfrao= scene->r.cfra; - scene->r.cfra -= (int)floor(give_timeoffset(parent) + 0.5f); /* we need a DAG per group... */ for(go= group->gobject.first; go; go= go->next) { diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c index d305499d3a1..0824a9f6685 100644 --- a/source/blender/blenkernel/intern/idcode.c +++ b/source/blender/blenkernel/intern/idcode.c @@ -78,6 +78,7 @@ static IDType idtypes[]= { { ID_VF, "VFont", "fonts", IDTYPE_FLAGS_ISLINKABLE}, { ID_WO, "World", "worlds", IDTYPE_FLAGS_ISLINKABLE}, { ID_WM, "WindowManager", "window_managers", 0}, + { ID_MC, "MovieClip", "movieclips", IDTYPE_FLAGS_ISLINKABLE}, }; static int nidtypes= sizeof(idtypes)/sizeof(idtypes[0]); diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 6d095117136..eb7d07a6f7d 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -59,6 +59,7 @@ #include "BKE_main.h" #include "BKE_object.h" #include "BKE_deform.h" +#include "BKE_scene.h" #include "RNA_access.h" @@ -153,7 +154,7 @@ Key *copy_key(Key *key) if(key==NULL) return NULL; - keyn= copy_libblock(key); + keyn= copy_libblock(&key->id); BLI_duplicatelist(&keyn->block, &key->block); @@ -1072,7 +1073,7 @@ static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int for(a=0; a<tot; a+=step, cfra+= delta) { - ctime= bsystem_time(scene, NULL, cfra, 0.0); // xxx ugly cruft! + ctime= BKE_curframe(scene); #if 0 // XXX old animation system if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) { ctime /= 100.0; @@ -1106,7 +1107,7 @@ static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int } } else { - ctime= bsystem_time(scene, ob, (float)scene->r.cfra, 0.0f); // xxx old cruft + ctime= BKE_curframe(scene); #if 0 // XXX old animation system if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) { @@ -1204,7 +1205,7 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in while (a < estep) { if (remain <= 0) { cfra+= delta; - ctime= bsystem_time(scene, NULL, cfra, 0.0f); // XXX old cruft + ctime= BKE_curframe(scene); ctime /= 100.0f; CLAMP(ctime, 0.0f, 1.0f); // XXX for compat, we use this, but this clamping was confusing @@ -1231,7 +1232,7 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in } else { - ctime= bsystem_time(scene, NULL, (float)scene->r.cfra, 0.0); + ctime= BKE_curframe(scene); if(key->type==KEY_RELATIVE) { do_rel_cu_key(cu, cu->key, actkb, ctime, out, tot); @@ -1267,7 +1268,7 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int for(a=0; a<tot; a++, cfra+= delta) { - ctime= bsystem_time(scene, NULL, cfra, 0.0); // XXX old cruft + ctime= BKE_curframe(scene); #if 0 // XXX old animation system if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) { ctime /= 100.0; @@ -1298,7 +1299,7 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int } } else { - ctime= bsystem_time(scene, NULL, (float)scene->r.cfra, 0.0); + ctime= BKE_curframe(scene); #if 0 // XXX old animation system if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) { @@ -1462,7 +1463,7 @@ KeyBlock *add_keyblock(Key *key, const char *name) kb->pos= curpos + 0.1f; else { #if 0 // XXX old animation system - curpos= bsystem_time(scene, 0, (float)CFRA, 0.0); + curpos= BKE_curframe(scene); if(calc_ipo_spec(key->ipo, KEY_SPEED, &curpos)==0) { curpos /= 100.0; } diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c new file mode 100644 index 00000000000..4edd032dc04 --- /dev/null +++ b/source/blender/blenkernel/intern/lamp.c @@ -0,0 +1,233 @@ +/* + * ***** 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) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/blenkernel/intern/lamp.c + * \ingroup bke + */ + +#include <stdlib.h> + +#include "MEM_guardedalloc.h" + +#include "DNA_lamp_types.h" +#include "DNA_material_types.h" +#include "DNA_object_types.h" +#include "DNA_texture_types.h" + +#include "BLI_listbase.h" +#include "BLI_math.h" +#include "BLI_utildefines.h" + +#include "BKE_animsys.h" +#include "BKE_colortools.h" +#include "BKE_icons.h" +#include "BKE_global.h" +#include "BKE_lamp.h" +#include "BKE_library.h" +#include "BKE_main.h" +#include "BKE_node.h" + +void *add_lamp(const char *name) +{ + Lamp *la; + + la= alloc_libblock(&G.main->lamp, ID_LA, name); + + la->r= la->g= la->b= la->k= 1.0f; + la->haint= la->energy= 1.0f; + la->dist= 25.0f; + la->spotsize= 45.0f; + la->spotblend= 0.15f; + la->att2= 1.0f; + la->mode= LA_SHAD_BUF; + la->bufsize= 512; + la->clipsta= 0.5f; + la->clipend= 40.0f; + la->shadspotsize= 45.0f; + la->samp= 3; + la->bias= 1.0f; + la->soft= 3.0f; + la->compressthresh= 0.05f; + la->ray_samp= la->ray_sampy= la->ray_sampz= 1; + la->area_size=la->area_sizey=la->area_sizez= 1.0f; + la->buffers= 1; + la->buftype= LA_SHADBUF_HALFWAY; + la->ray_samp_method = LA_SAMP_HALTON; + la->adapt_thresh = 0.001f; + la->preview=NULL; + la->falloff_type = LA_FALLOFF_INVSQUARE; + la->curfalloff = curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f); + la->sun_effect_type = 0; + la->horizon_brightness = 1.0; + la->spread = 1.0; + la->sun_brightness = 1.0; + la->sun_size = 1.0; + la->backscattered_light = 1.0f; + la->atm_turbidity = 2.0f; + la->atm_inscattering_factor = 1.0f; + la->atm_extinction_factor = 1.0f; + la->atm_distance_factor = 1.0f; + la->sun_intensity = 1.0f; + la->skyblendtype= MA_RAMP_ADD; + la->skyblendfac= 1.0f; + la->sky_colorspace= BLI_XYZ_CIE; + la->sky_exposure= 1.0f; + + curvemapping_initialize(la->curfalloff); + return la; +} + +Lamp *copy_lamp(Lamp *la) +{ + Lamp *lan; + int a; + + lan= copy_libblock(&la->id); + + for(a=0; a<MAX_MTEX; a++) { + if(lan->mtex[a]) { + lan->mtex[a]= MEM_mallocN(sizeof(MTex), "copylamptex"); + memcpy(lan->mtex[a], la->mtex[a], sizeof(MTex)); + id_us_plus((ID *)lan->mtex[a]->tex); + } + } + + lan->curfalloff = curvemapping_copy(la->curfalloff); + + if(la->nodetree) + lan->nodetree= ntreeCopyTree(la->nodetree); + + if(la->preview) + lan->preview = BKE_previewimg_copy(la->preview); + + return lan; +} + +Lamp *localize_lamp(Lamp *la) +{ + Lamp *lan; + int a; + + lan= copy_libblock(&la->id); + BLI_remlink(&G.main->lamp, lan); + + for(a=0; a<MAX_MTEX; a++) { + if(lan->mtex[a]) { + lan->mtex[a]= MEM_mallocN(sizeof(MTex), "localize_lamp"); + memcpy(lan->mtex[a], la->mtex[a], sizeof(MTex)); + /* free lamp decrements */ + id_us_plus((ID *)lan->mtex[a]->tex); + } + } + + lan->curfalloff = curvemapping_copy(la->curfalloff); + + if(la->nodetree) + lan->nodetree= ntreeLocalize(la->nodetree); + + lan->preview= NULL; + + return lan; +} + +void make_local_lamp(Lamp *la) +{ + Main *bmain= G.main; + Object *ob; + int is_local= FALSE, is_lib= FALSE; + + /* - only lib users: do nothing + * - only local users: set flag + * - mixed: make copy + */ + + if(la->id.lib==NULL) return; + if(la->id.us==1) { + id_clear_lib_data(bmain, &la->id); + return; + } + + ob= bmain->object.first; + while(ob) { + if(ob->data==la) { + if(ob->id.lib) is_lib= TRUE; + else is_local= TRUE; + } + ob= ob->id.next; + } + + if(is_local && is_lib == FALSE) { + id_clear_lib_data(bmain, &la->id); + } + else if(is_local && is_lib) { + Lamp *lan= copy_lamp(la); + lan->id.us= 0; + + /* Remap paths of new ID using old library as base. */ + BKE_id_lib_local_paths(bmain, &lan->id); + + ob= bmain->object.first; + while(ob) { + if(ob->data==la) { + + if(ob->id.lib==NULL) { + ob->data= lan; + lan->id.us++; + la->id.us--; + } + } + ob= ob->id.next; + } + } +} + +void free_lamp(Lamp *la) +{ + MTex *mtex; + int a; + + for(a=0; a<MAX_MTEX; a++) { + mtex= la->mtex[a]; + if(mtex && mtex->tex) mtex->tex->id.us--; + if(mtex) MEM_freeN(mtex); + } + + BKE_free_animdata((ID *)la); + + curvemapping_free(la->curfalloff); + + /* is no lib link block, but lamp extension */ + if(la->nodetree) { + ntreeFreeTree(la->nodetree); + MEM_freeN(la->nodetree); + } + + BKE_previewimg_free(&la->preview); + BKE_icon_delete(&la->id); + la->id.icon_id = 0; +} + diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 47878242604..7c9e2be4493 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -204,7 +204,7 @@ Lattice *copy_lattice(Lattice *lt) { Lattice *ltn; - ltn= copy_libblock(lt); + ltn= copy_libblock(<->id); ltn->def= MEM_dupallocN(lt->def); ltn->key= copy_key(ltn->key); @@ -658,7 +658,9 @@ static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, C return 0; } -void curve_deform_verts(Scene *scene, Object *cuOb, Object *target, DerivedMesh *dm, float (*vertexCos)[3], int numVerts, char *vgroup, short defaxis) +void curve_deform_verts(Scene *scene, Object *cuOb, Object *target, + DerivedMesh *dm, float (*vertexCos)[3], + int numVerts, const char *vgroup, short defaxis) { Curve *cu; int a, flag; @@ -817,7 +819,7 @@ void curve_deform_vector(Scene *scene, Object *cuOb, Object *target, float *orco } void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm, - float (*vertexCos)[3], int numVerts, char *vgroup) + float (*vertexCos)[3], int numVerts, const char *vgroup) { int a; int use_vgroups; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 35b50730a31..650f85da5b3 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -70,6 +70,7 @@ #include "DNA_windowmanager_types.h" #include "DNA_world_types.h" #include "DNA_gpencil_types.h" +#include "DNA_movieclip_types.h" #include "BLI_blenlib.h" #include "BLI_dynstr.h" @@ -77,7 +78,9 @@ #include "BLI_bpath.h" #include "BKE_animsys.h" +#include "BKE_camera.h" #include "BKE_context.h" +#include "BKE_lamp.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_global.h" @@ -109,6 +112,7 @@ #include "BKE_fcurve.h" #include "BKE_speaker.h" #include "BKE_utildefines.h" +#include "BKE_movieclip.h" #include "RNA_access.h" @@ -482,6 +486,8 @@ ListBase *which_libbase(Main *mainlib, short type) return &(mainlib->wm); case ID_GD: return &(mainlib->gpencil); + case ID_MC: + return &(mainlib->movieclip); } return NULL; } @@ -563,6 +569,7 @@ int set_listbasepointers(Main *main, ListBase **lb) lb[a++]= &(main->scene); lb[a++]= &(main->library); lb[a++]= &(main->wm); + lb[a++]= &(main->movieclip); lb[a]= NULL; @@ -671,6 +678,9 @@ static ID *alloc_libblock_notest(short type) case ID_GD: id = MEM_callocN(sizeof(bGPdata), "Grease Pencil"); break; + case ID_MC: + id = MEM_callocN(sizeof(MovieClip), "Movie Clip"); + break; } return id; } @@ -715,14 +725,11 @@ void copy_libblock_data(ID *id, const ID *id_from, const short do_action) } /* used everywhere in blenkernel */ -void *copy_libblock(void *rt) +void *copy_libblock(ID *id) { - ID *idn, *id; + ID *idn; ListBase *lb; - char *cp, *cpn; size_t idn_len; - - id= rt; lb= which_libbase(G.main, GS(id->name)); idn= alloc_libblock(lb, GS(id->name), id->name+2); @@ -731,8 +738,9 @@ void *copy_libblock(void *rt) idn_len= MEM_allocN_len(idn); if((int)idn_len - (int)sizeof(ID) > 0) { /* signed to allow neg result */ - cp= (char *)id; - cpn= (char *)idn; + const char *cp= (const char *)id; + char *cpn= (char *)idn; + memcpy(cpn+sizeof(ID), cp+sizeof(ID), idn_len - sizeof(ID)); } @@ -878,6 +886,9 @@ void free_libblock(ListBase *lb, void *idv) case ID_GD: free_gpencil_data((bGPdata *)id); break; + case ID_MC: + free_movieclip((MovieClip *)id); + break; } if (id->properties) { diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 7be3514e0f2..48c6d6b2a19 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -215,7 +215,7 @@ Material *copy_material(Material *ma) Material *man; int a; - man= copy_libblock(ma); + man= copy_libblock(&ma->id); id_lib_extern((ID *)man->group); @@ -247,7 +247,7 @@ Material *localize_material(Material *ma) Material *man; int a; - man= copy_libblock(ma); + man= copy_libblock(&ma->id); BLI_remlink(&G.main->mat, man); /* no increment for texture ID users, in previewrender.c it prevents decrement */ diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 327306b32ee..5c82acde99b 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -120,7 +120,7 @@ MetaBall *copy_mball(MetaBall *mb) MetaBall *mbn; int a; - mbn= copy_libblock(mb); + mbn= copy_libblock(&mb->id); BLI_duplicatelist(&mbn->elems, &mb->elems); diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 4a8bc34cdf7..ec9d4873057 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -206,7 +206,7 @@ Mesh *copy_mesh(Mesh *me) MTFace *tface; int a, i; - men= copy_libblock(me); + men= copy_libblock(&me->id); men->mat= MEM_dupallocN(me->mat); for(a=0; a<men->totcol; a++) { diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c new file mode 100644 index 00000000000..e3bfdd54ab1 --- /dev/null +++ b/source/blender/blenkernel/intern/movieclip.c @@ -0,0 +1,1026 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/blenkernel/intern/movieclip.c + * \ingroup bke + */ + + +#include <stdio.h> +#include <string.h> +#include <fcntl.h> + +#ifndef WIN32 +#include <unistd.h> +#else +#include <io.h> +#endif + +#include <time.h> + +#ifdef _WIN32 +#define open _open +#define close _close +#endif + +#include "MEM_guardedalloc.h" + +#include "DNA_constraint_types.h" +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_movieclip_types.h" +#include "DNA_object_types.h" +#include "DNA_scene_types.h" +#include "DNA_view3d_types.h" + +#include "BLI_utildefines.h" + +#include "BLI_blenlib.h" +#include "BLI_ghash.h" +#include "BLI_math.h" +#include "BLI_mempool.h" +#include "BLI_threads.h" + +#include "BKE_constraint.h" +#include "BKE_library.h" +#include "BKE_global.h" +#include "BKE_main.h" +#include "BKE_utildefines.h" +#include "BKE_movieclip.h" +#include "BKE_image.h" /* openanim */ +#include "BKE_tracking.h" + +#include "IMB_imbuf_types.h" +#include "IMB_imbuf.h" +#include "IMB_moviecache.h" + +/*********************** movieclip buffer loaders *************************/ + +static int sequence_guess_offset(const char *full_name, int head_len, int numlen) +{ + char num[FILE_MAX]= {0}; + + BLI_strncpy(num, full_name+head_len, numlen+1); + + return atoi(num); +} + +static int rendersize_to_proxy(MovieClipUser *user, int flag) +{ + if((flag&MCLIP_USE_PROXY)==0) + return IMB_PROXY_NONE; + + switch(user->render_size) { + case MCLIP_PROXY_RENDER_SIZE_25: + return IMB_PROXY_25; + + case MCLIP_PROXY_RENDER_SIZE_50: + return IMB_PROXY_50; + + case MCLIP_PROXY_RENDER_SIZE_75: + return IMB_PROXY_75; + + case MCLIP_PROXY_RENDER_SIZE_100: + return IMB_PROXY_100; + + case MCLIP_PROXY_RENDER_SIZE_FULL: + return IMB_PROXY_NONE; + } + + return IMB_PROXY_NONE; +} + +static int rendersize_to_number(int render_size) +{ + switch(render_size) { + case MCLIP_PROXY_RENDER_SIZE_25: + return 25; + + case MCLIP_PROXY_RENDER_SIZE_50: + return 50; + + case MCLIP_PROXY_RENDER_SIZE_75: + return 75; + + case MCLIP_PROXY_RENDER_SIZE_100: + return 100; + + case MCLIP_PROXY_RENDER_SIZE_FULL: + return 100; + } + + return 100; +} + +static int get_timecode(MovieClip *clip, int flag) +{ + if((flag&MCLIP_USE_PROXY)==0) + return IMB_TC_NONE; + + return clip->proxy.tc; +} + +static void get_sequence_fname(MovieClip *clip, int framenr, char *name) +{ + unsigned short numlen; + char head[FILE_MAX], tail[FILE_MAX]; + int offset; + + BLI_strncpy(name, clip->name, sizeof(clip->name)); + BLI_stringdec(name, head, tail, &numlen); + + /* movieclips always points to first image from sequence, + autoguess offset for now. could be something smarter in the future */ + offset= sequence_guess_offset(clip->name, strlen(head), numlen); + + if (numlen) BLI_stringenc(name, head, tail, numlen, offset+framenr-1); + else BLI_strncpy(name, clip->name, sizeof(clip->name)); + + BLI_path_abs(name, ID_BLEND_PATH(G.main, &clip->id)); +} + +/* supposed to work with sequences only */ +static void get_proxy_fname(MovieClip *clip, int proxy_render_size, int undistorted, int framenr, char *name) +{ + int size= rendersize_to_number(proxy_render_size); + char dir[FILE_MAX], clipdir[FILE_MAX], clipfile[FILE_MAX]; + + BLI_split_dirfile(clip->name, clipdir, clipfile, FILE_MAX, FILE_MAX); + + if(clip->flag&MCLIP_USE_PROXY_CUSTOM_DIR) { + BLI_strncpy(dir, clip->proxy.dir, sizeof(dir)); + } else { + BLI_snprintf(dir, FILE_MAX, "%s/BL_proxy", clipdir); + } + + if(undistorted) + BLI_snprintf(name, FILE_MAX, "%s/%s/proxy_%d_undistorted/%08d", dir, clipfile, size, framenr); + else + BLI_snprintf(name, FILE_MAX, "%s/%s/proxy_%d/%08d", dir, clipfile, size, framenr); + + BLI_path_abs(name, G.main->name); + BLI_path_frame(name, 1, 0); + + strcat(name, ".jpg"); +} + +static ImBuf *movieclip_load_sequence_file(MovieClip *clip, MovieClipUser *user, int framenr, int flag) +{ + struct ImBuf *ibuf; + char name[FILE_MAX]; + int loadflag /*, size */ /* UNUSED */, undistort; + + /* size= rendersize_to_number(user->render_size); */ + + undistort= user->render_flag&MCLIP_PROXY_RENDER_UNDISTORT; + + if((flag&MCLIP_USE_PROXY) && user->render_size != MCLIP_PROXY_RENDER_SIZE_FULL) + get_proxy_fname(clip, user->render_size, undistort, framenr, name); + else + get_sequence_fname(clip, framenr, name); + + loadflag= IB_rect|IB_multilayer; + + /* read ibuf */ + ibuf= IMB_loadiffname(name, loadflag); + + return ibuf; +} + +static ImBuf *movieclip_load_movie_file(MovieClip *clip, MovieClipUser *user, int framenr, int flag) +{ + ImBuf *ibuf= NULL; + int tc= get_timecode(clip, flag); + int proxy= rendersize_to_proxy(user, flag); + char str[FILE_MAX]; + + if(!clip->anim) { + BLI_strncpy(str, clip->name, FILE_MAX); + BLI_path_abs(str, ID_BLEND_PATH(G.main, &clip->id)); + + /* FIXME: make several stream accessible in image editor, too */ + clip->anim= openanim(str, IB_rect, 0); + + if(clip->anim) { + if(clip->flag&MCLIP_USE_PROXY_CUSTOM_DIR) { + char dir[FILE_MAX]; + BLI_strncpy(dir, clip->proxy.dir, sizeof(dir)); + BLI_path_abs(dir, G.main->name); + IMB_anim_set_index_dir(clip->anim, dir); + } + } + } + + if(clip->anim) { + int dur; + int fra; + + dur= IMB_anim_get_duration(clip->anim, tc); + fra= framenr-1; + + if(fra<0) + fra= 0; + + if(fra>(dur-1)) + fra= dur-1; + + ibuf= IMB_anim_absolute(clip->anim, fra, tc, proxy); + } + + return ibuf; +} + +/*********************** image buffer cache *************************/ + +typedef struct MovieClipCache { + /* regular movie cache */ + struct MovieCache *moviecache; + + /* cache for stable shot */ + int stable_framenr; + float stable_loc[2], stable_scale, stable_angle; + ImBuf *stableibuf; + int proxy; + short render_flag; + + /* cache for undistorted shot */ + int undist_framenr; + float principal[2]; + float k1, k2, k3; + ImBuf *undistibuf; +} MovieClipCache; + +typedef struct MovieClipImBufCacheKey { + int framenr; + int proxy; + short render_flag; +} MovieClipImBufCacheKey; + +static void moviecache_keydata(void *userkey, int *framenr, int *proxy, int *render_flags) +{ + MovieClipImBufCacheKey *key= (MovieClipImBufCacheKey*)userkey; + + *framenr= key->framenr; + *proxy= key->proxy; + *render_flags= key->render_flag; +} + +static unsigned int moviecache_hashhash(const void *keyv) +{ + MovieClipImBufCacheKey *key= (MovieClipImBufCacheKey*)keyv; + int rval= key->framenr; + + return rval; +} + +static int moviecache_hashcmp(const void *av, const void *bv) +{ + const MovieClipImBufCacheKey *a= (MovieClipImBufCacheKey*)av; + const MovieClipImBufCacheKey *b= (MovieClipImBufCacheKey*)bv; + + if(a->framenr<b->framenr) return -1; + else if(a->framenr>b->framenr) return 1; + + if(a->proxy<b->proxy) return -1; + else if(a->proxy>b->proxy) return 1; + + if(a->render_flag<b->render_flag) return -1; + else if(a->render_flag>b->render_flag) return 1; + + return 0; +} + +static ImBuf *get_imbuf_cache(MovieClip *clip, MovieClipUser *user, int flag) +{ + if(clip->cache) { + MovieClipImBufCacheKey key; + + key.framenr= user?user->framenr:clip->lastframe; + + if(flag&MCLIP_USE_PROXY) { + key.proxy= rendersize_to_proxy(user, flag); + key.render_flag= user->render_flag; + } + else { + key.proxy= IMB_PROXY_NONE; + key.render_flag= 0; + } + + return IMB_moviecache_get(clip->cache->moviecache, &key); + } + + return NULL; +} + +static void put_imbuf_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, int flag) +{ + MovieClipImBufCacheKey key; + + if(!clip->cache) { + clip->cache= MEM_callocN(sizeof(MovieClipCache), "movieClipCache"); + + clip->cache->moviecache= IMB_moviecache_create(sizeof(MovieClipImBufCacheKey), moviecache_hashhash, + moviecache_hashcmp, moviecache_keydata); + } + + key.framenr= user?user->framenr:clip->lastframe; + + if(flag&MCLIP_USE_PROXY) { + key.proxy= rendersize_to_proxy(user, flag); + key.render_flag= user->render_flag; + } + else { + key.proxy= IMB_PROXY_NONE; + key.render_flag= 0; + } + + IMB_moviecache_put(clip->cache->moviecache, &key, ibuf); +} + +/*********************** common functions *************************/ + +/* only image block itself */ +static MovieClip *movieclip_alloc(const char *name) +{ + MovieClip *clip; + + clip= alloc_libblock(&G.main->movieclip, ID_MC, name); + + clip->aspx= clip->aspy= 1.0f; + + clip->tracking.camera.sensor_width= 35.0f; + clip->tracking.camera.pixel_aspect= 1.0f; + clip->tracking.camera.units= CAMERA_UNITS_MM; + + clip->tracking.settings.frames_limit= 0; + clip->tracking.settings.keyframe1= 1; + clip->tracking.settings.keyframe2= 30; + clip->tracking.settings.dist= 1; + + clip->tracking.stabilization.scaleinf= 1.0f; + clip->tracking.stabilization.locinf= 1.0f; + clip->tracking.stabilization.rotinf= 1.0f; + clip->tracking.stabilization.maxscale= 2.0f; + + clip->proxy.build_size_flag= IMB_PROXY_25; + clip->proxy.build_tc_flag= IMB_TC_RECORD_RUN|IMB_TC_FREE_RUN|IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN; + clip->proxy.quality= 90; + + return clip; +} + +/* checks if image was already loaded, then returns same image + otherwise creates new. + does not load ibuf itself + pass on optional frame for #name images */ +MovieClip *BKE_add_movieclip_file(const char *name) +{ + MovieClip *clip; + MovieClipUser user; + int file, len, width, height; + const char *libname; + char str[FILE_MAX], strtest[FILE_MAX]; + + BLI_strncpy(str, name, sizeof(str)); + BLI_path_abs(str, G.main->name); + + /* exists? */ + file= open(str, O_BINARY|O_RDONLY); + if(file== -1) return NULL; + close(file); + + /* ** first search an identical clip ** */ + for(clip= G.main->movieclip.first; clip; clip= clip->id.next) { + BLI_strncpy(strtest, clip->name, sizeof(clip->name)); + BLI_path_abs(strtest, G.main->name); + + if(strcmp(strtest, str)==0) { + BLI_strncpy(clip->name, name, sizeof(clip->name)); /* for stringcode */ + clip->id.us++; /* officially should not, it doesn't link here! */ + + return clip; + } + } + + /* ** add new movieclip ** */ + + /* create a short library name */ + len= strlen(name); + + while (len > 0 && name[len - 1] != '/' && name[len - 1] != '\\') len--; + libname= name+len; + + clip= movieclip_alloc(libname); + BLI_strncpy(clip->name, name, sizeof(clip->name)); + + if(BLI_testextensie_array(name, imb_ext_movie)) clip->source= MCLIP_SRC_MOVIE; + else clip->source= MCLIP_SRC_SEQUENCE; + + user.framenr= 1; + BKE_movieclip_get_size(clip, &user, &width, &height); + if(width && height) { + clip->tracking.camera.principal[0]= ((float)width)/2; + clip->tracking.camera.principal[1]= ((float)height)/2; + + clip->tracking.camera.focal= 24.0f*width/clip->tracking.camera.sensor_width; + } + + return clip; +} + +static void real_ibuf_size(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, int *width, int *height) +{ + *width= ibuf->x; + *height= ibuf->y; + + if(clip->flag&MCLIP_USE_PROXY) { + switch(user->render_size) { + case MCLIP_PROXY_RENDER_SIZE_25: + (*width)*= 4; + (*height)*= 4; + break; + + case MCLIP_PROXY_RENDER_SIZE_50: + (*width)*= 2.0f; + (*height)*= 2.0f; + break; + + case MCLIP_PROXY_RENDER_SIZE_75: + *width= ((float)*width)*4.0f/3.0f; + *height= ((float)*height)*4.0f/3.0f; + break; + } + } +} + +static int need_undistorted_cache(MovieClipUser *user, int flag) +{ + if (!user) + return 0; + + /* only full undistorted render can be used as on-fly undistorting image */ + if(flag&MCLIP_USE_PROXY) { + if(user->render_size != MCLIP_PROXY_RENDER_SIZE_FULL || (user->render_flag&MCLIP_PROXY_RENDER_UNDISTORT)==0) + return 0; + } + else return 0; + + return 1; +} + +static ImBuf *get_undistorted_cache(MovieClip *clip, MovieClipUser *user) +{ + MovieClipCache *cache= clip->cache; + MovieTrackingCamera *camera= &clip->tracking.camera; + int framenr= user?user->framenr:clip->lastframe; + + /* no cache or no cached undistorted image */ + if(!clip->cache || !clip->cache->undistibuf) + return NULL; + + /* undistortion happened for other frame */ + if(cache->undist_framenr!=framenr) + return NULL; + + /* check for distortion model changes */ + if(!equals_v2v2(camera->principal, cache->principal)) + return NULL; + + if(!equals_v3v3(&camera->k1, &cache->k1)) + return NULL; + + IMB_refImBuf(cache->undistibuf); + + return cache->undistibuf; +} + +static ImBuf *get_undistorted_ibuf(MovieClip *clip, struct MovieDistortion *distoriton, ImBuf *ibuf) +{ + ImBuf *undistibuf; + + /* XXX: because of #27997 do not use float buffers to undistort, + otherwise, undistorted proxy can be darker than it should */ + imb_freerectfloatImBuf(ibuf); + + if(distoriton) + undistibuf= BKE_tracking_distortion_exec(distoriton, &clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f, 1); + else + undistibuf= BKE_tracking_undistort(&clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f); + + if(undistibuf->userflags|= IB_RECT_INVALID) { + ibuf->userflags&= ~IB_RECT_INVALID; + IMB_rect_from_float(undistibuf); + } + + IMB_scaleImBuf(undistibuf, ibuf->x, ibuf->y); + + return undistibuf; +} + +static ImBuf *put_undistorted_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf) +{ + MovieClipCache *cache= clip->cache; + MovieTrackingCamera *camera= &clip->tracking.camera; + + copy_v2_v2(cache->principal, camera->principal); + copy_v3_v3(&cache->k1, &camera->k1); + cache->undist_framenr= user?user->framenr:clip->lastframe; + + if(cache->undistibuf) + IMB_freeImBuf(cache->undistibuf); + + cache->undistibuf= get_undistorted_ibuf(clip, NULL, ibuf); + + if(cache->stableibuf) { + /* force stable buffer be re-calculated */ + IMB_freeImBuf(cache->stableibuf); + cache->stableibuf= NULL; + } + + IMB_refImBuf(cache->undistibuf); + + return cache->undistibuf; +} + +ImBuf *BKE_movieclip_get_ibuf(MovieClip *clip, MovieClipUser *user) +{ + ImBuf *ibuf= NULL; + int framenr= user?user->framenr:clip->lastframe; + int cache_undistorted= 0; + + /* cache isn't threadsafe itself and also loading of movies + can't happen from concurent threads that's why we use lock here */ + BLI_lock_thread(LOCK_MOVIECLIP); + + /* try to obtain cached undistorted image first */ + if(need_undistorted_cache(user, clip->flag)) { + ibuf= get_undistorted_cache(clip, user); + if(!ibuf) + cache_undistorted= 1; + } + + if(!ibuf) + ibuf= get_imbuf_cache(clip, user, clip->flag); + + if(!ibuf) { + int use_sequence= 1; + + /* undistorted proxies for movies should be read as image sequence */ + use_sequence&= user->render_flag&MCLIP_PROXY_RENDER_UNDISTORT; + use_sequence&= user->render_size!=MCLIP_PROXY_RENDER_SIZE_FULL; + + if(clip->source==MCLIP_SRC_SEQUENCE || use_sequence) + ibuf= movieclip_load_sequence_file(clip, user, framenr, clip->flag); + else { + ibuf= movieclip_load_movie_file(clip, user, framenr, clip->flag); + } + + if(ibuf) + put_imbuf_cache(clip, user, ibuf, clip->flag); + } + + if(ibuf) { + clip->lastframe= framenr; + real_ibuf_size(clip, user, ibuf, &clip->lastsize[0], &clip->lastsize[1]); + + /* put undistorted frame to cache */ + if(cache_undistorted) { + ImBuf *tmpibuf= ibuf; + ibuf= put_undistorted_cache(clip, user, tmpibuf); + IMB_freeImBuf(tmpibuf); + } + } + + BLI_unlock_thread(LOCK_MOVIECLIP); + + return ibuf; +} + +ImBuf *BKE_movieclip_get_ibuf_flag(MovieClip *clip, MovieClipUser *user, int flag) +{ + ImBuf *ibuf= NULL; + int framenr= user?user->framenr:clip->lastframe; + int cache_undistorted= 0; + + /* cache isn't threadsafe itself and also loading of movies + can't happen from concurent threads that's why we use lock here */ + BLI_lock_thread(LOCK_MOVIECLIP); + + /* try to obtain cached undistorted image first */ + if(need_undistorted_cache(user, flag)) { + ibuf= get_undistorted_cache(clip, user); + if(!ibuf) + cache_undistorted= 1; + } + + ibuf= get_imbuf_cache(clip, user, flag); + + if(!ibuf) { + if(clip->source==MCLIP_SRC_SEQUENCE) { + ibuf= movieclip_load_sequence_file(clip, user, framenr, flag); + } else { + ibuf= movieclip_load_movie_file(clip, user, framenr, flag); + } + + if(ibuf) { + int bits= MCLIP_USE_PROXY|MCLIP_USE_PROXY_CUSTOM_DIR; + + if((flag&bits)==(clip->flag&bits)) + put_imbuf_cache(clip, user, ibuf, clip->flag); + } + } + + /* put undistorted frame to cache */ + if(ibuf && cache_undistorted) { + ImBuf *tmpibuf= ibuf; + ibuf= put_undistorted_cache(clip, user, tmpibuf); + IMB_freeImBuf(tmpibuf); + } + + BLI_unlock_thread(LOCK_MOVIECLIP); + + return ibuf; +} + +ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float loc[2], float *scale, float *angle) +{ + ImBuf *ibuf, *stableibuf= NULL; + int framenr= user?user->framenr:clip->lastframe; + + ibuf= BKE_movieclip_get_ibuf(clip, user); + + if(!ibuf) + return NULL; + + if(clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) { + float tloc[2], tscale, tangle; + short proxy= IMB_PROXY_NONE; + int render_flag= 0; + + if(clip->flag&MCLIP_USE_PROXY) { + proxy= rendersize_to_proxy(user, clip->flag); + render_flag= user->render_flag; + } + + if(clip->cache->stableibuf && clip->cache->stable_framenr==framenr) { /* there's cached ibuf */ + if(clip->cache->render_flag==render_flag && clip->cache->proxy==proxy) { /* cached ibuf used the same proxy settings */ + stableibuf= clip->cache->stableibuf; + + BKE_tracking_stabilization_data(&clip->tracking, framenr, stableibuf->x, stableibuf->y, tloc, &tscale, &tangle); + + /* check for stabilization parameters */ + if(!equals_v2v2(tloc, clip->cache->stable_loc) || tscale!=clip->cache->stable_scale || tangle!=clip->cache->stable_angle) { + stableibuf= NULL; + } + } + } + + if(!stableibuf) { + if(clip->cache->stableibuf) + IMB_freeImBuf(clip->cache->stableibuf); + + stableibuf= BKE_tracking_stabilize(&clip->tracking, framenr, ibuf, tloc, &tscale, &tangle); + + copy_v2_v2(clip->cache->stable_loc, tloc); + clip->cache->stable_scale= tscale; + clip->cache->stable_angle= tangle; + clip->cache->stable_framenr= framenr; + clip->cache->stableibuf= stableibuf; + clip->cache->proxy= proxy; + clip->cache->render_flag= render_flag; + } + + IMB_refImBuf(stableibuf); + + if(loc) copy_v2_v2(loc, tloc); + if(scale) *scale= tscale; + if(angle) *angle= tangle; + } else { + if(loc) zero_v2(loc); + if(scale) *scale= 1.0f; + if(angle) *angle= 0.0f; + + stableibuf= ibuf; + } + + if(stableibuf!=ibuf) { + IMB_freeImBuf(ibuf); + ibuf= stableibuf; + } + + return ibuf; + +} + +int BKE_movieclip_has_frame(MovieClip *clip, MovieClipUser *user) +{ + ImBuf *ibuf= BKE_movieclip_get_ibuf(clip, user); + + if(ibuf) { + IMB_freeImBuf(ibuf); + return 1; + } + + return 0; +} + +void BKE_movieclip_get_size(MovieClip *clip, MovieClipUser *user, int *width, int *height) +{ + if(!user || user->framenr==clip->lastframe) { + *width= clip->lastsize[0]; + *height= clip->lastsize[1]; + } else { + ImBuf *ibuf= BKE_movieclip_get_ibuf(clip, user); + + if(ibuf && ibuf->x && ibuf->y) { + real_ibuf_size(clip, user, ibuf, width, height); + } else { + *width= 0; + *height= 0; + } + + if(ibuf) + IMB_freeImBuf(ibuf); + } +} + +void BKE_movieclip_aspect(MovieClip *clip, float *aspx, float *aspy) +{ + *aspx= *aspy= 1.0; + + /* x is always 1 */ + *aspy = clip->aspy/clip->aspx/clip->tracking.camera.pixel_aspect; +} + +/* get segments of cached frames. useful for debugging cache policies */ +void BKE_movieclip_get_cache_segments(MovieClip *clip, MovieClipUser *user, int *totseg_r, int **points_r) +{ + *totseg_r= 0; + *points_r= NULL; + + if(clip->cache) { + int proxy= rendersize_to_proxy(user, clip->flag); + + IMB_moviecache_get_cache_segments(clip->cache->moviecache, proxy, user->render_flag, totseg_r, points_r); + } +} + +void BKE_movieclip_user_set_frame(MovieClipUser *iuser, int framenr) +{ + /* TODO: clamp framenr here? */ + + iuser->framenr= framenr; +} + +static void free_buffers(MovieClip *clip) +{ + if(clip->cache) { + IMB_moviecache_free(clip->cache->moviecache); + + if(clip->cache->stableibuf) + IMB_freeImBuf(clip->cache->stableibuf); + + if(clip->cache->undistibuf) + IMB_freeImBuf(clip->cache->undistibuf); + + MEM_freeN(clip->cache); + clip->cache= NULL; + } + + if(clip->anim) { + IMB_free_anim(clip->anim); + clip->anim= FALSE; + } +} + +void BKE_movieclip_reload(MovieClip *clip) +{ + /* clear cache */ + free_buffers(clip); + + clip->tracking.stabilization.ok= 0; + + /* update clip source */ + if(BLI_testextensie_array(clip->name, imb_ext_movie)) clip->source= MCLIP_SRC_MOVIE; + else clip->source= MCLIP_SRC_SEQUENCE; +} + +void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClipScopes *scopes) +{ + if(scopes->ok) return; + + if(scopes->track_preview) { + IMB_freeImBuf(scopes->track_preview); + scopes->track_preview= NULL; + } + + scopes->marker= NULL; + scopes->track= NULL; + + if(clip) { + if(clip->tracking.act_track) { + MovieTrackingTrack *track= clip->tracking.act_track; + MovieTrackingMarker *marker= BKE_tracking_get_marker(track, user->framenr); + + if(marker->flag&MARKER_DISABLED) { + scopes->track_disabled= 1; + } else { + ImBuf *ibuf= BKE_movieclip_get_ibuf(clip, user); + + scopes->track_disabled= 0; + + if(ibuf && ibuf->rect) { + ImBuf *tmpibuf; + MovieTrackingMarker undist_marker= *marker; + + if(user->render_flag&MCLIP_PROXY_RENDER_UNDISTORT) { + int width, height; + float aspy= 1.0f/clip->tracking.camera.pixel_aspect;; + + BKE_movieclip_get_size(clip, user, &width, &height); + + undist_marker.pos[0]*= width; + undist_marker.pos[1]*= height*aspy; + + BKE_tracking_invert_intrinsics(&clip->tracking, undist_marker.pos, undist_marker.pos); + + undist_marker.pos[0]/= width; + undist_marker.pos[1]/= height*aspy; + } + + tmpibuf= BKE_tracking_get_pattern_imbuf(ibuf, track, &undist_marker, 1, 1, scopes->track_pos, NULL); + + if(tmpibuf->rect_float) + IMB_rect_from_float(tmpibuf); + + if(tmpibuf->rect) + scopes->track_preview= tmpibuf; + else + IMB_freeImBuf(tmpibuf); + } + + IMB_freeImBuf(ibuf); + } + + if((track->flag&TRACK_LOCKED)==0) { + scopes->marker= marker; + scopes->track= track; + scopes->slide_scale[0]= track->pat_max[0]-track->pat_min[0]; + scopes->slide_scale[1]= track->pat_max[1]-track->pat_min[1]; + } + } + } + + scopes->framenr= user->framenr; + scopes->ok= 1; +} + +static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, int proxy_render_size, int undistorted) +{ + char name[FILE_MAXFILE+FILE_MAXDIR]; + int quality, rectx, recty; + int size= size= rendersize_to_number(proxy_render_size); + ImBuf *scaleibuf; + + get_proxy_fname(clip, proxy_render_size, undistorted, cfra, name); + + rectx= ibuf->x*size/100.0f; + recty= ibuf->y*size/100.0f; + + scaleibuf= IMB_dupImBuf(ibuf); + + IMB_scaleImBuf(scaleibuf, (short)rectx, (short)recty); + + quality= clip->proxy.quality; + scaleibuf->ftype= JPG | quality; + + /* unsupported feature only confuses other s/w */ + if(scaleibuf->depth==32) + scaleibuf->depth= 24; + + BLI_lock_thread(LOCK_MOVIECLIP); + + BLI_make_existing_file(name); + if(IMB_saveiff(scaleibuf, name, IB_rect)==0) + perror(name); + + BLI_unlock_thread(LOCK_MOVIECLIP); + + IMB_freeImBuf(scaleibuf); +} + +void BKE_movieclip_build_proxy_frame(MovieClip *clip, struct MovieDistortion *distortion, + int cfra, int *build_sizes, int build_count, int undistorted) +{ + ImBuf *ibuf; + MovieClipUser user; + + user.framenr= cfra; + + ibuf= BKE_movieclip_get_ibuf_flag(clip, &user, 0); + + if(ibuf) { + ImBuf *tmpibuf= ibuf; + int i; + + if(undistorted) + tmpibuf= get_undistorted_ibuf(clip, distortion, ibuf); + + for(i= 0; i<build_count; i++) + movieclip_build_proxy_ibuf(clip, tmpibuf, cfra, build_sizes[i], undistorted); + + IMB_freeImBuf(ibuf); + + if(tmpibuf!=ibuf) + IMB_freeImBuf(tmpibuf); + } +} + +void free_movieclip(MovieClip *clip) +{ + free_buffers(clip); + + BKE_tracking_free(&clip->tracking); +} + +void unlink_movieclip(Main *bmain, MovieClip *clip) +{ + bScreen *scr; + ScrArea *area; + SpaceLink *sl; + Scene *sce; + Object *ob; + + for(scr= bmain->screen.first; scr; scr= scr->id.next) { + for(area= scr->areabase.first; area; area= area->next) { + for(sl= area->spacedata.first; sl; sl= sl->next) { + if(sl->spacetype==SPACE_CLIP) { + SpaceClip *sc= (SpaceClip *) sl; + + if(sc->clip==clip) + sc->clip= NULL; + } + else if(sl->spacetype==SPACE_VIEW3D) { + View3D *v3d= (View3D *) sl; + BGpic *bgpic; + + for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) { + if(bgpic->clip==clip) + bgpic->clip= NULL; + } + } + } + } + } + + for(sce= bmain->scene.first; sce; sce= sce->id.next) { + if(sce->clip==clip) + sce->clip= NULL; + } + + for(ob= bmain->object.first; ob; ob= ob->id.next) { + bConstraint *con= ob->constraints.first; + + for (con= ob->constraints.first; con; con= con->next) { + bConstraintTypeInfo *cti= constraint_get_typeinfo(con); + + if(cti->type==CONSTRAINT_TYPE_FOLLOWTRACK) { + bFollowTrackConstraint *data= (bFollowTrackConstraint *) con->data; + + if(data->clip==clip) + data->clip= NULL; + } + else if(cti->type==CONSTRAINT_TYPE_CAMERASOLVER) { + bCameraSolverConstraint *data= (bCameraSolverConstraint *) con->data; + + if(data->clip==clip) + data->clip= NULL; + } + } + } + + clip->id.us= 0; +} diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 8f609291351..115591863cc 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -629,7 +629,7 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree) for(newtree=G.main->nodetree.first; newtree; newtree= newtree->id.next) if(newtree==ntree) break; if(newtree) { - newtree= copy_libblock(ntree); + newtree= copy_libblock(&ntree->id); } else { newtree= MEM_dupallocN(ntree); copy_libblock_data(&newtree->id, &ntree->id, TRUE); /* copy animdata and ID props */ @@ -1790,6 +1790,7 @@ static void registerCompositNodes(ListBase *ntypelist) register_node_type_cmp_value(ntypelist); register_node_type_cmp_rgb(ntypelist); register_node_type_cmp_curve_time(ntypelist); + register_node_type_cmp_movieclip(ntypelist); register_node_type_cmp_composite(ntypelist); register_node_type_cmp_viewer(ntypelist); @@ -1854,6 +1855,9 @@ static void registerCompositNodes(ListBase *ntypelist) register_node_type_cmp_glare(ntypelist); register_node_type_cmp_tonemap(ntypelist); register_node_type_cmp_lensdist(ntypelist); + register_node_type_cmp_transform(ntypelist); + register_node_type_cmp_stabilize2d(ntypelist); + register_node_type_cmp_moviedistortion(ntypelist); } static void registerShaderNodes(ListBase *ntypelist) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index b09d1ea98aa..45bd8f095a4 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -42,11 +42,11 @@ #include "DNA_constraint_types.h" #include "DNA_group_types.h" #include "DNA_key_types.h" -#include "DNA_lamp_types.h" #include "DNA_lattice_types.h" #include "DNA_material_types.h" #include "DNA_meta_types.h" #include "DNA_meshdata_types.h" +#include "DNA_movieclip_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_sequence_types.h" @@ -81,6 +81,7 @@ #include "BKE_group.h" #include "BKE_icons.h" #include "BKE_key.h" +#include "BKE_lamp.h" #include "BKE_lattice.h" #include "BKE_library.h" #include "BKE_mesh.h" @@ -98,6 +99,7 @@ #include "BKE_speaker.h" #include "BKE_softbody.h" #include "BKE_material.h" +#include "BKE_camera.h" #include "LBM_fluidsim.h" @@ -715,288 +717,6 @@ int exist_object(Object *obtest) return 0; } -void *add_camera(const char *name) -{ - Camera *cam; - - cam= alloc_libblock(&G.main->camera, ID_CA, name); - - cam->lens= 35.0f; - cam->sensor_x= 32.0f; - cam->sensor_y= 18.0f; - cam->clipsta= 0.1f; - cam->clipend= 100.0f; - cam->drawsize= 0.5f; - cam->ortho_scale= 6.0; - cam->flag |= CAM_SHOWPASSEPARTOUT; - cam->passepartalpha = 0.5f; - - return cam; -} - -Camera *copy_camera(Camera *cam) -{ - Camera *camn; - - camn= copy_libblock(cam); - - return camn; -} - - - -void make_local_camera(Camera *cam) -{ - Main *bmain= G.main; - Object *ob; - int is_local= FALSE, is_lib= FALSE; - - /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ - - if(cam->id.lib==NULL) return; - if(cam->id.us==1) { - id_clear_lib_data(bmain, &cam->id); - return; - } - - for(ob= bmain->object.first; ob && ELEM(0, is_lib, is_local); ob= ob->id.next) { - if(ob->data==cam) { - if(ob->id.lib) is_lib= TRUE; - else is_local= TRUE; - } - } - - if(is_local && is_lib == FALSE) { - id_clear_lib_data(bmain, &cam->id); - } - else if(is_local && is_lib) { - Camera *camn= copy_camera(cam); - - camn->id.us= 0; - - /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &camn->id); - - for(ob= bmain->object.first; ob; ob= ob->id.next) { - if(ob->data == cam) { - if(ob->id.lib==NULL) { - ob->data= camn; - camn->id.us++; - cam->id.us--; - } - } - } - } -} - -/* get the camera's dof value, takes the dof object into account */ -float dof_camera(Object *ob) -{ - Camera *cam = (Camera *)ob->data; - if (ob->type != OB_CAMERA) - return 0.0f; - if (cam->dof_ob) { - /* too simple, better to return the distance on the view axis only - * return len_v3v3(ob->obmat[3], cam->dof_ob->obmat[3]); */ - float mat[4][4], imat[4][4], obmat[4][4]; - - copy_m4_m4(obmat, ob->obmat); - normalize_m4(obmat); - invert_m4_m4(imat, obmat); - mul_m4_m4m4(mat, cam->dof_ob->obmat, imat); - return (float)fabs(mat[3][2]); - } - return cam->YF_dofdist; -} - -void *add_lamp(const char *name) -{ - Lamp *la; - - la= alloc_libblock(&G.main->lamp, ID_LA, name); - - la->r= la->g= la->b= la->k= 1.0f; - la->haint= la->energy= 1.0f; - la->dist= 25.0f; - la->spotsize= 45.0f; - la->spotblend= 0.15f; - la->att2= 1.0f; - la->mode= LA_SHAD_BUF; - la->bufsize= 512; - la->clipsta= 0.5f; - la->clipend= 40.0f; - la->shadspotsize= 45.0f; - la->samp= 3; - la->bias= 1.0f; - la->soft= 3.0f; - la->compressthresh= 0.05f; - la->ray_samp= la->ray_sampy= la->ray_sampz= 1; - la->area_size=la->area_sizey=la->area_sizez= 1.0f; - la->buffers= 1; - la->buftype= LA_SHADBUF_HALFWAY; - la->ray_samp_method = LA_SAMP_HALTON; - la->adapt_thresh = 0.001f; - la->preview=NULL; - la->falloff_type = LA_FALLOFF_INVSQUARE; - la->curfalloff = curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f); - la->sun_effect_type = 0; - la->horizon_brightness = 1.0; - la->spread = 1.0; - la->sun_brightness = 1.0; - la->sun_size = 1.0; - la->backscattered_light = 1.0f; - la->atm_turbidity = 2.0f; - la->atm_inscattering_factor = 1.0f; - la->atm_extinction_factor = 1.0f; - la->atm_distance_factor = 1.0f; - la->sun_intensity = 1.0f; - la->skyblendtype= MA_RAMP_ADD; - la->skyblendfac= 1.0f; - la->sky_colorspace= BLI_XYZ_CIE; - la->sky_exposure= 1.0f; - - curvemapping_initialize(la->curfalloff); - return la; -} - -Lamp *copy_lamp(Lamp *la) -{ - Lamp *lan; - int a; - - lan= copy_libblock(la); - - for(a=0; a<MAX_MTEX; a++) { - if(lan->mtex[a]) { - lan->mtex[a]= MEM_mallocN(sizeof(MTex), "copylamptex"); - memcpy(lan->mtex[a], la->mtex[a], sizeof(MTex)); - id_us_plus((ID *)lan->mtex[a]->tex); - } - } - - lan->curfalloff = curvemapping_copy(la->curfalloff); - - if(la->nodetree) - lan->nodetree= ntreeCopyTree(la->nodetree); - - if(la->preview) - lan->preview = BKE_previewimg_copy(la->preview); - - return lan; -} - -Lamp *localize_lamp(Lamp *la) -{ - Lamp *lan; - int a; - - lan= copy_libblock(la); - BLI_remlink(&G.main->lamp, lan); - - for(a=0; a<MAX_MTEX; a++) { - if(lan->mtex[a]) { - lan->mtex[a]= MEM_mallocN(sizeof(MTex), "localize_lamp"); - memcpy(lan->mtex[a], la->mtex[a], sizeof(MTex)); - /* free lamp decrements */ - id_us_plus((ID *)lan->mtex[a]->tex); - } - } - - lan->curfalloff = curvemapping_copy(la->curfalloff); - - if(la->nodetree) - lan->nodetree= ntreeLocalize(la->nodetree); - - lan->preview= NULL; - - return lan; -} - -void make_local_lamp(Lamp *la) -{ - Main *bmain= G.main; - Object *ob; - int is_local= FALSE, is_lib= FALSE; - - /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ - - if(la->id.lib==NULL) return; - if(la->id.us==1) { - id_clear_lib_data(bmain, &la->id); - return; - } - - ob= bmain->object.first; - while(ob) { - if(ob->data==la) { - if(ob->id.lib) is_lib= TRUE; - else is_local= TRUE; - } - ob= ob->id.next; - } - - if(is_local && is_lib == FALSE) { - id_clear_lib_data(bmain, &la->id); - } - else if(is_local && is_lib) { - Lamp *lan= copy_lamp(la); - lan->id.us= 0; - - /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &lan->id); - - ob= bmain->object.first; - while(ob) { - if(ob->data==la) { - - if(ob->id.lib==NULL) { - ob->data= lan; - lan->id.us++; - la->id.us--; - } - } - ob= ob->id.next; - } - } -} - -void free_camera(Camera *ca) -{ - BKE_free_animdata((ID *)ca); -} - -void free_lamp(Lamp *la) -{ - MTex *mtex; - int a; - - for(a=0; a<MAX_MTEX; a++) { - mtex= la->mtex[a]; - if(mtex && mtex->tex) mtex->tex->id.us--; - if(mtex) MEM_freeN(mtex); - } - - BKE_free_animdata((ID *)la); - - curvemapping_free(la->curfalloff); - - /* is no lib link block, but lamp extension */ - if(la->nodetree) { - ntreeFreeTree(la->nodetree); - MEM_freeN(la->nodetree); - } - - BKE_previewimg_free(&la->preview); - BKE_icon_delete(&la->id); - la->id.icon_id = 0; -} - /* *************************************************** */ static void *add_obdata_from_type(int type) @@ -1365,7 +1085,7 @@ Object *copy_object(Object *ob) ModifierData *md; int a; - obn= copy_libblock(ob); + obn= copy_libblock(&ob->id); if(ob->totcol) { obn->mat= MEM_dupallocN(ob->mat); @@ -1700,33 +1420,6 @@ void object_make_proxy(Object *ob, Object *target, Object *gob) /* *************** CALC ****************** */ -/* there is also a timing calculation in drawobject() */ - - -// XXX THIS CRUFT NEEDS SERIOUS RECODING ASAP! -/* ob can be NULL */ -float bsystem_time(struct Scene *scene, Object *UNUSED(ob), float cfra, float ofs) -{ - /* returns float ( see BKE_curframe in scene.c) */ - cfra += scene->r.subframe; - - /* global time */ - if (scene) - cfra*= scene->r.framelen; - -#if 0 // XXX old animation system - if (ob) { - /* ofset frames */ - if ((ob->ipoflag & OB_OFFS_PARENT) && (ob->partype & PARSLOW)==0) - cfra-= give_timeoffset(ob); - } -#endif // XXX old animation system - - cfra-= ofs; - - return cfra; -} - void object_scale_to_mat3(Object *ob, float mat[][3]) { float vec[3]; @@ -1734,7 +1427,6 @@ void object_scale_to_mat3(Object *ob, float mat[][3]) size_to_mat3( mat,vec); } - void object_rot_to_mat3(Object *ob, float mat[][3]) { float rmat[3][3], dmat[3][3]; @@ -1873,12 +1565,6 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4]) makeDispListCurveTypes(scene, par, 0); if(cu->path==NULL) return; - /* exception, timeoffset is regarded as distance offset */ - if(cu->flag & CU_OFFS_PATHDIST) { - timeoffs = give_timeoffset(ob); - SWAP(float, sf_orig, ob->sf); - } - /* catch exceptions: feature for nla stride editing */ if(ob->ipoflag & OB_DISABLE_PATH) { ctime= 0.0f; @@ -1899,7 +1585,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4]) CLAMP(ctime, 0.0f, 1.0f); } else { - ctime= scene->r.cfra - give_timeoffset(ob); + ctime= scene->r.cfra; if (IS_EQF(cu->pathlen, 0.0f) == 0) ctime /= cu->pathlen; @@ -2125,11 +1811,30 @@ void set_no_parent_ipo(int val) no_parent_ipo= val; } -void where_is_object_time(Scene *scene, Object *ob, float ctime) +static int where_is_object_parslow(Object *ob, float obmat[4][4], float slowmat[4][4]) { - float *fp1, *fp2, slowmat[4][4] = MAT4_UNITY; - float stime=ctime, fac1, fac2; + float *fp1, *fp2; + float fac1, fac2; int a; + + // include framerate + fac1= ( 1.0f / (1.0f + (float)fabs(ob->sf)) ); + if(fac1 >= 1.0f) return 0; + fac2= 1.0f-fac1; + + fp1= obmat[0]; + fp2= slowmat[0]; + for(a=0; a<16; a++, fp1++, fp2++) { + fp1[0]= fac1*fp1[0] + fac2*fp2[0]; + } + + return 1; +} + +void where_is_object_time(Scene *scene, Object *ob, float ctime) +{ + float slowmat[4][4] = MAT4_UNITY; + float stime=ctime; /* new version: correct parent+vertexparent and track+parent */ /* this one only calculates direct attached parent and track */ @@ -2143,9 +1848,6 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime) if(ob->parent) { Object *par= ob->parent; - // XXX depreceated - animsys - if(ob->ipoflag & OB_OFFS_PARENT) ctime-= give_timeoffset(ob); - /* hurms, code below conflicts with depgraph... (ton) */ /* and even worse, it gives bad effects for NLA stride too (try ctime != par->ctime, with MBlur) */ if(no_parent_ipo==0 && stime != par->ctime) { @@ -2154,25 +1856,20 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime) if(par->proxy_from); // was a copied matrix, no where_is! bad... else where_is_object_time(scene, par, ctime); - + solve_parenting(scene, ob, par, ob->obmat, slowmat, 0); - + *par= tmp; } else solve_parenting(scene, ob, par, ob->obmat, slowmat, 0); + /* "slow parent" is definitely not threadsafe, and may also give bad results jumping around + * An old-fashioned hack which probably doesn't really cut it anymore + */ if(ob->partype & PARSLOW) { - // include framerate - fac1= ( 1.0f / (1.0f + (float)fabs(give_timeoffset(ob))) ); - if(fac1 >= 1.0f) return; - fac2= 1.0f-fac1; - - fp1= ob->obmat[0]; - fp2= slowmat[0]; - for(a=0; a<16; a++, fp1++, fp2++) { - fp1[0]= fac1*fp1[0] + fac2*fp2[0]; - } + if(!where_is_object_parslow(ob, ob->obmat, slowmat)) + return; } } else { @@ -2196,6 +1893,27 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime) else ob->transflag &= ~OB_NEG_SCALE; } +/* get object transformation matrix without recalculating dependencies and + constraints -- assume dependencies are already solved by depsgraph. + no changes to object and it's parent would be done. + used for bundles orientation in 3d space relative to parented blender camera */ +void where_is_object_mat(Scene *scene, Object *ob, float obmat[4][4]) +{ + float slowmat[4][4] = MAT4_UNITY; + + if(ob->parent) { + Object *par= ob->parent; + + solve_parenting(scene, ob, par, obmat, slowmat, 1); + + if(ob->partype & PARSLOW) + where_is_object_parslow(ob, obmat, slowmat); + } + else { + object_to_mat4(ob, obmat); + } +} + static void solve_parenting (Scene *scene, Object *ob, Object *par, float obmat[][4], float slowmat[][4], int simul) { float totmat[4][4]; @@ -2287,7 +2005,6 @@ void where_is_object_simul(Scene *scene, Object *ob) for a lamp that is the child of another object */ { Object *par; - //Ipo *ipo; float *fp1, *fp2; float slowmat[4][4]; float fac1, fac2; @@ -2298,10 +2015,9 @@ for a lamp that is the child of another object */ par= ob->parent; solve_parenting(scene, ob, par, ob->obmat, slowmat, 1); - + if(ob->partype & PARSLOW) { - - fac1= (float)(1.0/(1.0+ fabs(give_timeoffset(ob)))); + fac1= (float)(1.0/(1.0+ fabs(ob->sf))); fac2= 1.0f-fac1; fp1= ob->obmat[0]; fp2= slowmat[0]; @@ -2309,7 +2025,6 @@ for a lamp that is the child of another object */ fp1[0]= fac1*fp1[0] + fac2*fp2[0]; } } - } else { object_to_mat4(ob, ob->obmat); @@ -2438,7 +2153,7 @@ void object_set_dimensions(Object *ob, const float *value) } } -void minmax_object(Object *ob, float *min, float *max) +void minmax_object(Object *ob, float min[3], float max[3]) { BoundBox bb; float vec[3]; @@ -2835,15 +2550,6 @@ void object_sculpt_modifiers_changed(Object *ob) } } -float give_timeoffset(Object *ob) -{ - if ((ob->ipoflag & OB_OFFS_PARENTADD) && ob->parent) { - return ob->sf + give_timeoffset(ob->parent); - } else { - return ob->sf; - } -} - int give_obdata_texspace(Object *ob, short **texflag, float **loc, float **size, float **rot) { @@ -2942,255 +2648,6 @@ int object_insert_ptcache(Object *ob) return i; } -void object_camera_mode(RenderData *rd, Object *camera) -{ - rd->mode &= ~(R_ORTHO|R_PANORAMA); - if(camera && camera->type==OB_CAMERA) { - Camera *cam= camera->data; - if(cam->type == CAM_ORTHO) rd->mode |= R_ORTHO; - if(cam->flag & CAM_PANORAMA) rd->mode |= R_PANORAMA; - } -} - -void object_camera_intrinsics(Object *camera, Camera **cam_r, short *is_ortho, float *shiftx, float *shifty, - float *clipsta, float *clipend, float *lens, float *sensor_x, float *sensor_y, short *sensor_fit) -{ - Camera *cam= NULL; - - (*shiftx)= 0.0f; - (*shifty)= 0.0f; - - (*sensor_x)= DEFAULT_SENSOR_WIDTH; - (*sensor_y)= DEFAULT_SENSOR_HEIGHT; - (*sensor_fit)= CAMERA_SENSOR_FIT_AUTO; - - if(camera->type==OB_CAMERA) { - cam= camera->data; - - if(cam->type == CAM_ORTHO) { - *is_ortho= TRUE; - } - - /* solve this too... all time depending stuff is in convertblender.c? - * Need to update the camera early because it's used for projection matrices - * and other stuff BEFORE the animation update loop is done - * */ -#if 0 // XXX old animation system - if(cam->ipo) { - calc_ipo(cam->ipo, frame_to_float(re->scene, re->r.cfra)); - execute_ipo(&cam->id, cam->ipo); - } -#endif // XXX old animation system - (*shiftx)=cam->shiftx; - (*shifty)=cam->shifty; - (*lens)= cam->lens; - (*sensor_x)= cam->sensor_x; - (*sensor_y)= cam->sensor_y; - (*clipsta)= cam->clipsta; - (*clipend)= cam->clipend; - (*sensor_fit)= cam->sensor_fit; - } - else if(camera->type==OB_LAMP) { - Lamp *la= camera->data; - float fac= cosf((float)M_PI*la->spotsize/360.0f); - float phi= acos(fac); - - (*lens)= 16.0f*fac/sinf(phi); - if((*lens)==0.0f) - (*lens)= 35.0f; - (*clipsta)= la->clipsta; - (*clipend)= la->clipend; - } - else { /* envmap exception... */; - if((*lens)==0.0f) /* is this needed anymore? */ - (*lens)= 16.0f; - - if((*clipsta)==0.0f || (*clipend)==0.0f) { - (*clipsta)= 0.1f; - (*clipend)= 1000.0f; - } - } - - (*cam_r)= cam; -} - -/* 'lens' may be set for envmap only */ -void object_camera_matrix( - RenderData *rd, Object *camera, int winx, int winy, short field_second, - float winmat[][4], rctf *viewplane, float *clipsta, float *clipend, float *lens, - float *sensor_x, float *sensor_y, short *sensor_fit, float *ycor, - float *viewdx, float *viewdy) -{ - Camera *cam=NULL; - float pixsize; - float shiftx=0.0, shifty=0.0, winside, viewfac; - short is_ortho= FALSE; - - /* question mark */ - (*ycor)= rd->yasp / rd->xasp; - if(rd->mode & R_FIELDS) - (*ycor) *= 2.0f; - - object_camera_intrinsics(camera, &cam, &is_ortho, &shiftx, &shifty, clipsta, clipend, lens, sensor_x, sensor_y, sensor_fit); - - /* ortho only with camera available */ - if(cam && is_ortho) { - if((*sensor_fit)==CAMERA_SENSOR_FIT_AUTO) { - if(rd->xasp*winx >= rd->yasp*winy) viewfac= winx; - else viewfac= (*ycor) * winy; - } - else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) { - viewfac= winx; - } - else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */ - viewfac= (*ycor) * winy; - } - - /* ortho_scale == 1.0 means exact 1 to 1 mapping */ - pixsize= cam->ortho_scale/viewfac; - } - else { - if((*sensor_fit)==CAMERA_SENSOR_FIT_AUTO) { - if(rd->xasp*winx >= rd->yasp*winy) viewfac= ((*lens) * winx) / (*sensor_x); - else viewfac= (*ycor) * ((*lens) * winy) / (*sensor_x); - } - else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) { - viewfac= ((*lens) * winx) / (*sensor_x); - } - else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */ - viewfac= ((*lens) * winy) / (*sensor_y); - } - - pixsize= (*clipsta) / viewfac; - } - - /* viewplane fully centered, zbuffer fills in jittered between -.5 and +.5 */ - winside= MAX2(winx, winy); - - if(cam) { - if(cam->sensor_fit==CAMERA_SENSOR_FIT_HOR) - winside= winx; - else if(cam->sensor_fit==CAMERA_SENSOR_FIT_VERT) - winside= winy; - } - - viewplane->xmin= -0.5f*(float)winx + shiftx*winside; - viewplane->ymin= -0.5f*(*ycor)*(float)winy + shifty*winside; - viewplane->xmax= 0.5f*(float)winx + shiftx*winside; - viewplane->ymax= 0.5f*(*ycor)*(float)winy + shifty*winside; - - if(field_second) { - if(rd->mode & R_ODDFIELD) { - viewplane->ymin-= 0.5f * (*ycor); - viewplane->ymax-= 0.5f * (*ycor); - } - else { - viewplane->ymin+= 0.5f * (*ycor); - viewplane->ymax+= 0.5f * (*ycor); - } - } - /* the window matrix is used for clipping, and not changed during OSA steps */ - /* using an offset of +0.5 here would give clip errors on edges */ - viewplane->xmin *= pixsize; - viewplane->xmax *= pixsize; - viewplane->ymin *= pixsize; - viewplane->ymax *= pixsize; - - (*viewdx)= pixsize; - (*viewdy)= (*ycor) * pixsize; - - if(is_ortho) - orthographic_m4(winmat, viewplane->xmin, viewplane->xmax, viewplane->ymin, viewplane->ymax, *clipsta, *clipend); - else - perspective_m4(winmat, viewplane->xmin, viewplane->xmax, viewplane->ymin, viewplane->ymax, *clipsta, *clipend); - -} - -void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const short do_clip, const float scale[3], - float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]) -{ - float facx, facy; - float depth; - - /* aspect correcton */ - if (scene) { - float aspx= (float) scene->r.xsch*scene->r.xasp; - float aspy= (float) scene->r.ysch*scene->r.yasp; - - if(camera->sensor_fit==CAMERA_SENSOR_FIT_AUTO) { - if(aspx < aspy) { - r_asp[0]= aspx / aspy; - r_asp[1]= 1.0; - } - else { - r_asp[0]= 1.0; - r_asp[1]= aspy / aspx; - } - } - else if(camera->sensor_fit==CAMERA_SENSOR_FIT_AUTO) { - r_asp[0]= aspx / aspy; - r_asp[1]= 1.0; - } - else { - r_asp[0]= 1.0; - r_asp[1]= aspy / aspx; - } - } - else { - r_asp[0]= 1.0f; - r_asp[1]= 1.0f; - } - - if(camera->type==CAM_ORTHO) { - facx= 0.5f * camera->ortho_scale * r_asp[0] * scale[0]; - facy= 0.5f * camera->ortho_scale * r_asp[1] * scale[1]; - r_shift[0]= camera->shiftx * camera->ortho_scale * scale[0]; - r_shift[1]= camera->shifty * camera->ortho_scale * scale[1]; - depth= do_clip ? -((camera->clipsta * scale[2]) + 0.1f) : - drawsize * camera->ortho_scale * scale[2]; - - *r_drawsize= 0.5f * camera->ortho_scale; - } - else { - /* that way it's always visible - clipsta+0.1 */ - float fac; - float half_sensor= 0.5f*((camera->sensor_fit==CAMERA_SENSOR_FIT_VERT) ? (camera->sensor_y) : (camera->sensor_x)); - - *r_drawsize= drawsize / ((scale[0] + scale[1] + scale[2]) / 3.0f); - - if(do_clip) { - /* fixed depth, variable size (avoids exceeding clipping range) */ - depth = -(camera->clipsta + 0.1f); - fac = depth / (camera->lens/(-half_sensor) * scale[2]); - } - else { - /* fixed size, variable depth (stays a reasonable size in the 3D view) */ - depth= *r_drawsize * camera->lens/(-half_sensor) * scale[2]; - fac= *r_drawsize; - } - - facx= fac * r_asp[0] * scale[0]; - facy= fac * r_asp[1] * scale[1]; - r_shift[0]= camera->shiftx*fac*2 * scale[0]; - r_shift[1]= camera->shifty*fac*2 * scale[1]; - } - - r_vec[0][0]= r_shift[0] + facx; r_vec[0][1]= r_shift[1] + facy; r_vec[0][2]= depth; - r_vec[1][0]= r_shift[0] + facx; r_vec[1][1]= r_shift[1] - facy; r_vec[1][2]= depth; - r_vec[2][0]= r_shift[0] - facx; r_vec[2][1]= r_shift[1] - facy; r_vec[2][2]= depth; - r_vec[3][0]= r_shift[0] - facx; r_vec[3][1]= r_shift[1] + facy; r_vec[3][2]= depth; -} - -void camera_view_frame(Scene *scene, Camera *camera, float r_vec[4][3]) -{ - float dummy_asp[2]; - float dummy_shift[2]; - float dummy_drawsize; - const float dummy_scale[3]= {1.0f, 1.0f, 1.0f}; - - camera_view_frame_ex(scene, camera, FALSE, 1.0, dummy_scale, - dummy_asp, dummy_shift, &dummy_drawsize, r_vec); -} - #if 0 static int pc_findindex(ListBase *listbase, int index) { @@ -3387,3 +2844,28 @@ void object_relink(Object *ob) ID_NEW(ob->proxy); ID_NEW(ob->proxy_group); } + +MovieClip *object_get_movieclip(Scene *scene, Object *ob, int use_default) +{ + MovieClip *clip= use_default ? scene->clip : NULL; + bConstraint *con= ob->constraints.first, *scon= NULL; + + while(con){ + if(con->type==CONSTRAINT_TYPE_CAMERASOLVER){ + if(scon==NULL || (scon->flag&CONSTRAINT_OFF)) + scon= con; + } + + con= con->next; + } + + if(scon) { + bCameraSolverConstraint *solver= scon->data; + if((solver->flag&CAMERASOLVER_ACTIVECLIP)==0) + clip= solver->clip; + else + clip= scene->clip; + } + + return clip; +} diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 3901fde2bf1..a86e819ae9f 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -78,6 +78,7 @@ #include "BKE_mesh.h" #include "BKE_cdderivedmesh.h" #include "BKE_pointcache.h" +#include "BKE_scene.h" #include "RE_render_ext.h" @@ -619,13 +620,13 @@ static float psys_render_viewport_falloff(double rate, float dist, float width) return pow(rate, dist/width); } -static float psys_render_projected_area(ParticleSystem *psys, float *center, float area, double vprate, float *viewport) +static float psys_render_projected_area(ParticleSystem *psys, const float center[3], float area, double vprate, float *viewport) { ParticleRenderData *data= psys->renderdata; float co[4], view[3], ortho1[3], ortho2[3], w, dx, dy, radius; /* transform to view space */ - VECCOPY(co, center); + copy_v3_v3(co, center); co[3]= 1.0f; mul_m4_v4(data->viewmat, co); @@ -829,17 +830,17 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot) b= (origindex)? origindex[a]: a; if(b != -1) { - VECCOPY(co1, mvert[mf->v1].co); - VECCOPY(co2, mvert[mf->v2].co); - VECCOPY(co3, mvert[mf->v3].co); + copy_v3_v3(co1, mvert[mf->v1].co); + copy_v3_v3(co2, mvert[mf->v2].co); + copy_v3_v3(co3, mvert[mf->v3].co); - VECADD(facecenter[b], facecenter[b], co1); - VECADD(facecenter[b], facecenter[b], co2); - VECADD(facecenter[b], facecenter[b], co3); + add_v3_v3(facecenter[b], co1); + add_v3_v3(facecenter[b], co2); + add_v3_v3(facecenter[b], co3); if(mf->v4) { - VECCOPY(co4, mvert[mf->v4].co); - VECADD(facecenter[b], facecenter[b], co4); + copy_v3_v3(co4, mvert[mf->v4].co); + add_v3_v3(facecenter[b], co4); facearea[b] += area_quad_v3(co1, co2, co3, co4); facetotvert[b] += 4; } @@ -998,7 +999,7 @@ int psys_render_simplify_params(ParticleSystem *psys, ChildParticle *cpa, float /************************************************/ /* Interpolation */ /************************************************/ -static float interpolate_particle_value(float v1, float v2, float v3, float v4, float *w, int four) +static float interpolate_particle_value(float v1, float v2, float v3, float v4, const float w[4], int four) { float value; @@ -1029,12 +1030,12 @@ void psys_interpolate_particle(short type, ParticleKey keys[4], float dt, Partic if(dt>0.999f){ key_curve_position_weights(dt-0.001f, t, type); interp_v3_v3v3v3v3(temp, keys[0].co, keys[1].co, keys[2].co, keys[3].co, t); - VECSUB(result->vel, result->co, temp); + sub_v3_v3v3(result->vel, result->co, temp); } else{ key_curve_position_weights(dt+0.001f, t, type); interp_v3_v3v3v3v3(temp, keys[0].co, keys[1].co, keys[2].co, keys[3].co, t); - VECSUB(result->vel, temp, result->co); + sub_v3_v3v3(result->vel, temp, result->co); } } } @@ -1180,21 +1181,21 @@ static void init_particle_interpolation(Object *ob, ParticleSystem *psys, Partic } static void edit_to_particle(ParticleKey *key, PTCacheEditKey *ekey) { - VECCOPY(key->co, ekey->co); + copy_v3_v3(key->co, ekey->co); if(ekey->vel) { - VECCOPY(key->vel, ekey->vel); + copy_v3_v3(key->vel, ekey->vel); } key->time = *(ekey->time); } static void hair_to_particle(ParticleKey *key, HairKey *hkey) { - VECCOPY(key->co, hkey->co); + copy_v3_v3(key->co, hkey->co); key->time = hkey->time; } static void mvert_to_particle(ParticleKey *key, MVert *mvert, HairKey *hkey) { - VECCOPY(key->co, mvert->co); + copy_v3_v3(key->co, mvert->co); key->time = hkey->time; } @@ -1473,13 +1474,13 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or } } else { - VECCOPY(orco, vec); + copy_v3_v3(orco, vec); if(ornor && nor) - VECCOPY(ornor, nor); + copy_v3_v3(ornor, nor); } } } -void psys_interpolate_uvs(MTFace *tface, int quad, float *w, float *uvco) +void psys_interpolate_uvs(const MTFace *tface, int quad, const float w[4], float uvco[2]) { float v10= tface->uv[0][0]; float v11= tface->uv[0][1]; @@ -1502,7 +1503,7 @@ void psys_interpolate_uvs(MTFace *tface, int quad, float *w, float *uvco) } } -void psys_interpolate_mcol(MCol *mcol, int quad, float *w, MCol *mc) +void psys_interpolate_mcol(const MCol *mcol, int quad, const float w[4], MCol *mc) { char *cp, *cp1, *cp2, *cp3, *cp4; @@ -1527,7 +1528,7 @@ void psys_interpolate_mcol(MCol *mcol, int quad, float *w, MCol *mc) } } -static float psys_interpolate_value_from_verts(DerivedMesh *dm, short from, int index, float *fw, float *values) +static float psys_interpolate_value_from_verts(DerivedMesh *dm, short from, int index, const float fw[4], const float *values) { if(values==0 || index==-1) return 0.0; @@ -1543,18 +1544,18 @@ static float psys_interpolate_value_from_verts(DerivedMesh *dm, short from, int } } - return 0.0; + return 0.0f; } /* conversion of pa->fw to origspace layer coordinates */ -static void psys_w_to_origspace(float *w, float *uv) +static void psys_w_to_origspace(const float w[4], float uv[2]) { uv[0]= w[1] + w[2]; uv[1]= w[2] + w[3]; } /* conversion of pa->fw to weights in face from origspace */ -static void psys_origspace_to_w(OrigSpaceFace *osface, int quad, float *w, float *neww) +static void psys_origspace_to_w(OrigSpaceFace *osface, int quad, const float w[4], float neww[4]) { float v[4][3], co[3]; @@ -1567,17 +1568,17 @@ static void psys_origspace_to_w(OrigSpaceFace *osface, int quad, float *w, float if(quad) { v[3][0]= osface->uv[3][0]; v[3][1]= osface->uv[3][1]; v[3][2]= 0.0f; - interp_weights_poly_v3( neww,v, 4, co); + interp_weights_poly_v3(neww, v, 4, co); } else { - interp_weights_poly_v3( neww,v, 3, co); + interp_weights_poly_v3(neww, v, 3, co); neww[3]= 0.0f; } } /* find the derived mesh face for a particle, set the mf passed. this is slow * and can be optimized but only for many lookups. returns the face index. */ -int psys_particle_dm_face_lookup(Object *ob, DerivedMesh *dm, int index, float *fw, struct LinkNode *node) +int psys_particle_dm_face_lookup(Object *ob, DerivedMesh *dm, int index, const float fw[4], struct LinkNode *node) { Mesh *me= (Mesh*)ob->data; MFace *mface; @@ -1644,7 +1645,7 @@ int psys_particle_dm_face_lookup(Object *ob, DerivedMesh *dm, int index, float * return DMCACHE_NOTFOUND; } -static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache, float *fw, float UNUSED(foffset), int *mapindex, float *mapfw) +static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache, const float fw[4], float UNUSED(foffset), int *mapindex, float mapfw[4]) { if(index < 0) return 0; @@ -1663,7 +1664,7 @@ static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_ return 0; *mapindex = index; - QUATCOPY(mapfw, fw); + copy_v4_v4(mapfw, fw); } } else { /* for other meshes that have been modified, we try to map the particle @@ -1704,7 +1705,7 @@ static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_ } /* interprets particle data to get a point on a mesh in object space */ -void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache, float *fw, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor) +void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache, const float fw[4], float foffset, float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3], float ornor[3]) { float tmpnor[3], mapfw[4]; float (*orcodata)[3]; @@ -1732,7 +1733,7 @@ void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache } if(orco) - VECCOPY(orco, orcodata[mapindex]) + copy_v3_v3(orco, orcodata[mapindex]); if(ornor) { dm->getVertNo(dm,mapindex,nor); @@ -1759,11 +1760,11 @@ void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache if(from==PART_FROM_VOLUME) { psys_interpolate_face(mvert,mface,mtface,orcodata,mapfw,vec,tmpnor,utan,vtan,orco,ornor); if(nor) - VECCOPY(nor,tmpnor); + copy_v3_v3(nor,tmpnor); normalize_v3(tmpnor); mul_v3_fl(tmpnor,-foffset); - VECADD(vec,vec,tmpnor); + add_v3_v3(vec, tmpnor); } else psys_interpolate_face(mvert,mface,mtface,orcodata,mapfw,vec,nor,utan,vtan,orco,ornor); @@ -1805,22 +1806,22 @@ static void psys_particle_on_shape(int UNUSED(distr), int UNUSED(index), float * /* TODO */ float zerovec[3]={0.0f,0.0f,0.0f}; if(vec){ - VECCOPY(vec,zerovec); + copy_v3_v3(vec,zerovec); } if(nor){ - VECCOPY(nor,zerovec); + copy_v3_v3(nor,zerovec); } if(utan){ - VECCOPY(utan,zerovec); + copy_v3_v3(utan,zerovec); } if(vtan){ - VECCOPY(vtan,zerovec); + copy_v3_v3(vtan,zerovec); } if(orco){ - VECCOPY(orco,zerovec); + copy_v3_v3(orco,zerovec); } if(ornor){ - VECCOPY(ornor,zerovec); + copy_v3_v3(ornor,zerovec); } } /************************************************/ @@ -1990,7 +1991,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float } else if(inp_z > 0.0f){ mul_v3_v3fl(state_co, z_vec, (float)sin((float)M_PI/3.f)); - VECADDFAC(state_co,state_co,y_vec,-0.5f); + madd_v3_v3fl(state_co, y_vec, -0.5f); mul_v3_fl(y_vec, -amplitude * (float)cos(t + (float)M_PI/3.f)); mul_v3_fl(z_vec, amplitude/2.f * (float)cos(2.f*t + (float)M_PI/6.f)); @@ -2088,7 +2089,7 @@ void precalc_guides(ParticleSimulationData *sim, ListBase *effectors) data = eff->guide_data + p; - VECSUB(efd.vec_to_point, state.co, eff->guide_loc); + sub_v3_v3v3(efd.vec_to_point, state.co, eff->guide_loc); copy_v3_v3(efd.nor, eff->guide_dir); efd.distance = len_v3(efd.vec_to_point); @@ -2142,7 +2143,7 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time) normalize_v3(guidedir); - VECCOPY(vec_to_point, data->vec_to_point); + copy_v3_v3(vec_to_point, data->vec_to_point); if(guidetime != 0.0f) { /* curve direction */ @@ -2167,16 +2168,16 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time) } } par.co[0] = par.co[1] = par.co[2] = 0.0f; - VECCOPY(key.co, vec_to_point); + copy_v3_v3(key.co, vec_to_point); do_kink(&key, &par, 0, guidetime, pd->kink_freq, pd->kink_shape, pd->kink_amp, 0.f, pd->kink, pd->kink_axis, 0, 0); do_clump(&key, &par, guidetime, pd->clump_fac, pd->clump_pow, 1.0f); - VECCOPY(vec_to_point, key.co); + copy_v3_v3(vec_to_point, key.co); - VECADD(vec_to_point, vec_to_point, guidevec); + add_v3_v3(vec_to_point, guidevec); - //VECSUB(pa_loc,pa_loc,pa_zero); - VECADDFAC(effect, effect, vec_to_point, data->strength); - VECADDFAC(veffect, veffect, guidedir, data->strength); + //sub_v3_v3v3(pa_loc,pa_loc,pa_zero); + madd_v3_v3fl(effect, vec_to_point, data->strength); + madd_v3_v3fl(veffect, guidedir, data->strength); totstrength += data->strength; if(pd->flag & PFIELD_GUIDE_PATH_WEIGHT) @@ -2187,12 +2188,12 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time) if(totstrength > 1.0f) mul_v3_fl(effect, 1.0f / totstrength); CLAMP(totstrength, 0.0f, 1.0f); - //VECADD(effect,effect,pa_zero); + //add_v3_v3(effect,pa_zero); interp_v3_v3v3(state->co, state->co, effect, totstrength); normalize_v3(veffect); mul_v3_fl(veffect, len_v3(state->vel)); - VECCOPY(state->vel, veffect); + copy_v3_v3(state->vel, veffect); return 1; } return 0; @@ -2205,15 +2206,15 @@ static void do_rough(float *loc, float mat[4][4], float t, float fac, float size if(thres != 0.0f) if((float)fabs((float)(-1.5f+loc[0]+loc[1]+loc[2]))<1.5f*thres) return; - VECCOPY(rco,loc); + copy_v3_v3(rco,loc); mul_v3_fl(rco,t); rough[0]=-1.0f+2.0f*BLI_gTurbulence(size, rco[0], rco[1], rco[2], 2,0,2); rough[1]=-1.0f+2.0f*BLI_gTurbulence(size, rco[1], rco[2], rco[0], 2,0,2); rough[2]=-1.0f+2.0f*BLI_gTurbulence(size, rco[2], rco[0], rco[1], 2,0,2); - VECADDFAC(state->co,state->co,mat[0],fac*rough[0]); - VECADDFAC(state->co,state->co,mat[1],fac*rough[1]); - VECADDFAC(state->co,state->co,mat[2],fac*rough[2]); + madd_v3_v3fl(state->co, mat[0], fac * rough[0]); + madd_v3_v3fl(state->co, mat[1], fac * rough[1]); + madd_v3_v3fl(state->co, mat[2], fac * rough[2]); } static void do_rough_end(float *loc, float mat[4][4], float t, float fac, float shape, ParticleKey *state) { @@ -2226,8 +2227,8 @@ static void do_rough_end(float *loc, float mat[4][4], float t, float fac, float rough[1]=-1.0f+2.0f*rough[1]; mul_v2_fl(rough,roughfac); - VECADDFAC(state->co,state->co,mat[0],rough[0]); - VECADDFAC(state->co,state->co,mat[1],rough[1]); + madd_v3_v3fl(state->co, mat[0], rough[0]); + madd_v3_v3fl(state->co, mat[1], rough[1]); } static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheKey *ca, int k, int steps, float *UNUSED(rootco), float effector, float UNUSED(dfra), float UNUSED(cfra), float *length, float *vec) { @@ -2239,9 +2240,9 @@ static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheK if(sim->psys->flag & PSYS_HAIR_DYNAMICS) return; - VECCOPY(eff_key.co,(ca-1)->co); - VECCOPY(eff_key.vel,(ca-1)->vel); - QUATCOPY(eff_key.rot,(ca-1)->rot); + copy_v3_v3(eff_key.co,(ca-1)->co); + copy_v3_v3(eff_key.vel,(ca-1)->vel); + copy_qt_qt(eff_key.rot,(ca-1)->rot); pd_point_from_particle(sim, sim->psys->particles+i, &eff_key, &epoint); pdDoEffectors(sim->psys->effectors, sim->colliders, sim->psys->part->effector_weights, &epoint, force, NULL); @@ -2264,7 +2265,7 @@ static int check_path_length(int k, ParticleCacheKey *keys, ParticleCacheKey *st { if(*cur_length + length > max_length){ mul_v3_fl(dvec, (max_length - *cur_length) / length); - VECADD(state->co, (state - 1)->co, dvec); + add_v3_v3v3(state->co, (state - 1)->co, dvec); keys->steps = k; /* something over the maximum step value */ return k=100000; @@ -2364,8 +2365,9 @@ static void get_strand_normal(Material *ma, float *surfnor, float surfdist, floa interp_v3_v3v3(vnor, nstrand, surfnor, blend); normalize_v3(vnor); } - else - VECCOPY(vnor, nor) + else { + copy_v3_v3(vnor, nor); + } if(ma->strand_surfnor > 0.0f) { if(ma->strand_surfnor > surfdist) { @@ -2375,7 +2377,7 @@ static void get_strand_normal(Material *ma, float *surfnor, float surfdist, floa } } - VECCOPY(nor, vnor); + copy_v3_v3(nor, vnor); } static int psys_threads_init_path(ParticleThread *threads, Scene *scene, float cfra, int editupdate) @@ -2716,7 +2718,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle } if(ctx->ma && (part->draw_col == PART_DRAW_COL_MAT)) { - VECCOPY(child->col, &ctx->ma->r) + copy_v3_v3(child->col, &ctx->ma->r); get_strand_normal(ctx->ma, ornor, cur_length, child->vel); } } @@ -2834,7 +2836,7 @@ static void cache_key_incremental_rotation(ParticleCacheKey *key0, ParticleCache * angle, since floating point accuracy makes it give * different results across platforms */ if(cosangle > 0.999999f) { - QUATCOPY(key1->rot, key2->rot); + copy_v4_v4(key1->rot, key2->rot); } else { angle= saacos(cosangle); @@ -2899,7 +2901,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra) psys->lattice = psys_get_lattice(sim); ma= give_current_material(sim->ob, psys->part->omat); if(ma && (psys->part->draw_col == PART_DRAW_COL_MAT)) - VECCOPY(col, &ma->r) + copy_v3_v3(col, &ma->r); if((psys->flag & PSYS_GLOBAL_HAIR)==0) { if((psys->part->flag & PART_CHILD_EFFECT)==0) @@ -2933,9 +2935,9 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra) /* hairmat is needed for for non-hair particle too so we get proper rotations */ psys_mat_hair_to_global(sim->ob, psmd->dm, psys->part->from, pa, hairmat); - VECCOPY(rotmat[0], hairmat[2]); - VECCOPY(rotmat[1], hairmat[1]); - VECCOPY(rotmat[2], hairmat[0]); + copy_v3_v3(rotmat[0], hairmat[2]); + copy_v3_v3(rotmat[1], hairmat[1]); + copy_v3_v3(rotmat[2], hairmat[0]); if(part->draw & PART_ABS_PATH_TIME) { birthtime = MAX2(pind.birthtime, part->path_start); @@ -3189,7 +3191,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf else { if((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT){ if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT){ - VECCOPY(ca->col, sel_col); + copy_v3_v3(ca->col, sel_col); } else{ keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time)); @@ -3202,7 +3204,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf interp_v3_v3v3(ca->col, nosel_col, sel_col, keytime); } else{ - VECCOPY(ca->col, nosel_col); + copy_v3_v3(ca->col, nosel_col); } } } @@ -3253,9 +3255,9 @@ void copy_particle_key(ParticleKey *to, ParticleKey *from, int time){ } } void psys_get_from_key(ParticleKey *key, float *loc, float *vel, float *rot, float *time){ - if(loc) VECCOPY(loc,key->co); - if(vel) VECCOPY(vel,key->vel); - if(rot) QUATCOPY(rot,key->rot); + if(loc) copy_v3_v3(loc,key->co); + if(vel) copy_v3_v3(vel,key->vel); + if(rot) copy_qt_qt(rot,key->rot); if(time) *time=key->time; } /*-------changing particle keys from space to another-------*/ @@ -3263,13 +3265,13 @@ void psys_get_from_key(ParticleKey *key, float *loc, float *vel, float *rot, flo static void key_from_object(Object *ob, ParticleKey *key){ float q[4]; - VECADD(key->vel,key->vel,key->co); + add_v3_v3(key->vel, key->co); mul_m4_v3(ob->obmat,key->co); mul_m4_v3(ob->obmat,key->vel); mat4_to_quat(q,ob->obmat); - VECSUB(key->vel,key->vel,key->co); + sub_v3_v3v3(key->vel,key->vel,key->co); mul_qt_qtqt(key->rot,q,key->rot); } #endif @@ -3330,9 +3332,9 @@ static void psys_face_mat(Object *ob, DerivedMesh *dm, ParticleData *pa, float m osface=dm->getFaceData(dm,i,CD_ORIGSPACE); if(orco && (orcodata=dm->getVertDataArray(dm, CD_ORCO))) { - VECCOPY(v[0], orcodata[mface->v1]); - VECCOPY(v[1], orcodata[mface->v2]); - VECCOPY(v[2], orcodata[mface->v3]); + copy_v3_v3(v[0], orcodata[mface->v1]); + copy_v3_v3(v[1], orcodata[mface->v2]); + copy_v3_v3(v[2], orcodata[mface->v3]); /* ugly hack to use non-transformed orcos, since only those * give symmetric results for mirroring in particle mode */ @@ -3354,7 +3356,7 @@ void psys_mat_hair_to_object(Object *UNUSED(ob), DerivedMesh *dm, short from, Pa psys_face_mat(0, dm, pa, hairmat, 0); psys_particle_on_dm(dm, from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, vec, 0, 0, 0, 0, 0); - VECCOPY(hairmat[3],vec); + copy_v3_v3(hairmat[3],vec); } void psys_mat_hair_to_orco(Object *ob, DerivedMesh *dm, short from, ParticleData *pa, float hairmat[][4]) @@ -3367,7 +3369,7 @@ void psys_mat_hair_to_orco(Object *ob, DerivedMesh *dm, short from, ParticleData /* see psys_face_mat for why this function is called */ if(DM_get_vert_data_layer(dm, CD_ORIGINDEX)) transform_mesh_orco_verts(ob->data, &orco, 1, 1); - VECCOPY(hairmat[3],orco); + copy_v3_v3(hairmat[3],orco); } void psys_vec_rot_to_face(DerivedMesh *dm, ParticleData *pa, float *vec) @@ -3427,7 +3429,7 @@ ModifierData *object_add_particle_system(Scene *scene, Object *ob, const char *n psys->totpart=0; psys->flag = PSYS_ENABLED|PSYS_CURRENT; - psys->cfra=bsystem_time(scene,ob,scene->r.cfra+1,0.0); + psys->cfra = BKE_frame_to_ctime(scene, CFRA + 1); DAG_scene_sort(G.main, scene); DAG_id_tag_update(&ob->id, OB_RECALC_DATA); @@ -3576,7 +3578,7 @@ ParticleSettings *psys_copy_settings(ParticleSettings *part) ParticleSettings *partn; int a; - partn= copy_libblock(part); + partn= copy_libblock(&part->id); partn->pd= MEM_dupallocN(part->pd); partn->pd2= MEM_dupallocN(part->pd2); partn->effector_weights= MEM_dupallocN(part->effector_weights); @@ -3666,7 +3668,7 @@ void make_local_particlesettings(ParticleSettings *part) /* Textures */ /************************************************/ -static int get_particle_uv(DerivedMesh *dm, ParticleData *pa, int face_index, float *fuv, char *name, float *texco) +static int get_particle_uv(DerivedMesh *dm, ParticleData *pa, int face_index, const float fuv[4], char *name, float *texco) { MFace *mf; MTFace *tf; @@ -3710,7 +3712,7 @@ static int get_particle_uv(DerivedMesh *dm, ParticleData *pa, int face_index, fl #define CLAMP_PARTICLE_TEXTURE_POS(type, pvalue) if(event & type) { if(pvalue < 0.f) pvalue = 1.f+pvalue; CLAMP(pvalue, 0.0f, 1.0f); } #define CLAMP_PARTICLE_TEXTURE_POSNEG(type, pvalue) if(event & type) { CLAMP(pvalue, -1.0f, 1.0f); } -static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSettings *part, ParticleData *par, int child_index, int face_index, float *fw, float *orco, ParticleTexture *ptex, int event, float cfra) +static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSettings *part, ParticleData *par, int child_index, int face_index, const float fw[4], float *orco, ParticleTexture *ptex, int event, float cfra) { MTex *mtex, **mtexp = part->mtex; int m; @@ -4079,7 +4081,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * psys_particle_on_emitter(psmd,cpa_from,cpa_num,DMCACHE_ISCHILD,cpa->fuv,foffset,co,0,0,0,orco,0); /* we need to save the actual root position of the child for positioning it accurately to the surface of the emitter */ - //VECCOPY(cpa_1st,co); + //copy_v3_v3(cpa_1st,co); //mul_m4_v3(ob->obmat,cpa_1st); @@ -4150,7 +4152,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * w++; } /* apply offset for correct positioning */ - //VECADD(state->co,state->co,cpa_1st); + //add_v3_v3(state->co, cpa_1st); } else{ /* offset the child from the parent position */ @@ -4173,13 +4175,13 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * if(t>=0.001f){ tstate.time=t-0.001f; psys_get_particle_on_path(sim,p,&tstate,0); - VECSUB(state->vel,state->co,tstate.co); + sub_v3_v3v3(state->vel,state->co,tstate.co); normalize_v3(state->vel); } else{ tstate.time=t+0.001f; psys_get_particle_on_path(sim,p,&tstate,0); - VECSUB(state->vel,tstate.co,state->co); + sub_v3_v3v3(state->vel,tstate.co,state->co); normalize_v3(state->vel); } @@ -4198,7 +4200,7 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta float timestep = psys_get_timestep(sim); /* negative time means "use current time" */ - cfra = state->time > 0 ? state->time : bsystem_time(sim->scene, 0, (float)sim->scene->r.cfra, 0.0); + cfra = state->time > 0 ? state->time : BKE_curframe(sim->scene); if(p>=totpart){ if(!psys->totchild) @@ -4430,9 +4432,9 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa cross_v3_v3v3(nor, vec, side); unit_m4(mat); - VECCOPY(mat[0], vec); - VECCOPY(mat[1], side); - VECCOPY(mat[2], nor); + copy_v3_v3(mat[0], vec); + copy_v3_v3(mat[1], side); + copy_v3_v3(mat[2], nor); } else { quat_to_mat4(mat, pa->state.rot); @@ -4478,12 +4480,12 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3] normalize_v3_v3(temp, bb->vel); - VECSUB(zvec, bb->ob->obmat[3], bb->vec); + sub_v3_v3v3(zvec, bb->ob->obmat[3], bb->vec); if(bb->lock) { float fac = -dot_v3v3(zvec, temp); - VECADDFAC(zvec, zvec, temp, fac); + madd_v3_v3fl(zvec, temp, fac); } normalize_v3(zvec); @@ -4493,7 +4495,7 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3] cross_v3_v3v3(yvec,zvec,xvec); } else { - VECSUB(zvec, bb->ob->obmat[3], bb->vec); + sub_v3_v3v3(zvec, bb->ob->obmat[3], bb->vec); if(bb->lock) zvec[bb->align] = 0.0f; normalize_v3(zvec); @@ -4507,22 +4509,22 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3] cross_v3_v3v3(yvec,zvec,xvec); } - VECCOPY(tvec, xvec); - VECCOPY(tvec2, yvec); + copy_v3_v3(tvec, xvec); + copy_v3_v3(tvec2, yvec); mul_v3_fl(xvec, cos(bb->tilt * (float)M_PI)); mul_v3_fl(tvec2, sin(bb->tilt * (float)M_PI)); - VECADD(xvec, xvec, tvec2); + add_v3_v3(xvec, tvec2); mul_v3_fl(yvec, cos(bb->tilt * (float)M_PI)); mul_v3_fl(tvec, -sin(bb->tilt * (float)M_PI)); - VECADD(yvec, yvec, tvec); + add_v3_v3(yvec, tvec); mul_v3_fl(xvec, bb->size[0]); mul_v3_fl(yvec, bb->size[1]); - VECADDFAC(center, bb->vec, xvec, bb->offset[0]); - VECADDFAC(center, center, yvec, bb->offset[1]); + madd_v3_v3v3fl(center, bb->vec, xvec, bb->offset[0]); + madd_v3_v3fl(center, yvec, bb->offset[1]); } diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index ec058b23050..3e88fb7d65e 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -454,7 +454,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys) max[2]=MAX2(max[2],mv->co[2]); } - VECSUB(delta,max,min); + sub_v3_v3v3(delta, max, min); /* determine major axis */ axis = (delta[0]>=delta[1]) ? 0 : ((delta[1]>=delta[2]) ? 1 : 2); @@ -815,7 +815,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch normalize_v3(nor); mul_v3_fl(nor,-100.0); - VECADD(co2,co1,nor); + add_v3_v3v3(co2,co1,nor); min_d=2.0; intersect=0; @@ -1099,11 +1099,11 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D for(p=0; p<totvert; p++) { if(orcodata) { - VECCOPY(co,orcodata[p]) + copy_v3_v3(co,orcodata[p]); transform_mesh_orco_verts((Mesh*)ob->data, &co, 1, 1); } else - VECCOPY(co,mv[p].co) + copy_v3_v3(co,mv[p].co); BLI_kdtree_insert(tree,p,co,NULL); } @@ -1141,14 +1141,14 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D MFace *mf=dm->getFaceData(dm,i,CD_MFACE); if(orcodata) { - VECCOPY(co1, orcodata[mf->v1]); - VECCOPY(co2, orcodata[mf->v2]); - VECCOPY(co3, orcodata[mf->v3]); + copy_v3_v3(co1, orcodata[mf->v1]); + copy_v3_v3(co2, orcodata[mf->v2]); + copy_v3_v3(co3, orcodata[mf->v3]); transform_mesh_orco_verts((Mesh*)ob->data, &co1, 1, 1); transform_mesh_orco_verts((Mesh*)ob->data, &co2, 1, 1); transform_mesh_orco_verts((Mesh*)ob->data, &co3, 1, 1); if(mf->v4) { - VECCOPY(co4, orcodata[mf->v4]); + copy_v3_v3(co4, orcodata[mf->v4]); transform_mesh_orco_verts((Mesh*)ob->data, &co4, 1, 1); } } @@ -1156,12 +1156,12 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D v1= (MVert*)dm->getVertData(dm,mf->v1,CD_MVERT); v2= (MVert*)dm->getVertData(dm,mf->v2,CD_MVERT); v3= (MVert*)dm->getVertData(dm,mf->v3,CD_MVERT); - VECCOPY(co1, v1->co); - VECCOPY(co2, v2->co); - VECCOPY(co3, v3->co); + copy_v3_v3(co1, v1->co); + copy_v3_v3(co2, v2->co); + copy_v3_v3(co3, v3->co); if(mf->v4) { v4= (MVert*)dm->getVertData(dm,mf->v4,CD_MVERT); - VECCOPY(co4, v4->co); + copy_v3_v3(co4, v4->co); } } @@ -1588,15 +1588,15 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P if(part->tanfac!=0.0f){ //float phase=vg_rot?2.0f*(psys_particle_value_from_verts(sim->psmd->dm,part->from,pa,vg_rot)-0.5f):0.0f; float phase=0.0f; - mul_v3_fl(vtan,-(float)cos((float)M_PI*(part->tanphase+phase))); - fac=-(float)sin((float)M_PI*(part->tanphase+phase)); - VECADDFAC(vtan,vtan,utan,fac); + mul_v3_fl(vtan,-cosf((float)M_PI*(part->tanphase+phase))); + fac= -sinf((float)M_PI*(part->tanphase+phase)); + madd_v3_v3fl(vtan, utan, fac); mul_mat3_m4_v3(ob->obmat,vtan); - VECCOPY(utan,nor); + copy_v3_v3(utan, nor); mul_v3_fl(utan,dot_v3v3(vtan,nor)); - VECSUB(vtan,vtan,utan); + sub_v3_v3(vtan, utan); normalize_v3(vtan); } @@ -1648,7 +1648,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P normalize_v3(state->ave); } else { - VECCOPY(state->ave, nor); + copy_v3_v3(state->ave, nor); } /* calculate rotation matrix */ @@ -2423,7 +2423,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa pfr.element_size = MAXFLOAT; } sphdata->element_size = pfr.element_size; - VECCOPY(sphdata->flow, pfr.flow); + copy_v3_v3(sphdata->flow, pfr.flow); pressure = stiffness * (pfr.density - rest_density); near_pressure = stiffness_near_fac * pfr.near_density; @@ -2520,7 +2520,7 @@ static void sph_integrate(ParticleSimulationData *sim, ParticleData *pa, float d integrate_particle(part, pa, dtime, effector_acceleration, sph_force_cb, &sphdata); *element_size = sphdata.element_size; - VECCOPY(flow, sphdata.flow); + copy_v3_v3(flow, sphdata.flow); } /************************************************/ @@ -2592,21 +2592,21 @@ static void basic_integrate(ParticleSimulationData *sim, int p, float dfra, floa if(part->dampfac != 0.f) mul_v3_fl(pa->state.vel, 1.f - part->dampfac * efdata.ptex.damp * 25.f * dtime); - //VECCOPY(pa->state.ave, states->ave); + //copy_v3_v3(pa->state.ave, states->ave); /* finally we do guides */ time=(cfra-pa->time)/pa->lifetime; CLAMP(time, 0.0f, 1.0f); - VECCOPY(tkey.co,pa->state.co); - VECCOPY(tkey.vel,pa->state.vel); + copy_v3_v3(tkey.co,pa->state.co); + copy_v3_v3(tkey.vel,pa->state.vel); tkey.time=pa->state.time; if(part->type != PART_HAIR) { if(do_guides(sim->psys->effectors, &tkey, p, time)) { - VECCOPY(pa->state.co,tkey.co); + copy_v3_v3(pa->state.co,tkey.co); /* guides don't produce valid velocity */ - VECSUB(pa->state.vel,tkey.co,pa->prev_state.co); + sub_v3_v3v3(pa->state.vel, tkey.co, pa->prev_state.co); mul_v3_fl(pa->state.vel,1.0f/dtime); pa->state.time=tkey.time; } @@ -3471,9 +3471,9 @@ static void do_hair_dynamics(ParticleSimulationData *sim) /* create fake root before actual root to resist bending */ if(k==0) { float temp[3]; - VECSUB(temp, key->co, (key+1)->co); - VECCOPY(mvert->co, key->co); - VECADD(mvert->co, mvert->co, temp); + sub_v3_v3v3(temp, key->co, (key+1)->co); + copy_v3_v3(mvert->co, key->co); + add_v3_v3v3(mvert->co, mvert->co, temp); mul_m4_v3(hairmat, mvert->co); mvert++; @@ -3492,7 +3492,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim) } } - VECCOPY(mvert->co, key->co); + copy_v3_v3(mvert->co, key->co); mul_m4_v3(hairmat, mvert->co); mvert++; @@ -3589,7 +3589,7 @@ static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra)){ mul_m4_v3(ob->imat, key->co); if(pa->totkey) { - VECSUB(key->co, key->co, root->co); + sub_v3_v3(key->co, root->co); psys_vec_rot_to_face(sim->psmd->dm, pa, key->co); } diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index cd71f43221b..b6dd916b420 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -185,8 +185,8 @@ static void ptcache_softbody_interpolate(int index, void *soft_v, void **data, f if(cfra1 == cfra2) return; - VECCOPY(keys[1].co, bp->pos); - VECCOPY(keys[1].vel, bp->vec); + copy_v3_v3(keys[1].co, bp->pos); + copy_v3_v3(keys[1].vel, bp->vec); if(old_data) { memcpy(keys[2].co, old_data, 3 * sizeof(float)); @@ -204,8 +204,8 @@ static void ptcache_softbody_interpolate(int index, void *soft_v, void **data, f mul_v3_fl(keys->vel, 1.0f / dfra); - VECCOPY(bp->pos, keys->co); - VECCOPY(bp->vec, keys->vel); + copy_v3_v3(bp->pos, keys->co); + copy_v3_v3(bp->vec, keys->vel); } static int ptcache_softbody_totpoint(void *soft_v, int UNUSED(cfra)) { @@ -485,8 +485,8 @@ static void ptcache_cloth_interpolate(int index, void *cloth_v, void **data, flo if(cfra1 == cfra2) return; - VECCOPY(keys[1].co, vert->x); - VECCOPY(keys[1].vel, vert->v); + copy_v3_v3(keys[1].co, vert->x); + copy_v3_v3(keys[1].vel, vert->v); if(old_data) { memcpy(keys[2].co, old_data, 3 * sizeof(float)); @@ -504,8 +504,8 @@ static void ptcache_cloth_interpolate(int index, void *cloth_v, void **data, flo mul_v3_fl(keys->vel, 1.0f / dfra); - VECCOPY(vert->x, keys->co); - VECCOPY(vert->v, keys->vel); + copy_v3_v3(vert->x, keys->co); + copy_v3_v3(vert->v, keys->vel); /* should vert->xconst be interpolated somehow too? - jahka */ } @@ -2265,7 +2265,7 @@ int BKE_ptcache_id_exist(PTCacheID *pid, int cfra) } void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startframe, int *endframe, float *timescale) { - Object *ob; + /* Object *ob; */ /* UNUSED */ PointCache *cache; /* float offset; unused for now */ float time, nexttime; @@ -2282,13 +2282,13 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra * is probably to interpolate results from two frames for that .. */ - ob= pid->ob; + /* ob= pid->ob; */ /* UNUSED */ cache= pid->cache; if(timescale) { - time= bsystem_time(scene, ob, cfra, 0.0f); - nexttime= bsystem_time(scene, ob, cfra+1.0f, 0.0f); - + time= BKE_curframe(scene); + nexttime= BKE_frame_to_ctime(scene, CFRA+1); + *timescale= MAX2(nexttime - time, 0.0f); } @@ -2302,7 +2302,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra * system timing. */ #if 0 if ((ob->partype & PARSLOW)==0) { - offset= give_timeoffset(ob); + offset= ob->sf; *startframe += (int)(offset+0.5f); *endframe += (int)(offset+0.5f); @@ -3028,7 +3028,7 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) BKE_ptcache_update_info(pid); } -void BKE_ptcache_disk_cache_rename(PTCacheID *pid, char *from, char *to) +void BKE_ptcache_disk_cache_rename(PTCacheID *pid, const char *name_src, const char *name_dst) { char old_name[80]; int len; /* store the length of the string */ @@ -3045,7 +3045,7 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, char *from, char *to) BLI_strncpy(old_name, pid->cache->name, sizeof(old_name)); /* get "from" filename */ - BLI_strncpy(pid->cache->name, from, sizeof(pid->cache->name)); + BLI_strncpy(pid->cache->name, name_src, sizeof(pid->cache->name)); len = ptcache_filename(pid, old_filename, 0, 0, 0); /* no path */ @@ -3059,7 +3059,7 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, char *from, char *to) BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index); /* put new name into cache */ - BLI_strncpy(pid->cache->name, to, sizeof(pid->cache->name)); + BLI_strncpy(pid->cache->name, name_dst, sizeof(pid->cache->name)); while ((de = readdir(dir)) != NULL) { if (strstr(de->d_name, ext)) { /* do we have the right extension?*/ diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c index f9d470e48d8..d6c4b5f3a2e 100644 --- a/source/blender/blenkernel/intern/property.c +++ b/source/blender/blenkernel/intern/property.c @@ -200,7 +200,7 @@ void set_ob_property(Object *ob, bProperty *propc) /* negative: prop is smaller * positive: prop is larger */ -int compare_property(bProperty *prop, char *str) +int compare_property(bProperty *prop, const char *str) { // extern int Gdfra; /* sector.c */ float fvalue, ftest; @@ -237,7 +237,7 @@ int compare_property(bProperty *prop, char *str) return 0; } -void set_property(bProperty *prop, char *str) +void set_property(bProperty *prop, const char *str) { // extern int Gdfra; /* sector.c */ @@ -261,7 +261,7 @@ void set_property(bProperty *prop, char *str) } -void add_property(bProperty *prop, char *str) +void add_property(bProperty *prop, const char *str) { // extern int Gdfra; /* sector.c */ diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index a9de75dc7d0..14dfe015894 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -126,7 +126,7 @@ Scene *copy_scene(Scene *sce, int type) scen->r.layers= lb; } else { - scen= copy_libblock(sce); + scen= copy_libblock(&sce->id); BLI_duplicatelist(&(scen->base), &(sce->base)); clear_id_newpoins(); @@ -806,6 +806,8 @@ int scene_camera_switch_update(Scene *scene) scene->camera= camera; return 1; } +#else + (void)scene; #endif return 0; } @@ -908,15 +910,20 @@ int scene_check_setscene(Main *bmain, Scene *sce) } /* This function is needed to cope with fractional frames - including two Blender rendering features -* mblur (motion blur that renders 'subframes' and blurs them together), and fields rendering. */ - -/* see also bsystem_time in object.c */ + * mblur (motion blur that renders 'subframes' and blurs them together), and fields rendering. + */ float BKE_curframe(Scene *scene) { - float ctime = scene->r.cfra; - ctime+= scene->r.subframe; - ctime*= scene->r.framelen; + return BKE_frame_to_ctime(scene, scene->r.cfra); +} +/* This function is used to obtain arbitrary fractional frames */ +float BKE_frame_to_ctime(Scene *scene, const float frame) +{ + float ctime = frame; + ctime += scene->r.subframe; + ctime *= scene->r.framelen; + return ctime; } diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 6b319e6b5e1..3e9b570d104 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1980,6 +1980,8 @@ static ImBuf * seq_render_scene_strip_impl( /* stooping to new low's in hackyness :( */ oldmarkers= scene->markers; scene->markers.first= scene->markers.last= NULL; +#else + (void)oldmarkers; #endif if(sequencer_view3d_cb && BLI_thread_is_main() && doseq_gl && (scene == context.scene || have_seq==0) && camera) { @@ -3404,7 +3406,7 @@ void seq_offset_animdata(Scene *scene, Sequence *seq, int ofs) } } -void seq_dupe_animdata(Scene *scene, char *name_from, char *name_to) +void seq_dupe_animdata(Scene *scene, const char *name_src, const char *name_dst) { char str_from[32]; FCurve *fcu; @@ -3415,7 +3417,7 @@ void seq_dupe_animdata(Scene *scene, char *name_from, char *name_to) if(scene->adt==NULL || scene->adt->action==NULL) return; - sprintf(str_from, "[\"%s\"]", name_from); + sprintf(str_from, "[\"%s\"]", name_src); fcu_last= scene->adt->action->curves.last; @@ -3427,7 +3429,7 @@ void seq_dupe_animdata(Scene *scene, char *name_from, char *name_to) } /* notice validate is 0, keep this because the seq may not be added to the scene yet */ - BKE_animdata_fix_paths_rename(&scene->id, scene->adt, "sequence_editor.sequences_all", name_from, name_to, 0, 0, 0); + BKE_animdata_fix_paths_rename(&scene->id, scene->adt, "sequence_editor.sequences_all", name_src, name_dst, 0, 0, 0); /* add the original fcurves back */ BLI_movelisttolist(&scene->adt->action->curves, &lb); diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index e47dcd68ce1..aed246690bd 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -167,13 +167,11 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) //Convert the vertex to tree coordinates - if(calc->vert) - { - VECCOPY(tmp_co, calc->vert[i].co); + if(calc->vert) { + copy_v3_v3(tmp_co, calc->vert[i].co); } - else - { - VECCOPY(tmp_co, co); + else { + copy_v3_v3(tmp_co, co); } space_transform_apply(&calc->local2target, tmp_co); @@ -198,7 +196,7 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) if(dist > FLT_EPSILON) weight *= (dist - calc->keepDist)/dist; //Convert the coordinates back to mesh coordinates - VECCOPY(tmp_co, nearest.co); + copy_v3_v3(tmp_co, nearest.co); space_transform_invert(&calc->local2target, tmp_co); interp_v3_v3v3(co, co, tmp_co, weight); //linear interpolation @@ -228,11 +226,11 @@ int normal_projection_project_vertex(char options, const float *vert, const floa //Apply space transform (TODO readjust dist) if(transf) { - VECCOPY( tmp_co, vert ); + copy_v3_v3( tmp_co, vert ); space_transform_apply( transf, tmp_co ); co = tmp_co; - VECCOPY( tmp_no, dir ); + copy_v3_v3( tmp_no, dir ); space_transform_apply_normal( transf, tmp_no ); no = tmp_no; @@ -350,17 +348,17 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) /* this coordinated are deformed by vertexCos only for normal projection (to get correct normals) */ /* for other cases calc->varts contains undeformed coordinates and vertexCos should be used */ if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) { - VECCOPY(tmp_co, calc->vert[i].co); + copy_v3_v3(tmp_co, calc->vert[i].co); normal_short_to_float_v3(tmp_no, calc->vert[i].no); } else { - VECCOPY(tmp_co, co); - VECCOPY(tmp_no, proj_axis); + copy_v3_v3(tmp_co, co); + copy_v3_v3(tmp_no, proj_axis); } } else { - VECCOPY(tmp_co, co); - VECCOPY(tmp_no, proj_axis); + copy_v3_v3(tmp_co, co); + copy_v3_v3(tmp_no, proj_axis); } @@ -443,11 +441,11 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) //Convert the vertex to tree coordinates if(calc->vert) { - VECCOPY(tmp_co, calc->vert[i].co); + copy_v3_v3(tmp_co, calc->vert[i].co); } else { - VECCOPY(tmp_co, co); + copy_v3_v3(tmp_co, co); } space_transform_apply(&calc->local2target, tmp_co); @@ -469,7 +467,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE) { //Make the vertex stay on the front side of the face - VECADDFAC(tmp_co, nearest.co, nearest.no, calc->keepDist); + madd_v3_v3v3fl(tmp_co, nearest.co, nearest.no, calc->keepDist); } else { @@ -478,7 +476,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) if(dist > FLT_EPSILON) interp_v3_v3v3(tmp_co, tmp_co, nearest.co, (dist - calc->keepDist)/dist); //linear interpolation else - VECCOPY( tmp_co, nearest.co ); + copy_v3_v3( tmp_co, nearest.co ); } //Convert the coordinates back to mesh coordinates diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 7174126a00c..60941ef78a3 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -172,7 +172,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, { float tmp[3]; - VECCOPY(tmp, verts[i].co); + copy_v3_v3(tmp, verts[i].co); mul_m4_v3(ob->obmat, tmp); // min BB @@ -186,11 +186,11 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, max[2] = MAX2(max[2], tmp[2]); } - VECCOPY(smd->domain->p0, min); - VECCOPY(smd->domain->p1, max); + copy_v3_v3(smd->domain->p0, min); + copy_v3_v3(smd->domain->p1, max); // calc other res with max_res provided - VECSUB(size, max, min); + sub_v3_v3v3(size, max, min); // printf("size: %f, %f, %f\n", size[0], size[1], size[2]); @@ -354,9 +354,9 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs) for(i = 0; i < dm->getNumVerts(dm); i++) { float tmpvec[3]; - VECCOPY(tmpvec, mvert[i].co); + copy_v3_v3(tmpvec, mvert[i].co); mul_m4_v3(ob->obmat, tmpvec); - VECCOPY(&scs->points[i * 3], tmpvec); + copy_v3_v3(&scs->points[i * 3], tmpvec); } for(i = 0, facecounter = 0; i < dm->getNumFaces(dm); i++) @@ -372,18 +372,18 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs) if(again == 1 && mface[i].v4) { - VECSUB(side1, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co); - VECSUB(side2, mvert[ mface[i].v4 ].co, mvert[ mface[i].v1 ].co); + sub_v3_v3v3(side1, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co); + sub_v3_v3v3(side2, mvert[ mface[i].v4 ].co, mvert[ mface[i].v1 ].co); } else { - VECSUB(side1, mvert[ mface[i].v2 ].co, mvert[ mface[i].v1 ].co); - VECSUB(side2, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co); + sub_v3_v3v3(side1, mvert[ mface[i].v2 ].co, mvert[ mface[i].v1 ].co); + sub_v3_v3v3(side2, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co); } cross_v3_v3v3(trinormorg, side1, side2); normalize_v3(trinormorg); - VECCOPY(trinorm, trinormorg); + copy_v3_v3(trinorm, trinormorg); mul_v3_fl(trinorm, 0.25 * cell_len); for(j = 0; j <= divs1; j++) @@ -401,43 +401,42 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs) continue; } - VECCOPY(p1, mvert[ mface[i].v1 ].co); + copy_v3_v3(p1, mvert[ mface[i].v1 ].co); if(again == 1 && mface[i].v4) { - VECCOPY(p2, mvert[ mface[i].v3 ].co); - VECCOPY(p3, mvert[ mface[i].v4 ].co); + copy_v3_v3(p2, mvert[ mface[i].v3 ].co); + copy_v3_v3(p3, mvert[ mface[i].v4 ].co); } else { - VECCOPY(p2, mvert[ mface[i].v2 ].co); - VECCOPY(p3, mvert[ mface[i].v3 ].co); + copy_v3_v3(p2, mvert[ mface[i].v2 ].co); + copy_v3_v3(p3, mvert[ mface[i].v3 ].co); } mul_v3_fl(p1, (1.0-uf-vf)); mul_v3_fl(p2, uf); mul_v3_fl(p3, vf); - VECADD(p, p1, p2); - VECADD(p, p, p3); + add_v3_v3v3(p, p1, p2); + add_v3_v3(p, p3); if(newdivs > divs) printf("mem problem\n"); // mMovPoints.push_back(p + trinorm); - VECCOPY(tmpvec, p); - VECADD(tmpvec, tmpvec, trinorm); + add_v3_v3v3(tmpvec, p, trinorm); mul_m4_v3(ob->obmat, tmpvec); - VECCOPY(&scs->points[3 * (dm->getNumVerts(dm) + newdivs)], tmpvec); + copy_v3_v3(&scs->points[3 * (dm->getNumVerts(dm) + newdivs)], tmpvec); newdivs++; if(newdivs > divs) printf("mem problem\n"); // mMovPoints.push_back(p - trinorm); - VECCOPY(tmpvec, p); - VECSUB(tmpvec, tmpvec, trinorm); + copy_v3_v3(tmpvec, p); + sub_v3_v3(tmpvec, trinorm); mul_m4_v3(ob->obmat, tmpvec); - VECCOPY(&scs->points[3 * (dm->getNumVerts(dm) + newdivs)], tmpvec); + copy_v3_v3(&scs->points[3 * (dm->getNumVerts(dm) + newdivs)], tmpvec); newdivs++; } } @@ -488,23 +487,23 @@ static void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFa float side3[3]; int divs1=0, divs2=0, divs3=0; - VECCOPY(p0, verts[faces[i].v1].co); + copy_v3_v3(p0, verts[faces[i].v1].co); mul_m4_v3(ob->obmat, p0); - VECCOPY(p1, verts[faces[i].v2].co); + copy_v3_v3(p1, verts[faces[i].v2].co); mul_m4_v3(ob->obmat, p1); - VECCOPY(p2, verts[faces[i].v3].co); + copy_v3_v3(p2, verts[faces[i].v3].co); mul_m4_v3(ob->obmat, p2); - VECSUB(side1, p1, p0); - VECSUB(side2, p2, p0); - VECSUB(side3, p1, p2); + sub_v3_v3v3(side1, p1, p0); + sub_v3_v3v3(side2, p2, p0); + sub_v3_v3v3(side3, p1, p2); - if(INPR(side1, side1) > fsTri*fsTri) + if(dot_v3v3(side1, side1) > fsTri*fsTri) { float tmp = normalize_v3(side1); divs1 = (int)ceil(tmp/fsTri); } - if(INPR(side2, side2) > fsTri*fsTri) + if(dot_v3v3(side2, side2) > fsTri*fsTri) { float tmp = normalize_v3(side2); divs2 = (int)ceil(tmp/fsTri); @@ -527,23 +526,23 @@ static void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFa facecounter++; - VECCOPY(p0, verts[faces[i].v3].co); + copy_v3_v3(p0, verts[faces[i].v3].co); mul_m4_v3(ob->obmat, p0); - VECCOPY(p1, verts[faces[i].v4].co); + copy_v3_v3(p1, verts[faces[i].v4].co); mul_m4_v3(ob->obmat, p1); - VECCOPY(p2, verts[faces[i].v1].co); + copy_v3_v3(p2, verts[faces[i].v1].co); mul_m4_v3(ob->obmat, p2); - VECSUB(side1, p1, p0); - VECSUB(side2, p2, p0); - VECSUB(side3, p1, p2); + sub_v3_v3v3(side1, p1, p0); + sub_v3_v3v3(side2, p2, p0); + sub_v3_v3v3(side3, p1, p2); - if(INPR(side1, side1) > fsTri*fsTri) + if(dot_v3v3(side1, side1) > fsTri*fsTri) { float tmp = normalize_v3(side1); divs1 = (int)ceil(tmp/fsTri); } - if(INPR(side2, side2) > fsTri*fsTri) + if(dot_v3v3(side2, side2) > fsTri*fsTri) { float tmp = normalize_v3(side2); divs2 = (int)ceil(tmp/fsTri); @@ -1050,7 +1049,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd) if(psys_get_particle_state(&sim, p, &state, 0) == 0) continue; - // VECCOPY(pos, pa->state.co); + // copy_v3_v3(pos, pa->state.co); // mul_m4_v3(ob->imat, pos); // 1. get corresponding cell get_cell(smd->domain->p0, smd->domain->res, smd->domain->dx, state.co, cell, 0); @@ -1589,7 +1588,7 @@ static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int { float tmp[3]; - VECSUB(tmp, pos, p0); + sub_v3_v3v3(tmp, pos, p0); mul_v3_fl(tmp, 1.0 / dx); if(correct) diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 28925a7b170..5b02731050e 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -321,7 +321,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob) /* determine the ortho BB */ for(i=0; i < pccd_M->totvert; i++){ /* evaluate limits */ - VECCOPY(v,pccd_M->mvert[i].co); + copy_v3_v3(v,pccd_M->mvert[i].co); pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull); pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull); pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull); @@ -345,7 +345,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob) mima->minx=mima->miny=mima->minz=1e30f; mima->maxx=mima->maxy=mima->maxz=-1e30f; - VECCOPY(v,pccd_M->mvert[mface->v1].co); + copy_v3_v3(v,pccd_M->mvert[mface->v1].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -353,7 +353,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob) mima->maxy = MAX2(mima->maxy,v[1]+hull); mima->maxz = MAX2(mima->maxz,v[2]+hull); - VECCOPY(v,pccd_M->mvert[mface->v2].co); + copy_v3_v3(v,pccd_M->mvert[mface->v2].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -361,7 +361,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob) mima->maxy = MAX2(mima->maxy,v[1]+hull); mima->maxz = MAX2(mima->maxz,v[2]+hull); - VECCOPY(v,pccd_M->mvert[mface->v3].co); + copy_v3_v3(v,pccd_M->mvert[mface->v3].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -370,7 +370,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob) mima->maxz = MAX2(mima->maxz,v[2]+hull); if(mface->v4){ - VECCOPY(v,pccd_M->mvert[mface->v4].co); + copy_v3_v3(v,pccd_M->mvert[mface->v4].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -419,7 +419,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) /* determine the ortho BB */ for(i=0; i < pccd_M->totvert; i++){ /* evaluate limits */ - VECCOPY(v,pccd_M->mvert[i].co); + copy_v3_v3(v,pccd_M->mvert[i].co); pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull); pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull); pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull); @@ -429,7 +429,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) pccd_M->bbmax[2] = MAX2(pccd_M->bbmax[2],v[2]+hull); /* evaluate limits */ - VECCOPY(v,pccd_M->mprevvert[i].co); + copy_v3_v3(v,pccd_M->mprevvert[i].co); pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull); pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull); pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull); @@ -449,7 +449,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) mima->minx=mima->miny=mima->minz=1e30f; mima->maxx=mima->maxy=mima->maxz=-1e30f; - VECCOPY(v,pccd_M->mvert[mface->v1].co); + copy_v3_v3(v,pccd_M->mvert[mface->v1].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -457,7 +457,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) mima->maxy = MAX2(mima->maxy,v[1]+hull); mima->maxz = MAX2(mima->maxz,v[2]+hull); - VECCOPY(v,pccd_M->mvert[mface->v2].co); + copy_v3_v3(v,pccd_M->mvert[mface->v2].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -465,7 +465,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) mima->maxy = MAX2(mima->maxy,v[1]+hull); mima->maxz = MAX2(mima->maxz,v[2]+hull); - VECCOPY(v,pccd_M->mvert[mface->v3].co); + copy_v3_v3(v,pccd_M->mvert[mface->v3].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -474,7 +474,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) mima->maxz = MAX2(mima->maxz,v[2]+hull); if(mface->v4){ - VECCOPY(v,pccd_M->mvert[mface->v4].co); + copy_v3_v3(v,pccd_M->mvert[mface->v4].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -484,7 +484,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) } - VECCOPY(v,pccd_M->mprevvert[mface->v1].co); + copy_v3_v3(v,pccd_M->mprevvert[mface->v1].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -492,7 +492,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) mima->maxy = MAX2(mima->maxy,v[1]+hull); mima->maxz = MAX2(mima->maxz,v[2]+hull); - VECCOPY(v,pccd_M->mprevvert[mface->v2].co); + copy_v3_v3(v,pccd_M->mprevvert[mface->v2].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -500,7 +500,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) mima->maxy = MAX2(mima->maxy,v[1]+hull); mima->maxz = MAX2(mima->maxz,v[2]+hull); - VECCOPY(v,pccd_M->mprevvert[mface->v3].co); + copy_v3_v3(v,pccd_M->mprevvert[mface->v3].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -509,7 +509,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) mima->maxz = MAX2(mima->maxz,v[2]+hull); if(mface->v4){ - VECCOPY(v,pccd_M->mprevvert[mface->v4].co); + copy_v3_v3(v,pccd_M->mprevvert[mface->v4].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -1024,8 +1024,8 @@ static int sb_detect_aabb_collisionCached( float UNUSED(force[3]), unsigned int #endif if ((sb == NULL) || (sb->scratch ==NULL)) return 0; - VECCOPY(aabbmin,sb->scratch->aabbmin); - VECCOPY(aabbmax,sb->scratch->aabbmax); + copy_v3_v3(aabbmin,sb->scratch->aabbmin); + copy_v3_v3(aabbmax,sb->scratch->aabbmax); hash = vertexowner->soft->scratch->colliderhash; ihash = BLI_ghashIterator_new(hash); @@ -1099,8 +1099,8 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa aabbmax[2] = MAX3(face_v1[2],face_v2[2],face_v3[2]); /* calculate face normal once again SIGH */ - VECSUB(edge1, face_v1, face_v2); - VECSUB(edge2, face_v3, face_v2); + sub_v3_v3v3(edge1, face_v1, face_v2); + sub_v3_v3v3(edge2, face_v3, face_v2); cross_v3_v3v3(d_nvect, edge2, edge1); normalize_v3(d_nvect); @@ -1143,13 +1143,13 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa /* use mesh*/ if (mvert) { while(a){ - VECCOPY(nv1,mvert[a-1].co); + copy_v3_v3(nv1,mvert[a-1].co); if(mprevvert){ mul_v3_fl(nv1,time); Vec3PlusStVec(nv1,(1.0f-time),mprevvert[a-1].co); } /* origin to face_v2*/ - VECSUB(nv1, nv1, face_v2); + sub_v3_v3(nv1, face_v2); facedist = dot_v3v3(nv1,d_nvect); if (ABS(facedist)<outerfacethickness){ if (isect_point_tri_prism_v3(nv1, face_v1,face_v2,face_v3) ){ @@ -1253,11 +1253,11 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa if (mvert){ - VECCOPY(nv1,mvert[mface->v1].co); - VECCOPY(nv2,mvert[mface->v2].co); - VECCOPY(nv3,mvert[mface->v3].co); + copy_v3_v3(nv1,mvert[mface->v1].co); + copy_v3_v3(nv2,mvert[mface->v2].co); + copy_v3_v3(nv3,mvert[mface->v3].co); if (mface->v4){ - VECCOPY(nv4,mvert[mface->v4].co); + copy_v3_v3(nv4,mvert[mface->v4].co); } if (mprevvert){ mul_v3_fl(nv1,time); @@ -1277,8 +1277,8 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa } /* switch origin to be nv2*/ - VECSUB(edge1, nv1, nv2); - VECSUB(edge2, nv3, nv2); + sub_v3_v3v3(edge1, nv1, nv2); + sub_v3_v3v3(edge2, nv3, nv2); cross_v3_v3v3(d_nvect, edge2, edge1); normalize_v3(d_nvect); if ( @@ -1291,8 +1291,8 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa } if (mface->v4){ /* quad */ /* switch origin to be nv4 */ - VECSUB(edge1, nv3, nv4); - VECSUB(edge2, nv1, nv4); + sub_v3_v3v3(edge1, nv3, nv4); + sub_v3_v3v3(edge2, nv1, nv4); cross_v3_v3v3(d_nvect, edge2, edge1); normalize_v3(d_nvect); if ( @@ -1481,11 +1481,11 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa if (mvert){ - VECCOPY(nv1,mvert[mface->v1].co); - VECCOPY(nv2,mvert[mface->v2].co); - VECCOPY(nv3,mvert[mface->v3].co); + copy_v3_v3(nv1,mvert[mface->v1].co); + copy_v3_v3(nv2,mvert[mface->v2].co); + copy_v3_v3(nv3,mvert[mface->v3].co); if (mface->v4){ - VECCOPY(nv4,mvert[mface->v4].co); + copy_v3_v3(nv4,mvert[mface->v4].co); } if (mprevvert){ mul_v3_fl(nv1,time); @@ -1505,16 +1505,16 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa } /* switch origin to be nv2*/ - VECSUB(edge1, nv1, nv2); - VECSUB(edge2, nv3, nv2); + sub_v3_v3v3(edge1, nv1, nv2); + sub_v3_v3v3(edge2, nv3, nv2); cross_v3_v3v3(d_nvect, edge2, edge1); normalize_v3(d_nvect); if ( isect_line_tri_v3(edge_v1, edge_v2, nv1, nv2, nv3, &t, NULL)){ float v1[3],v2[3]; float intrusiondepth,i1,i2; - VECSUB(v1, edge_v1, nv2); - VECSUB(v2, edge_v2, nv2); + sub_v3_v3v3(v1, edge_v1, nv2); + sub_v3_v3v3(v2, edge_v2, nv2); i1 = dot_v3v3(v1,d_nvect); i2 = dot_v3v3(v2,d_nvect); intrusiondepth = -MIN2(i1,i2)/el; @@ -1524,16 +1524,16 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa } if (mface->v4){ /* quad */ /* switch origin to be nv4 */ - VECSUB(edge1, nv3, nv4); - VECSUB(edge2, nv1, nv4); + sub_v3_v3v3(edge1, nv3, nv4); + sub_v3_v3v3(edge2, nv1, nv4); cross_v3_v3v3(d_nvect, edge2, edge1); normalize_v3(d_nvect); if (isect_line_tri_v3( edge_v1, edge_v2,nv1, nv3, nv4, &t, NULL)){ float v1[3],v2[3]; float intrusiondepth,i1,i2; - VECSUB(v1, edge_v1, nv4); - VECSUB(v2, edge_v2, nv4); + sub_v3_v3v3(v1, edge_v1, nv4); + sub_v3_v3v3(v2, edge_v2, nv4); i1 = dot_v3v3(v1,d_nvect); i2 = dot_v3v3(v2,d_nvect); intrusiondepth = -MIN2(i1,i2)/el; @@ -1602,16 +1602,16 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow, } /* media in rest */ else{ - VECADD(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec); + add_v3_v3v3(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec); } f = normalize_v3(vel); f = -0.0001f*f*f*sb->aeroedge; /* (todo) add a nice angle dependant function done for now BUT */ /* still there could be some nice drag/lift function, but who needs it */ - VECSUB(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos); + sub_v3_v3v3(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos); project_v3_v3v3(pr,vel,sp); - VECSUB(vel,vel,pr); + sub_v3_v3(vel, pr); normalize_v3(vel); if (ob->softflag & OB_SB_AERO_ANGLE){ normalize_v3(sp); @@ -1725,9 +1725,9 @@ static int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,fl winner =3; } switch (winner){ - case 1: VECCOPY(w,ca); break; - case 2: VECCOPY(w,cb); break; - case 3: VECCOPY(w,cc); + case 1: copy_v3_v3(w,ca); break; + case 2: copy_v3_v3(w,cb); break; + case 3: copy_v3_v3(w,cc); } return(winner); } @@ -1824,11 +1824,11 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], if (mvert){ - VECCOPY(nv1,mvert[mface->v1].co); - VECCOPY(nv2,mvert[mface->v2].co); - VECCOPY(nv3,mvert[mface->v3].co); + copy_v3_v3(nv1,mvert[mface->v1].co); + copy_v3_v3(nv2,mvert[mface->v2].co); + copy_v3_v3(nv3,mvert[mface->v3].co); if (mface->v4){ - VECCOPY(nv4,mvert[mface->v4].co); + copy_v3_v3(nv4,mvert[mface->v4].co); } if (mprevvert){ @@ -1838,11 +1838,11 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], since the AABB reduced propabitlty to get here drasticallly it might be a nice tradeof CPU <--> memory */ - VECSUB(vv1,nv1,mprevvert[mface->v1].co); - VECSUB(vv2,nv2,mprevvert[mface->v2].co); - VECSUB(vv3,nv3,mprevvert[mface->v3].co); + sub_v3_v3v3(vv1,nv1,mprevvert[mface->v1].co); + sub_v3_v3v3(vv2,nv2,mprevvert[mface->v2].co); + sub_v3_v3v3(vv3,nv3,mprevvert[mface->v3].co); if (mface->v4){ - VECSUB(vv4,nv4,mprevvert[mface->v4].co); + sub_v3_v3v3(vv4,nv4,mprevvert[mface->v4].co); } mul_v3_fl(nv1,time); @@ -1862,9 +1862,9 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], } /* switch origin to be nv2*/ - VECSUB(edge1, nv1, nv2); - VECSUB(edge2, nv3, nv2); - VECSUB(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */ + sub_v3_v3v3(edge1, nv1, nv2); + sub_v3_v3v3(edge2, nv3, nv2); + sub_v3_v3v3(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */ cross_v3_v3v3(d_nvect, edge2, edge1); /* n_mag = */ /* UNUSED */ normalize_v3(d_nvect); @@ -1890,7 +1890,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], } if ((mprevvert) && (*damp > 0.0f)){ choose_winner(ve,opco,nv1,nv2,nv3,vv1,vv2,vv3); - VECADD(avel,avel,ve); + add_v3_v3(avel, ve); cavel ++; } *intrusion += facedist; @@ -1899,9 +1899,9 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], } if (mface->v4){ /* quad */ /* switch origin to be nv4 */ - VECSUB(edge1, nv3, nv4); - VECSUB(edge2, nv1, nv4); - VECSUB(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */ + sub_v3_v3v3(edge1, nv3, nv4); + sub_v3_v3v3(edge2, nv1, nv4); + sub_v3_v3v3(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */ cross_v3_v3v3(d_nvect, edge2, edge1); /* n_mag = */ /* UNUSED */ normalize_v3(d_nvect); @@ -1926,7 +1926,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], if ((mprevvert) && (*damp > 0.0f)){ choose_winner(ve,opco,nv1,nv3,nv4,vv1,vv3,vv4); - VECADD(avel,avel,ve); + add_v3_v3(avel, ve); cavel ++; } *intrusion += facedist; @@ -1939,46 +1939,46 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], float dist; closest_to_line_segment_v3(ve, opco, nv1, nv2); - VECSUB(ve,opco,ve); + sub_v3_v3v3(ve,opco,ve); dist = normalize_v3(ve); if ((dist < outerfacethickness)&&(dist < mindistedge )){ - VECCOPY(coledge,ve); + copy_v3_v3(coledge,ve); mindistedge = dist, deflected=1; } closest_to_line_segment_v3(ve, opco, nv2, nv3); - VECSUB(ve,opco,ve); + sub_v3_v3v3(ve,opco,ve); dist = normalize_v3(ve); if ((dist < outerfacethickness)&&(dist < mindistedge )){ - VECCOPY(coledge,ve); + copy_v3_v3(coledge,ve); mindistedge = dist, deflected=1; } closest_to_line_segment_v3(ve, opco, nv3, nv1); - VECSUB(ve,opco,ve); + sub_v3_v3v3(ve,opco,ve); dist = normalize_v3(ve); if ((dist < outerfacethickness)&&(dist < mindistedge )){ - VECCOPY(coledge,ve); + copy_v3_v3(coledge,ve); mindistedge = dist, deflected=1; } if (mface->v4){ /* quad */ closest_to_line_segment_v3(ve, opco, nv3, nv4); - VECSUB(ve,opco,ve); + sub_v3_v3v3(ve,opco,ve); dist = normalize_v3(ve); if ((dist < outerfacethickness)&&(dist < mindistedge )){ - VECCOPY(coledge,ve); + copy_v3_v3(coledge,ve); mindistedge = dist, deflected=1; } closest_to_line_segment_v3(ve, opco, nv1, nv4); - VECSUB(ve,opco,ve); + sub_v3_v3v3(ve,opco,ve); dist = normalize_v3(ve); if ((dist < outerfacethickness)&&(dist < mindistedge )){ - VECCOPY(coledge,ve); + copy_v3_v3(coledge,ve); mindistedge = dist, deflected=1; } @@ -2007,15 +2007,15 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], } if (deflected == 2){ // face inner detected - VECADD(force,force,innerforceaccu); + add_v3_v3(force, innerforceaccu); } if (deflected == 3){ // face outer detected - VECADD(force,force,outerforceaccu); + add_v3_v3(force, outerforceaccu); } BLI_ghashIterator_free(ihash); if (cavel) mul_v3_fl(avel,1.0f/(float)cavel); - VECCOPY(vel,avel); + copy_v3_v3(vel,avel); if (ci) *intrusion /= ci; if (deflected){ normalize_v3_v3(facenormal, force); @@ -2029,7 +2029,7 @@ static int sb_deflect_face(Object *ob,float *actpos,float *facenormal,float *for { float s_actpos[3]; int deflected; - VECCOPY(s_actpos,actpos); + copy_v3_v3(s_actpos,actpos); deflected= sb_detect_vertex_collisionCached(s_actpos, facenormal, cf, force , ob->lay, ob,time,vel,intrusion); //deflected= sb_detect_vertex_collisionCachedEx(s_actpos, facenormal, cf, force , ob->lay, ob,time,vel,intrusion); return(deflected); @@ -2286,7 +2286,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo /* gravitation */ if (sb && scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){ float gravity[3]; - VECCOPY(gravity, scene->physics_settings.gravity); + copy_v3_v3(gravity, scene->physics_settings.gravity); mul_v3_fl(gravity, sb_grav_force_scale(ob)*_final_mass(ob,bp)*sb->effector_weights->global_gravity); /* individual mass of node here */ add_v3_v3(bp->force, gravity); } @@ -2303,7 +2303,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo /* apply forcefield*/ mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale); - VECADD(bp->force, bp->force, force); + add_v3_v3(bp->force, force); /* BP friction in moving media */ kd= sb->mediafrict* eval_sb_fric_force_scale; @@ -2337,7 +2337,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo bp->choke = sb->choke*0.01f; } - VECSUB(cfforce,bp->vec,vel); + sub_v3_v3v3(cfforce,bp->vec,vel); Vec3PlusStVec(bp->force,-cf*50.0f,cfforce); Vec3PlusStVec(bp->force,kd,defforce); @@ -2524,7 +2524,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){ - VECCOPY(gravity, scene->physics_settings.gravity); + copy_v3_v3(gravity, scene->physics_settings.gravity); mul_v3_fl(gravity, sb_grav_force_scale(ob)*sb->effector_weights->global_gravity); } @@ -2697,7 +2697,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa /* gravitation */ - VECADDFAC(bp->force, bp->force, gravity, _final_mass(ob,bp)); /* individual mass of node here */ + madd_v3_v3fl(bp->force, gravity, _final_mass(ob,bp)); /* individual mass of node here */ /* particle field & vortex */ @@ -2711,7 +2711,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa /* apply forcefield*/ mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale); - VECADD(bp->force, bp->force, force); + add_v3_v3(bp->force, force); /* BP friction in moving media */ kd= sb->mediafrict* eval_sb_fric_force_scale; @@ -2764,7 +2764,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa } else{ - VECSUB(cfforce,bp->vec,vel); + sub_v3_v3v3(cfforce,bp->vec,vel); Vec3PlusStVec(bp->force,-cf*50.0f,cfforce); } @@ -2774,7 +2774,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa bp->choke = sb->choke*0.01f; } else{ - VECSUB(cfforce,bp->vec,vel); + sub_v3_v3v3(cfforce,bp->vec,vel); Vec3PlusStVec(bp->force,-cf*50.0f,cfforce); } Vec3PlusStVec(bp->force,kd,defforce); @@ -2876,7 +2876,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa else{ printf("Matrix inversion failed \n"); for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - VECCOPY(bp->impdv,bp->force); + copy_v3_v3(bp->impdv,bp->force); } } @@ -2923,7 +2923,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * if(_final_goal(ob,bp) < SOFTGOALSNAP){ /* this makes t~ = t */ - if(mid_flags & MID_PRESERVE) VECCOPY(dx,bp->vec); + if(mid_flags & MID_PRESERVE) copy_v3_v3(dx,bp->vec); /* so here is (v)' = a(cceleration) = sum(F_springs)/m + gravitation + some friction forces + more forces*/ /* the ( ... )' operator denotes derivate respective time */ @@ -2931,11 +2931,11 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * /* v(t + dt) = v(t) + a(t) * dt */ mul_v3_fl(bp->force,timeovermass);/* individual mass of node here */ /* some nasty if's to have heun in here too */ - VECCOPY(dv,bp->force); + copy_v3_v3(dv,bp->force); if (mode == 1){ - VECCOPY(bp->prevvec, bp->vec); - VECCOPY(bp->prevdv, dv); + copy_v3_v3(bp->prevvec, bp->vec); + copy_v3_v3(bp->prevdv, dv); } if (mode ==2){ @@ -2948,10 +2948,10 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * maxerrvel = MAX2(maxerrvel,ABS(dv[1] - bp->prevdv[1])); maxerrvel = MAX2(maxerrvel,ABS(dv[2] - bp->prevdv[2])); } - else {VECADD(bp->vec, bp->vec, bp->force);} + else { add_v3_v3(bp->vec, bp->force); } /* this makes t~ = t+dt */ - if(!(mid_flags & MID_PRESERVE)) VECCOPY(dx,bp->vec); + if(!(mid_flags & MID_PRESERVE)) copy_v3_v3(dx,bp->vec); /* so here is (x)'= v(elocity) */ /* the euler step for location then becomes */ @@ -2970,8 +2970,8 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * */ /* again some nasty if's to have heun in here too */ if (mode ==1){ - VECCOPY(bp->prevpos,bp->pos); - VECCOPY(bp->prevdx ,dx); + copy_v3_v3(bp->prevpos,bp->pos); + copy_v3_v3(bp->prevdx ,dx); } if (mode ==2){ @@ -2994,7 +2994,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * } } - else { VECADD(bp->pos, bp->pos, dx);} + else { add_v3_v3(bp->pos, dx);} }/*snap*/ /* so while we are looping BPs anyway do statistics on the fly */ aabbmin[0] = MIN2(aabbmin[0],bp->pos[0]); @@ -3008,8 +3008,8 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * if (sb->totpoint) mul_v3_fl(cm,1.0f/sb->totpoint); if (sb->scratch){ - VECCOPY(sb->scratch->aabbmin,aabbmin); - VECCOPY(sb->scratch->aabbmax,aabbmax); + copy_v3_v3(sb->scratch->aabbmin,aabbmin); + copy_v3_v3(sb->scratch->aabbmax,aabbmax); } if (err){ /* so step size will be controlled by biggest difference in slope */ @@ -3032,8 +3032,8 @@ static void softbody_restore_prev_step(Object *ob) int a; for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - VECCOPY(bp->vec, bp->prevvec); - VECCOPY(bp->pos, bp->prevpos); + copy_v3_v3(bp->vec, bp->prevvec); + copy_v3_v3(bp->pos, bp->prevpos); } } @@ -3045,8 +3045,8 @@ static void softbody_store_step(Object *ob) int a; for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - VECCOPY(bp->prevvec,bp->vec); - VECCOPY(bp->prevpos,bp->pos); + copy_v3_v3(bp->prevvec,bp->vec); + copy_v3_v3(bp->prevpos,bp->pos); } } @@ -3061,10 +3061,10 @@ static void softbody_store_state(Object *ob,float *ppos,float *pvel) for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - VECCOPY(pv, bp->vec); + copy_v3_v3(pv, bp->vec); pv+=3; - VECCOPY(pp, bp->pos); + copy_v3_v3(pp, bp->pos); pp+=3; } } @@ -3079,10 +3079,10 @@ static void softbody_retrieve_state(Object *ob,float *ppos,float *pvel) for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - VECCOPY(bp->vec,pv); + copy_v3_v3(bp->vec,pv); pv+=3; - VECCOPY(bp->pos,pp); + copy_v3_v3(bp->pos,pp); pp+=3; } } @@ -3098,14 +3098,14 @@ static void softbody_swap_state(Object *ob,float *ppos,float *pvel) for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - VECCOPY(temp, bp->vec); - VECCOPY(bp->vec,pv); - VECCOPY(pv,temp); + copy_v3_v3(temp, bp->vec); + copy_v3_v3(bp->vec,pv); + copy_v3_v3(pv,temp); pv+=3; - VECCOPY(temp, bp->pos); - VECCOPY(bp->pos,pp); - VECCOPY(pp,temp); + copy_v3_v3(temp, bp->pos); + copy_v3_v3(bp->pos,pp); + copy_v3_v3(pp,temp); pp+=3; } } @@ -3126,8 +3126,8 @@ static void softbody_apply_goalsnap(Object *ob) for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { if (_final_goal(ob,bp) >= SOFTGOALSNAP){ - VECCOPY(bp->prevpos,bp->pos); - VECCOPY(bp->pos,bp->origT); + copy_v3_v3(bp->prevpos,bp->pos); + copy_v3_v3(bp->pos,bp->origT); } } } @@ -3238,7 +3238,7 @@ static void springs_from_mesh(Object *ob) if(me->totvert) { bp= ob->soft->bpoint; for(a=0; a<me->totvert; a++, bp++) { - VECCOPY(bp->origS, me->mvert[a].co); + copy_v3_v3(bp->origS, me->mvert[a].co); mul_m4_v3(ob->obmat, bp->origS); } @@ -3399,12 +3399,12 @@ static void reference_to_scratch(Object *ob) bp= ob->soft->bpoint; rp= sb->scratch->Ref.ivert; for(a=0; a<sb->totpoint; a++, rp++, bp++) { - VECCOPY(rp->pos,bp->pos); - VECADD(accu_pos,accu_pos,bp->pos); + copy_v3_v3(rp->pos,bp->pos); + add_v3_v3(accu_pos, bp->pos); accu_mass += _final_mass(ob,bp); } mul_v3_fl(accu_pos,1.0f/accu_mass); - VECCOPY(sb->scratch->Ref.com,accu_pos); + copy_v3_v3(sb->scratch->Ref.com,accu_pos); /* printf("reference_to_scratch \n"); */ } @@ -3415,9 +3415,9 @@ when object is rescaled static float globallen(float *v1,float *v2,Object *ob) { float p1[3],p2[3]; - VECCOPY(p1,v1); + copy_v3_v3(p1,v1); mul_m4_v3(ob->obmat, p1); - VECCOPY(p2,v2); + copy_v3_v3(p2,v2); mul_m4_v3(ob->obmat, p2); return len_v3v3(p1,p2); } @@ -3656,7 +3656,7 @@ static void softbody_to_object(Object *ob, float (*vertexCos)[3], int numVerts, invert_m4_m4(ob->imat, ob->obmat); for(a=0; a<numVerts; a++, bp++) { - VECCOPY(vertexCos[a], bp->pos); + copy_v3_v3(vertexCos[a], bp->pos); if(local==0) mul_m4_v3(ob->imat, vertexCos[a]); /* softbody is in global coords, baked optionally not */ } @@ -3784,14 +3784,14 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo for(a=0,bp=sb->bpoint; a<numVerts; a++, bp++) { /* store where goals are now */ - VECCOPY(bp->origS, bp->origE); + copy_v3_v3(bp->origS, bp->origE); /* copy the position of the goals at desired end time */ - VECCOPY(bp->origE, vertexCos[a]); + copy_v3_v3(bp->origE, vertexCos[a]); /* vertexCos came from local world, go global */ mul_m4_v3(ob->obmat, bp->origE); /* just to be save give bp->origT a defined value will be calulated in interpolate_exciter()*/ - VECCOPY(bp->origT, bp->origE); + copy_v3_v3(bp->origT, bp->origE); } } @@ -3828,14 +3828,14 @@ void SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscal rpos= MEM_callocN( (sb->totpoint)*3*sizeof(float), "SB_RPOS"); /* might filter vertex selection with a vertex group */ for(a=0, bp=sb->bpoint, rp=sb->scratch->Ref.ivert; a<sb->totpoint; a++, bp++, rp++) { - VECCOPY(rpos[a],rp->pos); - VECCOPY(opos[a],bp->pos); + copy_v3_v3(rpos[a],rp->pos); + copy_v3_v3(opos[a],bp->pos); } vcloud_estimate_transform(sb->totpoint, opos, NULL, rpos, NULL, com, rcom,lrot,lscale); - //VECSUB(com,com,rcom); - if (lloc) VECCOPY(lloc,com); - VECCOPY(sb->lcom,com); + //sub_v3_v3(com,rcom); + if (lloc) copy_v3_v3(lloc,com); + copy_v3_v3(sb->lcom,com); if (lscale) copy_m3_m3(sb->lscale,lscale); if (lrot) copy_m3_m3(sb->lrot,lrot); @@ -3850,11 +3850,11 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int int a; for(a=0,bp=sb->bpoint; a<numVerts; a++, bp++) { - VECCOPY(bp->pos, vertexCos[a]); + copy_v3_v3(bp->pos, vertexCos[a]); mul_m4_v3(ob->obmat, bp->pos); /* yep, sofbody is global coords*/ - VECCOPY(bp->origS, bp->pos); - VECCOPY(bp->origE, bp->pos); - VECCOPY(bp->origT, bp->pos); + copy_v3_v3(bp->origS, bp->pos); + copy_v3_v3(bp->origE, bp->pos); + copy_v3_v3(bp->origT, bp->pos); bp->vec[0]= bp->vec[1]= bp->vec[2]= 0.0f; /* the bp->prev*'s are for rolling back from a canceled try to propagate in time @@ -3869,10 +3869,10 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int 4.b yup we're done */ - VECCOPY(bp->prevpos, bp->pos); - VECCOPY(bp->prevvec, bp->vec); - VECCOPY(bp->prevdx, bp->vec); - VECCOPY(bp->prevdv, bp->vec); + copy_v3_v3(bp->prevpos, bp->pos); + copy_v3_v3(bp->prevvec, bp->vec); + copy_v3_v3(bp->prevdx, bp->vec); + copy_v3_v3(bp->prevdv, bp->vec); } /* make a nice clean scratch struc */ diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c index 018c7a197ff..a14233e9179 100644 --- a/source/blender/blenkernel/intern/speaker.c +++ b/source/blender/blenkernel/intern/speaker.c @@ -69,7 +69,7 @@ Speaker *copy_speaker(Speaker *spk) { Speaker *spkn; - spkn= copy_libblock(spk); + spkn= copy_libblock(&spk->id); if(spkn->sound) spkn->sound->id.us++; diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index f02a8031bce..522154d959e 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -668,7 +668,7 @@ static void ccgDM_getFinalVertCo(DerivedMesh *dm, int vertNum, float co_r[3]) MVert mvert; ccgDM_getFinalVert(dm, vertNum, &mvert); - VECCOPY(co_r, mvert.co); + copy_v3_v3(co_r, mvert.co); } static void ccgDM_getFinalVertNo(DerivedMesh *dm, int vertNum, float no_r[3]) diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 69af2570d0c..e8be0bb2608 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -431,7 +431,7 @@ Text *copy_text(Text *ta) Text *tan; TextLine *line, *tmp; - tan= copy_libblock(ta); + tan= copy_libblock(&ta->id); /* file name can be NULL */ if(ta->name) { @@ -1234,7 +1234,7 @@ char *txt_to_buf (Text *text) return buf; } -int txt_find_string(Text *text, char *findstr, int wrap, int match_case) +int txt_find_string(Text *text, const char *findstr, int wrap, int match_case) { TextLine *tl, *startl; char *s= NULL; diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index d3bd7d7b766..377eeef117e 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -227,7 +227,7 @@ void init_mapping(TexMapping *texmap) mul_m3_m3m3(mat, rmat, smat); copy_m4_m3(texmap->mat, mat); - VECCOPY(texmap->mat[3], texmap->loc); + copy_v3_v3(texmap->mat[3], texmap->loc); } @@ -751,7 +751,7 @@ Tex *copy_texture(Tex *tex) { Tex *texn; - texn= copy_libblock(tex); + texn= copy_libblock(&tex->id); if(texn->type==TEX_IMAGE) id_us_plus((ID *)texn->ima); else texn->ima= NULL; @@ -781,7 +781,7 @@ Tex *localize_texture(Tex *tex) { Tex *texn; - texn= copy_libblock(tex); + texn= copy_libblock(&tex->id); BLI_remlink(&G.main->tex, texn); /* image texture: free_texture also doesn't decrease */ diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c new file mode 100644 index 00000000000..a834628641a --- /dev/null +++ b/source/blender/blenkernel/intern/tracking.c @@ -0,0 +1,2206 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/blenkernel/intern/tracking.c + * \ingroup bke + */ + +#include <stddef.h> +#include <limits.h> +#include <math.h> +#include <memory.h> + +#include "MEM_guardedalloc.h" + +#include "DNA_gpencil_types.h" +#include "DNA_camera_types.h" +#include "DNA_movieclip_types.h" +#include "DNA_object_types.h" /* SELECT */ +#include "DNA_scene_types.h" + +#include "BLI_utildefines.h" +#include "BLI_math.h" +#include "BLI_math_base.h" +#include "BLI_listbase.h" +#include "BLI_ghash.h" +#include "BLI_path_util.h" + +#include "BKE_global.h" +#include "BKE_tracking.h" +#include "BKE_movieclip.h" +#include "BKE_object.h" +#include "BKE_scene.h" + +#include "IMB_imbuf_types.h" +#include "IMB_imbuf.h" + +#ifdef WITH_LIBMV +# include "libmv-capi.h" +#else +struct libmv_Features; +#endif + +typedef struct MovieDistortion { + struct libmv_CameraIntrinsics *intrinsics; +} MovieDistortion; + +/*********************** common functions *************************/ + +void BKE_tracking_clamp_track(MovieTrackingTrack *track, int event) +{ + int a; + float pat_min[2]; + float pat_max[2]; + float max_pyramid_level_factor = 1.0; + if (track->tracker == TRACKER_KLT) { + max_pyramid_level_factor = 1 << (track->pyramid_levels - 1); + } + + /* sort */ + for(a= 0; a<2; a++) { + if(track->pat_min[a]>track->pat_max[a]) + SWAP(float, track->pat_min[a], track->pat_max[a]); + + if(track->search_min[a]>track->search_max[a]) + SWAP(float, track->search_min[a], track->search_max[a]); + } + + /* compute the effective pattern size, which differs from the fine resolution + * pattern size for the pyramid KLT tracker */ + for(a= 0; a<2; a++) { + pat_min[a] = max_pyramid_level_factor * track->pat_min[a]; + pat_max[a] = max_pyramid_level_factor * track->pat_max[a]; + } + + if(event==CLAMP_PAT_DIM) { + for(a= 0; a<2; a++) { + /* search shouldn't be resized smaller than pattern */ + track->search_min[a]= MIN2(pat_min[a], track->search_min[a]); + track->search_max[a]= MAX2(pat_max[a], track->search_max[a]); + } + } + else if(event==CLAMP_PAT_POS) { + float dim[2]; + sub_v2_v2v2(dim, track->pat_max, pat_min); + + for(a= 0; a<2; a++) { + /* pattern shouldn't be moved outside of search */ + if(pat_min[a] < track->search_min[a]) { + track->pat_min[a]= track->search_min[a] - (pat_min[a] - track->pat_min[a]); + track->pat_max[a]= (pat_min[a] - track->pat_min[a])+dim[a]; + } + if(track->pat_max[a] > track->search_max[a]) { + track->pat_max[a]= track->search_max[a] - (pat_max[a] - track->pat_max[a]); + track->pat_min[a]= track->pat_max[a]-dim[a] - (pat_min[a] - track->pat_min[a]); + } + } + } + else if(event==CLAMP_SEARCH_DIM) { + float max_pyramid_level_factor = 1.0; + if (track->tracker == TRACKER_KLT) { + max_pyramid_level_factor = 1 << (track->pyramid_levels - 1); + } + for(a= 0; a<2; a++) { + /* search shouldn't be resized smaller than pattern */ + track->search_min[a]= MIN2(pat_min[a], track->search_min[a]); + track->search_max[a]= MAX2(pat_max[a], track->search_max[a]); + } + } + else if(event==CLAMP_SEARCH_POS) { + float dim[2]; + sub_v2_v2v2(dim, track->search_max, track->search_min); + + for(a= 0; a<2; a++) { + /* search shouldn't be moved inside pattern */ + if(track->search_min[a] > pat_min[a]) { + track->search_min[a]= pat_min[a]; + track->search_max[a]= track->search_min[a]+dim[a]; + } + if(track->search_max[a] < pat_max[a]) { + track->search_max[a]= pat_max[a]; + track->search_min[a]= track->search_max[a]-dim[a]; + } + } + } + + else if(event==CLAMP_PYRAMID_LEVELS || (event==CLAMP_SEARCH_DIM && track->tracker == TRACKER_KLT)) { + float dim[2]; + sub_v2_v2v2(dim, track->pat_max, track->pat_min); + { + float search_ratio = 2.3f * max_pyramid_level_factor; + + /* resize the search area to something sensible based + * on the number of pyramid levels */ + for(a= 0; a<2; a++) { + track->search_min[a]= search_ratio * track->pat_min[a]; + track->search_max[a]= search_ratio * track->pat_max[a]; + } + } + } + + /* marker's center should be in center of pattern */ + if(event==CLAMP_PAT_DIM || event==CLAMP_PAT_POS) { + float dim[2]; + sub_v2_v2v2(dim, track->pat_max, track->pat_min); + + for(a= 0; a<2; a++) { + track->pat_min[a]= -dim[a]/2.0f; + track->pat_max[a]= dim[a]/2.0f; + } + } +} + +void BKE_tracking_track_flag(MovieTrackingTrack *track, int area, int flag, int clear) +{ + if(area==TRACK_AREA_NONE) + return; + + if(clear) { + if(area&TRACK_AREA_POINT) track->flag&= ~flag; + if(area&TRACK_AREA_PAT) track->pat_flag&= ~flag; + if(area&TRACK_AREA_SEARCH) track->search_flag&= ~flag; + } else { + if(area&TRACK_AREA_POINT) track->flag|= flag; + if(area&TRACK_AREA_PAT) track->pat_flag|= flag; + if(area&TRACK_AREA_SEARCH) track->search_flag|= flag; + } +} + +MovieTrackingTrack *BKE_tracking_add_track(MovieTracking *tracking, float x, float y, + int framenr, int width, int height) +{ + MovieTrackingTrack *track; + MovieTrackingMarker marker; + + /* pick reasonable defaults */ + float pat[2]= {5.5f, 5.5f}, search[2]= {25.5f, 25.5f}; /* TODO: move to default setting? */ + + pat[0] /= (float)width; + pat[1] /= (float)height; + + search[0] /= (float)width; + search[1] /= (float)height; + + track= MEM_callocN(sizeof(MovieTrackingTrack), "add_marker_exec track"); + strcpy(track->name, "Track"); + + /* default to KLT tracker */ + track->tracker = TRACKER_KLT; + track->pyramid_levels = 2; + + /* set SAD defaults even though it's not selected by default */ + track->minimum_correlation= 0.75f; + + memset(&marker, 0, sizeof(marker)); + marker.pos[0]= x; + marker.pos[1]= y; + marker.framenr= framenr; + + copy_v2_v2(track->pat_max, pat); + negate_v2_v2(track->pat_min, pat); + + copy_v2_v2(track->search_max, search); + negate_v2_v2(track->search_min, search); + + BKE_tracking_insert_marker(track, &marker); + + BLI_addtail(&tracking->tracks, track); + BKE_track_unique_name(tracking, track); + + return track; +} + +void BKE_tracking_insert_marker(MovieTrackingTrack *track, MovieTrackingMarker *marker) +{ + MovieTrackingMarker *old_marker= BKE_tracking_get_marker(track, marker->framenr); + + if(old_marker && old_marker->framenr==marker->framenr) { + *old_marker= *marker; + } else { + int a= track->markersnr; + + while(a--) { + if(track->markers[a].framenr<marker->framenr) + break; + } + + track->markersnr++; + + if(track->markers) track->markers= MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr); + else track->markers= MEM_callocN(sizeof(MovieTrackingMarker), "MovieTracking markers"); + + memmove(track->markers+a+2, track->markers+a+1, (track->markersnr-a-2)*sizeof(MovieTrackingMarker)); + track->markers[a+1]= *marker; + + track->last_marker= a+1; + } +} + +void BKE_tracking_delete_marker(MovieTrackingTrack *track, int framenr) +{ + int a= 0; + + while(a<track->markersnr) { + if(track->markers[a].framenr==framenr) { + if(track->markersnr>1) { + memmove(track->markers+a, track->markers+a+1, (track->markersnr-a-1)*sizeof(MovieTrackingMarker)); + track->markersnr--; + track->markers= MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr); + } else { + MEM_freeN(track->markers); + track->markers= NULL; + track->markersnr= 0; + } + + break; + } + + a++; + } +} + +MovieTrackingMarker *BKE_tracking_get_marker(MovieTrackingTrack *track, int framenr) +{ + int a= track->markersnr-1; + + if(!track->markersnr) + return NULL; + + /* approximate pre-first framenr marker with first marker */ + if(framenr<track->markers[0].framenr) + return &track->markers[0]; + + if(track->last_marker<track->markersnr) + a= track->last_marker; + + if(track->markers[a].framenr<=framenr) { + while(a<track->markersnr && track->markers[a].framenr<=framenr) { + if(track->markers[a].framenr==framenr) { + track->last_marker= a; + return &track->markers[a]; + } + a++; + } + + /* if there's no marker for exact position, use nearest marker from left side */ + return &track->markers[a-1]; + } else { + while(a>=0 && track->markers[a].framenr>=framenr) { + if(track->markers[a].framenr==framenr) { + track->last_marker= a; + return &track->markers[a]; + } + + a--; + } + + /* if there's no marker for exact position, use nearest marker from left side */ + return &track->markers[a]; + } + + return NULL; +} + +MovieTrackingMarker *BKE_tracking_ensure_marker(MovieTrackingTrack *track, int framenr) +{ + MovieTrackingMarker *marker= BKE_tracking_get_marker(track, framenr); + + if(marker && marker->framenr!=framenr) { + MovieTrackingMarker marker_new; + + marker_new= *marker; + marker_new.framenr= framenr; + + BKE_tracking_insert_marker(track, &marker_new); + marker= BKE_tracking_get_marker(track, framenr); + } + + return marker; +} + +MovieTrackingMarker *BKE_tracking_exact_marker(MovieTrackingTrack *track, int framenr) +{ + MovieTrackingMarker *marker= BKE_tracking_get_marker(track, framenr); + + if(marker && marker->framenr!=framenr) + return NULL; + + return marker; +} + +int BKE_tracking_has_marker(MovieTrackingTrack *track, int framenr) +{ + return BKE_tracking_exact_marker(track, framenr) != 0; +} + +void BKE_tracking_free_track(MovieTrackingTrack *track) +{ + if(track->markers) MEM_freeN(track->markers); +} + +MovieTrackingTrack *BKE_tracking_copy_track(MovieTrackingTrack *track) +{ + MovieTrackingTrack *new_track= MEM_dupallocN(track); + + new_track->next= new_track->prev= NULL; + + if(new_track->markers) + new_track->markers= MEM_dupallocN(new_track->markers); + + return new_track; +} + +static void put_disabled_marker(MovieTrackingTrack *track, MovieTrackingMarker *ref_marker, int before, int overwrite) +{ + MovieTrackingMarker marker_new; + + marker_new= *ref_marker; + marker_new.flag&= ~MARKER_TRACKED; + marker_new.flag|= MARKER_DISABLED; + + if(before) marker_new.framenr--; + else marker_new.framenr++; + + if(!BKE_tracking_has_marker(track, marker_new.framenr) || overwrite) + BKE_tracking_insert_marker(track, &marker_new); +} + +void BKE_tracking_clear_path(MovieTrackingTrack *track, int ref_frame, int action) +{ + int a; + + if(action==TRACK_CLEAR_REMAINED) { + a= 1; + while(a<track->markersnr) { + if(track->markers[a].framenr>ref_frame) { + track->markersnr= a; + track->markers= MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr); + + break; + } + + a++; + } + + if(track->markersnr) + put_disabled_marker(track, &track->markers[track->markersnr-1], 0, 1); + } else if(action==TRACK_CLEAR_UPTO) { + a= track->markersnr-1; + while(a>=0) { + if(track->markers[a].framenr<=ref_frame) { + memmove(track->markers, track->markers+a, (track->markersnr-a)*sizeof(MovieTrackingMarker)); + + track->markersnr= track->markersnr-a; + track->markers= MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr); + + break; + } + + a--; + } + + if(track->markersnr) + put_disabled_marker(track, &track->markers[0], 1, 1); + } else if(action==TRACK_CLEAR_ALL) { + MovieTrackingMarker *marker, marker_new; + + marker= BKE_tracking_get_marker(track, ref_frame); + marker_new= *marker; + + MEM_freeN(track->markers); + track->markers= NULL; + track->markersnr= 0; + + BKE_tracking_insert_marker(track, &marker_new); + + put_disabled_marker(track, &marker_new, 1, 1); + put_disabled_marker(track, &marker_new, 0, 1); + } +} + +int BKE_tracking_test_join_tracks(MovieTrackingTrack *dst_track, MovieTrackingTrack *src_track) +{ + int i, a= 0, b= 0, tot= dst_track->markersnr+src_track->markersnr; + int count= 0; + + for(i= 0; i<tot; i++) { + if(a>=src_track->markersnr) { + b++; + count++; + } + else if(b>=dst_track->markersnr) { + a++; + count++; + } + else if(src_track->markers[a].framenr<dst_track->markers[b].framenr) { + a++; + count++; + } else if(src_track->markers[a].framenr>dst_track->markers[b].framenr) { + b++; + count++; + } else { + if((src_track->markers[a].flag&MARKER_DISABLED)==0 && (dst_track->markers[b].flag&MARKER_DISABLED)==0) + return 0; + + a++; + b++; + count++; + } + } + + return count; +} + +void BKE_tracking_join_tracks(MovieTrackingTrack *dst_track, MovieTrackingTrack *src_track) +{ + int i, a= 0, b= 0, tot; + MovieTrackingMarker *markers; + + tot= BKE_tracking_test_join_tracks(dst_track, src_track); + + markers= MEM_callocN(tot*sizeof(MovieTrackingMarker), "tracking joined tracks"); + + for(i= 0; i<tot; i++) { + if(b>=dst_track->markersnr) { + markers[i]= src_track->markers[a++]; + } + else if(a>=src_track->markersnr) { + markers[i]= dst_track->markers[b++]; + } + else if(src_track->markers[a].framenr<dst_track->markers[b].framenr) { + markers[i]= src_track->markers[a++]; + } else if(src_track->markers[a].framenr>dst_track->markers[b].framenr) { + markers[i]= dst_track->markers[b++]; + } else { + if((src_track->markers[a].flag&MARKER_DISABLED)) markers[i]= dst_track->markers[b]; + else markers[i]= src_track->markers[a++]; + + a++; + b++; + } + } + + MEM_freeN(dst_track->markers); + + dst_track->markers= markers; + dst_track->markersnr= tot; +} + +void BKE_tracking_free(MovieTracking *tracking) +{ + MovieTrackingTrack *track; + + for(track= tracking->tracks.first; track; track= track->next) { + BKE_tracking_free_track(track); + } + + BLI_freelistN(&tracking->tracks); + + if(tracking->reconstruction.cameras) + MEM_freeN(tracking->reconstruction.cameras); + + if(tracking->stabilization.scaleibuf) + IMB_freeImBuf(tracking->stabilization.scaleibuf); + + if(tracking->camera.intrinsics) + BKE_tracking_distortion_destroy(tracking->camera.intrinsics); +} + +/*********************** tracking *************************/ + +typedef struct TrackContext { + MovieTrackingTrack *track; + +#ifdef WITH_LIBMV + float keyframed_pos[2]; + + /* ** KLT tracker ** */ + struct libmv_RegionTracker *region_tracker; + float *patch; /* keyframed patch */ + + /* ** SAD tracker ** */ + int patsize; /* size of pattern (currently only 16x16 due to libmv side) */ + unsigned char *pattern; /* keyframed pattern */ + unsigned char *warped; /* warped version of reference */ +#endif +} TrackContext; + +typedef struct MovieTrackingContext { + MovieClipUser user; + MovieClip *clip; + + int first_time, frames; + + TrackContext *track_context; + int num_tracks; + + GHash *hash; + MovieTrackingSettings settings; + + short backwards, disable_failed; + int sync_frame; +} MovieTrackingContext; + +MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *user, short backwards, short disable_failed) +{ + MovieTrackingContext *context= MEM_callocN(sizeof(MovieTrackingContext), "trackingContext"); + MovieTracking *tracking= &clip->tracking; + MovieTrackingSettings *settings= &tracking->settings; + MovieTrackingTrack *track; + TrackContext *track_context; + + context->settings= *settings; + context->backwards= backwards; + context->disable_failed= disable_failed; + context->hash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "tracking trackHash"); + context->sync_frame= user->framenr; + context->first_time= 1; + + /* count */ + track= tracking->tracks.first; + while(track) { + if(TRACK_SELECTED(track) && (track->flag&TRACK_LOCKED)==0) { + MovieTrackingMarker *marker= BKE_tracking_get_marker(track, user->framenr); + + if((marker->flag&MARKER_DISABLED)==0) + context->num_tracks++; + } + + track= track->next; + } + + if(context->num_tracks) { + int width, height; + + BKE_movieclip_get_size(clip, user, &width, &height); + + /* create tracking data */ + context->track_context= MEM_callocN(sizeof(TrackContext)*context->num_tracks, "tracking track_context"); + + track_context= context->track_context; + track= tracking->tracks.first; + while(track) { + if(TRACK_SELECTED(track) && (track->flag&TRACK_LOCKED)==0) { + MovieTrackingMarker *marker= BKE_tracking_get_marker(track, user->framenr); + + if((marker->flag&MARKER_DISABLED)==0) { + MovieTrackingTrack *new_track= BKE_tracking_copy_track(track); + + track_context->track= new_track; +#ifdef WITH_LIBMV + { + if(track_context->track->tracker==TRACKER_KLT) { + float search_size_x= (track->search_max[0]-track->search_min[0])*width; + float search_size_y= (track->search_max[1]-track->search_min[1])*height; + float pattern_size_x= (track->pat_max[0]-track->pat_min[0])*width; + float pattern_size_y= (track->pat_max[1]-track->pat_min[1])*height; + + /* compute the maximum pyramid size */ + double search_to_pattern_ratio= MIN2(search_size_x, search_size_y) + / MAX2(pattern_size_x, pattern_size_y); + double log2_search_to_pattern_ratio = log(floor(search_to_pattern_ratio)) / M_LN2; + int max_pyramid_levels= floor(log2_search_to_pattern_ratio + 1); + + /* try to accomodate the user's choice of pyramid level in a way + * that doesn't cause the coarsest pyramid pattern to be larger + * than the search size */ + int level= MIN2(track_context->track->pyramid_levels, max_pyramid_levels); + track_context->region_tracker= libmv_regionTrackerNew(100, level); + } + else if(track_context->track->tracker==TRACKER_SAD) { + /* nothing to initialize */ + } + } +#endif + + BLI_ghash_insert(context->hash, new_track, track); + + track_context++; + } + } + + track= track->next; + } + } + + context->clip= clip; + context->user= *user; + + return context; +} + +void BKE_tracking_context_free(MovieTrackingContext *context) +{ + int a; + TrackContext *track_context; + + for(a= 0, track_context= context->track_context; a<context->num_tracks; a++, track_context++) { + BKE_tracking_free_track(context->track_context[a].track); + +#if WITH_LIBMV + if(track_context->region_tracker) + libmv_regionTrackerDestroy(track_context->region_tracker); + + if(track_context->patch) + MEM_freeN(track_context->patch); + + if(track_context->pattern) + MEM_freeN(track_context->pattern); + + if(track_context->warped) + MEM_freeN(track_context->warped); +#endif + + MEM_freeN(track_context->track); + } + + if(context->track_context) + MEM_freeN(context->track_context); + + BLI_ghash_free(context->hash, NULL, NULL); + + MEM_freeN(context); +} + +static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track) +{ + int x, y; + + if((track->flag&(TRACK_DISABLE_RED|TRACK_DISABLE_GREEN|TRACK_DISABLE_BLUE))==0) + return; + + for(y= 0; y<ibuf->y; y++) { + for (x= 0; x<ibuf->x; x++) { + int pixel= ibuf->x*y + x; + + if(ibuf->rect_float) { + float *rrgbf= ibuf->rect_float + pixel*4; + + if(track->flag&TRACK_DISABLE_RED) rrgbf[0]= 0; + if(track->flag&TRACK_DISABLE_GREEN) rrgbf[1]= 0; + if(track->flag&TRACK_DISABLE_BLUE) rrgbf[2]= 0; + } else { + char *rrgb= (char*)ibuf->rect + pixel*4; + + if(track->flag&TRACK_DISABLE_RED) rrgb[0]= 0; + if(track->flag&TRACK_DISABLE_GREEN) rrgb[1]= 0; + if(track->flag&TRACK_DISABLE_BLUE) rrgb[2]= 0; + } + } + } +} + +static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker, + float min[2], float max[2], int margin, int anchored, float pos[2], int origin[2]) +{ + ImBuf *tmpibuf; + int x, y; + int x1, y1, x2, y2, w, h; + float mpos[2]; + + copy_v2_v2(mpos, marker->pos); + if(anchored) + add_v2_v2(mpos, track->offset); + + x= mpos[0]*ibuf->x; + y= mpos[1]*ibuf->y; + x1= x-(int)(-min[0]*ibuf->x); + y1= y-(int)(-min[1]*ibuf->y); + x2= x+(int)(max[0]*ibuf->x); + y2= y+(int)(max[1]*ibuf->y); + + /* dimensions should be odd */ + w= (x2-x1)|1; + h= (y2-y1)|1; + + tmpibuf= IMB_allocImBuf(w+margin*2, h+margin*2, 32, IB_rect); + IMB_rectcpy(tmpibuf, ibuf, 0, 0, x1-margin, y1-margin, w+margin*2, h+margin*2); + + if(pos != NULL) { + pos[0]= mpos[0]*ibuf->x-x1+margin; + pos[1]= mpos[1]*ibuf->y-y1+margin; + } + + if(origin != NULL) { + origin[0]= x1-margin; + origin[1]= y1-margin; + } + + disable_imbuf_channels(tmpibuf, track); + + return tmpibuf; +} + +ImBuf *BKE_tracking_get_pattern_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker, + int margin, int anchored, float pos[2], int origin[2]) +{ + return get_area_imbuf(ibuf, track, marker, track->pat_min, track->pat_max, margin, anchored, pos, origin); +} + +ImBuf *BKE_tracking_get_search_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker, + int margin, int anchored, float pos[2], int origin[2]) +{ + return get_area_imbuf(ibuf, track, marker, track->search_min, track->search_max, margin, anchored, pos, origin); +} + +#ifdef WITH_LIBMV +static float *get_search_floatbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker, + int *width_r, int *height_r, float pos[2], int origin[2]) +{ + ImBuf *tmpibuf; + float *pixels, *fp; + int x, y, width, height; + + width= (track->search_max[0]-track->search_min[0])*ibuf->x; + height= (track->search_max[1]-track->search_min[1])*ibuf->y; + + tmpibuf= BKE_tracking_get_search_imbuf(ibuf, track, marker, 0, 0, pos, origin); + disable_imbuf_channels(tmpibuf, track); + + *width_r= width; + *height_r= height; + + fp= pixels= MEM_callocN(width*height*sizeof(float), "tracking floatBuf"); + for(y= 0; y<(int)height; y++) { + for (x= 0; x<(int)width; x++) { + int pixel= tmpibuf->x*y + x; + + if(tmpibuf->rect_float) { + float *rrgbf= tmpibuf->rect_float + pixel*4; + + *fp= 0.2126*rrgbf[0] + 0.7152*rrgbf[1] + 0.0722*rrgbf[2]; + } else { + unsigned char *rrgb= (unsigned char*)tmpibuf->rect + pixel*4; + + *fp= (0.2126*rrgb[0] + 0.7152*rrgb[1] + 0.0722*rrgb[2])/255.0f; + } + + fp++; + } + } + + IMB_freeImBuf(tmpibuf); + + return pixels; +} + +static unsigned char *get_ucharbuf(ImBuf *ibuf) +{ + int x, y; + unsigned char *pixels, *cp; + + cp= pixels= MEM_callocN(ibuf->x*ibuf->y*sizeof(unsigned char), "tracking ucharBuf"); + for(y= 0; y<ibuf->y; y++) { + for (x= 0; x<ibuf->x; x++) { + int pixel= ibuf->x*y + x; + + if(ibuf->rect_float) { + float *rrgbf= ibuf->rect_float + pixel*4; + + *cp= FTOCHAR(0.2126f*rrgbf[0] + 0.7152f*rrgbf[1] + 0.0722f*rrgbf[2]); + } else { + unsigned char *rrgb= (unsigned char*)ibuf->rect + pixel*4; + + *cp= 0.2126f*rrgb[0] + 0.7152f*rrgb[1] + 0.0722f*rrgb[2]; + } + + cp++; + } + } + + return pixels; +} + +static unsigned char *get_search_bytebuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker, + int *width_r, int *height_r, float pos[2], int origin[2]) +{ + ImBuf *tmpibuf; + unsigned char *pixels; + + tmpibuf= BKE_tracking_get_search_imbuf(ibuf, track, marker, 0, 0, pos, origin); + disable_imbuf_channels(tmpibuf, track); + + *width_r= tmpibuf->x; + *height_r= tmpibuf->y; + + pixels= get_ucharbuf(tmpibuf); + + IMB_freeImBuf(tmpibuf); + + return pixels; +} + +static ImBuf *get_frame_ibuf(MovieTrackingContext *context, int framenr) +{ + ImBuf *ibuf; + int framenr_old= context->user.framenr; + + context->user.framenr= framenr; + + ibuf= BKE_movieclip_get_ibuf_flag(context->clip, &context->user, 0); + + context->user.framenr= framenr_old; + + return ibuf; +} + +static ImBuf *get_keyframed_ibuf(MovieTrackingContext *context, MovieTrackingTrack *track, + MovieTrackingMarker *marker, MovieTrackingMarker **marker_keyed) +{ + int framenr= marker->framenr; + int a= marker-track->markers; + + *marker_keyed= marker; + + while(a>=0 && a<track->markersnr) { + int next= (context->backwards) ? a+1 : a-1; + int is_keyframed= 0; + MovieTrackingMarker *marker= &track->markers[a]; + MovieTrackingMarker *next_marker= NULL; + + if(next>=0 && next<track->markersnr) + next_marker= &track->markers[next]; + + /* if next mrker is disabled, stop searching keyframe and use current frame as keyframe */ + if(next_marker && next_marker->flag&MARKER_DISABLED) + is_keyframed= 1; + + is_keyframed|= (marker->flag&MARKER_TRACKED)==0; + + if(is_keyframed) { + framenr= marker->framenr; + *marker_keyed= marker; + break; + } + + a= next; + } + + return get_frame_ibuf(context, framenr); +} + +static ImBuf *get_adjust_ibuf(MovieTrackingContext *context, MovieTrackingTrack *track, MovieTrackingMarker *marker, + int curfra, MovieTrackingMarker **marker_keyed) +{ + ImBuf *ibuf= NULL; + + if(context->settings.adjframes == 0) { + ibuf= get_keyframed_ibuf(context, track, marker, marker_keyed); + } else { + ibuf= get_frame_ibuf(context, curfra); + + /* use current marker as keyframed position */ + *marker_keyed= marker; + } + + return ibuf; +} + +static void get_warped(TrackContext *track_context, int x, int y, int width, unsigned char *image) +{ + int i, j; + + for(i=0; i<track_context->patsize; i++) { + for(j=0; j<track_context->patsize; j++) { + track_context->warped[i*track_context->patsize+j]= + image[(y+i-track_context->patsize/2)*width+x+j-track_context->patsize/2]; + } + } +} + +#endif + +void BKE_tracking_sync(MovieTrackingContext *context) +{ + TrackContext *track_context; + MovieTracking *tracking= &context->clip->tracking; + MovieTrackingTrack *track; + ListBase tracks= {NULL, NULL}, new_tracks= {NULL, NULL}; + ListBase *old_tracks= &context->clip->tracking.tracks; + int a, newframe; + + /* duplicate currently tracking tracks to temporary list. + this is needed to keep names in unique state and it's faster to change names + of currently tracking tracks (if needed) */ + for(a= 0, track_context= context->track_context; a<context->num_tracks; a++, track_context++) { + int replace_sel= 0; + MovieTrackingTrack *new_track, *old; + + track= track_context->track; + + /* find original of tracking track in list of previously displayed tracks */ + old= BLI_ghash_lookup(context->hash, track); + if(old) { + MovieTrackingTrack *cur= old_tracks->first; + + while(cur) { + if(cur==old) + break; + + cur= cur->next; + } + + /* original track was found, re-use flags and remove this track */ + if(cur) { + if(cur==tracking->act_track) + replace_sel= 1; + + track->flag= cur->flag; + track->pat_flag= cur->pat_flag; + track->search_flag= cur->search_flag; + + BKE_tracking_free_track(cur); + BLI_freelinkN(old_tracks, cur); + } + } + + new_track= BKE_tracking_copy_track(track); + + BLI_ghash_remove(context->hash, track, NULL, NULL); /* XXX: are we actually need this */ + BLI_ghash_insert(context->hash, track, new_track); + + if(replace_sel) /* update current selection in clip */ + tracking->act_track= new_track; + + BLI_addtail(&tracks, new_track); + } + + /* move all tracks, which aren't tracking */ + track= old_tracks->first; + while(track) { + MovieTrackingTrack *next= track->next; + + track->next= track->prev= NULL; + BLI_addtail(&new_tracks, track); + + track= next; + } + + /* now move all tracks which are currently tracking and keep their names unique */ + track= tracks.first; + while(track) { + MovieTrackingTrack *next= track->next; + + BLI_remlink(&tracks, track); + + track->next= track->prev= NULL; + BLI_addtail(&new_tracks, track); + + BLI_uniquename(&new_tracks, track, "Track", '.', offsetof(MovieTrackingTrack, name), sizeof(track->name)); + + track= next; + } + + context->clip->tracking.tracks= new_tracks; + + if(context->backwards) newframe= context->user.framenr+1; + else newframe= context->user.framenr-1; + + context->sync_frame= newframe; +} + +void BKE_tracking_sync_user(MovieClipUser *user, MovieTrackingContext *context) +{ + user->framenr= context->sync_frame; +} + +int BKE_tracking_next(MovieTrackingContext *context) +{ + ImBuf *ibuf_new; + int curfra= context->user.framenr; + int a, ok= 0; + + /* nothing to track, avoid unneeded frames reading to save time and memory */ + if(!context->num_tracks) + return 0; + + if(context->backwards) context->user.framenr--; + else context->user.framenr++; + + ibuf_new= BKE_movieclip_get_ibuf_flag(context->clip, &context->user, 0); + if(!ibuf_new) + return 0; + + #pragma omp parallel for private(a) shared(ibuf_new, ok) if(context->num_tracks>1) + for(a= 0; a<context->num_tracks; a++) { + TrackContext *track_context= &context->track_context[a]; + MovieTrackingTrack *track= track_context->track; + MovieTrackingMarker *marker= BKE_tracking_get_marker(track, curfra); + + if(marker && (marker->flag&MARKER_DISABLED)==0 && marker->framenr==curfra) { +#ifdef WITH_LIBMV + int width, height, origin[2], tracked= 0, need_readjust= 0; + float pos[2], margin[2]; + double x1, y1, x2, y2; + ImBuf *ibuf= NULL; + MovieTrackingMarker marker_new, *marker_keyed; + int onbound= 0, coords_correct= 0; + int nextfra; + + if(!context->settings.adjframes) need_readjust= context->first_time; + else need_readjust= context->frames%context->settings.adjframes == 0; + + if(context->backwards) nextfra= curfra-1; + else nextfra= curfra+1; + + /* margin from frame boundaries */ + sub_v2_v2v2(margin, track->pat_max, track->pat_min); + + margin[0]= MAX2(margin[0], (float)context->settings.margin / ibuf_new->x); + margin[1]= MAX2(margin[1], (float)context->settings.margin / ibuf_new->y); + + /* do not track markers which are too close to boundary */ + if(marker->pos[0]<margin[0] || marker->pos[0]>1.0f-margin[0] || + marker->pos[1]<margin[1] || marker->pos[1]>1.0f-margin[1]) { + onbound= 1; + } + else if(track_context->track->tracker==TRACKER_KLT) { + int wndx, wndy; + float *patch_new; + + if(need_readjust) { + /* calculate patch for keyframed position */ + ibuf= get_adjust_ibuf(context, track, marker, curfra, &marker_keyed); + + if(track_context->patch) + MEM_freeN(track_context->patch); + + track_context->patch= get_search_floatbuf(ibuf, track, marker_keyed, &width, &height, track_context->keyframed_pos, origin); + + IMB_freeImBuf(ibuf); + } + + patch_new= get_search_floatbuf(ibuf_new, track, marker, &width, &height, pos, origin); + + x1= track_context->keyframed_pos[0]; + y1= track_context->keyframed_pos[1]; + + x2= pos[0]; + y2= pos[1]; + + wndx= (int)((track->pat_max[0]-track->pat_min[0])*ibuf_new->x)/2; + wndy= (int)((track->pat_max[1]-track->pat_min[1])*ibuf_new->y)/2; + + tracked= libmv_regionTrackerTrack(track_context->region_tracker, track_context->patch, patch_new, + width, height, MAX2(wndx, wndy), x1, y1, &x2, &y2); + + MEM_freeN(patch_new); + } + else if(track_context->track->tracker==TRACKER_SAD) { + unsigned char *image_new; + float correlation; + float warp[3][2]={{0}}; + + if(need_readjust) { + unsigned char *image; + + /* calculate pattern for keyframed position */ + ibuf= get_adjust_ibuf(context, track, marker, curfra, &marker_keyed); + + image= get_search_bytebuf(ibuf, track, marker_keyed, &width, &height, pos, origin); + + memset(warp, 0, sizeof(warp)); + warp[0][0]= 1; + warp[1][1]= 1; + warp[2][0]= pos[0]; + warp[2][1]= pos[1]; + + /* pattern size is hardcoded to 16x16px in libmv */ + track_context->patsize= 16; + + if(!track_context->pattern) + track_context->pattern= MEM_callocN(sizeof(unsigned char)*track_context->patsize*track_context->patsize, "trackking pattern"); + + libmv_SADSamplePattern(image, width, warp, track_context->pattern); + + MEM_freeN(image); + IMB_freeImBuf(ibuf); + } + + image_new= get_search_bytebuf(ibuf_new, track, marker, &width, &height, pos, origin); + + if(track_context->warped==NULL) { + unsigned char *image_old; + + ibuf= get_frame_ibuf(context, curfra); + + if(track_context->warped==NULL) + track_context->warped= MEM_callocN(sizeof(unsigned char)*track_context->patsize*track_context->patsize, "trackking warped"); + + image_old= get_search_bytebuf(ibuf, track, marker, &width, &height, pos, origin); + get_warped(track_context, pos[0], pos[1], width, image_old); + IMB_freeImBuf(ibuf); + MEM_freeN(image_old); + } + + memset(warp, 0, sizeof(warp)); + warp[0][0]= 1; + warp[1][1]= 1; + warp[2][0]= pos[0]; + warp[2][1]= pos[1]; + + correlation= libmv_SADTrackerTrack(track_context->pattern, track_context->warped, image_new, width, width, height, warp); + + x2= warp[2][0]; + y2= warp[2][1]; + + tracked= track_context->track->minimum_correlation < correlation; + + if(tracked) + get_warped(track_context, x2, y2, width, image_new); + + MEM_freeN(image_new); + } + + coords_correct= !isnan(x2) && !isnan(y2) && finite(x2) && finite(y2); + if(coords_correct && (tracked || !context->disable_failed)) { + if(context->first_time) { + #pragma omp critical + { + /* check if there's no keyframe/tracked markers before tracking marker. + if so -- create disabled marker before currently tracking "segment" */ + put_disabled_marker(track, marker, 1, 0); + } + } + + memset(&marker_new, 0, sizeof(marker_new)); + + if(!onbound) { + marker_new.pos[0]= (origin[0]+x2)/ibuf_new->x; + marker_new.pos[1]= (origin[1]+y2)/ibuf_new->y; + } else { + copy_v2_v2(marker_new.pos, marker->pos); + } + + marker_new.flag|= MARKER_TRACKED; + marker_new.framenr= nextfra; + + #pragma omp critical + { + BKE_tracking_insert_marker(track, &marker_new); + } + + /* make currently tracked segment be finished with disabled marker */ + #pragma omp critical + { + put_disabled_marker(track, &marker_new, 0, 0); + } + } else { + marker_new= *marker; + + marker_new.framenr= nextfra; + marker_new.flag|= MARKER_DISABLED; + + #pragma omp critical + { + BKE_tracking_insert_marker(track, &marker_new); + } + } + + ok= 1; +#endif + } + } + + IMB_freeImBuf(ibuf_new); + + context->first_time= 0; + context->frames++; + + return ok; +} + +#if WITH_LIBMV +static struct libmv_Tracks *create_libmv_tracks(MovieTracking *tracking, int width, int height) +{ + int tracknr= 0; + MovieTrackingTrack *track; + struct libmv_Tracks *tracks= libmv_tracksNew(); + + track= tracking->tracks.first; + while(track) { + int a= 0; + + for(a= 0; a<track->markersnr; a++) { + MovieTrackingMarker *marker= &track->markers[a]; + + if((marker->flag&MARKER_DISABLED)==0) + libmv_tracksInsert(tracks, marker->framenr, tracknr, + marker->pos[0]*width, marker->pos[1]*height); + } + + track= track->next; + tracknr++; + } + + return tracks; +} + +static int retrieve_libmv_reconstruct(MovieTracking *tracking, struct libmv_Reconstruction *libmv_reconstruction) +{ + int tracknr= 0; + int sfra= INT_MAX, efra= INT_MIN, a, origin_set= 0; + MovieTrackingTrack *track; + MovieTrackingReconstruction *reconstruction= &tracking->reconstruction; + MovieReconstructedCamera *reconstructed; + float origin[3]= {0.0f, 0.0f, 0.0f}; + int ok= 1; + + track= tracking->tracks.first; + while(track) { + double pos[3]; + + if(libmv_reporojectionPointForTrack(libmv_reconstruction, tracknr, pos)) { + track->bundle_pos[0]= pos[0]; + track->bundle_pos[1]= pos[1]; + track->bundle_pos[2]= pos[2]; + + track->flag|= TRACK_HAS_BUNDLE; + track->error= libmv_reporojectionErrorForTrack(libmv_reconstruction, tracknr); + } else { + track->flag&= ~TRACK_HAS_BUNDLE; + ok= 0; + + printf("No bundle for track #%d '%s'\n", tracknr, track->name); + } + + if(track->markersnr) { + if(track->markers[0].framenr<sfra) sfra= track->markers[0].framenr; + if(track->markers[track->markersnr-1].framenr>efra) efra= track->markers[track->markersnr-1].framenr; + } + + track= track->next; + tracknr++; + } + + if(reconstruction->cameras) + MEM_freeN(reconstruction->cameras); + + reconstruction->camnr= 0; + reconstruction->cameras= NULL; + reconstructed= MEM_callocN((efra-sfra+1)*sizeof(MovieReconstructedCamera), "temp reconstructed camera"); + + for(a= sfra; a<=efra; a++) { + double matd[4][4]; + + if(libmv_reporojectionCameraForImage(libmv_reconstruction, a, matd)) { + int i, j; + float mat[4][4]; + float error= libmv_reporojectionErrorForImage(libmv_reconstruction, a); + + for(i=0; i<4; i++) + for(j= 0; j<4; j++) + mat[i][j]= matd[i][j]; + + if(!origin_set) { + copy_v3_v3(origin, mat[3]); + origin_set= 1; + } + + if(origin_set) + sub_v3_v3(mat[3], origin); + + copy_m4_m4(reconstructed[reconstruction->camnr].mat, mat); + reconstructed[reconstruction->camnr].framenr= a; + reconstructed[reconstruction->camnr].error= error; + reconstruction->camnr++; + } else { + ok= 0; + printf("No camera for frame %d\n", a); + } + } + + if(reconstruction->camnr) { + reconstruction->cameras= MEM_callocN(reconstruction->camnr*sizeof(MovieReconstructedCamera), "reconstructed camera"); + memcpy(reconstruction->cameras, reconstructed, reconstruction->camnr*sizeof(MovieReconstructedCamera)); + } + + if(origin_set) { + track= tracking->tracks.first; + while(track) { + if(track->flag&TRACK_HAS_BUNDLE) + sub_v3_v3(track->bundle_pos, origin); + + track= track->next; + } + } + + MEM_freeN(reconstructed); + + return ok; +} + +#endif + +float BKE_tracking_solve_reconstruction(MovieTracking *tracking, int width, int height) +{ +#if WITH_LIBMV + { + MovieTrackingCamera *camera= &tracking->camera; + float aspy= 1.0f/tracking->camera.pixel_aspect; + struct libmv_Tracks *tracks= create_libmv_tracks(tracking, width, height*aspy); + struct libmv_Reconstruction *reconstruction = libmv_solveReconstruction(tracks, + tracking->settings.keyframe1, tracking->settings.keyframe2, + camera->focal, + camera->principal[0], camera->principal[1]*aspy, + camera->k1, camera->k2, camera->k3); + float error= libmv_reprojectionError(reconstruction); + + tracking->reconstruction.error= error; + + if(!retrieve_libmv_reconstruct(tracking, reconstruction)) + error= -1.0f; + + libmv_destroyReconstruction(reconstruction); + libmv_tracksDestroy(tracks); + + tracking->reconstruction.flag|= TRACKING_RECONSTRUCTED; + + return error; + } +#else + (void)tracking; + (void)width; + (void)height; + + return -1.0f; +#endif +} + +void BKE_track_unique_name(MovieTracking *tracking, MovieTrackingTrack *track) +{ + BLI_uniquename(&tracking->tracks, track, "Track", '.', offsetof(MovieTrackingTrack, name), sizeof(track->name)); +} + +MovieTrackingTrack *BKE_tracking_named_track(MovieTracking *tracking, const char *name) +{ + MovieTrackingTrack *track= tracking->tracks.first; + + while(track) { + if(!strcmp(track->name, name)) + return track; + + track= track->next; + } + + return NULL; +} + +static int reconstruction_camera_index(MovieTracking *tracking, int framenr, int nearest) +{ + MovieTrackingReconstruction *reconstruction= &tracking->reconstruction; + MovieReconstructedCamera *cameras= reconstruction->cameras; + int a= 0, d= 1; + + if(!reconstruction->camnr) + return -1; + + if(framenr<cameras[0].framenr) { + if(nearest) return 0; + else return -1; + } + + if(framenr>cameras[reconstruction->camnr-1].framenr) { + if(nearest) return reconstruction->camnr-1; + else return -1; + } + + if(reconstruction->last_camera<reconstruction->camnr) + a= reconstruction->last_camera; + + if(cameras[a].framenr>=framenr) + d= -1; + + while(a>=0 && a<reconstruction->camnr) { + int cfra= cameras[a].framenr; + + /* check if needed framenr was "skipped" -- no data for requested frame */ + + if(d>0 && cfra>framenr) { + /* interpolate with previous position */ + if(nearest) return a-1; + else break; + } + + if(d<0 && cfra<framenr) { + /* interpolate with next position */ + if(nearest) return a; + else break; + } + + if(cfra==framenr) { + reconstruction->last_camera= a; + + return a; + } + + a+= d; + } + + return -1; +} + +MovieReconstructedCamera *BKE_tracking_get_reconstructed_camera(MovieTracking *tracking, int framenr) +{ + int a= reconstruction_camera_index(tracking, framenr, 0); + + if(a==-1) + return NULL; + + return &tracking->reconstruction.cameras[a]; +} + +void BKE_tracking_get_interpolated_camera(MovieTracking *tracking, int framenr, float mat[4][4]) +{ + MovieTrackingReconstruction *reconstruction= &tracking->reconstruction; + MovieReconstructedCamera *cameras= reconstruction->cameras; + int a= reconstruction_camera_index(tracking, framenr, 1); + + if(a==-1) { + unit_m4(mat); + return; + } + + if(cameras[a].framenr!=framenr && a>0 && a<reconstruction->camnr-1) { + float t= ((float)framenr-cameras[a].framenr) / (cameras[a+1].framenr-cameras[a].framenr); + + blend_m4_m4m4(mat, cameras[a].mat, cameras[a+1].mat, t); + } else { + copy_m4_m4(mat, cameras[a].mat); + } +} + +void BKE_get_tracking_mat(Scene *scene, Object *ob, float mat[4][4]) +{ + if(!ob) { + if(scene->camera) ob= scene->camera; + else ob= scene_find_camera(scene); + } + + if(ob) + where_is_object_mat(scene, ob, mat); + else + unit_m4(mat); +} + +void BKE_tracking_camera_shift(MovieTracking *tracking, int winx, int winy, float *shiftx, float *shifty) +{ + *shiftx= (0.5f*winx-tracking->camera.principal[0]) / winx; + *shifty= (0.5f*winy-tracking->camera.principal[1]) / winx; +} + +void BKE_tracking_camera_to_blender(MovieTracking *tracking, Scene *scene, Camera *camera, int width, int height) +{ + float focal= tracking->camera.focal; + + camera->sensor_x= tracking->camera.sensor_width; + camera->sensor_fit= CAMERA_SENSOR_FIT_AUTO; + camera->lens= focal*camera->sensor_x/width; + + scene->r.xsch= width*tracking->camera.pixel_aspect; + scene->r.ysch= height; + + scene->r.xasp= 1.0f; + scene->r.yasp= 1.0f; + + BKE_tracking_camera_shift(tracking, width, height, &camera->shiftx, &camera->shifty); +} + +void BKE_tracking_projection_matrix(MovieTracking *tracking, int framenr, int winx, int winy, float mat[4][4]) +{ + MovieReconstructedCamera *camera; + float lens= tracking->camera.focal*tracking->camera.sensor_width/(float)winx; + float viewfac, pixsize, left, right, bottom, top, clipsta, clipend; + float winmat[4][4]; + float ycor= 1.0f/tracking->camera.pixel_aspect; + float shiftx, shifty, winside= MAX2(winx, winy); + + BKE_tracking_camera_shift(tracking, winx, winy, &shiftx, &shifty); + + clipsta= 0.1f; + clipend= 1000.0f; + + if(winx >= winy) + viewfac= (lens*winx)/tracking->camera.sensor_width; + else + viewfac= (ycor*lens*winy)/tracking->camera.sensor_width; + + pixsize= clipsta/viewfac; + + left= -0.5f*(float)winx + shiftx*winside; + bottom= -0.5f*(ycor)*(float)winy + shifty*winside; + right= 0.5f*(float)winx + shiftx*winside; + top= 0.5f*(ycor)*(float)winy + shifty*winside; + + left *= pixsize; + right *= pixsize; + bottom *= pixsize; + top *= pixsize; + + perspective_m4(winmat, left, right, bottom, top, clipsta, clipend); + + camera= BKE_tracking_get_reconstructed_camera(tracking, framenr); + if(camera) { + float imat[4][4]; + + invert_m4_m4(imat, camera->mat); + mul_m4_m4m4(mat, imat, winmat); + } else copy_m4_m4(mat, winmat); +} + +void BKE_tracking_apply_intrinsics(MovieTracking *tracking, float co[2], float nco[2]) +{ + MovieTrackingCamera *camera= &tracking->camera; + +#ifdef WITH_LIBMV + double x, y; + float aspy= 1.0f/tracking->camera.pixel_aspect; + + /* normalize coords */ + x= (co[0]-camera->principal[0]) / camera->focal; + y= (co[1]-camera->principal[1] * aspy) / camera->focal; + + libmv_applyCameraIntrinsics(camera->focal, camera->principal[0], camera->principal[1] * aspy, + camera->k1, camera->k2, camera->k3, x, y, &x, &y); + + /* result is in image coords already */ + nco[0]= x; + nco[1]= y; +#else + (void)camera; + (void)co; + (void)nco; +#endif +} + +void BKE_tracking_invert_intrinsics(MovieTracking *tracking, float co[2], float nco[2]) +{ + MovieTrackingCamera *camera= &tracking->camera; + +#ifdef WITH_LIBMV + double x= co[0], y= co[1]; + float aspy= 1.0f/tracking->camera.pixel_aspect; + + libmv_InvertIntrinsics(camera->focal, camera->principal[0], camera->principal[1] * aspy, + camera->k1, camera->k2, camera->k3, x, y, &x, &y); + + nco[0]= x * camera->focal + camera->principal[0]; + nco[1]= y * camera->focal + camera->principal[1] * aspy; +#else + (void)camera; + (void)co; + (void)nco; +#endif +} + +#ifdef WITH_LIBMV +static int point_in_stroke(bGPDstroke *stroke, float x, float y) +{ + int i, prev; + int count= 0; + bGPDspoint *points= stroke->points; + + prev= stroke->totpoints-1; + + for(i= 0; i<stroke->totpoints; i++) { + if((points[i].y<y && points[prev].y>=y) || (points[prev].y<y && points[i].y>=y)) { + float fac= (y-points[i].y)/(points[prev].y-points[i].y); + + if (points[i].x+fac*(points[prev].x-points[i].x)<x) + count++; + } + + prev= i; + } + + return count%2; +} + +static int point_in_layer(bGPDlayer *layer, float x, float y) +{ + bGPDframe *frame= layer->frames.first; + + while(frame) { + bGPDstroke *stroke= frame->strokes.first; + while(stroke) { + if(point_in_stroke(stroke, x, y)) + return 1; + + stroke= stroke->next; + } + frame= frame->next; + } + + return 0; +} + +static void retrieve_libmv_features(MovieTracking *tracking, struct libmv_Features *features, + int framenr, int width, int height, bGPDlayer *layer, int place_outside_layer) +{ + int a; + + a= libmv_countFeatures(features); + while(a--) { + MovieTrackingTrack *track; + double x, y, size, score; + int ok= 1; + float xu, yu; + + libmv_getFeature(features, a, &x, &y, &score, &size); + + xu= x/width; + yu= y/height; + + if(layer) + ok= point_in_layer(layer, xu, yu)!=place_outside_layer; + + if(ok) { + track= BKE_tracking_add_track(tracking, xu, yu, framenr, width, height); + track->flag|= SELECT; + track->pat_flag|= SELECT; + track->search_flag|= SELECT; + } + } +} +#endif + +void BKE_tracking_detect_fast(MovieTracking *tracking, ImBuf *ibuf, + int framenr, int margin, int min_trackness, int min_distance, bGPDlayer *layer, + int place_outside_layer) +{ +#ifdef WITH_LIBMV + struct libmv_Features *features; + unsigned char *pixels= get_ucharbuf(ibuf); + + features= libmv_detectFeaturesFAST(pixels, ibuf->x, ibuf->y, ibuf->x, margin, min_trackness, min_distance); + + MEM_freeN(pixels); + + retrieve_libmv_features(tracking, features, framenr, ibuf->x, ibuf->y, layer, place_outside_layer); + + libmv_destroyFeatures(features); +#else + (void)tracking; + (void)ibuf; + (void)framenr; + (void)margin; + (void)min_trackness; + (void)min_distance; + (void)layer; + (void)place_outside_layer; +#endif +} + +MovieTrackingTrack *BKE_tracking_indexed_track(MovieTracking *tracking, int tracknr) +{ + MovieTrackingTrack *track= tracking->tracks.first; + int cur= 1; + + while(track) { + if(track->flag&TRACK_HAS_BUNDLE) { + if(cur==tracknr) + return track; + + cur++; + } + + track= track->next; + } + + return NULL; +} + +static int stabilization_median_point(MovieTracking *tracking, int framenr, float median[2]) +{ + int ok= 0; + float min[2], max[2]; + MovieTrackingTrack *track; + + INIT_MINMAX2(min, max); + + track= tracking->tracks.first; + while(track) { + if(track->flag&TRACK_USE_2D_STAB) { + MovieTrackingMarker *marker= BKE_tracking_get_marker(track, framenr); + + DO_MINMAX2(marker->pos, min, max); + + ok= 1; + } + + track= track->next; + } + + median[0]= (max[0]+min[0])/2.0f; + median[1]= (max[1]+min[1])/2.0f; + + return ok; +} + +static void calculate_stabdata(MovieTracking *tracking, int framenr, float width, float height, + float firstmedian[2], float median[2], float loc[2], float *scale, float *angle) +{ + MovieTrackingStabilization *stab= &tracking->stabilization; + + *scale= (stab->scale-1.0f)*stab->scaleinf+1.0f; + *angle= 0.0f; + + loc[0]= (firstmedian[0]-median[0])*width*(*scale); + loc[1]= (firstmedian[1]-median[1])*height*(*scale); + + mul_v2_fl(loc, stab->locinf); + + if(stab->rot_track && stab->rotinf) { + MovieTrackingMarker *marker; + float a[2], b[2]; + float x0= (float)width/2.0f, y0= (float)height/2.0f; + float x= median[0]*width, y= median[1]*height; + + marker= BKE_tracking_get_marker(stab->rot_track, 1); + sub_v2_v2v2(a, marker->pos, firstmedian); + a[0]*= width; + a[1]*= height; + + marker= BKE_tracking_get_marker(stab->rot_track, framenr); + sub_v2_v2v2(b, marker->pos, median); + b[0]*= width; + b[1]*= height; + + *angle= -atan2(a[0]*b[1]-a[1]*b[0], a[0]*b[0]+a[1]*b[1]); + *angle*= stab->rotinf; + + /* convert to rotation around image center */ + loc[0]-= (x0 + (x-x0)*cos(*angle)-(y-y0)*sin(*angle) - x)*(*scale); + loc[1]-= (y0 + (x-x0)*sin(*angle)+(y-y0)*cos(*angle) - y)*(*scale); + } +} + +static float stabilization_auto_scale_factor(MovieTracking *tracking, int width, int height) +{ + float firstmedian[2]; + MovieTrackingStabilization *stab= &tracking->stabilization; + + if(stab->ok) + return stab->scale; + + if(stabilization_median_point(tracking, 1, firstmedian)) { + int sfra= INT_MAX, efra= INT_MIN, cfra; + float delta[2]= {0.0f, 0.0f}, scalex= 1.0f, scaley= 1.0f; + MovieTrackingTrack *track; + + stab->scale= 1.0f; + + track= tracking->tracks.first; + while(track) { + if(track->flag&TRACK_USE_2D_STAB || track==stab->rot_track) { + if(track->markersnr) { + sfra= MIN2(sfra, track->markers[0].framenr); + efra= MAX2(efra, track->markers[track->markersnr-1].framenr); + } + } + + track= track->next; + } + + for(cfra=sfra; cfra<=efra; cfra++) { + float median[2], near[2]; + float loc[2], scale, angle; + + stabilization_median_point(tracking, cfra, median); + + calculate_stabdata(tracking, cfra, width, height, firstmedian, median, + loc, &scale, &angle); + + if(angle==0.0f) { + loc[0]= fabsf(loc[0]); + loc[1]= fabsf(loc[1]); + + delta[0]= MAX2(delta[0], loc[0]); + delta[1]= MAX2(delta[1], loc[1]); + + near[0]= MIN2(median[0], 1.0f-median[0]); + near[1]= MIN2(median[1], 1.0f-median[1]); + near[0]= MAX2(near[0], 0.05f); + near[1]= MAX2(near[1], 0.05f); + + scalex= 1.0f+delta[0]/(near[0]*width); + scaley= 1.0f+delta[1]/(near[1]*height); + } else { + int i; + float mat[4][4]; + float points[4][2]={{0.0f, 0.0f}, {0.0f, height}, {width, height}, {width, 0.0f}}; + + BKE_tracking_stabdata_to_mat4(width, height, loc, scale, angle, mat); + + for(i= 0; i<4; i++) { + int j; + float a[3]= {0.0f, 0.0f, 0.0f}, b[3]= {0.0f, 0.0f, 0.0f}; + + copy_v3_v3(a, points[i]); + copy_v3_v3(b, points[(i+1)%4]); + + mul_m4_v3(mat, a); + mul_m4_v3(mat, b); + + for(j= 0; j<4; j++) { + float point[3]= {points[j][0], points[j][1], 0.0f}; + float v1[3], v2[3]; + + sub_v3_v3v3(v1, b, a); + sub_v3_v3v3(v2, point, a); + + if(cross_v2v2(v1, v2) >= 0.0f) { + float dist= dist_to_line_v2(point, a, b); + if(i%2==0) { + scalex= MAX2(scalex, (width+2*dist)/width); + } else { + scaley= MAX2(scaley, (height+2*dist)/height); + } + } + } + } + } + } + + stab->scale= MAX2(scalex, scaley); + + if(stab->maxscale>0.0f) + stab->scale= MIN2(stab->scale, stab->maxscale); + } else { + stab->scale= 1.0f; + } + + stab->ok= 1; + + return stab->scale; +} + +static ImBuf* stabilize_alloc_ibuf(ImBuf *cacheibuf, ImBuf *srcibuf, int fill) +{ + int flags; + + if(cacheibuf && (cacheibuf->x != srcibuf->x || cacheibuf->y != srcibuf->y)) { + IMB_freeImBuf(cacheibuf); + cacheibuf= NULL; + } + + flags= IB_rect; + + if(srcibuf->rect_float) + flags|= IB_rectfloat; + + if(cacheibuf) { + if(fill) { + float col[4]= {0.0f, 0.0f, 0.0f, 0.0f}; + IMB_rectfill(cacheibuf, col); + } + } + else { + cacheibuf= IMB_allocImBuf(srcibuf->x, srcibuf->y, srcibuf->depth, flags); + cacheibuf->profile= srcibuf->profile; + } + + return cacheibuf; +} + +void BKE_tracking_stabilization_data(MovieTracking *tracking, int framenr, int width, int height, float loc[2], float *scale, float *angle) +{ + float firstmedian[2], median[2]; + MovieTrackingStabilization *stab= &tracking->stabilization; + + if((stab->flag&TRACKING_2D_STABILIZATION)==0) { + zero_v2(loc); + *scale= 1.0f; + *angle= 0.0f; + + return; + } + + if(stabilization_median_point(tracking, 1, firstmedian)) { + stabilization_median_point(tracking, framenr, median); + + if((stab->flag&TRACKING_AUTOSCALE)==0) + stab->scale= 1.0f; + + if(!stab->ok) { + if(stab->flag&TRACKING_AUTOSCALE) + stabilization_auto_scale_factor(tracking, width, height); + + calculate_stabdata(tracking, framenr, width, height, firstmedian, median, loc, scale, angle); + + stab->ok= 1; + } else { + calculate_stabdata(tracking, framenr, width, height, firstmedian, median, loc, scale, angle); + } + } else { + zero_v2(loc); + *scale= 1.0f; + *angle= 0.0f; + } +} + +ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf, float loc[2], float *scale, float *angle) +{ + float tloc[2], tscale, tangle; + MovieTrackingStabilization *stab= &tracking->stabilization; + ImBuf *tmpibuf; + float width= ibuf->x, height= ibuf->y; + + if(loc) copy_v2_v2(tloc, loc); + if(scale) tscale= *scale; + + if((stab->flag&TRACKING_2D_STABILIZATION)==0) { + if(loc) zero_v2(loc); + if(scale) *scale= 1.0f; + + return ibuf; + } + + BKE_tracking_stabilization_data(tracking, framenr, width, height, tloc, &tscale, &tangle); + + tmpibuf= stabilize_alloc_ibuf(NULL, ibuf, 1); + + /* scale would be handled by matrix transformation when angle is non-zero */ + if(tscale!=1.0f && tangle==0.0f) { + ImBuf *scaleibuf; + + stabilization_auto_scale_factor(tracking, width, height); + + scaleibuf= stabilize_alloc_ibuf(stab->scaleibuf, ibuf, 0); + stab->scaleibuf= scaleibuf; + + IMB_rectcpy(scaleibuf, ibuf, 0, 0, 0, 0, ibuf->x, ibuf->y); + IMB_scalefastImBuf(scaleibuf, ibuf->x*tscale, ibuf->y*tscale); + + ibuf= scaleibuf; + } + + if(tangle==0.0f) { + /* if angle is zero, then it's much faster to use rect copy + but could be issues with subpixel precisions */ + IMB_rectcpy(tmpibuf, ibuf, tloc[0]-(tscale-1.0f)*width/2.0f, tloc[1]-(tscale-1.0f)*height/2.0f, 0, 0, ibuf->x, ibuf->y); + } else { + float mat[4][4]; + int i, j; + + BKE_tracking_stabdata_to_mat4(ibuf->x, ibuf->y, tloc, tscale, tangle, mat); + invert_m4(mat); + + for(j=0; j<tmpibuf->y; j++) { + for(i=0; i<tmpibuf->x;i++) { + float vec[3]= {i, j, 0}; + + mul_v3_m4v3(vec, mat, vec); + + /* TODO: add selector for interpolation method */ + neareast_interpolation(ibuf, tmpibuf, vec[0], vec[1], i, j); + } + } + } + + tmpibuf->userflags|= IB_MIPMAP_INVALID; + + if(tmpibuf->rect_float) + tmpibuf->userflags|= IB_RECT_INVALID; + + if(loc) copy_v2_v2(loc, tloc); + if(scale) *scale= tscale; + if(angle) *angle= tangle; + + return tmpibuf; +} + +void BKE_tracking_stabdata_to_mat4(int width, int height, float loc[2], float scale, float angle, float mat[4][4]) +{ + float lmat[4][4], rmat[4][4], smat[4][4], cmat[4][4], icmat[4][4]; + float svec[3]= {scale, scale, scale}; + + unit_m4(rmat); + unit_m4(lmat); + unit_m4(smat); + unit_m4(cmat); + + /* image center as rotation center */ + cmat[3][0]= (float)width/2.0f; + cmat[3][1]= (float)height/2.0f; + invert_m4_m4(icmat, cmat); + + size_to_mat4(smat, svec); /* scale matrix */ + add_v2_v2(lmat[3], loc); /* tranlation matrix */ + rotate_m4(rmat, 'Z', angle); /* rotation matrix */ + + /* compose transformation matrix */ + mul_serie_m4(mat, lmat, cmat, rmat, smat, icmat, NULL, NULL, NULL); +} + +MovieDistortion *BKE_tracking_distortion_create(void) +{ + MovieDistortion *distortion; + + distortion= MEM_callocN(sizeof(MovieDistortion), "BKE_tracking_distortion_create"); + + return distortion; +} + +MovieDistortion *BKE_tracking_distortion_copy(MovieDistortion *distortion) +{ + MovieDistortion *new_distortion; + + new_distortion= MEM_callocN(sizeof(MovieDistortion), "BKE_tracking_distortion_create"); + +#ifdef WITH_LIBMV + new_distortion->intrinsics= libmv_CameraIntrinsicsCopy(distortion->intrinsics); +#else + (void)distortion; +#endif + + return new_distortion; +} + +void BKE_tracking_distortion_update(MovieDistortion *distortion, MovieTracking *tracking, int width, int height) +{ + MovieTrackingCamera *camera= &tracking->camera; + float aspy= 1.0f/tracking->camera.pixel_aspect; + +#ifdef WITH_LIBMV + if(!distortion->intrinsics) { + distortion->intrinsics= libmv_CameraIntrinsicsNew(camera->focal, + camera->principal[0], camera->principal[1] * aspy, + camera->k1, camera->k2, camera->k3, width, height * aspy); + } else { + libmv_CameraIntrinsicsUpdate(distortion->intrinsics, camera->focal, + camera->principal[0], camera->principal[1] * aspy, + camera->k1, camera->k2, camera->k3, width, height * aspy); + } +#else + (void)distortion; + (void)width; + (void)height; + (void)camera; + (void)aspy; +#endif +} + +ImBuf *BKE_tracking_distortion_exec(MovieDistortion *distortion, MovieTracking *tracking, + ImBuf *ibuf, int width, int height, float overscan, int undistort) +{ + ImBuf *resibuf; + + BKE_tracking_distortion_update(distortion, tracking, width, height); + + resibuf= IMB_dupImBuf(ibuf); + + if(ibuf->rect_float) { +#ifdef WITH_LIBMV + if(undistort) { + libmv_CameraIntrinsicsUndistortFloat(distortion->intrinsics, + ibuf->rect_float, resibuf->rect_float, + ibuf->x, ibuf->y, overscan, ibuf->channels); + } else { + libmv_CameraIntrinsicsDistortFloat(distortion->intrinsics, + ibuf->rect_float, resibuf->rect_float, + ibuf->x, ibuf->y, overscan, ibuf->channels); + } +#endif + + ibuf->userflags|= IB_RECT_INVALID; + } else { +#ifdef WITH_LIBMV + if(undistort) { + libmv_CameraIntrinsicsUndistortByte(distortion->intrinsics, + (unsigned char*)ibuf->rect, (unsigned char*)resibuf->rect, + ibuf->x, ibuf->y, overscan, ibuf->channels); + } else { + libmv_CameraIntrinsicsDistortByte(distortion->intrinsics, + (unsigned char*)ibuf->rect, (unsigned char*)resibuf->rect, + ibuf->x, ibuf->y, overscan, ibuf->channels); + } +#endif + } + +#ifndef WITH_LIBMV + (void)overscan; + (void)undistort; +#endif + + return resibuf; +} + +void BKE_tracking_distortion_destroy(MovieDistortion *distortion) +{ +#ifdef WITH_LIBMV + libmv_CameraIntrinsicsDestroy(distortion->intrinsics); +#endif + + MEM_freeN(distortion); +} + +ImBuf *BKE_tracking_undistort(MovieTracking *tracking, ImBuf *ibuf, int width, int height, float overscan) +{ + MovieTrackingCamera *camera= &tracking->camera; + + if(camera->intrinsics == NULL) + camera->intrinsics= BKE_tracking_distortion_create(); + + return BKE_tracking_distortion_exec(camera->intrinsics, tracking, ibuf, width, height, overscan, 1); +} + +ImBuf *BKE_tracking_distort(MovieTracking *tracking, ImBuf *ibuf, int width, int height, float overscan) +{ + MovieTrackingCamera *camera= &tracking->camera; + + if(camera->intrinsics == NULL) + camera->intrinsics= BKE_tracking_distortion_create(); + + return BKE_tracking_distortion_exec(camera->intrinsics, tracking, ibuf, width, height, overscan, 0); +} + +/* area - which part of marker should be selected. see TRACK_AREA_* constants */ +void BKE_tracking_select_track(MovieTracking *tracking, MovieTrackingTrack *track, int area, int extend) +{ + if(extend) { + BKE_tracking_track_flag(track, area, SELECT, 0); + } else { + MovieTrackingTrack *cur= tracking->tracks.first; + + while(cur) { + if(cur==track) { + BKE_tracking_track_flag(cur, TRACK_AREA_ALL, SELECT, 1); + BKE_tracking_track_flag(cur, area, SELECT, 0); + } + else { + BKE_tracking_track_flag(cur, TRACK_AREA_ALL, SELECT, 1); + } + + cur= cur->next; + } + } +} + +void BKE_tracking_deselect_track(MovieTrackingTrack *track, int area) +{ + BKE_tracking_track_flag(track, area, SELECT, 1); +} diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index 01b090f2967..616c27f6b0b 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -426,9 +426,9 @@ void bUnit_AsString(char *str, int len_max, double value, int prec, int system, } -static char *unit_find_str(char *str, const char *substr) +static const char *unit_find_str(const char *str, const char *substr) { - char *str_found; + const char *str_found; if(substr && substr[0] != '\0') { str_found= strstr(str, substr); @@ -485,7 +485,7 @@ static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pr { char *str_found; - if((len_max>0) && (str_found= unit_find_str(str, replace_str))) { /* XXX - investigate, does not respect len_max properly */ + if((len_max>0) && (str_found= (char *)unit_find_str(str, replace_str))) { /* XXX - investigate, does not respect len_max properly */ int len, len_num, len_name, len_move, found_ofs; found_ofs = (int)(str_found-str); @@ -537,7 +537,7 @@ static int unit_replace(char *str, int len_max, char *str_tmp, double scale_pref return ofs; } -static int unit_find(char *str, bUnitDef *unit) +static int unit_find(const char *str, bUnitDef *unit) { if (unit_find_str(str, unit->name_short)) return 1; if (unit_find_str(str, unit->name_plural)) return 1; @@ -562,7 +562,7 @@ static int unit_find(char *str, bUnitDef *unit) * * return true of a change was made. */ -int bUnit_ReplaceString(char *str, int len_max, char *str_prev, double scale_pref, int system, int type) +int bUnit_ReplaceString(char *str, int len_max, const char *str_prev, double scale_pref, int system, int type) { bUnitCollection *usys = unit_get_system(system, type); @@ -676,7 +676,7 @@ int bUnit_ReplaceString(char *str, int len_max, char *str_prev, double scale_pre } /* 45µm --> 45um */ -void bUnit_ToUnitAltName(char *str, int len_max, char *orig_str, int system, int type) +void bUnit_ToUnitAltName(char *str, int len_max, const char *orig_str, int system, int type) { bUnitCollection *usys = unit_get_system(system, type); @@ -687,9 +687,7 @@ void bUnit_ToUnitAltName(char *str, int len_max, char *orig_str, int system, int for(unit= usys->units; unit->name; unit++) { if(len_max > 0 && (unit->name_alt || unit == unit_def)) { - char *found= NULL; - - found= unit_find_str(orig_str, unit->name_short); + const char *found= unit_find_str(orig_str, unit->name_short); if(found) { int offset= (int)(found - orig_str); int len_name= 0; diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index c7d2763774d..1d6972b9d61 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -118,7 +118,7 @@ World *copy_world(World *wrld) World *wrldn; int a; - wrldn= copy_libblock(wrld); + wrldn= copy_libblock(&wrld->id); for(a=0; a<MAX_MTEX; a++) { if(wrld->mtex[a]) { @@ -142,7 +142,7 @@ World *localize_world(World *wrld) World *wrldn; int a; - wrldn= copy_libblock(wrld); + wrldn= copy_libblock(&wrld->id); BLI_remlink(&G.main->world, wrldn); for(a=0; a<MAX_MTEX; a++) { diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index da1412dac0d..2646f5164b2 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -1046,7 +1046,7 @@ void ffmpeg_property_del(RenderData *rd, void *type, void *prop_) } } -IDProperty *ffmpeg_property_add(RenderData *rd, char * type, int opt_index, int parent_index) +IDProperty *ffmpeg_property_add(RenderData *rd, const char *type, int opt_index, int parent_index) { AVCodecContext c; const AVOption * o; diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index 4daa27a5c72..8ead7bf5f17 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -85,11 +85,11 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis); void BLI_bvhtree_free(BVHTree *tree); /* construct: first insert points, then call balance */ -int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints); +int BLI_bvhtree_insert(BVHTree *tree, int index, const float *co, int numpoints); void BLI_bvhtree_balance(BVHTree *tree); /* update: first update points/nodes, then call update_tree to refit the bounding volumes */ -int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints); +int BLI_bvhtree_update_node(BVHTree *tree, int index, const float *co, const float *co_moving, int numpoints); void BLI_bvhtree_update_tree(BVHTree *tree); /* collision/overlap: check two trees if they overlap, alloc's *overlap with length of the int return value */ @@ -98,14 +98,14 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, unsigned int float BLI_bvhtree_getepsilon(BVHTree *tree); /* find nearest node to the given coordinates (if nearest is given it will only search nodes where square distance is smaller than nearest->dist) */ -int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata); +int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata); -int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata); +int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata); -float BLI_bvhtree_bb_raycast(float *bv, float *light_start, float *light_end, float *pos); +float BLI_bvhtree_bb_raycast(float *bv, const float light_start[3], const float light_end[3], float pos[3]); /* range query */ -int BLI_bvhtree_range_query(BVHTree *tree, const float *co, float radius, BVHTree_RangeQuery callback, void *userdata); +int BLI_bvhtree_range_query(BVHTree *tree, const float co[3], float radius, BVHTree_RangeQuery callback, void *userdata); #ifdef __cplusplus } diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index e259071a27a..2b9d6d2d6d6 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -54,11 +54,18 @@ MINLINE void swap_v2_v2(float a[2], float b[2]); MINLINE void swap_v3_v3(float a[3], float b[3]); MINLINE void swap_v4_v4(float a[4], float b[4]); +/* char */ +MINLINE void copy_v2_v2_char(char r[2], const char a[2]); +MINLINE void copy_v3_v3_char(char r[3], const char a[3]); +MINLINE void copy_v4_v4_char(char r[4], const char a[4]); /* short */ MINLINE void copy_v2_v2_short(short r[2], const short a[2]); MINLINE void copy_v3_v3_short(short r[3], const short a[3]); MINLINE void copy_v4_v4_short(short r[4], const short a[4]); - +/* int */ +MINLINE void copy_v2_v2_int(int r[2], const int a[2]); +MINLINE void copy_v3_v3_int(int r[3], const int a[3]); +MINLINE void copy_v4_v4_int(int r[4], const int a[4]); /********************************* Arithmetic ********************************/ diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h index 10a0787adf2..a513b9f9e85 100644 --- a/source/blender/blenlib/BLI_threads.h +++ b/source/blender/blenlib/BLI_threads.h @@ -75,6 +75,7 @@ int BLI_system_thread_count(void); /* gets the number of threads the system can #define LOCK_RCACHE 4 #define LOCK_OPENGL 5 #define LOCK_NODES 6 +#define LOCK_MOVIECLIP 7 void BLI_lock_thread(int type); void BLI_unlock_thread(int type); diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index d1734151b4a..f01777bdce1 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -387,7 +387,7 @@ static void build_skip_links(BVHTree *tree, BVHNode *node, BVHNode *left, BVHNod /* * BVHTree bounding volumes functions */ -static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoints, int moving) +static void create_kdop_hull(BVHTree *tree, BVHNode *node, const float *co, int numpoints, int moving) { float newminmax; float *bv = node->bv; @@ -973,7 +973,7 @@ void BLI_bvhtree_balance(BVHTree *tree) //bvhtree_info(tree); } -int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints) +int BLI_bvhtree_insert(BVHTree *tree, int index, const float *co, int numpoints) { int i; BVHNode *node = NULL; @@ -1005,7 +1005,7 @@ int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints) // call before BLI_bvhtree_update_tree() -int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints) +int BLI_bvhtree_update_node(BVHTree *tree, int index, const float *co, const float *co_moving, int numpoints) { int i; BVHNode *node= NULL; @@ -1194,7 +1194,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, unsigned int } //Determines the nearest point of the given node BV. Returns the squared distance to that point. -static float calc_nearest_point(const float *proj, BVHNode *node, float *nearest) +static float calc_nearest_point(const float proj[3], BVHNode *node, float *nearest) { int i; const float *bv = node->bv; @@ -1212,7 +1212,7 @@ static float calc_nearest_point(const float *proj, BVHNode *node, float *nearest /* //nearest on a general hull - VECCOPY(nearest, data->co); + copy_v3_v3(nearest, data->co); for(i = data->tree->start_axis; i != data->tree->stop_axis; i++, bv+=2) { float proj = dot_v3v3( nearest, KDOP_AXES[i]); @@ -1221,11 +1221,11 @@ static float calc_nearest_point(const float *proj, BVHNode *node, float *nearest if(dl > 0) { - VECADDFAC(nearest, nearest, KDOP_AXES[i], dl); + madd_v3_v3fl(nearest, KDOP_AXES[i], dl); } else if(du < 0) { - VECADDFAC(nearest, nearest, KDOP_AXES[i], du); + madd_v3_v3fl(nearest, KDOP_AXES[i], du); } } */ @@ -1377,7 +1377,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node) #endif -int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata) +int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata) { int i; @@ -1510,7 +1510,7 @@ static void dfs_raycast(BVHRayCastData *data, BVHNode *node) { data->hit.index = node->index; data->hit.dist = dist; - VECADDFAC(data->hit.co, data->ray.origin, data->ray.direction, dist); + madd_v3_v3v3fl(data->hit.co, data->ray.origin, data->ray.direction, dist); } } else @@ -1553,7 +1553,7 @@ static void iterative_raycast(BVHRayCastData *data, BVHNode *node) { data->hit.index = node->index; data->hit.dist = dist; - VECADDFAC(data->hit.co, data->ray.origin, data->ray.direction, dist); + madd_v3_v3v3fl(data->hit.co, data->ray.origin, data->ray.direction, dist); } node = node->skip[1]; @@ -1566,7 +1566,7 @@ static void iterative_raycast(BVHRayCastData *data, BVHNode *node) } #endif -int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata) +int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata) { int i; BVHRayCastData data; @@ -1577,8 +1577,8 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float data.callback = callback; data.userdata = userdata; - VECCOPY(data.ray.origin, co); - VECCOPY(data.ray.direction, dir); + copy_v3_v3(data.ray.origin, co); + copy_v3_v3(data.ray.direction, dir); data.ray.radius = radius; normalize_v3(data.ray.direction); @@ -1620,7 +1620,7 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float return data.hit.index; } -float BLI_bvhtree_bb_raycast(float *bv, float *light_start, float *light_end, float *pos) +float BLI_bvhtree_bb_raycast(float *bv, const float light_start[3], const float light_end[3], float pos[3]) { BVHRayCastData data; float dist = 0.0; @@ -1639,13 +1639,13 @@ float BLI_bvhtree_bb_raycast(float *bv, float *light_start, float *light_end, fl data.ray.origin[2] = light_start[2]; normalize_v3(data.ray.direction); - VECCOPY(data.ray_dot_axis, data.ray.direction); + copy_v3_v3(data.ray_dot_axis, data.ray.direction); dist = ray_nearest_hit(&data, bv); if(dist > 0.0f) { - VECADDFAC(pos, light_start, data.ray.direction, dist); + madd_v3_v3v3fl(pos, light_start, data.ray.direction, dist); } return dist; @@ -1706,7 +1706,7 @@ static void dfs_range_query(RangeQueryData *data, BVHNode *node) } } -int BLI_bvhtree_range_query(BVHTree *tree, const float *co, float radius, BVHTree_RangeQuery callback, void *userdata) +int BLI_bvhtree_range_query(BVHTree *tree, const float co[3], float radius, BVHTree_RangeQuery callback, void *userdata) { BVHNode * root = tree->nodes[tree->totleaf]; diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 259b25e67dd..8ad79dd819a 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -362,7 +362,7 @@ static int rewrite_path_alloc(char **path, BPathVisitor visit_cb, const char *ab void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int flag, void *bpath_user_data) { Image *ima; - const char *absbase= (flag & BPATH_TRAVERSE_ABS) ? (id->lib ? id->lib->filepath : bmain->name) : NULL; + const char *absbase= (flag & BPATH_TRAVERSE_ABS) ? ID_BLEND_PATH(bmain, id) : NULL; if ((flag & BPATH_TRAVERSE_SKIP_LIBRARY) && id->lib) { return; diff --git a/source/blender/blenlib/intern/graph.c b/source/blender/blenlib/intern/graph.c index 6dd278ed777..d0d3d0e137e 100644 --- a/source/blender/blenlib/intern/graph.c +++ b/source/blender/blenlib/intern/graph.c @@ -823,14 +823,14 @@ static void testAxialSymmetry(BGraph *graph, BNode* root_node, BNode* node1, BNo } /* mirror node2 along axis */ - VECCOPY(p, node2->p); + copy_v3_v3(p, node2->p); BLI_mirrorAlongAxis(p, root_node->p, nor); /* check if it's within limit before continuing */ if (len_v3v3(node1->p, p) <= limit) { /* mark node as symmetric physically */ - VECCOPY(root_node->symmetry_axis, nor); + copy_v3_v3(root_node->symmetry_axis, nor); root_node->symmetry_flag |= SYM_PHYSICAL; root_node->symmetry_flag |= SYM_AXIAL; diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index c460b69679b..1c7d131c750 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -78,6 +78,28 @@ MINLINE void copy_v4_v4(float r[4], const float a[4]) } /* short */ +MINLINE void copy_v2_v2_char(char r[2], const char a[2]) +{ + r[0]= a[0]; + r[1]= a[1]; +} + +MINLINE void copy_v3_v3_char(char r[3], const char a[3]) +{ + r[0]= a[0]; + r[1]= a[1]; + r[2]= a[2]; +} + +MINLINE void copy_v4_v4_char(char r[4], const char a[4]) +{ + r[0]= a[0]; + r[1]= a[1]; + r[2]= a[2]; + r[3]= a[3]; +} + +/* short */ MINLINE void copy_v2_v2_short(short r[2], const short a[2]) { r[0]= a[0]; @@ -99,6 +121,28 @@ MINLINE void copy_v4_v4_short(short r[4], const short a[4]) r[3]= a[3]; } +/* int */ +MINLINE void copy_v2_v2_int(int r[2], const int a[2]) +{ + r[0]= a[0]; + r[1]= a[1]; +} + +MINLINE void copy_v3_v3_int(int r[3], const int a[3]) +{ + r[0]= a[0]; + r[1]= a[1]; + r[2]= a[2]; +} + +MINLINE void copy_v4_v4_int(int r[4], const int a[4]) +{ + r[0]= a[0]; + r[1]= a[1]; + r[2]= a[2]; + r[3]= a[3]; +} + MINLINE void swap_v2_v2(float a[2], float b[2]) { SWAP(float, a[0], b[0]); diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index d472f43accd..38b3fe669b6 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -114,6 +114,7 @@ static pthread_mutex_t _custom1_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t _rcache_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t _opengl_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t _nodes_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t _movieclip_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_t mainid; static int thread_levels= 0; /* threads can be invoked inside threads */ @@ -350,6 +351,8 @@ void BLI_lock_thread(int type) pthread_mutex_lock(&_opengl_lock); else if (type==LOCK_NODES) pthread_mutex_lock(&_nodes_lock); + else if (type==LOCK_MOVIECLIP) + pthread_mutex_lock(&_movieclip_lock); } void BLI_unlock_thread(int type) @@ -368,6 +371,8 @@ void BLI_unlock_thread(int type) pthread_mutex_unlock(&_opengl_lock); else if(type==LOCK_NODES) pthread_mutex_unlock(&_nodes_lock); + else if(type==LOCK_MOVIECLIP) + pthread_mutex_unlock(&_movieclip_lock); } /* Mutex Locks */ diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 3f08e2301a7..6e4dcb66bfb 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -301,11 +301,17 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil /* makes lookup of existing images in old main */ blo_make_image_pointer_map(fd, oldmain); + /* makes lookup of existing video clips in old main */ + blo_make_movieclip_pointer_map(fd, oldmain); + bfd= blo_read_file_internal(fd, filename); /* ensures relinked images are not freed */ blo_end_image_pointer_map(fd, oldmain); + /* ensures relinked movie clips are not freed */ + blo_end_movieclip_pointer_map(fd, oldmain); + /* move libraries from old main to new main */ if(bfd && mainlist.first!=mainlist.last) { diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 2711c072a8f..a870dcc2e94 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -89,6 +89,7 @@ #include "DNA_space_types.h" #include "DNA_vfont_types.h" #include "DNA_world_types.h" +#include "DNA_movieclip_types.h" #include "MEM_guardedalloc.h" @@ -130,6 +131,7 @@ #include "BKE_screen.h" #include "BKE_sequencer.h" #include "BKE_texture.h" // for open_plugin_tex +#include "BKE_tracking.h" #include "BKE_utildefines.h" // SWITCH_INT DATA ENDB DNA1 O_BINARY GLOB USER TEST REND #include "BKE_sound.h" @@ -1038,6 +1040,8 @@ void blo_freefiledata(FileData *fd) oldnewmap_free(fd->globmap); if (fd->imamap) oldnewmap_free(fd->imamap); + if (fd->movieclipmap) + oldnewmap_free(fd->movieclipmap); if (fd->libmap && !(fd->flags & FD_FLAGS_NOT_MY_LIBMAP)) oldnewmap_free(fd->libmap); if (fd->bheadmap) @@ -1113,6 +1117,13 @@ static void *newimaadr(FileData *fd, void *adr) /* used to restore image data a return NULL; } +static void *newmclipadr(FileData *fd, void *adr) /* used to restore movie clip data after undo */ +{ + if(fd->movieclipmap && adr) + return oldnewmap_lookup_and_inc(fd->movieclipmap, adr); + return NULL; +} + static void *newlibadr(FileData *fd, void *lib, void *adr) /* only lib data */ { @@ -1241,6 +1252,62 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain) } } +void blo_make_movieclip_pointer_map(FileData *fd, Main *oldmain) +{ + MovieClip *clip= oldmain->movieclip.first; + Scene *sce= oldmain->scene.first; + + fd->movieclipmap= oldnewmap_new(); + + for(;clip; clip= clip->id.next) { + if(clip->cache) + oldnewmap_insert(fd->movieclipmap, clip->cache, clip->cache, 0); + + if(clip->tracking.camera.intrinsics) + oldnewmap_insert(fd->movieclipmap, clip->tracking.camera.intrinsics, clip->tracking.camera.intrinsics, 0); + } + + for(; sce; sce= sce->id.next) { + if(sce->nodetree) { + bNode *node; + for(node= sce->nodetree->nodes.first; node; node= node->next) + if(node->type==CMP_NODE_MOVIEDISTORTION) + oldnewmap_insert(fd->movieclipmap, node->storage, node->storage, 0); + } + } +} + +/* set old main movie clips caches to zero if it has been restored */ +/* this works because freeing old main only happens after this call */ +void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain) +{ + OldNew *entry= fd->movieclipmap->entries; + MovieClip *clip= oldmain->movieclip.first; + Scene *sce= oldmain->scene.first; + int i; + + /* used entries were restored, so we put them to zero */ + for (i=0; i<fd->movieclipmap->nentries; i++, entry++) { + if (entry->nr>0) + entry->newp= NULL; + } + + for(;clip; clip= clip->id.next) { + clip->cache= newmclipadr(fd, clip->cache); + clip->tracking.camera.intrinsics= newmclipadr(fd, clip->tracking.camera.intrinsics); + } + + for(; sce; sce= sce->id.next) { + if(sce->nodetree) { + bNode *node; + for(node= sce->nodetree->nodes.first; node; node= node->next) + if(node->type==CMP_NODE_MOVIEDISTORTION) + node->storage= newmclipadr(fd, node->storage); + } + } +} + + /* undo file support: add all library pointers in lookup */ void blo_add_library_pointer_map(ListBase *mainlist, FileData *fd) { @@ -2227,7 +2294,11 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree) link_list(fd, &node->inputs); link_list(fd, &node->outputs); - node->storage= newdataadr(fd, node->storage); + if(node->type == CMP_NODE_MOVIEDISTORTION) { + node->storage= newmclipadr(fd, node->storage); + } else + node->storage= newdataadr(fd, node->storage); + if(node->storage) { /* could be handlerized at some point */ if(ntree->type==NTREE_SHADER && (node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB)) @@ -3994,6 +4065,7 @@ static void direct_link_pose(FileData *fd, bPose *pose) direct_link_motionpath(fd, pchan->mpath); pchan->iktree.first= pchan->iktree.last= NULL; + pchan->siktree.first= pchan->siktree.last= NULL; /* incase this value changes in future, clamp else we get undefined behavior */ CLAMP(pchan->rotmode, ROT_MODE_MIN, ROT_MODE_MAX); @@ -4447,7 +4519,7 @@ static void direct_link_object(FileData *fd, Object *ob) * a hook we need to make sure it gets converted * and free'd, regardless of version. */ - VECCOPY(hmd->cent, hook->cent); + copy_v3_v3(hmd->cent, hook->cent); hmd->falloff = hook->falloff; hmd->force = hook->force; hmd->indexar = hook->indexar; @@ -4574,6 +4646,8 @@ static void lib_link_scene(FileData *fd, Main *main) marker->camera= newlibadr(fd, sce->id.lib, marker->camera); } } +#else + (void)marker; #endif if(sce->ed) @@ -4795,6 +4869,7 @@ static void direct_link_scene(FileData *fd, Scene *sce) if(sce->nodetree) direct_link_nodetree(fd, sce->nodetree); + sce->clip= newlibadr_us(fd, sce->id.lib, sce->clip); } /* ************ READ WM ***************** */ @@ -4949,6 +5024,7 @@ static void lib_link_screen(FileData *fd, Main *main) for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) { bgpic->ima= newlibadr_us(fd, sc->id.lib, bgpic->ima); + bgpic->clip= newlibadr_us(fd, sc->id.lib, bgpic->clip); } if(v3d->localvd) { v3d->localvd->camera= newlibadr(fd, sc->id.lib, v3d->localvd->camera); @@ -5071,6 +5147,14 @@ static void lib_link_screen(FileData *fd, Main *main) snode->linkdrag.first = snode->linkdrag.last = NULL; } + else if(sl->spacetype==SPACE_CLIP) { + SpaceClip *sclip= (SpaceClip *)sl; + + sclip->clip= newlibadr_us(fd, sc->id.lib, sclip->clip); + + sclip->scopes.track_preview = NULL; + sclip->scopes.ok = 0; + } } sa= sa->next; } @@ -5158,6 +5242,7 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) { bgpic->ima= restore_pointer_by_name(newmain, (ID *)bgpic->ima, 1); + bgpic->clip= restore_pointer_by_name(newmain, (ID *)bgpic->clip, 1); } if(v3d->localvd) { /*Base *base;*/ @@ -5300,6 +5385,13 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) snode->nodetree= restore_pointer_by_name(newmain, &snode->nodetree->id, 1); } } + else if(sl->spacetype==SPACE_CLIP) { + SpaceClip *sclip= (SpaceClip *)sl; + + sclip->clip= restore_pointer_by_name(newmain, (ID *)sclip->clip, 1); + + sclip->scopes.ok = 0; + } } sa= sa->next; } @@ -5783,6 +5875,55 @@ static void lib_link_group(FileData *fd, Main *main) } } +/* ***************** READ MOVIECLIP *************** */ + +static void direct_link_movieclip(FileData *fd, MovieClip *clip) +{ + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *track; + + if(fd->movieclipmap) clip->cache= newmclipadr(fd, clip->cache); + else clip->cache= NULL; + + if(fd->movieclipmap) clip->tracking.camera.intrinsics= newmclipadr(fd, clip->tracking.camera.intrinsics); + else clip->tracking.camera.intrinsics= NULL; + + tracking->reconstruction.cameras= newdataadr(fd, tracking->reconstruction.cameras); + + link_list(fd, &tracking->tracks); + + track= tracking->tracks.first; + while(track) { + track->markers= newdataadr(fd, track->markers); + + track= track->next; + } + + clip->tracking.act_track= newdataadr(fd, clip->tracking.act_track); + + clip->anim= NULL; + clip->tracking_context= NULL; + + clip->tracking.stabilization.ok= 0; + clip->tracking.stabilization.scaleibuf= NULL; + clip->tracking.stabilization.rot_track= newdataadr(fd, clip->tracking.stabilization.rot_track); +} + +static void lib_link_movieclip(FileData *fd, Main *main) +{ + MovieClip *clip; + + clip= main->movieclip.first; + while(clip) { + if(clip->id.flag & LIB_NEEDLINK) { + clip->gpd= newlibadr_us(fd, clip->id.lib, clip->gpd); + + clip->id.flag -= LIB_NEEDLINK; + } + clip= clip->id.next; + } +} + /* ************** GENERAL & MAIN ******************** */ @@ -5817,6 +5958,7 @@ static const char *dataname(short id_code) case ID_BR: return "Data from BR"; case ID_PA: return "Data from PA"; case ID_GD: return "Data from GD"; + case ID_MC: return "Data from MC"; } return "Data from Lib Block"; @@ -5986,6 +6128,9 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID case ID_GD: direct_link_gpencil(fd, (bGPdata *)id); break; + case ID_MC: + direct_link_movieclip(fd, (MovieClip *)id); + break; } /*link direct data of ID properties*/ @@ -7188,7 +7333,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) while(ob) { if(ob->transflag & 1) { ob->transflag -= 1; - ob->ipoflag |= OB_OFFS_OB; + //ob->ipoflag |= OB_OFFS_OB; } ob= ob->id.next; } @@ -7219,7 +7364,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } ob= main->object.first; while(ob) { - ob->ipoflag |= OB_OFFS_PARENT; + //ob->ipoflag |= OB_OFFS_PARENT; if(ob->dt==0) ob->dt= OB_SOLID; ob= ob->id.next; } @@ -9640,7 +9785,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) part->obfac = paf->obfac; part->randfac = paf->randfac * 25.0f; part->dampfac = paf->damp; - VECCOPY(part->acc, paf->force); + copy_v3_v3(part->acc, paf->force); /* flags */ if(paf->stype & PAF_VECT) { @@ -10691,7 +10836,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) tot= MIN2(me->totvert, key->refkey->totelem); for(a=0; a<tot; a++, data+=3) - VECCOPY(me->mvert[a].co, data) + copy_v3_v3(me->mvert[a].co, data); } } @@ -10701,7 +10846,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) tot= MIN2(lt->pntsu*lt->pntsv*lt->pntsw, key->refkey->totelem); for(a=0; a<tot; a++, data+=3) - VECCOPY(lt->def[a].vec, data) + copy_v3_v3(lt->def[a].vec, data); } } @@ -10714,9 +10859,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main) BezTriple *bezt = nu->bezt; for(a=0; a<nu->pntsu; a++, bezt++) { - VECCOPY(bezt->vec[0], data); data+=3; - VECCOPY(bezt->vec[1], data); data+=3; - VECCOPY(bezt->vec[2], data); data+=3; + copy_v3_v3(bezt->vec[0], data); data+=3; + copy_v3_v3(bezt->vec[1], data); data+=3; + copy_v3_v3(bezt->vec[2], data); data+=3; bezt->alfa= *data; data++; } } @@ -10724,7 +10869,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) BPoint *bp = nu->bp; for(a=0; a<nu->pntsu*nu->pntsv; a++, bp++) { - VECCOPY(bp->vec, data); data+=3; + copy_v3_v3(bp->vec, data); data+=3; bp->alfa= *data; data++; } } @@ -12154,7 +12299,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ma= ma->id.next; } } - } if (main->versionfile < 260){ @@ -12190,7 +12334,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } } - } if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 1)){ @@ -12214,7 +12357,65 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* put compatibility code here until next subversion bump */ { - + { + bScreen *sc; + MovieClip *clip; + + for (sc= main->screen.first; sc; sc= sc->id.next) { + ScrArea *sa; + for (sa= sc->areabase.first; sa; sa= sa->next) { + SpaceLink *sl; + for (sl= sa->spacedata.first; sl; sl= sl->next) { + if(sl->spacetype==SPACE_VIEW3D) { + View3D *v3d= (View3D *)sl; + if(v3d->bundle_size==0.0f) { + v3d->bundle_size= 0.2f; + v3d->flag2 |= V3D_SHOW_RECONSTRUCTION; + } + else if(sl->spacetype==SPACE_CLIP) { + SpaceClip *sc= (SpaceClip *)sl; + if(sc->scopes.track_preview_height==0) + sc->scopes.track_preview_height= 120; + } + + if(v3d->bundle_drawtype==0) + v3d->bundle_drawtype= OB_PLAINAXES; + } + } + } + } + + for (clip= main->movieclip.first; clip; clip= clip->id.next) { + MovieTrackingTrack *track; + + if(clip->aspx<1.0f) { + clip->aspx= 1.0f; + clip->aspy= 1.0f; + } + + /* XXX: a bit hacky, probably include imbuf and use real constants are nicer */ + clip->proxy.build_tc_flag= 7; + if(clip->proxy.build_size_flag==0) + clip->proxy.build_size_flag= 1; + + if(clip->proxy.quality==0) + clip->proxy.quality= 90; + + if(clip->tracking.camera.pixel_aspect<0.01f) + clip->tracking.camera.pixel_aspect= 1.f; + + track= clip->tracking.tracks.first; + while(track) { + if(track->pyramid_levels==0) + track->pyramid_levels= 2; + + if(track->minimum_correlation==0.0f) + track->minimum_correlation= 0.75f; + + track= track->next; + } + } + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ @@ -12261,6 +12462,7 @@ static void lib_link_all(FileData *fd, Main *main) lib_link_nodetree(fd, main); /* has to be done after scene/materials, this will verify group nodes */ lib_link_brush(fd, main); lib_link_particlesettings(fd, main); + lib_link_movieclip(fd, main); lib_link_mesh(fd, main); /* as last: tpage images with users at zero */ @@ -13409,7 +13611,7 @@ static void give_base_to_groups(Main *mainvar, Scene *scene) ob->dup_group= group; ob->transflag |= OB_DUPLIGROUP; rename_id(&ob->id, group->id.name+2); - VECCOPY(ob->loc, scene->cursor); + copy_v3_v3(ob->loc, scene->cursor); } } } diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index fdb567a7dce..358a7659d51 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -78,6 +78,7 @@ typedef struct FileData { struct OldNewMap *globmap; struct OldNewMap *libmap; struct OldNewMap *imamap; + struct OldNewMap *movieclipmap; struct bheadsort *bheadmap; int tot_bheadmap; @@ -120,6 +121,8 @@ FileData *blo_openblendermemfile(struct MemFile *memfile, struct ReportList *rep void blo_clear_proxy_pointers_from_lib(Main *oldmain); void blo_make_image_pointer_map(FileData *fd, Main *oldmain); void blo_end_image_pointer_map(FileData *fd, Main *oldmain); +void blo_make_movieclip_pointer_map(FileData *fd, Main *oldmain); +void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain); void blo_add_library_pointer_map(ListBase *mainlist, FileData *fd); void blo_freefiledata( FileData *fd); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index cb94ebcf8f1..11a80d0d41a 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -129,6 +129,7 @@ Any case: direct data is ALWAYS after the lib block #include "DNA_vfont_types.h" #include "DNA_world_types.h" #include "DNA_windowmanager_types.h" +#include "DNA_movieclip_types.h" #include "MEM_guardedalloc.h" // MEM_freeN #include "BLI_blenlib.h" @@ -711,6 +712,8 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree) write_curvemapping(wd, node->storage); else if(ntree->type==NTREE_TEXTURE && (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME) ) write_curvemapping(wd, node->storage); + else if(ntree->type==NTREE_COMPOSIT && node->type==CMP_NODE_MOVIEDISTORTION) + /* pass */ ; else writestruct(wd, DATA, node->typeinfo->storagename, 1, node->storage); } @@ -2284,6 +2287,9 @@ static void write_screens(WriteData *wd, ListBase *scrbase) else if(sl->spacetype==SPACE_USERPREF) { writestruct(wd, DATA, "SpaceUserPref", 1, sl); } + else if(sl->spacetype==SPACE_CLIP) { + writestruct(wd, DATA, "SpaceClip", 1, sl); + } sl= sl->next; } @@ -2532,6 +2538,38 @@ static void write_scripts(WriteData *wd, ListBase *idbase) } } +static void write_movieclips(WriteData *wd, ListBase *idbase) +{ + MovieClip *clip; + + clip= idbase->first; + while(clip) { + if(clip->id.us>0 || wd->current) { + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *track; + writestruct(wd, ID_MC, "MovieClip", 1, clip); + + if(tracking->reconstruction.camnr) + writestruct(wd, DATA, "MovieReconstructedCamera", tracking->reconstruction.camnr, tracking->reconstruction.cameras); + + track= tracking->tracks.first; + while(track) { + writestruct(wd, DATA, "MovieTrackingTrack", 1, track); + + if(track->markers) + writestruct(wd, DATA, "MovieTrackingMarker", track->markersnr, track->markers); + + track= track->next; + } + } + + clip= clip->id.next; + } + + /* flush helps the compression for undo-save */ + mywrite(wd, MYWRITE_FLUSH, 0); +} + /* context is usually defined by WM, two cases where no WM is available: * - for forward compatibility, curscreen has to be saved * - for undofile, curscene needs to be saved */ @@ -2608,6 +2646,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil write_windowmanagers(wd, &mainvar->wm); write_screens (wd, &mainvar->screen); } + write_movieclips (wd, &mainvar->movieclip); write_scenes (wd, &mainvar->scene); write_curves (wd, &mainvar->curve); write_mballs (wd, &mainvar->mball); diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index b115a96cfa1..7bd70e9f289 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -759,7 +759,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames , Ob for (it = frames.begin(); it != frames.end(); it++) { float mat[4][4], ipar[4][4]; - float ctime = bsystem_time(scene, ob_arm, *it, 0.0f); + float ctime = BKE_frame_to_ctime(scene, *it); BKE_animsys_evaluate_animdata(scene , &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM); where_is_pose_bone(scene, ob_arm, pchan, ctime, 1); @@ -1265,7 +1265,7 @@ void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, i for (it = frames.begin(); it != frames.end(); it++) { float mat[4][4], ipar[4][4]; - float ctime = bsystem_time(scene, ob_arm, *it, 0.0f); + float ctime = BKE_frame_to_ctime(scene, *it); BKE_animsys_evaluate_animdata(scene , &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM); diff --git a/source/blender/collada/AnimationExporter.h b/source/blender/collada/AnimationExporter.h index 7f6c99b108f..c3a5c7a5383 100644 --- a/source/blender/collada/AnimationExporter.h +++ b/source/blender/collada/AnimationExporter.h @@ -38,6 +38,7 @@ extern "C" #include "BKE_DerivedMesh.h" #include "BKE_fcurve.h" #include "BKE_animsys.h" +#include "BKE_scene.h" #ifdef NAN_BUILDINFO extern char build_rev[]; #endif diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 8cdb1065699..267aa925c74 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -54,7 +54,9 @@ #include "BLI_string.h" #include "BLI_utildefines.h" +#include "BKE_camera.h" #include "BKE_main.h" +#include "BKE_lamp.h" #include "BKE_library.h" #include "BKE_texture.h" #include "BKE_fcurve.h" diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt index 7b7d11bd487..088376b20ef 100644 --- a/source/blender/editors/CMakeLists.txt +++ b/source/blender/editors/CMakeLists.txt @@ -35,6 +35,7 @@ if(WITH_BLENDER) add_subdirectory(space_action) add_subdirectory(space_api) add_subdirectory(space_buttons) + add_subdirectory(space_clip) add_subdirectory(space_console) add_subdirectory(space_file) add_subdirectory(space_graph) diff --git a/source/blender/editors/SConscript b/source/blender/editors/SConscript index a1b766ec2be..ed66a76a324 100644 --- a/source/blender/editors/SConscript +++ b/source/blender/editors/SConscript @@ -17,6 +17,7 @@ SConscript(['datafiles/SConscript', 'render/SConscript', 'sound/SConscript', 'space_buttons/SConscript', + 'space_clip/SConscript', 'space_file/SConscript', 'space_image/SConscript', 'space_info/SConscript', diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index e8af5a8f290..f0f3b8f4123 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -176,13 +176,13 @@ static void acf_generic_channel_color(bAnimContext *ac, bAnimListElem *ale, floa unsigned char cp[3]; if (indent == 2) { - VECCOPY(cp, grp->cs.solid); + copy_v3_v3_char((char *)cp, grp->cs.solid); } else if (indent == 1) { - VECCOPY(cp, grp->cs.select); + copy_v3_v3_char((char *)cp, grp->cs.select); } else { - VECCOPY(cp, grp->cs.active); + copy_v3_v3_char((char *)cp, grp->cs.active); } /* copy the colors over, transforming from bytes to floats */ diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 2774bd2cda4..569125e1055 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -237,28 +237,6 @@ void ANIM_draw_cfra (const bContext *C, View2D *v2d, short flag) glVertex2fv(vec); glEnd(); - /* Draw dark green line if slow-parenting/time-offset is enabled */ - if (flag & DRAWCFRA_SHOW_TIMEOFS) { - Object *ob= OBACT; - if(ob) { - float timeoffset= give_timeoffset(ob); - // XXX ob->ipoflag is depreceated! - if ((ob->ipoflag & OB_OFFS_OB) && (timeoffset != 0.0f)) { - vec[0]-= timeoffset; /* could avoid calling twice */ - - UI_ThemeColorShade(TH_CFRAME, -30); - - glBegin(GL_LINE_STRIP); - /*vec[1]= v2d->cur.ymax;*/ // this is set already. this line is only included - glVertex2fv(vec); - - vec[1]= v2d->cur.ymin; - glVertex2fv(vec); - glEnd(); - } - } - } - glLineWidth(1.0); /* Draw current frame number in a little box */ diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 4a359acabd9..aa1af231afd 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -1069,6 +1069,8 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera) WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene); } +#else + (void)camera; #endif WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL); @@ -1493,6 +1495,8 @@ void ED_marker_keymap(wmKeyConfig *keyconf) kmi= WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "extend", 1); RNA_boolean_set(kmi->ptr, "camera", 1); +#else + (void)kmi; #endif WM_keymap_verify_item(keymap, "MARKER_OT_select_border", BKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index fb34245d338..9f466ef52d3 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -911,20 +911,6 @@ short insert_keyframe (ReportList *reports, ID *id, bAction *act, const char gro /* apply NLA-mapping to frame to use (if applicable) */ cfra= BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP); } - -#if 0 - /* apply special time tweaking */ - // XXX check on this stuff... - if (GS(id->name) == ID_OB) { - //Object *ob= (Object *)id; - - /* ancient time-offset cruft */ - //if ( (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)) ) { - // /* actually frametofloat calc again! */ - // cfra-= give_timeoffset(ob)*scene->r.framelen; - //} - } -#endif /* key entire array convenience method */ if (array_index == -1) { @@ -1018,20 +1004,6 @@ short delete_keyframe (ReportList *reports, ID *id, bAction *act, const char gro } } -#if 0 - /* apply special time tweaking */ - // XXX check on this stuff... - if (GS(id->name) == ID_OB) { - //Object *ob= (Object *)id; - - /* ancient time-offset cruft */ - //if ( (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)) ) { - // /* actually frametofloat calc again! */ - // cfra-= give_timeoffset(ob)*scene->r.framelen; - //} - } -#endif - /* key entire array convenience method */ if (array_index == -1) { array_index= 0; diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h index 47123b7fb4d..87254c20c0f 100644 --- a/source/blender/editors/armature/armature_intern.h +++ b/source/blender/editors/armature/armature_intern.h @@ -173,7 +173,7 @@ void poseAnim_mapping_refresh(struct bContext *C, struct Scene *scene, struct Ob void poseAnim_mapping_reset(ListBase *pfLinks); void poseAnim_mapping_autoKeyframe(struct bContext *C, struct Scene *scene, struct Object *ob, ListBase *pfLinks, float cframe); -LinkData *poseAnim_mapping_getNextFCurve(ListBase *fcuLinks, LinkData *prev, char *path); +LinkData *poseAnim_mapping_getNextFCurve(ListBase *fcuLinks, LinkData *prev, const char *path); /* ******************************************************* */ /* PoseLib */ @@ -209,13 +209,13 @@ void BIF_sk_selectStroke(struct bContext *C, const int mval[2], short extend); /* duplicate method */ void preEditBoneDuplicate(struct ListBase *editbones); -struct EditBone *duplicateEditBone(struct EditBone *curBone, char *name, struct ListBase *editbones, struct Object *ob); +struct EditBone *duplicateEditBone(struct EditBone *curBone, const char *name, struct ListBase *editbones, struct Object *ob); void updateDuplicateSubtarget(struct EditBone *dupBone, struct ListBase *editbones, struct Object *ob); /* duplicate method (cross objects */ /* editbones is the target list */ -struct EditBone *duplicateEditBoneObjects(struct EditBone *curBone, char *name, struct ListBase *editbones, struct Object *src_ob, struct Object *dst_ob); +struct EditBone *duplicateEditBoneObjects(struct EditBone *curBone, const char *name, struct ListBase *editbones, struct Object *src_ob, struct Object *dst_ob); /* editbones is the source list */ void updateDuplicateSubtargetObjects(struct EditBone *dupBone, struct ListBase *editbones, struct Object *src_ob, struct Object *dst_ob); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 15c8868f9b9..7376b2e804c 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -2523,7 +2523,7 @@ void updateDuplicateSubtarget(EditBone *dupBone, ListBase *editbones, Object *ob } -EditBone *duplicateEditBoneObjects(EditBone *curBone, char *name, ListBase *editbones, Object *src_ob, Object *dst_ob) +EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase *editbones, Object *src_ob, Object *dst_ob) { EditBone *eBone = MEM_mallocN(sizeof(EditBone), "addup_editbone"); @@ -2567,7 +2567,7 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, char *name, ListBase *edit return eBone; } -EditBone *duplicateEditBone(EditBone *curBone, char *name, ListBase *editbones, Object *ob) +EditBone *duplicateEditBone(EditBone *curBone, const char *name, ListBase *editbones, Object *ob) { return duplicateEditBoneObjects(curBone, name, editbones, ob, ob); } @@ -5319,7 +5319,7 @@ static void constraint_bone_name_fix(Object *ob, ListBase *conlist, char *oldnam /* called by UI for renaming a bone */ /* warning: make sure the original bone was not renamed yet! */ /* seems messy, but thats what you get with not using pointers but channel names :) */ -void ED_armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep) +void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *newnamep) { Object *ob; char newname[MAXBONENAME]; diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index 6f1da5757c6..b1651886620 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -157,14 +157,14 @@ static void getEditBoneRollUpAxis(EditBone *bone, float roll, float up_axis[3]) sub_v3_v3v3(nor, bone->tail, bone->head); vec_roll_to_mat3(nor, roll, mat); - VECCOPY(up_axis, mat[2]); + copy_v3_v3(up_axis, mat[2]); } static float rollBoneByQuatAligned(EditBone *bone, float old_up_axis[3], float qrot[4], float qroll[4], float aligned_axis[3]) { float nor[3], new_up_axis[3], x_axis[3], z_axis[3]; - VECCOPY(new_up_axis, old_up_axis); + copy_v3_v3(new_up_axis, old_up_axis); mul_qt_v3(qrot, new_up_axis); sub_v3_v3v3(nor, bone->tail, bone->head); @@ -236,7 +236,7 @@ static float rollBoneByQuatJoint(RigEdge *edge, RigEdge *previous, float qrot[4] mul_qt_v3(qroll, normal); - VECCOPY(new_up_axis, edge->up_axis); + copy_v3_v3(new_up_axis, edge->up_axis); mul_qt_v3(qrot, new_up_axis); normalize_v3(new_up_axis); @@ -252,7 +252,7 @@ float rollBoneByQuat(EditBone *bone, float old_up_axis[3], float qrot[4]) { float new_up_axis[3]; - VECCOPY(new_up_axis, old_up_axis); + copy_v3_v3(new_up_axis, old_up_axis); mul_qt_v3(qrot, new_up_axis); return ED_rollBoneToVector(bone, new_up_axis, FALSE); @@ -367,7 +367,7 @@ static RigNode *newRigNodeHead(RigGraph *rg, RigArc *arc, float p[3]) node = MEM_callocN(sizeof(RigNode), "rig node"); BLI_addtail(&rg->nodes, node); - VECCOPY(node->p, p); + copy_v3_v3(node->p, p); node->degree = 1; node->arcs = NULL; @@ -389,7 +389,7 @@ static RigNode *newRigNode(RigGraph *rg, float p[3]) node = MEM_callocN(sizeof(RigNode), "rig node"); BLI_addtail(&rg->nodes, node); - VECCOPY(node->p, p); + copy_v3_v3(node->p, p); node->degree = 0; node->arcs = NULL; @@ -412,12 +412,12 @@ static void RIG_appendEdgeToArc(RigArc *arc, RigEdge *edge) if (edge->prev == NULL) { - VECCOPY(edge->head, arc->head->p); + copy_v3_v3(edge->head, arc->head->p); } else { RigEdge *last_edge = edge->prev; - VECCOPY(edge->head, last_edge->tail); + copy_v3_v3(edge->head, last_edge->tail); RIG_calculateEdgeAngles(last_edge, edge); } @@ -434,7 +434,7 @@ static void RIG_addEdgeToArc(RigArc *arc, float tail[3], EditBone *bone) edge = MEM_callocN(sizeof(RigEdge), "rig edge"); - VECCOPY(edge->tail, tail); + copy_v3_v3(edge->tail, tail); edge->bone = bone; if (bone) @@ -489,10 +489,10 @@ static RigControl *cloneControl(RigGraph *rg, RigGraph *src_rg, RigControl *src_ ctrl = newRigControl(rg); - VECCOPY(ctrl->head, src_ctrl->head); - VECCOPY(ctrl->tail, src_ctrl->tail); - VECCOPY(ctrl->up_axis, src_ctrl->up_axis); - VECCOPY(ctrl->offset, src_ctrl->offset); + copy_v3_v3(ctrl->head, src_ctrl->head); + copy_v3_v3(ctrl->tail, src_ctrl->tail); + copy_v3_v3(ctrl->up_axis, src_ctrl->up_axis); + copy_v3_v3(ctrl->offset, src_ctrl->offset); ctrl->tail_mode = src_ctrl->tail_mode; ctrl->flag = src_ctrl->flag; @@ -531,9 +531,9 @@ static RigArc *cloneArc(RigGraph *rg, RigGraph *src_rg, RigArc *src_arc, GHash * edge = MEM_callocN(sizeof(RigEdge), "rig edge"); - VECCOPY(edge->head, src_edge->head); - VECCOPY(edge->tail, src_edge->tail); - VECCOPY(edge->up_axis, src_edge->up_axis); + copy_v3_v3(edge->head, src_edge->head); + copy_v3_v3(edge->tail, src_edge->tail); + copy_v3_v3(edge->up_axis, src_edge->up_axis); edge->length = src_edge->length; edge->angle = src_edge->angle; @@ -690,8 +690,8 @@ static void RIG_addControlBone(RigGraph *rg, EditBone *bone) { RigControl *ctrl = newRigControl(rg); ctrl->bone = bone; - VECCOPY(ctrl->head, bone->head); - VECCOPY(ctrl->tail, bone->tail); + copy_v3_v3(ctrl->head, bone->head); + copy_v3_v3(ctrl->tail, bone->tail); getEditBoneRollUpAxis(bone, bone->roll, ctrl->up_axis); ctrl->tail_mode = TL_NONE; @@ -765,7 +765,7 @@ static int RIG_parentControl(RigControl *ctrl, EditBone *link) ctrl->link = link; ctrl->flag = flag; - VECCOPY(ctrl->offset, offset); + copy_v3_v3(ctrl->offset, offset); return 1; } @@ -1146,7 +1146,7 @@ static void RIG_removeUneededOffsets(RigGraph *rg) BLI_remlink(&arc->edges, first_edge); MEM_freeN(first_edge); - VECCOPY(arc->head->p, next_edge->head); + copy_v3_v3(arc->head->p, next_edge->head); } } } @@ -1222,7 +1222,7 @@ static void RIG_removeUneededOffsets(RigGraph *rg) BLI_remlink(&arc->edges, first_edge); MEM_freeN(first_edge); - VECCOPY(arc->head->p, next_edge->head); + copy_v3_v3(arc->head->p, next_edge->head); /* remove null edge in other arcs too */ for (other_arc = rg->arcs.first; other_arc; other_arc = other_arc->next) @@ -1284,7 +1284,7 @@ static void RIG_removeUneededOffsets(RigGraph *rg) BLI_remlink(&arc->edges, last_edge); MEM_freeN(last_edge); - VECCOPY(arc->tail->p, previous_edge->tail); + copy_v3_v3(arc->tail->p, previous_edge->tail); previous_edge->angle = 0; } } @@ -1755,7 +1755,7 @@ static void finalizeControl(RigGraph *rigg, RigControl *ctrl, float resize) sub_v3_v3v3(v1, ctrl->bone->tail, ctrl->bone->head); sub_v3_v3v3(v2, tail_vec, ctrl->bone->head); - VECCOPY(ctrl->bone->tail, tail_vec); + copy_v3_v3(ctrl->bone->tail, tail_vec); rotation_between_vecs_to_quat(qtail, v1, v2); mul_qt_qtqt(ctrl->qrot, qtail, ctrl->qrot); @@ -1791,7 +1791,7 @@ static void repositionControl(RigGraph *rigg, RigControl *ctrl, float head[3], f { float parent_offset[3], tail_offset[3]; - VECCOPY(parent_offset, ctrl->offset); + copy_v3_v3(parent_offset, ctrl->offset); mul_v3_fl(parent_offset, resize); mul_qt_v3(qrot, parent_offset); @@ -1799,7 +1799,7 @@ static void repositionControl(RigGraph *rigg, RigControl *ctrl, float head[3], f ctrl->flag |= RIG_CTRL_HEAD_DONE; - QUATCOPY(ctrl->qrot, qrot); + copy_qt_qt(ctrl->qrot, qrot); if (ctrl->tail_mode == TL_NONE) { @@ -1836,8 +1836,8 @@ static void repositionBone(bContext *C, RigGraph *rigg, RigEdge *edge, float vec rotation_between_vecs_to_quat(qrot, v1, v2); - VECCOPY(bone->head, vec0); - VECCOPY(bone->tail, vec1); + copy_v3_v3(bone->head, vec0); + copy_v3_v3(bone->tail, vec1); if (!is_zero_v3(up_axis)) { diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 31be1efdc1f..b97e843529a 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -187,7 +187,7 @@ void BIF_makeListTemplates(const bContext *C) } } -char *BIF_listTemplates(const bContext *UNUSED(C)) +const char *BIF_listTemplates(const bContext *UNUSED(C)) { GHashIterator ghi; char menu_header[] = "Template%t|None%x0|"; @@ -624,7 +624,7 @@ static void drawSubdividedStrokeBy(ToolSettings *toolsettings, BArcIterator *ite gluQuadricNormals(quad, GLU_SMOOTH); iter->head(iter); - VECCOPY(head, iter->p); + copy_v3_v3(head, iter->p); index = next_subdividion(toolsettings, iter, bone_start, end, head, tail); while (index != -1) @@ -640,7 +640,7 @@ static void drawSubdividedStrokeBy(ToolSettings *toolsettings, BArcIterator *ite glPopMatrix(); - VECCOPY(head, tail); + copy_v3_v3(head, tail); bone_start = index; // start next bone from current index index = next_subdividion(toolsettings, iter, bone_start, end, head, tail); @@ -748,7 +748,7 @@ static SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones, if ((bone->flag & BONE_CONNECTED) == 0) { - VECCOPY(vec, bone->head); + copy_v3_v3(vec, bone->head); mul_m4_v3(ob->obmat, vec); project_short_noclip(ar, vec, pval); @@ -758,13 +758,13 @@ static SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones, { *dist = pdist; pt = &boneSnap; - VECCOPY(pt->p, vec); + copy_v3_v3(pt->p, vec); pt->type = PT_EXACT; } } - VECCOPY(vec, bone->tail); + copy_v3_v3(vec, bone->tail); mul_m4_v3(ob->obmat, vec); project_short_noclip(ar, vec, pval); @@ -774,7 +774,7 @@ static SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones, { *dist = pdist; pt = &boneSnap; - VECCOPY(pt->p, vec); + copy_v3_v3(pt->p, vec); pt->type = PT_EXACT; } } @@ -1024,7 +1024,7 @@ static void sk_projectDrawPoint(bContext *C, float vec[3], SK_Stroke *stk, SK_Dr if (last != NULL) { - VECCOPY(fp, last->p); + copy_v3_v3(fp, last->p); } initgrabz(ar->regiondata, fp[0], fp[1], fp[2]); @@ -1134,12 +1134,12 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S } else { - VECCOPY(vec, p1->p); + copy_v3_v3(vec, p1->p); } if (last_p == NULL) { - VECCOPY(p, vec); + copy_v3_v3(p, vec); size = new_size; dist = 0; break; @@ -1149,7 +1149,7 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S if (new_dist < dist) { - VECCOPY(p, vec); + copy_v3_v3(p, vec); dist = new_dist; size = new_size; } @@ -1161,7 +1161,7 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S pt->type = dd->type; pt->mode = PT_SNAP; pt->size = size / 2; - VECCOPY(pt->p, p); + copy_v3_v3(pt->p, p); point_added = 1; } @@ -1193,7 +1193,7 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S if (spt != NULL) { - VECCOPY(pt->p, spt->p); + copy_v3_v3(pt->p, spt->p); point_added = 1; } } @@ -1207,7 +1207,7 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S { pt->type = dd->type; pt->mode = PT_SNAP; - VECCOPY(pt->p, vec); + copy_v3_v3(pt->p, vec); point_added = 1; } @@ -1234,7 +1234,7 @@ static int sk_addStrokeSnapPoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, int total; int i; - VECCOPY(final_p, pt.p); + copy_v3_v3(final_p, pt.p); sk_projectDrawPoint(C, pt.p, stk, dd); sk_appendStrokePoint(stk, &pt); @@ -1259,7 +1259,7 @@ static int sk_addStrokeSnapPoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, sk_interpolateDepth(C, stk, i + 1, stk->nb_points - 2, length, distance); } - VECCOPY(stk->points[stk->nb_points - 1].p, final_p); + copy_v3_v3(stk->points[stk->nb_points - 1].p, final_p); point_added = 1; } @@ -1296,7 +1296,7 @@ static void sk_getStrokePoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_S { point_added = sk_getStrokeSnapPoint(C, pt, sketch, stk, dd); LAST_SNAP_POINT_VALID = 1; - VECCOPY(LAST_SNAP_POINT, pt->p); + copy_v3_v3(LAST_SNAP_POINT, pt->p); } else { @@ -1536,8 +1536,8 @@ static void sk_convertStroke(bContext *C, SK_Stroke *stk) { bone = ED_armature_edit_bone_add(arm, "Bone"); - VECCOPY(bone->head, head->p); - VECCOPY(bone->tail, pt->p); + copy_v3_v3(bone->head, head->p); + copy_v3_v3(bone->tail, pt->p); mul_m4_v3(invmat, bone->head); mul_m4_v3(invmat, bone->tail); diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 53d0141f44d..40d2d80f2b7 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -1241,8 +1241,8 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float memset(&isec, 0, sizeof(isec)); isec.labda= 1e10f; - VECADD(isec.start, co1, epsilon); - VECADD(end, co2, epsilon); + add_v3_v3v3(isec.start, co1, epsilon); + add_v3_v3v3(end, co2, epsilon); sub_v3_v3v3(isec.vec, end, isec.start); if(meshdeform_intersect(mdb, &isec)) { diff --git a/source/blender/editors/armature/poseUtils.c b/source/blender/editors/armature/poseUtils.c index 71cdda7fe15..1a9ff73e5dc 100644 --- a/source/blender/editors/armature/poseUtils.c +++ b/source/blender/editors/armature/poseUtils.c @@ -262,7 +262,7 @@ void poseAnim_mapping_autoKeyframe (bContext *C, Scene *scene, Object *ob, ListB /* find the next F-Curve for a PoseChannel with matching path... * - path is not just the pfl rna_path, since that path doesn't have property info yet */ -LinkData *poseAnim_mapping_getNextFCurve (ListBase *fcuLinks, LinkData *prev, char *path) +LinkData *poseAnim_mapping_getNextFCurve (ListBase *fcuLinks, LinkData *prev, const char *path) { LinkData *first= (prev)? prev->next : (fcuLinks)? fcuLinks->first : NULL; LinkData *ld; diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 4a12206d404..0556291c197 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -816,7 +816,7 @@ static void calc_shapeKeys(Object *obedit) if (oldbezt) { int j; for (j= 0; j < 3; ++j) { - VECSUB(ofs[i], bezt->vec[j], oldbezt->vec[j]); + sub_v3_v3v3(ofs[i], bezt->vec[j], oldbezt->vec[j]); i++; } ofs[i++][0]= bezt->alfa - oldbezt->alfa; @@ -832,7 +832,7 @@ static void calc_shapeKeys(Object *obedit) while(a--) { oldbp= getKeyIndexOrig_bp(editnurb, bp); if (oldbp) { - VECSUB(ofs[i], bp->vec, oldbp->vec); + sub_v3_v3v3(ofs[i], bp->vec, oldbp->vec); ofs[i+1][0]= bp->alfa - oldbp->alfa; } i += 2; @@ -866,10 +866,10 @@ static void calc_shapeKeys(Object *obedit) oldbezt= getKeyIndexOrig_bezt(editnurb, bezt); for (j= 0; j < 3; ++j, ++i) { - VECCOPY(fp, bezt->vec[j]); + copy_v3_v3(fp, bezt->vec[j]); if (restore && oldbezt) { - VECCOPY(bezt->vec[j], oldbezt->vec[j]); + copy_v3_v3(bezt->vec[j], oldbezt->vec[j]); } fp+= 3; @@ -890,12 +890,12 @@ static void calc_shapeKeys(Object *obedit) while(a--) { oldbp= getKeyIndexOrig_bp(editnurb, bp); - VECCOPY(fp, bp->vec); + copy_v3_v3(fp, bp->vec); fp[3]= bp->alfa; if(restore && oldbp) { - VECCOPY(bp->vec, oldbp->vec); + copy_v3_v3(bp->vec, oldbp->vec); bp->alfa= oldbp->alfa; } @@ -921,10 +921,10 @@ static void calc_shapeKeys(Object *obedit) curofp= ofp + index; for (j= 0; j < 3; ++j, ++i) { - VECCOPY(fp, curofp); + copy_v3_v3(fp, curofp); if(apply_offset) { - VECADD(fp, fp, ofs[i]); + add_v3_v3(fp, ofs[i]); } fp+= 3; curofp+= 3; @@ -933,7 +933,7 @@ static void calc_shapeKeys(Object *obedit) if(apply_offset) { /* apply alfa offsets */ - VECADD(fp, fp, ofs[i]); + add_v3_v3(fp, ofs[i]); ++i; } @@ -941,7 +941,7 @@ static void calc_shapeKeys(Object *obedit) } else { int j; for (j= 0; j < 3; ++j, ++i) { - VECCOPY(fp, bezt->vec[j]); + copy_v3_v3(fp, bezt->vec[j]); fp+= 3; } fp[0]= bezt->alfa; @@ -959,15 +959,15 @@ static void calc_shapeKeys(Object *obedit) if (index >= 0) { curofp= ofp + index; - VECCOPY(fp, curofp); + copy_v3_v3(fp, curofp); fp[3]= curofp[3]; if(apply_offset) { - VECADD(fp, fp, ofs[i]); + add_v3_v3(fp, ofs[i]); fp[3]+=ofs[i+1][0]; } } else { - VECCOPY(fp, bp->vec); + copy_v3_v3(fp, bp->vec); fp[3]= bp->alfa; } @@ -2890,14 +2890,14 @@ static void subdividenurb(Object *obedit, int number_cuts) interp_v3_v3v3(vec+12, vec+3, vec+6, factor); /* change handle of prev beztn */ - VECCOPY((beztn-1)->vec[2], vec); + copy_v3_v3((beztn-1)->vec[2], vec); /* new point */ - VECCOPY(beztn->vec[0], vec+9); + copy_v3_v3(beztn->vec[0], vec+9); interp_v3_v3v3(beztn->vec[1], vec+9, vec+12, factor); - VECCOPY(beztn->vec[2], vec+12); + copy_v3_v3(beztn->vec[2], vec+12); /* handle of next bezt */ - if(a==0 && i == number_cuts - 1 && (nu->flagu & CU_NURB_CYCLIC)) {VECCOPY(beztnew->vec[0], vec+6);} - else {VECCOPY(bezt->vec[0], vec+6);} + if(a==0 && i == number_cuts - 1 && (nu->flagu & CU_NURB_CYCLIC)) {copy_v3_v3(beztnew->vec[0], vec+6);} + else {copy_v3_v3(bezt->vec[0], vec+6);} beztn->radius = (prevbezt->radius + bezt->radius)/2; beztn->weight = (prevbezt->weight + bezt->weight)/2; @@ -3381,7 +3381,7 @@ static int convertspline(short type, Nurb *nu) a= nr; bp= nu->bp; while(a--) { - VECCOPY(bezt->vec[1], bp->vec); + copy_v3_v3(bezt->vec[1], bp->vec); bezt->f1=bezt->f2=bezt->f3= bp->f1; bezt->h1= bezt->h2= HD_VECT; bezt->weight= bp->weight; @@ -3418,7 +3418,7 @@ static int convertspline(short type, Nurb *nu) while(a--) { if(type==CU_POLY && bezt->h1==HD_VECT && bezt->h2==HD_VECT) { /* vector handle becomes 1 poly vertice */ - VECCOPY(bp->vec, bezt->vec[1]); + copy_v3_v3(bp->vec, bezt->vec[1]); bp->vec[3]= 1.0; bp->f1= bezt->f2; nr-= 2; @@ -3428,7 +3428,7 @@ static int convertspline(short type, Nurb *nu) } else { for(c=0;c<3;c++) { - VECCOPY(bp->vec, bezt->vec[c]); + copy_v3_v3(bp->vec, bezt->vec[c]); bp->vec[3]= 1.0; if(c==0) bp->f1= bezt->f1; else if(c==1) bp->f1= bezt->f2; @@ -3475,13 +3475,13 @@ static int convertspline(short type, Nurb *nu) a= nr; bp= nu->bp; while(a--) { - VECCOPY(bezt->vec[0], bp->vec); + copy_v3_v3(bezt->vec[0], bp->vec); bezt->f1= bp->f1; bp++; - VECCOPY(bezt->vec[1], bp->vec); + copy_v3_v3(bezt->vec[1], bp->vec); bezt->f2= bp->f1; bp++; - VECCOPY(bezt->vec[2], bp->vec); + copy_v3_v3(bezt->vec[2], bp->vec); bezt->f3= bp->f1; bezt->radius= bp->radius; bezt->weight= bp->weight; @@ -4472,7 +4472,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) (BezTriple*)MEM_callocN((nu->pntsu+1) * sizeof(BezTriple), "addvert_Nurb"); ED_curve_beztcpy(editnurb, newbezt, nu->bezt, nu->pntsu); *(newbezt+nu->pntsu)= *bezt; - VECCOPY(temp, bezt->vec[1]); + copy_v3_v3(temp, bezt->vec[1]); MEM_freeN(nu->bezt); nu->bezt= newbezt; newbezt+= nu->pntsu; @@ -4491,7 +4491,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) BEZ_SEL(newbezt); cu->lastsel= newbezt; newbezt->h2= newbezt->h1; - VECCOPY(temp, bezt->vec[1]); + copy_v3_v3(temp, bezt->vec[1]); MEM_freeN(nu->bezt); nu->bezt= newbezt; bezt= newbezt+1; @@ -4503,7 +4503,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) *newbezt= *bezt; BEZ_SEL(newbezt); newbezt->h2= newbezt->h1; - VECCOPY(temp, bezt->vec[1]); + copy_v3_v3(temp, bezt->vec[1]); newnu= (Nurb*)MEM_mallocN(sizeof(Nurb), "addvert_Nurb newnu"); memcpy(newnu, nu, sizeof(Nurb)); @@ -6189,7 +6189,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob) if(rv3d) { copy_m4_m4(viewmat, rv3d->viewmat); - VECCOPY(zvec, rv3d->viewinv[2]); + copy_v3_v3(zvec, rv3d->viewinv[2]); } setflagsNurb(editnurb, 0); diff --git a/source/blender/editors/datafiles/blender_icons.png.c b/source/blender/editors/datafiles/blender_icons.png.c index c4ea4601ed2..0ff16998665 100644 --- a/source/blender/editors/datafiles/blender_icons.png.c +++ b/source/blender/editors/datafiles/blender_icons.png.c @@ -1,6257 +1,6289 @@ /* DataToC output of file <blender_icons_png> */ -int datatoc_blender_icons_png_size= 200029; +int datatoc_blender_icons_png_size= 201043; char datatoc_blender_icons_png[]= { -137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 2, 90, 0, 0, 2,128, 8, 6, 0, 0, 0, - 68,254,214,163, 0, 0, 0, 4,103, 65, 77, 65, 0, 0,177,142,124,251, 81,147, 0, 0, 0, 32, 99, 72, 82, 77, 0, 0,135, 15, - 0, 0,140, 15, 0, 0,253, 82, 0, 0,129, 64, 0, 0,125,121, 0, 0,233,139, 0, 0, 60,229, 0, 0, 25,204,115, 60,133,119, - 0, 0, 10, 57,105, 67, 67, 80, 80,104,111,116,111,115,104,111,112, 32, 73, 67, 67, 32,112,114,111,102,105,108,101, 0, 0, 72, -199,157,150,119, 84, 84,215, 22,135,207,189,119,122,161,205, 48, 2, 82,134,222,187,192, 0,210,123,147, 94, 69, 97,152, 25, 96, - 40, 3, 14, 51, 52,177, 33,162, 2, 17, 69, 68,154, 34, 72, 80,196,128,209, 80, 36, 86, 68,177, 16, 20, 84,176, 7, 36, 8, 40, - 49, 24, 69, 84, 44,111, 70,214,139,174,172,188,247,242,242,251,227,172,111,237,179,247,185,251,236,189,207, 90, 23, 0,146,167, - 47,151,151, 6, 75, 1,144,202, 19,240,131, 60,156,233, 17,145, 81,116,236, 0,128, 1, 30, 96,128, 41, 0, 76, 86, 70,186, 95, -176,123, 8, 16,201,203,205,133,158, 33,114, 2, 95, 4, 1,240,122, 88,188, 2,112,211,208, 51,128, 78, 7,255,159,164, 89,233, -124,129,232,152, 0, 17,155,179, 57, 25, 44, 17, 23,136, 56, 37, 75,144, 46,182,207,138,152, 26,151, 44,102, 24, 37,102,190, 40, - 65, 17,203,137, 57, 97,145, 13, 62,251, 44,178,163,152,217,169, 60,182,136,197, 57,167,179, 83,217, 98,238, 21,241,182, 76, 33, - 71,196,136,175,136, 11, 51,185,156, 44, 17,223, 18,177, 70,138, 48,149, 43,226, 55,226,216, 84, 14, 51, 3, 0, 20, 73,108, 23, -112, 88,137, 34, 54, 17, 49,137, 31, 18,228, 34,226,229, 0,224, 72, 9, 95,113,220, 87, 44,224,100, 11,196,151,114, 73, 75,207, -225,115, 19, 18, 5,116, 29,150, 46,221,212,218,154, 65,247,228,100,165,112, 4, 2,195, 0, 38, 43,153,201,103,211, 93,210, 82, -211,153,188, 28, 0, 22,239,252, 89, 50,226,218,210, 69, 69,182, 52,181,182,180, 52, 52, 51, 50,253,170, 80,255,117,243,111, 74, -220,219, 69,122, 25,248,185,103, 16,173,255,139,237,175,252,210, 26, 0, 96,204,137,106,179,243,139, 45,174, 10,128,206, 45, 0, -200,221,251, 98,211, 56, 0,128,164,168,111, 29,215,191,186, 15, 77, 60, 47,137, 2, 65,186,141,177,113, 86, 86,150, 17,151,195, - 50, 18, 23,244, 15,253, 79,135,191,161,175,190,103, 36, 62,238,143,242,208, 93, 57,241, 76, 97,138,128, 46,174, 27, 43, 45, 37, - 77,200,167,103,164, 51, 89, 28,186,225,159,135,248, 31, 7,254,117, 30, 6, 65,156,120, 14,159,195, 19, 69,132,137,166,140,203, - 75, 16,181,155,199,230, 10,184,105, 60, 58,151,247,159,154,248, 15,195,254,164,197,185, 22,137,210,248, 17, 80, 99,140,128,212, -117, 42, 64,126,237, 7, 40, 10, 17, 32,209,251,197, 93,255,163,111,190,248, 48, 32,126,121,225, 42,147,139,115,255,239, 55,253, -103,193,165,226, 37,131,155,240, 57,206, 37, 40,132,206, 18,242, 51, 23,247,196,207, 18,160, 1, 1, 72, 2, 42,144, 7,202, 64, - 29,232, 0, 67, 96, 6,172,128, 45,112, 4,110,192, 27,248,131, 16, 16, 9, 86, 3, 22, 72, 4,169,128, 15,178, 64, 30,216, 4, - 10, 65, 49,216, 9,246,128,106, 80, 7, 26, 65, 51,104, 5,199, 65, 39, 56, 5,206,131, 75,224, 26,184, 1,110,131,251, 96, 20, - 76,128,103, 96, 22,188, 6, 11, 16, 4, 97, 33, 50, 68,129,228, 33, 21, 72, 19,210,135,204, 32, 6,100, 15,185, 65,190, 80, 16, - 20, 9,197, 66, 9, 16, 15, 18, 66,121,208,102,168, 24, 42,131,170,161,122,168, 25,250, 30, 58, 9,157,135,174, 64,131,208, 93, -104, 12,154,134,126,135,222,193, 8, 76,130,169,176, 18,172, 5, 27,195, 12,216, 9,246,129, 67,224, 85,112, 2,188, 6,206,133, - 11,224, 29,112, 37,220, 0, 31,133, 59,224,243,240, 53,248, 54, 60, 10, 63,131,231, 16,128, 16, 17, 26,162,138, 24, 34, 12,196, - 5,241, 71,162,144,120,132,143,172, 71,138,144, 10,164, 1,105, 69,186,145, 62,228, 38, 50,138,204, 32,111, 81, 24, 20, 5, 69, - 71, 25,162,108, 81,158,168, 80, 20, 11,181, 6,181, 30, 85,130,170, 70, 29, 70,117,160,122, 81, 55, 81, 99,168, 89,212, 71, 52, - 25,173,136,214, 71,219,160,189,208, 17,232, 4,116, 22,186, 16, 93,129,110, 66,183,163, 47,162,111,163, 39,208,175, 49, 24, 12, - 13,163,141,177,194,120, 98, 34, 49, 73,152,181,152, 18,204, 62, 76, 27,230, 28,102, 16, 51,142,153,195, 98,177,242, 88,125,172, - 29,214, 31,203,196, 10,176,133,216, 42,236, 81,236, 89,236, 16,118, 2,251, 6, 71,196,169,224,204,112,238,184, 40, 28, 15,151, -143,171,192, 29,193,157,193, 13,225, 38,113, 11,120, 41,188, 38,222, 6,239,143,103,227,115,240,165,248, 70,124, 55,254, 58,126, - 2,191, 64,144, 38,104, 19,236, 8, 33,132, 36,194, 38, 66, 37,161,149,112,145,240,128,240,146, 72, 36,170, 17,173,137,129, 68, - 46,113, 35,177,146,120,140,120,153, 56, 70,124, 75,146, 33,233,145, 92, 72,209, 36, 33,105, 7,233, 16,233, 28,233, 46,233, 37, -153, 76,214, 34, 59,146,163,200, 2,242, 14,114, 51,249, 2,249, 17,249,141, 4, 69,194, 72,194, 75,130, 45,177, 65,162, 70,162, - 67, 98, 72,226,185, 36, 94, 82, 83,210, 73,114,181,100,174,100,133,228, 9,201,235,146, 51, 82,120, 41, 45, 41, 23, 41,166,212, -122,169, 26,169,147, 82, 35, 82,115,210, 20,105, 83,105,127,233, 84,233, 18,233, 35,210, 87,164,167,100,176, 50, 90, 50,110, 50, -108,153, 2,153,131, 50, 23,100,198, 41, 8, 69,157,226, 66, 97, 81, 54, 83, 26, 41, 23, 41, 19, 84, 12, 85,155,234, 69, 77,162, - 22, 83,191,163, 14, 80,103,101,101,100,151,201,134,201,102,203,214,200,158,150, 29,165, 33, 52, 45,154, 23, 45,133, 86, 74, 59, - 78, 27,166,189, 91,162,180,196,105, 9,103,201,246, 37,173, 75,134,150,204,203, 45,149,115,148,227,200, 21,201,181,201,221,150, -123, 39, 79,151,119,147, 79,150,223, 37,223, 41,255, 80, 1,165,160,167, 16,168,144,165,176, 95,225,162,194,204, 82,234, 82,219, -165,172,165, 69, 75,143, 47,189,167, 8, 43,234, 41, 6, 41,174, 85, 60,168,216,175, 56,167,164,172,228,161,148,174, 84,165,116, - 65,105, 70,153,166,236,168,156,164, 92,174,124, 70,121, 90,133,162, 98,175,194, 85, 41, 87, 57,171,242,148, 46, 75,119,162,167, -208, 43,233,189,244, 89, 85, 69, 85, 79, 85,161,106,189,234,128,234,130,154,182, 90,168, 90,190, 90,155,218, 67,117,130, 58, 67, - 61, 94,189, 92,189, 71,125, 86, 67, 69,195, 79, 35, 79,163, 69,227,158, 38, 94,147,161,153,168,185, 87,179, 79,115, 94, 75, 91, - 43, 92,107,171, 86,167,214,148,182,156,182,151,118,174,118,139,246, 3, 29,178,142,131,206, 26,157, 6,157, 91,186, 24, 93,134, -110,178,238, 62,221, 27,122,176,158,133, 94,162, 94,141,222,117,125, 88,223, 82,159,171,191, 79,127,208, 0,109, 96,109,192, 51, -104, 48, 24, 49, 36, 25, 58, 25,102, 26,182, 24,142, 25,209,140,124,141,242,141, 58,141,158, 27,107, 24, 71, 25,239, 50,238, 51, -254,104, 98, 97,146, 98,210,104,114,223, 84,198,212,219, 52,223,180,219,244,119, 51, 61, 51,150, 89,141,217, 45,115,178,185,187, -249, 6,243, 46,243, 23,203,244,151,113,150,237, 95,118,199,130, 98,225,103,177,213,162,199,226,131,165,149, 37,223,178,213,114, -218, 74,195, 42,214,170,214,106,132, 65,101, 4, 48, 74, 24,151,173,209,214,206,214, 27,172, 79, 89,191,181,177,180, 17,216, 28, -183,249,205,214,208, 54,217,246,136,237,212,114,237,229,156,229,141,203,199,237,212,236,152,118,245,118,163,246,116,251, 88,251, - 3,246,163, 14,170, 14, 76,135, 6,135,199,142,234,142,108,199, 38,199, 73, 39, 93,167, 36,167,163, 78,207,157, 77,156,249,206, -237,206,243, 46, 54, 46,235, 92,206,185, 34,174, 30,174, 69,174, 3,110, 50,110,161,110,213,110,143,220,213,220, 19,220, 91,220, -103, 61, 44, 60,214,122,156,243, 68,123,250,120,238,242, 28,241, 82,242, 98,121, 53,123,205,122, 91,121,175,243,238,245, 33,249, - 4,251, 84,251, 60,246,213,243,229,251,118,251,193,126,222,126,187,253, 30,172,208, 92,193, 91,209,233, 15,252,189,252,119,251, - 63, 12,208, 14, 88, 19,240, 99, 32, 38, 48, 32,176, 38,240, 73,144,105, 80, 94, 80, 95, 48, 37, 56, 38,248, 72,240,235, 16,231, -144,210,144,251,161, 58,161,194,208,158, 48,201,176,232,176,230,176,249,112,215,240,178,240,209, 8,227,136,117, 17,215, 34, 21, - 34,185,145, 93, 81,216,168,176,168,166,168,185,149,110, 43,247,172,156,136,182,136, 46,140, 30, 94,165,189, 42,123,213,149,213, - 10,171, 83, 86,159,142,145,140, 97,198,156,136, 69,199,134,199, 30,137,125,207,244,103, 54, 48,231,226,188,226,106,227,102, 89, - 46,172,189,172,103,108, 71,118, 57,123,154, 99,199, 41,227, 76,198,219,197,151,197, 79, 37,216, 37,236, 78,152, 78,116, 72,172, - 72,156,225,186,112,171,185, 47,146, 60,147,234,146,230,147,253,147, 15, 37,127, 74, 9, 79,105, 75,197,165,198,166,158,228,201, -240,146,121,189,105,202,105,217,105,131,233,250,233,133,233,163,107,108,214,236, 89, 51,203,247,225, 55,101, 64, 25,171, 50,186, - 4, 84,209,207, 84,191, 80, 71,184, 69, 56,150,105,159, 89,147,249, 38, 43, 44,235, 68,182,116, 54, 47,187, 63, 71, 47,103,123, -206,100,174,123,238,183,107, 81,107, 89,107,123,242, 84,243, 54,229,141,173,115, 90, 87,191, 30, 90, 31,183,190,103,131,250,134, -130, 13, 19, 27, 61, 54, 30,222, 68,216,148,188,233,167,124,147,252,178,252, 87,155,195, 55,119, 23, 40, 21,108, 44, 24,223,226, -177,165,165, 80,162,144, 95, 56,178,213,118,107,221, 54,212, 54,238,182,129,237,230,219,171,182,127, 44, 98, 23, 93, 45, 54, 41, -174, 40,126, 95,194, 42,185,250,141,233, 55,149,223,124,218, 17,191, 99,160,212,178,116,255, 78,204, 78,222,206,225, 93, 14,187, - 14,151, 73,151,229,150,141,239,246,219,221, 81, 78, 47, 47, 42,127,181, 39,102,207,149,138,101, 21,117,123, 9,123,133,123, 71, - 43,125, 43,187,170, 52,170,118, 86,189,175, 78,172,190, 93,227, 92,211, 86,171, 88,187,189,118,126, 31,123,223,208,126,199,253, -173,117, 74,117,197,117,239, 14,112, 15,220,169,247,168,239,104,208,106,168, 56,136, 57,152,121,240, 73, 99, 88, 99,223,183,140, -111,155,155, 20,154,138,155, 62, 28,226, 29, 26, 61, 28,116,184,183,217,170,185,249,136,226,145,210, 22,184, 69,216, 50,125, 52, -250,232,141,239, 92,191,235,106, 53,108,173,111,163,181, 21, 31, 3,199,132,199,158,126, 31,251,253,240,113,159,227, 61, 39, 24, - 39, 90,127,208,252,161,182,157,210, 94,212, 1,117,228,116,204,118, 38,118,142,118, 69,118, 13,158,244, 62,217,211,109,219,221, -254,163,209,143,135, 78,169,158,170, 57, 45,123,186,244, 12,225, 76,193,153, 79,103,115,207,206,157, 75, 63, 55,115, 62,225,252, -120, 79, 76,207,253, 11, 17, 23,110,245, 6,246, 14, 92,244,185,120,249,146,251,165, 11,125, 78,125,103, 47,219, 93, 62,117,197, -230,202,201,171,140,171,157,215, 44,175,117,244, 91,244,183,255,100,241, 83,251,128,229, 64,199,117,171,235, 93, 55,172,111,116, - 15, 46, 31, 60, 51,228, 48,116,254,166,235,205, 75,183,188,110, 93,187,189,226,246,224,112,232,240,157,145,232,145,209, 59,236, - 59, 83,119, 83,238,190,184,151,121,111,225,254,198, 7,232, 7, 69, 15,165, 30, 86, 60, 82,124,212,240,179,238,207,109,163,150, -163,167,199, 92,199,250, 31, 7, 63,190, 63,206, 26,127,246, 75,198, 47,239, 39, 10,158,144,159, 84, 76,170, 76, 54, 79,153, 77, -157,154,118,159,190,241,116,229,211,137,103,233,207, 22,102, 10,127,149,254,181,246,185,206,243, 31,126,115,252,173,127, 54, 98, -118,226, 5,255,197,167,223, 75, 94,202,191, 60,244,106,217,171,158,185,128,185, 71,175, 83, 95, 47,204, 23,189,145,127,115,248, - 45,227,109,223,187,240,119,147, 11, 89,239,177,239, 43, 63,232,126,232,254,232,243,241,193,167,212, 79,159,254, 5, 3,152,243, -252,186,196,232,211, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 13,213, 0, 0, 13,213, 1, 61,214, 88,241, 0, 0, 0, 7,116, 73, - 77, 69, 7,219, 2, 27, 16, 38, 47, 61,220,216,191, 0, 0, 0, 25,116, 69, 88,116, 83,111,102,116,119, 97,114,101, 0, 80, 97, -105,110,116, 46, 78, 69, 84, 32,118, 51, 46, 53, 46, 56, 55, 59,128, 93, 0, 0,245, 9, 73, 68, 65, 84,120, 94,236, 93, 5,120, - 21, 71, 23, 13,208, 22, 47,238,238,238, 46, 45, 82, 92, 90,218,226, 82, 40, 69, 91, 10, 69, 11, 84,130, 83,193, 29, 10, 20, 10, - 4, 40, 69, 83,160, 69,138,123,208,226, 20,183,224, 26, 60,153,255,156,229,205,251, 55,155,221,183,187,201, 11, 16,178,251,125, -243,237,123,187, 51,119,103,238,216,153,123,239,220,241,241,113, 46,135, 3, 14, 7, 28, 14, 56, 28,112, 56,224,112,192,225,128, -195, 1,135, 3, 14, 7, 28, 14, 56, 28,112, 56,224,112,192,225,128,195, 1,135, 3,175, 53, 7,252,253,253,133,141, 2, 86,181, - 18,151, 52, 93,161,162,133,248, 47,149,166,133,252,201, 40,118,243,105,133,175, 86,105, 86,116,241,179,159,133,252, 90,165, 41, -235, 40, 50,242,233,205,122,151,101,247, 10, 77,217,222,113,183, 74,215,148,159,234, 62,100,177, 63, 89,166,105,163, 47,189,116, -154, 22,218, 38,163,132, 39,159,102,109,212, 14, 77,171,125,201, 14, 77,171,125,201, 14, 77,175,183, 79,111,181,121,109,155,180, - 72,215, 99,217,245,218,185,133,190,100,139,166,197,190,244, 74,208,180,208,151,194,155, 79, 79,125,201, 82,251, 84,207,237,170, -186,183, 50, 55, 89, 40,214,107, 24, 69, 54, 60, 27, 69, 51,173, 8, 53, 45, 11, 29,197,210,192, 27, 89, 52, 85,147,174,217, 64, -110, 57,159, 22,203,108, 27,188, 69,133, 58, 66,217,215, 51,159,242,110,146,103, 75,109,201,155,117,164,110,239, 54,232, 90, 26, -208, 92,229, 86, 38, 92, 11,117,101,153,166,164,101,129,238, 75,165, 25, 89,252,180,192, 75,211,190,169, 87,239, 22,232,190,108, -126, 90,237, 75,150,243,233,173, 58,210,182, 73,139,116,109,247,247,136,182,121,163,190, 99, 66,215, 86, 62, 45,246, 79, 91, 52, - 35,139,159, 17,109,243,122,243,176,133, 58,178,240,217,104, 16,197, 38,163, 44, 53, 24,213,164, 83,209, 2, 11,109,209,180, 64, -207,116,224, 85,119, 14, 27, 96,211, 82, 62, 45,174,154,108, 3, 45,245, 42,194, 27, 0, 38, 50,234,200,226,202,214,110,217,229, -202, 62,194, 0, 70,150, 89,239,238,129,167,166,245,174,238, 67, 22,251,147,109,154,228,109, 68,235, 61, 50,243,169,106,247,102, -245,100,185,236, 54,250,210, 75,165,105,163, 47,217,201,103,100, 74,180,188, 82, 71,178, 77,186,234,169, 95, 68, 1,140,118,140, -179,208,151, 44,241, 83,221,119, 44,140,163,225,162,233,141,190,169,225,167,217,162,205, 86, 62, 45,246, 37, 83,154,218,182,110, -145,174,197,105,251, 53,142,102,161, 49,171, 75,111,185, 34,108,176,204, 18, 77,139, 43, 7, 91,147,120, 84,161,105,113,133, 99, -187,236, 54,234,222, 82, 29, 69, 86, 62,213,192,200, 27, 3, 90, 84, 2, 90,222,172, 35, 45, 45, 11,180, 77,235, 61,170,209,180, -209, 70,109,149,221, 2, 47, 45, 45, 0,181,249,179, 64,215, 86, 62, 45,246, 37, 83, 41,153,186, 31, 90,228,169, 45,154,145,153, -207,136,140, 33, 70,245, 17, 17,144, 25, 85,104,234,213,137,197,186,183, 1, 7, 94,211,168, 22, 58,114,184,128,150, 68,186, 22, -216,102, 58, 80,168, 80, 52, 81,190,217,202,222,210,128,166, 55, 80, 68,164, 3,170, 65,155,133, 85,147, 45, 80,196, 50,123,155, -166,197,129,236,165,231, 19,229, 86, 86,202,222,170,119,213,192, 96,149,167,166,237, 83,221,135, 44,246, 39,203, 52, 85, 43, 70, -175, 72, 33,108,246, 37,203,249,180,177,104,177, 76,211,198,106,217, 14,205,168, 82,239, 94,207,167,141,190,100, 10,138,212,227, -187,197,241,201, 22, 77,139,227,147, 45,154, 22,251, 82,120,105,122,154,151,108,209,180,216,151,108,209,180,216,151, 44,245,163, -112,212,189, 5, 24,224, 68,177, 13,180,108,178,204,180,114,109,210,179, 13,180, 44,210,119,242,105,145, 81, 22,163, 57,252,180, -200, 40,139,209, 28,126, 90,100,148,197,104, 14, 63, 45, 50,202, 98, 52,135,159, 22, 25,101, 49, 90, 84,225,167,197,226, 56,209, - 28,160,245,156, 3, 81,165, 97, 59,249,244,110,159,117,248,233,240,211, 91, 28,112,218,146,183, 56,233,140,201, 81,165, 45,121, -183,198, 29,106, 14, 7, 28, 14, 56, 28,112, 56,224,112,192,225,128,195, 1,135, 3,209,148, 3,233,210,165,243,207,153, 51,231, - 81,163,144, 54,109,218,127,162, 41,107, 94,153, 98, 59,117,244,202, 84,133,147, 17,115, 14,196, 68,148, 55, 92,129,191, 99,152, - 39,113, 98, 56, 28,112, 56,224,112,224, 53,230, 64,182,108,217, 14, 63,123,246, 76, 60,121,242, 68, 60,124,248, 80,220,187,119, - 79,220,190,125, 91, 92,191,126, 93, 92,188,120, 81,100,207,158,253, 63,187,197, 79,157, 58,245, 6,128,131,115,118, 2,210,108, - 50,249,206, 22,188, 15,140, 17, 35,134, 59,196,140, 25, 51,144, 33, 86,172, 88, 74,120,227,141, 55,148,240,230,155,111,202,176, -219,140,166, 30, 61, 61,154, 42,186, 30,105, 38, 78,156,120, 87,242,228,201, 3, 83,164, 72,225, 14, 41, 83,166, 12,148, 33, 85, -170, 84,129, 50,160,204,129, 12,120,199,178, 25, 94,145, 81, 71,118,235,244,117,138,207,246,153, 62,125,250,115,118, 66,154, 52, -105, 60,182, 79, 44, 72,246,128,222, 21, 27,225, 58,210,108, 54, 1, 34, 74,155,247, 20,180,237, 23,253, 96,151, 89,155, 55,162, - 39,105,201,126,165,234, 7,102, 52,229, 39, 99,162,159,252,132,126,127, 15,253,224, 42,194,149,100,201,146, 5, 50,168,251, 68, -146, 36, 73, 14,188, 78,237,201, 41,139,195, 1,135, 3, 14, 7, 60,114, 32, 75,150, 44, 71,239,223,191, 47,118,239,222, 45, 2, - 2, 2,194, 4, 0,173, 99,118, 89, 72,240,112,249,200, 33, 17,116,243,134,184, 19,120, 89, 4, 7, 7, 11,130, 57,134, 11,251, -247,138, 51, 1, 59,196,127, 91, 54,138,167, 79,159, 42,225,241,227,199, 4,116, 23, 77,190,115,238,199, 31,127, 20, 19, 39, 78, - 20, 35, 70,140, 16,131, 7, 15, 22,223,125,247,157,232,209,163,135,248,242,203, 47, 69,187,118,237, 68,171, 86,173, 68,211,166, - 77, 69,195,134, 13,197,251,239,191, 47,226,198,141,107, 74,115,200,144, 33, 98,252,248,241, 98,216,176, 97, 98,208,160, 65,226, -219,111,191, 13, 69,179,101,203,150,162, 73,147, 38,162,126,253,250,162,118,237,218, 34, 78,156, 56, 30,105,114, 66, 97,121,120, -133,132,132, 40,101,102, 25, 9,100,249,252,209,163, 71, 97, 2, 39,124, 79,101,143,140, 58,178, 91,167,175, 83,124,182,207,153, - 27,247,137,165, 1, 71,197,194,157,135,149,186,145,225,200,132,217,226,240,152,153,226,224,136,105,161,158,155,181, 79, 0,177, -155,118,104, 94,186,116, 41, 40, 81,162, 68,243,193, 87, 74,125,140,174,115, 15, 30, 60, 16, 12, 65, 65, 65,238, 32,159,177, 45, - 49,223,108, 99,108,107, 43, 86,172, 16, 92,112,152,245,163,174, 93,187,138, 78,157, 58,137,182,109,219,138, 22, 45, 90,136,198, -141, 27, 43,237,187, 94,189,122,162, 78,157, 58,162,102,205,154,162, 90,181,106,226,189,247,222, 19,229,203,151, 23, 92,100, 88, -168,127,150,227,231, 90,181,106,221, 96, 94, 22, 46, 92, 40,246,236,217, 35, 14, 30, 60, 40,142, 28, 57, 34,142, 31, 63, 46,254, -251,239, 63,113,230,204, 25, 1,254, 95,177, 64,207,137,226,112,192,225,128,195,129,215,131, 3,152, 32, 86, 64,109,120,132, 33, - 99,198,140,247,112,127,172, 14, 57,114,228,184,175,167, 86,244,164, 82,228, 68, 70,144,213, 57,129,143, 18, 40, 29, 99,184,113, -227,255,207,248,156,146, 51, 6, 78, 22,248,206, 37,179, 9,130,128,232,228,201,147,226,194,133, 11, 2,249, 22,200,175,128,180, - 71,228,206,157, 91, 20, 40, 80, 64, 20, 45, 90, 84,148, 42, 85, 74,188,243,206, 59,162,114,229,202,166, 64, 11, 43,248,115, 99, -199,142, 21,144, 40, 41, 1,101, 18, 57,179,101, 21, 99, 63,105, 36,166,126,210, 80,148, 44, 82, 88, 20, 42, 84, 72, 20, 43, 86, - 76,161, 91,174, 92, 57, 83,160, 69, 73, 22, 65,214,254,253,251,197,161, 67,135,196,209,163, 71,149, 9,230,244,233,211,226,220, -185,115, 2, 19,172, 2, 22,201, 15, 89,118, 0,173,243,158,202,174,174,163, 76,153, 50,221, 65,125, 92, 67,184,232, 10,215,192, -187,187,118,235,232,245,104,189,225, 43, 5,219, 39, 65, 86,226,207,134, 40,225,238,221,187, 74,160, 52,247, 87,159,172,238,192, - 5, 8, 1, 14,219, 39,121,109, 82, 71, 55,173,210, 60,123,246,108, 80,217,178,101,255,202,144, 33,195,167,102, 64,139,223, 39, - 80, 57,113,226,132, 2, 82, 40,101,190,122,245,170,184,117,235,150, 96,254, 8,222, 9,108,184, 80,104,223,190,189, 37,160,213, -161, 67, 7,198,163, 91, 8,130, 40,246, 19,241,246,219,111,139,164, 73,147, 10, 72, 91, 5, 36, 82, 34,115,230,204,236,147, 34, - 79,158, 60, 86,128, 22, 65,214,144,234,213,171, 7, 50, 47,188, 42, 85,170, 36,240, 95,140, 25, 51, 70,248,249,249, 9, 46, 88, - 8,236, 88, 14, 7,104,133,175,221, 58,169, 28, 14, 68, 7, 14, 96,248,120, 19,161, 36, 66, 29,132,154, 8,229, 92,191,249,159, -129,239,228,123,229,191, 30, 95, 84,113,148,247,170,255, 85, 37, 29,205,243,210,120, 94,217,245,174, 10,238,113, 53,223,145,233, -220,249,208,173, 15, 51,191, 38, 84, 81,201,129,146,131, 37, 87,202, 92, 53,115, 64,191,115,231,142, 2,148,174, 92,185, 34, 48, - 81,112,226, 57, 97, 84,233,156,200, 40,201, 82, 3, 45,166,189,121,243,166,251,153, 4, 90,164,235,154,200, 60, 2, 45,130,162, -145, 35, 71,138,226,197,139, 43,193, 8,100,113, 5, 78,144,197, 65, 62, 94,188,120, 30, 39, 71,210,228, 4, 69,128, 85,185,116, - 97,177,174, 95,107,241,192,183,133,184,218,237, 19,113,169,245, 71,226,250,187,249,196,198,142,159,136,102,181,106, 40, 32,171, - 66,133, 10,166,224,141, 64,139, 18, 60, 35,144, 69,254, 21, 44, 88, 80, 1, 89,156,216, 41,237, 50, 3, 90,106, 62,103,205,154, -245, 79,212,209,118, 84,207,122, 6,212,209,118,212,209, 17,212,209, 53, 59,117, 20, 29, 58,172,167,246, 73, 73,150, 26,104,177, - 46,180, 64,139, 32,135,210, 35,182,207, 92,185,114,153, 2, 45, 43, 52, 9,178, 80,255,107, 74,150, 44,217,164, 68,137, 18,239, -154, 1, 45,246, 61, 41, 9,210, 3, 89,236,167,108,195,236, 15,148,232, 90,144, 62,157,115,197, 19,147, 39, 79, 14, 19,208, 22, - 5, 36,168, 10,200,202,155, 55,175,178,208,160, 42,222, 67,123,161, 13,214, 27, 0,103,183,213, 99, 7,165,202,205,154, 53, 19, -235,215,175, 87, 36, 91, 29, 59,118, 84,164,206, 4,139, 88, 56, 56, 18,173,232,220, 1,157,178, 71,123, 14,120,194, 34, 24,210, -170,244,238,221,187, 15,177, 17, 22,164,126, 4, 62,252, 45,131, 4, 93,154,255,161,192,150, 11,172, 41,233, 92,233,249, 67,253, - 95,121,142,160,128, 39, 25, 79,126,151,119, 60,175, 37,255,171,232,132,202,135, 17,208, 82,156, 27, 26, 57, 79,164,138,138, 19, -139,145, 26, 81,173, 90,196, 64,108,104,187, 69,160, 69,176, 33, 37, 89, 18,112,241,206,149, 56, 65, 6, 65,193,160, 28, 41,197, -168, 34, 89,197, 81,255,133, 4,110, 30,129, 22,236, 69,206,253,240,195, 15, 2, 82, 0,143, 32, 75,174,164,169, 2, 49, 3, 90, -164, 73, 21,100,142,236,217, 68,240,252, 79,196,233,241, 29, 69,175,102, 31,184, 39,152,222, 77,155,136,141, 93, 58,137, 35,159, -183, 21, 53,170, 84, 81, 84, 41,102,234, 72, 2, 45, 2,212, 99,199,142,185, 37, 89,231,207,159, 87, 36, 89, 4, 89, 4,156,133, - 11, 23, 86,192, 43,109,226, 24,215, 14,208,130,164, 97, 2, 0,192, 12, 76, 94, 19, 80, 31, 12, 51,118,237,218,181, 12,247, 29, - 8, 23,173,214, 81,116,238,233,108,159, 4, 79, 82,146,181,202,167,164,144, 65, 74,177, 8,178, 58, 12,243, 85,194,239,235, 86, - 90,146,104,153,209, 36,200,202,152, 35,235,114,128,146, 6,232,192,197, 0,182,222,177, 2,180,184,176,209,130, 44,126, 75, 13, -178, 0,192, 21, 21,183, 21,160,197,120,148, 98,233, 1, 45,210, 65, 95, 20,249,242,229, 83,218, 41, 23, 53, 86,128, 22,212,160, - 87, 22, 45, 90,164, 72,178, 26, 52,104, 32,166, 78,157,170,168, 50, 63,255,252,115, 5,100,113,225, 65,169, 46,165,113, 88,216, - 56, 64, 43, 58,119, 64,167,236,209,158, 3,158, 60,199,171,129,143, 26, 84,201,223,218,247,106, 48, 37, 25,171, 6,107, 70, 64, - 75, 11,158,244,128,152,140, 99,144, 15, 93, 73,154, 2,176, 60,121,102, 87,171,168,164, 58,209,232,110,166, 58, 36,128, 48, 82, - 23, 18,100, 49,140, 46,154, 77, 76,171, 84, 88, 28,255,211, 26,208, 26, 56,112,160,178,218,166,186,144, 42,196,203,151, 47,187, -213,133,148,100,113,144,167,109, 9, 65,214,135, 31,126, 40,226,199,143,239, 81, 10, 65,160,229,235,235, 43,242,231,205, 45,196, - 63,189,196,187,165,139,187, 65,150, 84, 23, 86,133,116,108,197,183, 67, 68,125,216,124, 89,145,146,209,232,157,147,160, 84, 23, - 74,144,197, 9,134,249, 43, 83,166,140, 40, 82,164,136, 2,178, 24,143, 82, 0, 0,173, 11, 70, 61, 15, 54, 95,187,164,209,188, -235,126, 7,119,134,219,174,112, 7,223,188, 0,137,203,104,132, 63, 80, 95, 59,100,157, 57, 59, 70,245,185,170, 6, 90,148, 98, -169,129,150,180,133,226,130, 67, 2,173,121,107,151,219, 2, 90,122, 52,165, 36,139, 32, 11,157, 54, 61, 66, 14,171, 64,139, 32, - 93,170, 11,165, 42,147, 32,107,248,240,225,238, 69, 7,234, 94,124,244,209, 71,150,128, 22,129, 80,194,132, 9,221, 64,171,123, -247,238, 66, 6,210,201,159, 63,191, 2,178, 32,113,227,138, 82,196,142, 29,219,204, 70, 43, 38,128,214,101,170,203,217,255,104, - 39,185,124,249,114,177,109,219, 54, 65, 53, 37, 37, 89,167, 78,157, 82, 22, 26, 92,100, 57, 64, 43,218,207,179, 14, 3,162, 57, - 7, 60, 97, 17, 12,109,149, 53,146, 37,183, 68, 75, 15,240,104,129, 22,226, 40,106, 69, 21, 72,146,170,195, 48, 18, 45, 53,216, -210,147,156,169, 37, 93,234,247, 18,188,133, 75,162,229,173,186,231, 68, 70,160,165,167, 46,148, 32,139,210,132,233,239, 21, 21, -243, 62,120, 87,156, 92,185,216, 84, 53, 3,155,146,115, 52,126,231,106,155, 54, 89, 28,208, 97,120,171,216, 78,169, 65, 22, 13, -214, 9,178, 56,153,152, 1, 45,210,236,211,167, 15, 84,121,249,196,197, 35,147, 68,185,178,165,195,216,100, 85,175, 86, 93, 76, - 24,191, 88, 52,250,184,190, 2,224,204,164,100, 4, 90,180,155,161,138, 68,130, 44, 78,128,228, 5, 37, 98,156,184,104, 75, 70, -149, 33, 65, 35, 47, 79, 64,139,188,164,250,150, 52,101,144, 6,245, 4,107,148,192, 48,142,183,234, 46, 58,208,145, 64, 75,170, - 11,181, 64, 75, 26,155, 75,160, 53,103,149,191,105,251,164, 49, 60,129,179, 30, 77,130, 44,180,211,229, 80,239, 53, 0, 88, 47, -132, 42,207,136,144,203, 10,208, 34,176, 34,200, 34, 64,241, 4,178, 8,142,234,214,173,107, 38,125,242,161,186,156, 70,239,216, - 9, 24, 10,104, 41, 13, 81,115,177,173, 82, 93,110, 1,104,197,192, 78,194, 75,180, 37,163, 26,115,245,234,213,138, 36,139, 32, -235,223,127,255, 85, 22, 69,157, 59,119, 86,158,145, 63, 0,155,142, 68, 43, 58,116, 52,167,140, 14, 7, 12, 56, 96, 34,209, 42, -171, 5, 84,158, 36, 75,154,119,110,144,229, 82,255, 85, 81, 73,185,244, 84,135,138,189,149, 30,224,178, 32,225, 50,150,104,121, - 82, 29,122,171, 85,112, 34, 59,191,111,143,219, 30, 75,173, 46,252, 33, 79, 90, 49,174,100, 78, 49,163, 74, 49, 5, 36, 48, 88, -177,129, 33, 40, 2,227, 20,149,134,218,240, 93, 11,178, 56,137, 16,100,113, 85,157, 32, 65, 2,143, 18, 45,210,228, 74,190,112, -137, 66, 98,212,253, 33,162,108,165,119, 66, 25,190,115,146,169, 85,171,142,232, 61,127,191,104,210,184,169,178, 43,203, 12,188, - 17,104, 17, 8,169, 37, 89,220,209,197, 73,176, 10,212,143,204, 47,213, 49, 44, 7,213, 52, 46,160,101,152, 79,242,146, 0, 75, -187,177, 64,254, 39,216,114,128,150,189,150, 75,126,157,221, 50, 65,172,236,234,163, 4,181,186,176,111,142, 82, 66, 6,242,150, -117, 73, 80,108,197, 70, 75,143, 38, 65, 86,234,248,111,175, 33,200,114, 73,178, 50, 54,106,212,168,208,208,161, 67, 45,169, 14, - 9,250,244, 64, 22, 54, 69, 40,146, 93,181, 4,170, 70,141, 26,150,128, 22,219, 34,120, 96, 10,180, 42, 86,172,168,180, 89,236, -180, 53, 5,242, 48,164,191, 68,117,249, 47,191,252, 34,182,111,223,238,182,201,162,100, 55, 48, 48, 80, 1, 89,148,108,145,159, - 14,208,178,215, 94,157,216, 14, 7, 94, 55, 14, 88, 81, 29, 18,252,184,192,146, 21, 27, 45,181, 4, 75,253,251, 77, 79, 64,139, -239, 60, 1,170,112,217,104,105, 43,203,165, 42, 52,116, 86,170,221,201,102, 85, 21,197,137,236,204,174,237,110,112, 32,109,178, - 40,197, 26, 95, 42,151,248, 21, 32,235,247,143, 42,186, 39, 56, 43, 19,153, 4, 69, 52,206,149,187, 11, 9, 90,184, 90,230,138, -159,146, 44, 53,200,226, 46, 39, 43, 64,139,174, 33,138,150, 43, 34,106, 62,123, 79,188, 83,163,146,123,119, 33, 65, 22, 37, 80, -117, 63,248, 80,180, 92,113, 77, 52,107,209, 82,217, 2,111, 6,180,232, 35,139, 19, 11,213,154,109,218,180, 81, 36, 89, 4,126, -116, 55, 65, 41,220,187,239,190,171,168,100, 40,129,136, 40,208,250, 42, 97, 12,197, 88,155, 42, 68,216,204,245, 64,125,141, 67, - 88,142,122, 90,251,186,117, 76,111,150, 71,105,159, 27, 71,187,129,150, 90, 93,168, 6, 90, 82,114,104,165,125, 82,162,165,165, -105, 32,201,202,220,186,117,235, 66,163, 71,143,182, 4,180,152, 7,173, 36, 75,130, 44, 74,118,217,142,168,138,102,155,226, 38, - 16, 51,233, 19,213,229, 4,100, 52,158,151, 59, 11,105,244,174,119, 85,173, 90, 85,145, 26, 91, 5, 90,220, 81, 72, 3,120, 74, -178,168, 70,228,127, 41,201, 98, 63, 32,112,229,229, 0, 45,111,182,102,135,150,195,129,215,139, 3, 82,245,231,146,106, 81, 66, - 85, 74, 74,184, 84,207,220,187, 14,117, 36, 90,242,157,214, 64, 94, 62, 55,218,117, 40,159,203, 59,119, 33,170,191,109,109,215, -161,182, 58,104,252,206,129,143,134,235,148, 42,201, 65, 93, 58, 45,229, 46,193,107,215,174, 41,182, 21,116, 77, 96,213,121, 41, - 39, 50,250,201,162,212,165, 91,226, 88,138, 61,150, 52, 60,158, 81,181,184, 88, 80,191,178, 88,254,233, 7,202, 4, 66,160,224, -154,200, 60, 26,195,195, 32,247, 92,151, 46, 93, 20,105,144, 90, 93,216,188,121,115,101,183, 21,237, 88, 24, 40,201, 34,200, 34, -200,129, 29,138, 71,137, 22,105,210, 80,183,104,233,162, 34,255,211, 76,226,147, 35, 61, 68,163,111,186, 40,234, 18,130,172,166, -223, 14, 23,141,253,207,137,250,235, 31,137,198, 77,155, 41,254,134,204,192, 27,129, 22, 13,127,137,216,185,221,158,121,129, 4, - 67, 1,129,156,224, 72, 27, 42, 35,101,130,164, 68,226,239,191,255,166,234,208,176,236, 82,162,165,221, 88, 32,213,178,228, 31, - 0,219, 93,240,114, 2,234,237,111,212,213, 41,171,245,244,122,117, 79,235,165, 33, 79, 79,175, 31, 30, 10,104, 73,117,161, 22, -104, 81,154,104,165,125, 18,104,169,105, 74,155, 44,151, 36, 43, 3,186, 89, 38,180,213, 66,104, 19, 84, 29,102, 71,200,135,157, -172, 30,141,225,169,230,147,254,189,216, 79,105,147,101, 4,178,168,230, 35,136,183, 2,180,104,107, 40,141,222,229,206, 66, 61, -160,197,197,203, 7, 31,124, 64,195,121, 83,137, 22, 84,145,151,184,232, 97,127,148,110, 28,216, 31,165, 36,139,252,149,151, 3, -180,172,183, 85, 39,166,195, 1,135, 3,198, 28, 80,129, 50,125, 53,222,171,192, 60, 76,244, 71,185,202,212,115, 84, 26, 17,231, -165,210, 6, 70, 74,178,126,206,159, 65, 76, 44,151, 87,252, 86,189,100, 40, 53,205,182,111, 58,138,189, 67,123,137,171, 91,214, - 82, 5,226, 17,104,189,245,214, 91,231, 56,104,211,152, 92, 79, 93,200,119,116,194, 72,149, 29, 47,238,210,130,111, 32, 83,160, -245,217,103,159, 41,210,128,106, 77,106,138,142,127, 15, 18, 95, 30,219, 36, 58,110,184, 41,234,174,186, 43, 50, 45, 13, 22,159, -252,190, 95,180,236,212, 93, 1, 89,156, 68,172, 0, 45,174,230,169,146,100,158, 32,189, 80,118,131, 17,104,113,130, 99,222, 41, -145,163,202,135, 59, 40, 41,133,192,196,227, 17,104, 17, 0,171,129,214, 87,111,199, 84, 92,101, 48, 16,172, 2, 48, 7, 97,167, -232, 31,168, 51, 94, 55,195,227,100,246, 85,104,143, 47, 42, 15, 18,188, 74, 73,150,223,183,141,133, 12, 82, 93, 72,158, 15,153, -154, 79, 9,139,215,118, 51,109,159, 4, 90, 4,101,164, 73,144,149, 55, 91,250, 21,168,151, 6,176,235, 35,176,202,132,144,133, - 32,235,171,175,190, 42,140,223, 57, 17,242, 91, 1, 90,180,117, 84,131, 44,212,173, 98,163,168,150,100, 73,144,197,197,129,153, -244,137,146, 97,198, 35, 13,245,206, 66, 61,160, 37, 37,196, 86,129, 22,119, 21,174, 91,183, 78,217,113, 75, 73, 49, 23, 49, 92, -168,145, 39, 92, 36,177, 63, 16,180, 58, 64,235, 69,181,116,231, 59, 14, 7, 28, 14,188,116, 14, 64,197,180,210,232,140, 67,128, - 0, 58, 42,213,117, 94,170,163, 66, 12,117, 98,184, 4, 90, 82,146, 53,185, 92, 62,241, 91,141, 82, 98, 97,131, 42,110, 41, 22, - 87,184,251,126,236, 45,142, 78, 24, 44,174,239,218,168, 55,145,133,162, 73,160, 69, 9, 17, 87,237,114,119,161,158,186,176, 87, -175, 94,110,175,241, 58, 64, 43, 12, 77, 74,156, 74,151, 46,237,246,147, 85,173, 70, 77,241,197,200,223, 68,251,113,127,136,143, - 27, 61,247, 8, 47, 65, 22, 37,103, 58, 64, 43, 76,217, 57, 73,179,236,156, 96,164,141,143,222, 68,166, 90,225,107,129,150,155, -166, 52,134,151, 54, 89, 82,146,245,109,218,132, 98, 64,150,100,202, 55, 48,201, 63, 64, 93,253,142,176,145,245,137,250,249, 91, -167,113, 69,149, 83,221, 35, 61,159,106,160,197,118,168, 6, 90,234,141, 7, 18,104, 45, 92,211,133,192,196,176,142,200,107, 9, -180,164, 36,139, 32, 11,245,171, 39,201,202, 57, 96,192,128, 34,191,253,246, 91,113, 29,160, 21,170,236, 84,243,177,141,240, 36, - 4, 74,178, 36,200,162,141, 34,213,133,148,140,170, 65, 22,129,188, 14,208, 10, 69,147, 64,139,182, 87,146,134,220, 89, 40,165, -184,148,186,202, 93,187,210,214, 17, 27, 64,180, 18,173, 48,117,132,221,177,151, 40,245,166,241, 59, 29, 10, 75,191, 89,180,127, -227, 37, 37, 91,148,208, 25, 0,173, 72,175,119, 47, 13,184, 78, 62,189,196, 72, 23, 25,135,159,209,147,159,222, 45,117, 84,165, - 70,169, 8, 7, 72,174,168,229, 74,157,234, 63,170, 17,117, 84, 83,186, 96, 67, 30, 57,243,223,223,254,226,228,106,127,113,122, -245,159,138,170, 80,134,203, 91,214,136,171,219,215, 35,172,163,189,136, 86,250, 20,138, 38, 84, 34,231,120, 92, 8, 37, 64,180, -117,210, 3, 89, 84, 23,114,128,167, 93, 8, 37, 74, 56,107,205, 35, 77,130, 55, 58, 86,164,148, 73, 78, 52,156,172, 36,109, 45, -200, 50, 80, 71,234,150,157, 19, 10, 87,239, 84,203,154, 93, 0, 70,151, 53,237, 36, 20,208,162,148,133, 64, 75, 74,178,184,185, -128, 32,107, 72,174,212,118,118, 29, 58, 3,154,139,201, 18,188, 74, 27,172, 61, 43,103,137,128,229, 51,196,174,101,211, 20, 59, - 34, 25,150,252,211, 67, 44, 90,219, 85,204,251,171,157,105,251, 4,208,186, 5,128,161,236, 46,132, 67,210,143,113,204, 77, 62, -212,123, 10,132,228,104,147,185,208, 38,115,224,119, 18,132,196,144,106,101,134, 97,120, 70, 72, 54,181,170,195, 48, 64,139, 42, -104, 74, 93,217,246,217, 86, 41,101, 98,251,100, 59,101, 95,208, 2, 36, 29,233, 83, 40,154, 84,151,179,189, 75,160, 38, 29,241, -210,232,157, 71,239,208, 80,158,187,100,165,195, 81, 46, 68,172, 2, 45, 74,145, 41, 81,166,205, 36, 23, 4, 52, 65,144,151, 60, -134,138,255, 29,160, 21,102, 86,112,250,166,119, 39, 74,135,159,175, 62, 63,189,155,195,168, 74,141, 96,202, 72,173,168,163,154, - 10,213,176,117,124, 63, 5,106,124, 65,133,249, 15, 71,159,218,195,154,181, 19,196, 22,218,159, 48,112,213,206,192, 73,133,129, - 19, 1, 3, 12,213,149, 0,169,147, 18,240,219, 50, 77, 53, 93, 53,109, 45,125,124,199, 35, 77,148, 99, 23, 38,221, 64, 25, 0, -162, 2,205, 2,211,120, 2, 90,210,150, 77,123,238, 29,165, 5,156,204, 44,238, 58,116, 6, 31, 23,147,201,111,179,246,168,125, -111,214, 62, 97,155,183, 3,109,110, 33, 36,193,173, 33, 37,170, 96, 37, 0,104,149, 70,150,232, 89, 93, 94, 90,233,211, 22, 15, - 7,166, 43,125, 65,219, 31,208,118, 13,219, 18, 63, 2,135,166, 91,228,161,235, 50,189, 94,159, 82,183,123,252,246, 72,147,116, - 97,163,181,149,246,137,146,111,108,255, 70,237, 30,188,212, 59, 84,218,105,159,222,157, 44, 28,126, 58,252,244, 22, 7, 34,163, - 45,121, 43,111, 81,155, 14,213,131, 70,106, 69, 29,213, 84,100, 84,132, 67, 19, 77,200, 10,104,101, 28, 11,173,205,225,167, 5, - 38,217,136,226,240,211, 6,179, 44, 68,117,248,105,129, 73, 54,162, 56,252,180,193, 44, 11, 81, 29,126, 90, 96,146, 19, 37,114, - 57,224, 52, 66,239,242,215,225,167,195, 79,111,113,192,105, 75,222,226,228,115, 58, 14, 63, 29,126,122,139, 3,209,185, 45,121, -139,135,209,138, 78,116,110, 48, 78,217,189,219,212, 29,126, 58,252,244, 22, 7,156,182,228, 45, 78, 58, 32,211,105, 75,222,109, - 75,175, 45, 53, 54, 20,189, 96,167,192, 70, 52, 60, 61, 55,163,239,208,212,175,151,240,214,151,195, 79,135,159, 86,219,128,211, - 55,141, 57, 96,149,135,234,120, 14, 63, 29,126,234,113, 32, 58,183, 37,201,143,240,206,103,102,125, 42, 90,189,119,208,190,119, -171,219,225,167,195, 79,111,113,192,105, 75,222,226,164, 35,213,113,218,146,211,150,188,203, 1,135,154, 45, 14, 56, 29,208, 22, -187, 76, 35, 59,252, 52,101,145,173, 8, 14, 63,109,177,203, 52,178,195, 79, 83, 22,217,138,224,240,211, 22,187, 76, 35, 59,252, - 52,101,145,173, 8,145,193, 79, 91, 25,112, 34, 59,171, 60,179, 70, 24, 43, 28,141,196,144, 38,220, 16, 37, 69, 72, 99, 16,146, -122,248,150, 39,154, 49, 64, 47, 54, 66, 66, 23,125,126,131,191,249, 76,237,126, 64, 75,222, 77, 83,136,126, 49, 47, 92, 24, 83, -232,252,217,137,109,207,157,155,244,249,153, 51,147,202, 8,177, 34,182, 76,144, 32,117,222,124,105,178, 23,255, 42, 73,198, 2, - 99,210,100, 43,222, 62, 78,170, 92, 89, 12,242,106,198,207,112,176,211, 49, 96, 14, 15,211,194,211,150, 34,240, 29,167,222, 35, -192, 60,157,164,102,252,124, 31,105,246, 34,236, 67,104,100,241,211,102, 52, 45,146, 9, 21,205,161, 25, 30,174, 25,167,137, 42, -252,244,110,169, 95,117,106, 56, 15,112, 87,162, 68,137, 2,225,220,211, 29,146, 38, 77, 26,200, 0,223, 56, 74,128,251, 0,119, -128, 15, 28,190, 51,245,171,163, 42,247, 27,248,221, 20,223,153,138,116, 71, 25,248,155,207, 16,248,206,232, 50,107, 48,137,144, -176, 29,194, 6, 87,224,111, 62,243,116,121,162, 89, 8, 60, 56,129,242, 29, 7,129,100, 12, 40,247,113,240,230, 4,126, 23, 10, - 71, 62, 99,194, 95,209, 40,120,178,231, 96,246,165,205,118,224, 9, 20,165,197, 25,120,143,245, 2, 64, 81, 90,187,249, 68,154, -183, 16, 82,142, 25, 51, 38, 47,124, 63, 53,135, 31,164,159, 24,248,155,207,248,142,113, 12,232,186,243, 73,144,181,123, 87,151, - 73,203,255,172,114,139, 97,207,158,110,147,206,159,159, 82, 65,136,128, 55,227, 37,207,149,182,232, 59,181,199, 30, 59,126,106, -242,147,103,207, 38,175,220,176, 99, 82,246,194,239,141, 51, 0, 91,102,245,110,147,149, 74,116,135, 38,152,128,147, 18,118,201, -126,110,212,199,217,191, 25, 82,166, 76,233, 14, 24, 3, 12,251, 59,105,154,141, 23, 90,122,244,183,133,103, 91, 52, 21,233,174, - 35,244,185,173, 70, 99,143, 30, 45,233,191, 75,199,205,137,154,166,146, 79, 45, 93, 89, 94, 53, 93,210,147, 52,193, 7, 79,249, -220, 21, 25,249, 12, 15, 77, 79,249,116,241, 57, 38,238, 99, 93, 60,202,133,223,219,121,122, 5,125,241,193,143,218,126,252, 47, -138,182,177,135,113, 16, 24, 87,239,114,250, 81,120, 70, 31,227, 52,209,153,159,222,229,228,171, 78,141, 32, 75,237,193, 57, 36, - 36, 68,241,104, 78,175,217,116,144, 41,157, 98,178, 83,242,236, 66,158,185,199, 65,216,104,144,212, 60, 47, 8,250,199,126,248, -225,135, 71,167, 78,157, 82, 14,174,102,224,153,104, 63,255,252,243, 35,190, 67,252,130, 54, 58, 53, 7,128,106, 8,126,112,246, -248,248,207, 63,255, 84,188,120, 51,143,243,231,207,231,249,111,143,249,206, 21, 71,111,176, 48,106,216,239,192,193,226,249,255, -254,251, 47,120,213,170, 85, 79, 48,224,172,102, 64, 62,131,241, 44, 4,131,240,121,208,164, 23,111, 59,131, 79, 3,120,167, 15, -100, 89,113,228, 9,193,150,188, 40, 33,242, 36, 37, 98,188, 48,249, 84, 73,178, 8,166,132, 94, 32,208,114, 73,186,244, 36, 91, -122, 52, 19,224, 32,224,140, 0, 86, 63, 16,184,105,105,242, 25,223, 49, 14,232, 38,208, 41,188,155, 38, 37, 89, 4, 88,247,111, - 30, 17, 12,211,127,173,116,167,253,151,205,253,210,102, 47,246, 75,146, 12, 5,198, 30, 58,114,124, 50,104, 76,254,103,231,177, -201,190, 19, 86, 76,254,232,203, 81,147,146,103, 46,218,222, 19, 77, 47,246,157,232, 60,160,185,203,158, 36, 73,146,203,242, 72, - 28,189,131,228,121,242,131,236,231,242,156, 82,222, 9, 58,140,250, 59,193,139, 60, 48, 90,142, 29,242, 68, 8, 62,151,231, 73, -242,187, 50,112,188,129,119,248,115, 70, 52,145,207, 75, 50,159,164,201,211, 41, 56,110, 72,186,106,239,253,234,179, 41,113,186, -132,229,124, 90,161, 73,218,112, 64,123,209, 40,159, 4, 68,140,195, 75,230,147, 99,167,204, 39,199, 80,117, 94,229,127,140, 53, -134, 39, 65,232,209, 52, 43, 59,191,225,137,159,174,252,143, 61,122,244,168, 50,166,227, 16,251,235, 56,245,226, 41,219, 0,199, - 80,140,165, 33, 56,214,236, 9,207,165,252,244,211, 79, 57,182, 16,108,217, 25,235, 34,210, 85,157,190, 25, 17,238,133, 77, 27, - 85,248,233,221, 82,191,234,212,184,194,229, 64, 49,119,238, 92,241,199, 31,127,136, 37, 75,150,136,229,203,151, 11, 0, 14,241, -207, 63,255,136, 77,155, 54,137,237,219,183, 43, 7, 79,243,176,100, 14,188, 22,129, 86,137,172, 89,179, 6,241, 88, 14,245, 37, -207, 1,100,135,231,225,179, 24, 28,131,192,163, 18, 22, 38,220,143,241,221,203, 99,199,142, 85, 14,170,213,187, 56,112, 28, 58, -116, 72,240,188, 67, 72,205,120, 54,221,199, 70,131,164,124, 14, 79,239,245,114,228,200, 17,136,203, 77,114,200,144, 33,103, 23, - 46, 92,120,141,131, 49,207,111,219,188,121,179,200,152, 49, 99, 32,142,236,169,103, 33,159,140, 18, 27, 43,199,189, 39, 78,156, - 8,222,183,111,223, 83,120, 12,159,231, 74,135,197, 99,236,159, 48,168,173,199,255, 54, 30,218,134, 30, 40,114, 75,178,144,209, -219, 8, 65,154,112, 91, 74,185, 12, 36, 91,161,104, 82, 45,184,103,207,158, 76,240, 36, 30, 64,128,133, 99, 98,206,224,104,159, -171,152, 48, 30, 35, 60,193,239, 64, 28, 21,115,150,239, 24,135,113,153,198,136,159, 84, 23, 74,160,117,248,192, 6,241, 73,155, - 10,143,254, 59,185,111,211,157,187,119,103,173,222,122,112,242,177,179, 87, 38, 47, 93,127, 96,242,228, 63,182, 76, 46,209,252, -167,201,239,127, 53,105,114,218,220,165,198, 37, 78,159,191, 34,104, 26,122, 71,247, 82,255,137, 42,131, 79,164,230, 19,160,232, - 50, 27,249,210,165, 75,197,138, 21, 43,196,234,213,171,197,250,245,235,197,150, 45, 91,196,142, 29, 59, 4,234, 88, 57,171,144, - 19, 50,192, 53, 15,199, 22, 4, 95, 58, 39, 15,184,243, 73,160, 69,154,127,255,253,183, 50, 94,108,220,184, 81,108,221,186, 85, -236,218,181, 75,236,221,187,215, 77, 15, 11, 22,133, 30,199, 3,130, 47, 0, 3, 46, 94,212,151,154,230, 37,246,101,142, 61,204, -219,206,157, 59,221,121, 59,114,228,136, 80,211,226,113, 63, 60, 92,157, 96, 4,227,205, 85, 35,154, 4, 48,204, 39,203,203,254, -204,242,226, 32,118,113,224,192, 1, 65,154,232,171,226,204,153, 51,202, 57,141, 60,102,140, 71, 8,145, 38,128,150, 33,120,147, - 52, 61,149,153, 52, 89,102, 53, 77, 79, 71,110, 73,154, 44,251,182,109,219,220,124, 60,120,240,160, 82, 47, 44,187,150, 38,129, - 29,192,147, 33, 63,201, 19,212, 83, 0,249,206, 67,191, 89, 63, 4,187, 44, 55,199,250,191,254,250, 75, 41, 55,121,241,235,175, -191, 10, 44,128, 41,217,210,187, 34,181,125,122,169,175,147,140,147, 79, 47, 50, 51,146,248,105,152, 67,116,211, 55, 17, 74, 34, -212, 65,168,137, 80,206,245,187,170,235, 94, 26,247,202,174,223, 85,112, 47,229,250,205,248,252,205,247,252, 45, 67, 73,245,199, - 84,180,249, 13,249, 29, 25, 87,126, 67,251, 95, 62,215,190, 15, 69, 91,249, 14,207, 77,115, 5, 78,110,202, 37,129,150, 21,144, -117,248,240, 97, 5,104,233,172,112,181, 76,139, 3,112,113,150,131,139,250,226,202,139,207, 56, 88,112, 80,231,157,131, 40,212, - 15,156,208,227,152,180,141,115, 4, 62, 4,106,102, 23,243,200, 65, 31,244,180,171,230, 48,159,160,202,128,171,120,210,230, 64, -198,201,135, 3, 23,243, 74, 41, 28, 7,161,169, 83,167, 42, 3, 20,121,101,177,253,126, 53,120,240,224, 71, 28,172,113,166,221, -117,164,145,210,176,193,147, 39, 79, 14,228,119,112,222,220, 58, 60,215, 2,151, 48,228, 81, 86,105,147,229,150,100,225,217, 3, -132, 0, 77,120,128,196,138,164, 11,151,148,108, 37,209,203, 47,222,211, 38, 43, 21,202, 62,154,241, 49,168, 31,199,255, 39, 8, -103, 16, 14,186, 2,127, 63, 90,187,118,237, 17,198, 97, 92,166, 97, 90, 61,154,180,201,162,186,144, 96,171, 71,239,119,130, 14, -252,187,230,240,211,167,119,252,119, 30, 60, 61, 99,228,172,127, 38, 47, 92,179, 79,145,104, 49, 28, 56,126, 97,114,187, 1,115, - 39, 15,158,180,108,114,209, 74,245,199, 37, 76,151,191,142, 69,190, 58,209, 34,192, 1, 76,226,151, 9, 96, 8,178, 88,167, 0, -230, 2,234,109,129, 35,118,184, 48, 17,144, 36,113, 17,165,244, 75, 44,128, 4, 22, 32, 2,210,104,143, 71, 60, 17, 24,144, 38, -218,137, 66, 75, 75, 19, 19,188,224,184,161, 6, 7, 92,100,233, 0, 45,119,201,144,230, 18,251, 35,129,134, 26, 0, 74,144,165, -166, 69,144, 69, 48, 72, 73, 82,182,108,217,180, 64,203, 77, 83,230, 83, 11,178,152, 55,130, 44, 74,158,213, 32, 75,210,212, 1, - 90,110,154, 52,169,160, 36,203, 8, 88,106, 1,145,164,169, 3,180, 66,209, 36, 63, 37,200,194,226, 78,120, 2, 89, 28,187, 88, -118, 29,160,165,109, 41,249, 40,201, 90,188,120,177, 96, 88,182,108,153, 27,100,113,204, 99,160,116, 11,135,151, 83,178, 93, 52, - 2,205,204, 73,234,112,192,148, 3,122, 88, 68, 38,194, 28, 81,165,119,239,222,125, 56, 70,149, 45, 91,214,143,128,201, 53,175, -185,239,242, 61,239,242, 61,227,104,255,171,210, 41,228, 17,151, 32,206, 77, 71,157, 86,253, 13,213, 92, 26,230,219,242,157,150, -182,187,208, 44, 28,255,200, 59,127, 19, 60,112,176,224, 42, 87, 74,178, 8, 42,164, 36,139,171, 62, 74,178,228,128,196,142,109, - 6,180,112,158, 90, 15,216,247, 60,246, 4,178, 54,108,216,160,128, 62,174,160,113, 0,239, 99,166, 49,169, 29,101, 69,202, 21, -238,162, 69,139,148, 21,183,246,226,128, 57,106,212, 40,225,235,235,171,208, 6, 61, 67, 96, 84,184,112,225,126, 77,155, 54,221, -214,188,121,243, 11, 28,168,184, 2, 39, 31,250,245,235, 39,142, 31, 63,174,172, 66, 57, 33,241,142,202, 83, 6, 38, 28,226,123, -161, 88,177, 98, 27, 49, 9,245,243,144,215,183, 48,160,221,162,138, 21, 43,196, 96, 12,148,139, 93,113, 59,125,243,205, 55,151, -185,170, 71,254,111,225,249, 80,211,214,248,188, 38,245, 36, 89,119,212, 32, 11,249, 14, 64, 25,110, 98, 2,187,133,137,231, 42, - 37, 91, 49, 99,198,188,139, 56,105,244,190,129,231,241,112, 88,112, 57,188,123, 6,169, 21, 25, 73,144,181, 95, 77, 19,244, 2, - 64,107, 63, 0,231, 29,240,137,118,107,207,152,134,105,245,105,174,136, 77,155,172,141,235, 7,247,204,148, 53,203,165, 60,121, -114,223,143, 31, 63,193,179, 76,153,179,222,206, 81,160,244,161,189, 7,142,204, 32,200,186,112,229,246,228, 89, 43,118, 77,254, - 98,232,239,147,155,246,253,109,114,215,159,126,159,156, 48,109,161, 31,173,240,194,137, 19, 49, 14, 0,108, 92,162,148,134,210, -106,246,113, 9, 58,184,232,145,146, 29, 41, 45,186,116,233,146, 34, 57,166, 20,196,211, 89,154, 4, 48,236, 63,236,207, 4, 28, -122,210, 39,173,164,136,139, 37, 79,192, 64,230, 83,210,210, 74,157,122,246,236,169,244, 75, 9,178,184, 40, 34, 56, 1,208,186, -102,196, 33,130, 34,230,147,210,121, 41,201, 82,131, 44, 12, 22,130, 82,109, 46,142, 8,136, 8, 6, 73,211, 12,104,201,177, 3, - 11, 42,101,204, 49,187,147, 38,202, 78,105,187,238, 37,243,201,241,136, 32,139, 67,128,148,100, 25,209,119,209,212, 74,180,212, -244, 21,195,247, 15, 62,248,224, 41,199,111,142,101,160,253, 16,207,246, 49,212,169, 83,231, 17,129,230,130, 5, 11, 4,198,183, - 16,215,115,171, 6,242, 17,107,148, 78,234,104,201, 1, 61, 44, 34, 25,161, 5, 66,122, 64,235,249,212, 24, 22,128,105,159, 51, - 14,130, 91,234,164, 6,113,242,157, 30,240,114,189, 83,164, 90,122, 52,229, 51, 53,109,119, 69,234,161, 72,138,254, 57, 88, 88, - 1, 89,236,140, 6,170,132, 80,141, 5,131,197, 58,174, 14,229,197, 65,139,146, 44, 2, 33, 14,114, 20,223, 51, 47,115,230,204, - 81, 58,183,159,159,159, 96, 26,147, 22,167, 0, 45,174,112, 25, 56, 96,114,101, 70,245, 4, 7,228, 1, 3, 6,136,110,221,186, -137,175,191,254, 90,124,247,221,119, 2,170, 63,143, 64, 11,224, 97, 39, 7, 40,136,202,111, 16, 96,253,246,219,111, 2,160, 67, -116,233,210, 69,145,218,113, 32,159, 62,125,186,232,209,163,135,242,156, 19, 83,219,182,109,175,145, 79, 37, 75,150,220,230, 33, -175,149, 24,159, 60,109,214,172,217, 51,196, 99, 37,151,131, 77,196, 53, 14,228, 88,169, 62,194, 68,242, 23,158, 73, 59,170, 55, - 61,149,155, 64,139,149,234,170,216, 48,146, 44, 76,156, 1, 0,117, 1,168,155, 0, 76, 72, 1,151, 47, 95,166, 4,141,146, 5, - 2, 93, 35,160,149, 24,147, 82, 47,198,131, 10,225, 18,226,157, 83,131, 44, 76,132, 1,152,100, 21,154,144,234, 29, 7,143, 15, - 51, 46,211, 32, 94, 98,163,252, 38, 74, 20,191, 26,164,147,183,161,134, 14,134,234, 81,145, 18,114, 50,156, 61,103, 78, 48,118, - 22, 60,154, 60,117,250,210,121,127,239,158,220,126,240,188,201,181, 59, 77,154, 92,165,253,216,201,223,141, 91, 6,160, 85,192, - 18,232,140,150, 35,146, 23, 11,141, 62,118,137,160,132,109, 89, 74,177, 40,113,162, 20,139,210, 34, 41,197,202,155, 55,175,192, - 66, 68, 96, 67,132,178,104,225, 1,209, 70,217, 32, 48, 32,112,226, 2, 8, 42, 39, 74,167, 5,105, 98, 49, 70,169,149,178,104, -225, 88, 32, 65, 12, 39,122, 3, 85,151,251, 19, 4, 90,164, 41, 1,160, 4, 68, 18,176,113,225,195,241, 68, 2, 34,246, 53, 94, - 80, 29,122, 4, 90,252,174,118,225, 40, 37, 89, 4, 90, 4, 89,204, 31,199, 43, 73,211, 12,104, 17,184,106, 85,164,122,146, 44, -210,100, 92,142, 53,102, 64,139,249, 36, 77,230,149,253, 78, 79, 93, 40,243,169,162,233, 9,104,109, 39,175,120, 73,117,161,203, - 0, 94,225, 57,192,225, 9, 74,205, 56, 6, 78,153, 50, 69,208, 60, 3,237, 67,239,224,111, 47,182, 70,135, 84,116,230,128,137, - 68,171,178,145,196, 74, 13,122, 84,243,162,161,212,201, 5,148, 20, 86, 19, 20,105, 64,149, 2,192,244,128,150,252, 14,222, 41, -170, 66,163,255,186,117,168,135, 34, 9,180, 56,168,169, 87,185,122,171, 62, 57,200, 81,183,239,105,133,203, 15,199,143, 31,255, -182, 28,168,244, 64, 22, 87, 84, 4, 89, 19, 39, 78, 84, 36, 80,252,207, 52, 38, 13, 47, 20,208,146,128,139,119, 0, 32,241,197, - 23, 95, 80, 50,230, 6, 90, 4,111,160,103, 56, 65, 20, 44, 88,112, 30, 86,244,193,148,168, 65,109,122,133,182, 88,180,247,160, - 17, 46,239, 44, 47, 7, 37,242,130, 96, 16,171,232,171,195,134, 13, 35,136, 11,198,224, 59,215, 67, 94,135, 82, 4, 79,144, 65, -155, 24,198,131,141,211,114,216,163, 5, 67,154, 21,156, 61,123,118,110, 0,200,141,144, 0,131,221,152,234,213,171, 7, 64,250, -244,149, 17, 61, 79, 64, 11,188, 13,192,132, 19, 0, 0, 27,128, 65, 57, 0, 82, 5,254,190,194, 70, 97, 2,180, 82, 64,146, 57, -219,213,120, 8,200,168, 46, 84, 84,145,144, 96, 16,172, 5, 96,130, 84,104, 66, 74,177, 31,121, 63,201,184, 76,131, 56, 41, 12, -242,154, 18,117,120,199,200,126,142,252, 76,156, 36,201,163, 97,211,253,103, 12,152,188,114,242, 79, 51,214, 76, 30, 60,109,229, -228,138, 13,187, 76, 76,144, 58,119,197,232, 60,232,188,168,178, 67,253,123,137, 18, 42, 74,178,212,125, 92,171,146, 99,251, 39, - 80,102, 95,224, 68,110, 6,180,216,199,165,138, 79, 45,125,146, 32,134, 32,139, 18, 94,130, 3,126,223,165,234,186, 96, 84,110, - 2, 45, 2, 66,246, 77,130, 44,246,107, 46,128,216,134, 72,171,111,223,190, 10, 40, 82, 3, 34, 43, 64,139,227,156,148,206,251, - 52, 56, 40, 24,206,159, 63,175,208, 36,208, 82,131, 23,185, 72, 4, 40, 98,127,210,189,104,118, 64,154,204,167,153, 36, 75,190, - 39, 93,140, 31,134, 18, 45, 73, 83,170, 11,217,239, 36,112, 51,146,104,145, 38,242,105,200, 79,208,216,206,250,100,122, 74,233, -105, 79, 39,129,214,183,223,126,219,126,224,192,129,247, 38, 76,152,160, 44, 80,201,235, 54,109,218, 80,122, 31, 84,165, 74,149, -189,249,242,229, 91,244,162,218,167,243,157,232,195, 1, 19,137, 86, 89,130, 27, 53,192,145, 64,199,238,221, 69, 39, 20,160,114, -169, 23,171, 72,110,235, 1, 45,249,125,189, 60,104,158,133,173, 52, 21,138,236, 39,223, 82,244,207, 1, 75,170, 18, 60,129, 44, -174, 34,205, 84, 9, 46, 96,113,159, 64,131,116, 57,136,113, 85,203,213, 25,191,161, 6, 89, 63,254,248,163, 64, 39, 87, 12, 48, - 1, 70,238,155, 52, 51, 67,160,197,129, 65, 11,180, 72, 19,244, 60,217, 84,197,205,153, 51,231,112, 72,167,214, 98, 37,239, 7, - 99,247, 43, 92,121, 83, 2,195, 21, 37, 3, 85,148, 28,148, 8, 44, 49, 0,206,135, 68,103, 45, 38,157,225,160, 27,215, 40,175, -176, 83,217,195,213, 35,249,136, 56, 51, 17,138, 34,127, 33,156, 56, 48,168,209,142,170, 35, 66, 18,216,176, 65, 32,183,248, 14, - 7,122,236, 74,164, 65,186, 46, 77, 35,160, 5,192, 27, 0,169, 91, 0, 38,201, 0,168, 25, 2,214,172, 89, 19,128,252, 18, 28, -113,151,148, 41,208,130,244, 97, 62,226,133,128, 62,141,222, 14, 82,253,136,137, 38, 0, 60,112,211,132,221, 77,192,202,149, 43, -247, 65, 98,248, 31,227, 50,141, 17,208, 66,121, 38,227,251,207, 69, 11,170,139,237,128,124,229, 64, 63,124,248,240,144, 68, 73, - 82,253,155, 52, 99,161,201,201, 51, 23,166,202,240,135,231, 32,171,159,209,118,242,232, 51,242,188,128,146, 18,104,113,161,196, -182, 41, 37, 78, 90, 41, 22, 65, 86,185,114,229, 4, 54,108, 8, 44, 2, 4,212,221, 2, 54, 69, 30, 37, 90, 28, 19, 40,125,194, -100,175,132, 44, 89,178, 40, 27, 93, 36,136, 33,200,162,148,152,241,216,175, 92, 82, 29, 67, 96, 64,201, 27,227, 18, 0,114,236, - 32, 96, 35, 45, 74,171, 57, 6,161, 31, 41,249, 34, 48,144, 11, 58, 51,160, 69, 0,195, 62, 72,224,166,166, 73,176,197,252, 17, -104,185,131,170,253,154, 1, 45,210, 84, 3, 85,181,157,151, 86,234, 36,201,234,236,100,116,215,190,204,167, 84, 23,146,143,106, - 99,122, 35,154, 38, 64, 75, 81, 29, 66, 82,249,132,227, 25,198, 10, 81,187,118,237,199, 24,151,206, 96,210,185,175,237,179,234, -255, 72, 67,247, 54,206,229,112,192,171, 28,208,195, 34, 90,224,195,121, 76,109,115,101, 6,188,180,241,249,159,193,149, 78, 43, -185,114,107,146,244,128,150, 38,173,164,161,220, 77,129,150, 30,167, 8,180,184,114,245,180, 19, 71,118,116,130, 16,174,224, 60, -173,112,249, 13,208,220,194, 52,156, 92,213, 32,139,118, 96,179,103,207, 22, 92, 61, 17,100,113,192,164,106, 2,187,252, 4,211, -120, 19,104,193,232,220, 12,104,105, 63, 87,181, 80,161, 66, 23, 57,144, 83, 34,197,188,193,206,140, 6,193, 4, 46,116, 41, 97, -233,202,147, 39,207, 51,214, 6,165, 95, 72,240, 41,194, 4,170, 1, 8,190, 80, 70, 26,235,102,134,209,241, 22, 24,159, 62,162, -244, 7,146,183,219, 0,153, 63, 24, 17,215, 0,173,123, 80,119, 6,128,175, 1,144,142, 5, 96,135, 37, 37, 78, 1, 24, 60, 3, - 32,117, 11,128,170,147,128,139, 27, 0,204,128, 86, 98, 24,189,126,195,120,152,208,174,128,230, 57,212,173,155, 38,212,155, 10, - 77,168, 95, 3, 80,103,135,102,205,154, 69, 95,101, 52,148,253, 6,249, 73,172,151, 87, 72,187, 78, 74,245,132, 28,168, 57,169, -210, 38,141, 19, 59,119,102,209,142, 7, 82, 62,170, 33,157,235, 37,112, 0, 42,194,139,156,168,181,234, 51, 41, 49,145, 59,248, - 8,198,216,207,169, 90,231,229, 9,104, 17, 24, 48, 62, 37, 89, 90, 16, 3,201,168, 2, 98, 8,178, 56,198,176, 61, 72,154, 0, - 6, 90,183, 9,110,142, 72,160, 37,141,212,105,147, 69, 21, 62,119, 19, 83,146,245,253,247,223, 43,139, 56, 2, 54, 46,212, 36, -216, 2,192, 51, 84, 29, 50,159, 76,195,241,136,155, 92,164, 68,139,119,242,132, 32, 75,170,225, 20,192,229,186,144, 79, 67, 3, -123,238,190, 38, 77,169,218,179, 2,178, 72,214, 19,208,210,210,180, 2,178, 72,211, 19, 63, 93,140,205, 7, 9,213, 45,214, 21, - 55, 10, 17,192, 81,186,199,113,138,151,156, 88,212,119, 62,199, 2,212,176,158, 94, 66, 19,118, 62, 25, 13, 56,128,102,167,222, - 9,200,223,114, 87,161,118,231,159,222, 78, 64,117,252, 80,187, 14, 85,116,195,179, 11, 81,126, 75,189, 83, 49,236,142, 67,163, -250,161,141, 5, 59,159,209,118,103, 53,200, 98, 60, 51, 85, 2,191, 3,224,208, 31, 59,245,158,114, 16,146,146, 44, 45,200,226, -138,148,234,128,161, 67,135, 10,216, 75, 61,101, 26, 51,160, 69,233,136, 90,101, 40,127,235, 73,180,104,103, 0,122, 86,119, 9, - 42,159,166,228,138,131, 37, 7, 99,184,101, 80,118,254,144, 63, 54,218,246, 91,180,107,225,197,242, 33, 29,117,187,255,144, 15, - 4, 26,248, 61, 17,161, 3, 55, 10,112,226, 1,143,238, 67, 2, 54,141, 44,179, 2,180, 48, 73, 93,199,100,117, 19, 19, 67, 32, -242, 23,128, 13, 11, 1,176, 25, 11,152, 55,111, 94, 0,236,222, 78, 67,250,116, 6, 64, 86, 81,243,153,168, 14,227,195, 48,150, -162, 83,174, 24,254,165, 59, 7, 76,182, 32,249,156, 38,232, 4,192, 47, 89,192,140, 25, 51,246,128,254, 73,236,252,160,195, 74, -193, 52, 40, 90,124,189,188, 98, 51,131,226,151, 71, 94,114,215, 38,109,119,104, 47, 71, 9, 35,121, 0,149, 5,165,122,206,245, - 18, 56, 0, 41,214, 69,130, 30,245,230, 22,181,161, 58, 23, 82, 90,144,101, 5,104, 17, 96, 19,100,113,151, 34, 84, 77,110,251, - 46,181,100,140,113,212,237,195,196, 78, 73,145,104, 81,146, 69,144, 69,105, 22, 1, 27,251, 20, 65, 17, 55,172,112, 28,226,165, - 6, 90, 88, 8,208, 62, 81,247, 34,128, 33, 77, 9,178, 36, 8, 36,208,226,115,130, 43, 2, 55, 23,234, 80, 3, 45, 67,240, 38, - 65, 17,121,104, 71,117,232, 9,188,168,105, 74,208,243,203, 47,191, 40,229, 54, 81, 29, 26,170, 35,201,144, 2, 5, 10,236, 99, -159,164,145, 61,109, 91, 49,102, 8,244,111,101, 12,246,116, 97,113,120,243, 37, 52, 85,231,147, 14, 7, 94, 47, 14, 16, 72,176, - 19,107,119, 30,121, 90,229,122, 90,225,186,184,147, 24,246, 58,215, 41,205,224,170,148,234, 66,181, 36,139, 3,102,231,206,157, -221,226,127,198, 69,186,196, 38,156, 61,207,129,130,249,226, 96,161, 6, 92,106,160,213,167, 79, 31, 5,188, 81, 74, 6,122,158, - 12, 68,195,124,142,187, 41, 57, 16,211, 23, 23,191, 65, 9, 12, 37,126, 54,106, 60, 9, 85, 46,188, 56,128, 33, 93, 69, 24, 4, - 43,187, 2, 56,168,225,127,103,132,133,224, 73, 8,202, 17, 2, 48,180, 18,255, 61,121,199,231,210, 58, 25,242,145,133, 1, 32, -229, 49, 3, 36, 15, 87,160,134, 13, 0, 95, 3,192,215, 0, 72, 8, 3, 48, 8,159, 2,216,121, 28, 43, 86,172,199,140, 11,144, -152, 25,105,117,143,228,193,243,152, 8,169,161, 10,156,195,193, 28, 96,232, 0, 38,216,187,176, 11, 57, 1, 73,214,126,168, 0, -247,193,110,237, 48,232,159, 70, 61,173, 98, 28,198,101, 26,166,213,227, 7, 36, 90,167,164, 68,139, 19, 23, 87,249,220,185, 74, -251, 54, 74, 6, 71,143, 30,173,128, 45, 72,180,232, 46,194,185, 94, 2, 7, 8,180, 40,101,214,115,105, 32, 65, 22,251, 24, 23, - 52,234,203, 76,162,197,122,151,146, 34,218, 58, 18,196, 80, 90, 43,237,188,212,210, 49, 73,215, 19,208,162,138,147, 11, 17, 2, - 44,210, 98,159,166, 1, 60,109,179,216,182,184,241,133,146,112, 6,181,234,208, 10,208,146, 52,213, 18, 45, 74,218, 60,168, 14, - 77,129,150, 85, 73,150, 44,187, 21,160,165,150,100,177,255,169,141,233,245,128,145, 39,126,178,169, 97, 92, 24,199, 49,151,160, -141,124,194,102,135, 39, 24, 55, 66, 62,249,228, 19, 23,182, 12,235, 4,153, 47,176, 0,230,238, 68,231,114, 56,224,112, 32, 34, - 28,144,126,164,212,219,187,141, 64,150, 28,128,117, 6, 94, 61, 7,113,213,115,229,202, 21, 68,201, 16, 7,118,250,233,226,100, -203, 65,178,127,255,254,138,127, 30,218, 92, 96, 5, 71,135,165,213,117,202,160,165,249, 9, 60,191, 63,160, 95, 43,170, 56,104, - 23,193,221,134, 4, 92, 4, 90,157, 58,117, 82, 86,186, 63,253,244,147,248,248,227,143,105, 92, 79,186,159,104,232,122,116,100, - 71,160, 69,145, 58, 85,125,148,196,208,150,129,155, 5, 76,248,171,166,153, 1, 91,165,149,129,139,121, 66,186,114,101,202,148, - 81,196, 60,180, 39,193,255,186,176,243,186,197,255,216,225,195,109,212, 93, 12,104,107,157,139,210,239,149,123,247, 33, 38,181, -243, 0, 69,231, 1,166,206, 34,143,167, 33, 49, 58, 57,105,210, 36,186, 96,144, 58,105,250,209,210,250,187,210,210,140,139, 85, -109, 78, 72,212, 78, 51,221,231,159,127,190, 31,229,254, 23, 32,147,116,143,207,156, 57,115, 59,242,190,157,239, 24,135,113, 65, - 83,107, 71,230,166, 9, 27,173, 41,200,199, 83, 74, 26,200, 67,130, 84,122,235,231,102, 7, 78,146,220,209,212,161, 67,135,103, -136, 55,198, 6, 63, 35,210,180,213,105, 29, 7,134,224, 6, 84,254, 23,164, 58, 95,237, 55, 74,237, 38, 65, 11,178,216, 86, 61, -245,119, 74, 96,184, 80,227, 2,165,120,241,226,244,123, 67,155, 67, 81,173, 90, 53,193,190, 64,144,165, 71, 19, 11, 16,173, 4, -198, 93, 71,210,104, 95, 2, 54, 61,213,163, 30,216, 0,128,184, 97,212,223,165, 68, 75,173,206, 84,219,140,233,209,227, 51,228, - 83, 11,180,220,249,228,120, 33, 55,251,216,148,104,105,237,211,116,105, 82, 77, 10, 73,148, 2, 46,217,175, 60, 73,180, 60,241, -211,197, 19,229, 8, 30, 44,152, 40,157, 86,142,224,193,233, 28,226,253,247,223, 55, 42,186, 26,128, 73,182, 58,253,200, 91, 35, -210,115, 58,209,153,159,222,229,228,171, 78,141, 64,139, 29, 90, 30,185,193, 65,147, 43, 84,174, 40, 57,136,112,160,116,219, 46, -184,186,164, 69,160,197,162,215,192,196,122, 29, 43,209, 39, 4, 90,148,108,113, 55,224,160, 65,131,232,250,224,169, 75,146, 85, -195, 10,216,112,197, 73,137,251, 56, 0,128,103, 4, 92, 4,132, 4,114,180,221,128,161,181, 2,110, 80, 30,186, 84, 24,135,192, -184,218,203, 12,104, 93,230, 14,162,220,185,115, 11, 24,202, 43, 59,116,232,228,209, 6, 48, 72,133, 9, 70,209, 63, 64,205, 70, -208, 83, 24,255, 21,160,213,168, 81, 35,254, 47, 80,181,106, 85,229,127,139, 22, 45,248,223,200, 49, 96,152,124, 34,137, 91,178, - 5,201,149, 96,192, 42,213, 29,176,115,145,224, 70,145,124, 49,174,149,178, 35, 94,162,105,211,166,229,146,146, 45,164, 9, 99, -171,193,119,140,195,184, 38, 52, 83,162,174,239,208,191, 25,165, 26,116,131, 49,126,252,120, 5,248,114, 21,205, 65, 29, 94,248, -169,134,240,116,240,117,116, 31,124, 34,117,224, 69,191, 85,128,150,158,115, 78, 61, 73,150,156,129,173, 0, 45,214, 57,125,111, -201, 29,139, 82, 5,169, 7,178, 92, 0,198, 16,104, 1, 20, 41,170, 67,181, 84, 76,109,223,101,132, 12, 32, 41, 50, 4, 90, 18, - 20,145,166, 26,184,185,213,133, 6, 68,205,128, 22,249, 38,221, 66, 72, 64,100, 70, 19,249,244, 8,180, 36, 77,117,127, 52,163, -105, 1,104,105,187,175, 52,144, 87,206, 16, 82,127, 75,205, 10,215,115, 7,104, 69,111, 80, 20, 25,227,210,171, 14,141,188,155, - 63, 30, 16, 45, 15,144, 85, 31,166, 74,123, 37, 6, 26,190, 51,112,176,149, 1, 96,198,206,161,210,137, 32,126,254, 30, 42,202, - 77,240,205,114,151,129,191,249, 12, 37,209,155,188,173,116,234,236,136, 52,255,189,247,222, 11, 33, 24,162, 29, 7,220, 38, 80, - 66,196,157,116,124,103,116,121,108, 48,216, 97,179,154,190,184, 40,129,163, 29, 75,235,214,173,185,131,106,181, 13,160, 69, 17, -253,116,172,234, 9,246,166, 51, 29, 28, 3, 78,135, 23,248, 96, 0,161,223,248,159,239, 75,151, 46,205,255,158, 92, 68,232,230, -147, 82, 42,181,100, 75, 11,140,248, 78, 71,146,229,145,159,148, 82, 33,164,110,216,176, 97, 37,236, 64,235, 13, 96, 53,151,129, -191,249,140,239, 24,199,128, 7,218,124, 86, 6,216,186, 5, 41,214, 83,122, 10,167,183,105,250,229,249,242,203, 47, 9,170, 9, -178,140,206,139, 84,147,143,140, 78,237,208, 4,135,169,198,166,244,138, 64, 67,189,152, 50, 3, 49,102, 64,139,244, 8,172,180, -139, 51,181, 77,150, 22,199,120, 58,134, 70, 2, 45,185,200,163,122,208, 12,104,144, 62,212,103, 30,165, 79, 4, 66,146, 38, 1, -160, 21,154,224,153,225,177, 62, 18,188,145,127, 92,140, 90,165, 9,201,155, 33,208,226,152,203, 5, 46,105,178,220, 86,105,122, -226,167,167,241, 11,118,117, 60, 21,194,240,114,128,150,155,123,206, 24,226, 93,232,225, 80, 11, 7, 7, 94, 86, 35, 44,129,188, - 46,115, 5,254, 54,187,204,242, 25, 7, 59, 15,127,195, 96,119, 2,131,232, 9,168, 62, 9,142,204,142, 6,210,163,169, 5, 38, - 9, 53, 25,211,254,215,230,219, 48,159, 24, 17,121, 36, 15, 1,149, 94,240, 36, 45,242, 68,147, 54, 91,241, 17, 18, 35,164,112, - 5,254,230, 51, 79,174, 23,244,104,166,192,113, 46,191,192,102,235, 52, 13,228,185, 27,145,174, 31, 80,192,228,102,149,227,122, -111, 86, 71, 22,201,132,138,230,208,100, 5, 36, 79,190, 93,187,152,210, 91, 72,169, 23, 85,252,237,105, 97, 5,137,239, 46,210, -148, 11, 51,163,197,153, 29,154,248,222, 86, 79, 11, 61, 45, 45,249, 31,229,219,175,105, 28,238,122,199,187, 93,225,161,233,169, -236,146,166,228,161,118, 65,106,148, 79,228,131, 42,121,221,197, 69,120,105,218, 92,252,186,191, 13, 32,185, 29,105,239,162,143, - 62, 68,127,229, 2, 49,148,116, 11, 82,104,181, 31, 49,167, 31,133,103,244, 49, 78, 19,157,249,233, 93, 78, 70, 19,106,209,185, -193, 56,101,247,110, 35,119,248,233,240,211, 91, 28,112,218,146,183, 56,249,156,142,195, 79,135,159,222,229,128, 67,205, 22, 7, -156, 14,104,139, 93,166,145, 29,126,154,178,200, 86, 4,135,159,182,216,101, 26,217,225,167, 41,139,108, 69,112,248,105,139, 93, -166,145, 29,126,154,178,200, 86,132,200,224,167,173, 12, 68,165,200,100,150, 94,176, 83, 6, 35, 26,158,158,155,209,119,104,234, -215, 75,120,235,203,225,167,195, 79,171,109,192,233,155,198, 28,176,202, 67,117, 60,135,159, 14, 63,245, 56, 16,157,219,146,228, - 71,120,231, 51,179, 62, 21,173,222, 71, 6,226,117,104,122,183, 9, 57,252,116,248,233, 45, 14, 56,109,201, 91,156,124, 78,199, -225,167,195, 79,111,113, 32,170,180, 37,111,149, 55, 90,209,137, 42,149,235,228,211,187,205,210,225,167,195, 79,111,113,192,105, - 75,222,226,164, 3,222,156,182,244,234,183, 37,239,230, 48,154, 80,115, 26,182,119, 43,218,225,167,195, 79,111,113,192,105, 75, -222,226,164, 3, 96,156,182,228,180, 37,239,114,192,161,102,139, 3, 78, 7,180,197, 46,211,200, 14, 63, 77, 89,100, 43,130,195, - 79, 91,236, 50,141,108,196,207,220,112,198,121, 8, 14,127,233, 39,170,149, 41,149,208, 17,236,214, 81, 51, 56, 46,190, 14,127, -124,127,131, 76,110,131,111,217,165,105, 37,203, 14, 77, 43, 92,178, 30,199,225,167,117, 94, 89,137, 25, 85,248,105,165, 44, 78, - 28, 13, 7,162, 74,229, 58,249,244,110,211,117,248,233,240, 83,114, 32, 55,124,208, 93,147,103, 20,194,121,168,214,209,167, 25, -167,108,181, 37, 28,222,126,129, 14, 61,113,230,167,128,255, 42,250,122,210, 3, 91,102, 52,115,195,121, 40,129, 33,207, 68,109, -102,150, 65,215,123, 51,154,146, 76, 43, 56, 46,190,129,179, 73,255,242, 0, 4,101, 92,171, 52, 45,102, 81,137,230,208,180,195, - 45,243,184, 14, 63, 61,243,168, 32, 94, 23, 50,103,163, 19, 35, 34, 28,112, 26, 97, 68,184, 23, 54,173,195, 79,135,159,222,226, -192,139,104, 75,110,144,197, 35,110,112, 48,185,192,137, 8, 4, 24,118, 46, 91,249,132, 83,220, 3,235,215,175, 87, 14, 47,255, -231,159,127, 68,214,172, 89, 9,236,180, 96,203, 19,205, 80,192,144, 78, 87, 45,102,214, 82, 62, 75,149, 42,117,145, 94,221,153, - 71,120,186, 55, 2,130, 14,208,114, 0,161,197,102,103, 57,154,165,246,105,153,218,243,136, 70, 52,233,204,251,147, 24, 49, 98, -236, 40, 88,176,160,114, 46, 39,126,111,197,179,134, 8,111,216,252,198,235, 21, 29, 7,147,174,103,120,189, 74,229,148,198,225, -128,195,129,151,196, 1,140,175, 5, 32,200,186,175,156,115, 56,110,220, 56,158, 15,250, 4,121, 89,131,176, 68, 39,244,197, 51, - 79, 71,111,169,139,193,120,140,175, 71,103, 13,191,195,239,241,124, 77, 28,178,206, 51, 74, 31,232,128, 45, 61,182,184, 65, 22, -243,204,115, 57,225, 21,221, 46, 48,244,200,110, 28, 99,245, 47, 15, 86, 39, 16, 36,240,132, 55,120, 51,176,245,146,170,207,249, -172,195, 1,219, 28,200,130, 20, 63, 98,177,115,131,135,146,227, 44, 92,177,116,233, 82,177,112,225, 66, 49,114,228, 72, 81,185, -114,101, 1, 73, 46,205, 7,122, 33, 36, 49,162,254,218, 98, 17,158,254,142, 80,145,193, 54,107,157, 4, 14, 7, 28, 14, 56, 28, - 8,203,129, 45, 60, 67,144,128,133,160,130,103,254, 25, 93,129,129,129,130,135,203, 67,213,247, 47,200,152, 29, 46,158,180, 88, -177, 98, 71,120,200,189,250,226,249,137, 60,116,153,103, 53, 94,191,126, 93, 92,184,112, 65,249,238,249,243,231,149,195,157, 65, - 87,123, 12,143, 54,199,161, 64,214,202,149, 43, 5,142,189,137, 12, 16,148, 27, 82,178, 43, 4, 89,204, 31,207,254,196,249,161, -122, 82, 55,167, 77, 57, 28,136, 74, 28,232,253,241,199, 31, 7,127,241,197, 23, 98,242,228,201,196, 19, 98,193,130, 5, 98,230, -204,153, 98,198,140, 25, 98,246,236,217, 98,214,172, 89, 98,236,216,177,162,126,253,250, 2,103, 41, 63, 68,225, 38, 32,228, 82, - 23,242,181,198, 34, 44, 92, 84,170, 81, 39,175, 14, 7, 28, 14,188,242, 28,216,207, 67,165, 9,162, 8, 40,172, 4,130, 15, 23, -216, 50,146,108, 37, 34,200,162,148,140,170, 72, 43, 52, 9,180, 8,188,192,173, 45, 30, 56,150, 5, 42,142,235, 82,250,246,215, - 95,127, 81,250,246, 24,241,141,164,111, 75,240,110, 26, 66,102, 3,154,124, 62, 18,129,241,244,194, 26,168, 13, 31,179,188,148, -186, 29, 56,112,128, 82,183,235,136,155,245,149,175, 85, 39,131, 14, 7,244, 57,112,244,240,225,195,226,223,127,255, 85, 84,246, - 43, 86,172, 8, 5,180, 8,178,126,251,237, 55, 49,125,250,116, 37, 76,157, 58, 85,116,232,208, 65,100,203,150, 45, 4,228,190, -147, 36, 95,107, 44,242, 90, 23,206,233, 22, 14, 7, 28, 14,188, 12, 14,228,198,225,235, 15, 8, 36, 8,118, 60,169, 14,161, 62, - 59, 41, 37, 60,148,108, 33,179, 84, 11,234, 93,125, 41,201,146,246, 94, 76,167, 3,100,214,192, 46,235,201,226,197,139,149,239, - 82,117,152, 39, 79,158,251,136, 87,192, 3, 19,134, 83,234, 37,165,111,143, 31, 63, 54,148,190,201, 23,148,214, 1, 44,233,130, - 55, 72,194,214,242,189,217,197,239, 72,169,219,137, 19, 39, 88,238,233, 47,163,162,156,111, 58, 28,240, 2, 7,142,238,221,187, - 87,244,234,213, 75,204,159, 63, 95,233,119,219,182,109, 19,203,150, 45, 19,191,255,254,187, 34,205,146, 32, 75,125,167, 74, 17, -223, 62, 26, 93,128, 86,191,215, 86, 47,234,133, 22,228,144,112, 56,224,112, 32, 92, 28,200, 77, 99,244,221,187,119,139,211,167, - 79, 43, 54, 73,241,227,199, 63,160, 67, 41, 41, 65, 19,213,139, 4, 30, 46,240,164,247,193, 37, 4, 47,140,227, 2, 89, 97,212, -140,220,205, 71, 48,246,232,209, 35,177,113,227, 70, 35, 99,120, 45,237,233,151, 46, 93, 18, 87,174, 92,177, 36, 37,147, 42, 63, - 2, 42,189, 76, 18,128, 73, 59, 44, 79, 82,183, 83,167, 78,137,115,231,206, 41,128,208, 5,180,134,135,139,203, 78, 34,135, 3, - 47,159, 3,255,110,223,190, 93,145, 98,253,248,227,143,162,103,207,158, 98,222,188,121,110, 9,151, 22,104,181,111,223, 94, 20, - 47, 94, 92,116,239,222, 93, 11,180, 94,111, 44,226,216,104,189,252,150,234,228,192,225,192,107,200,129,220,233,210,165,187, 66, - 91,164, 35, 71,142, 80, 53,120,214,160,140,110, 16,101, 5,104, 25,197,161,189, 19, 37, 83, 84, 95,120,112,239,160,205, 66,214, -188,121,243, 94, 39,224,185,120,241,162,176,168, 58,164,106, 48,179, 65, 89,248,156,170,197, 37, 6, 97, 13,164,125,143,105, 79, -118,239,222, 61,181,234,144,198,196,206,229,112, 32, 42,114,224, 67,244,243, 91, 67,134, 12, 81, 92,171, 80, 77,200,223, 61,122, -244, 16,126,126,126, 10,224,162,148, 89, 2,172,242,229,203,139, 38, 77,154,136,118,194,135, 64,139,182,153,238,203,193, 34, 81, -177,250,157, 60, 59, 28,112, 56,240,178, 57,144,155,110, 29,224, 67,139,198,229,122,126,169,146, 54,104,208,224, 34, 13,218, 35, - 42,209, 2,253, 86, 0, 88,231, 92,146, 51, 35,135,165,122,252,200,157, 51,103,206,171, 4,131,148, 50, 69,166, 49, 60, 84,153, -215, 8,178,104,188, 79,201,151, 99, 12,255,178,155,167,243,125, 47,113,224,109,208, 25, 8,187,171,135,195,134, 13, 83, 22, 44, -191,252,242,139, 24, 60,120,176, 34,185,130,255, 56, 37, 52,108,216, 80,116,235,214, 77,212,172, 89, 83, 96,135,226,109,164,249, -200, 75,223,119,200, 56, 28,112, 56,224,112,192,225,128,139, 3,153,113,119, 27,139, 19,100, 81,213,199,157,130,102, 54, 90,151, - 47, 95, 22, 12, 46,215, 8,106, 27, 45, 79,198,233, 86, 25,159, 59, 75,150, 44, 87,119,237,218,165,168, 58,233,222,193, 64,213, -105,149, 94,152,120,241,226,197,251,155,170, 77,130, 44, 74,249, 28,247, 14,225,102,165,147,240,213,229, 64, 42,100,109,108,254, -252,249,159,142, 26, 53, 74, 44, 89,178, 68,177,209,252,240,195, 15, 21, 27,174,198,141, 27,211,190,241, 17,226,252,128,144,248, -213, 45, 70,212,201,217,139,116,146, 22, 17,174, 56,249,140, 8,247,194,166,117,248,233,240,211, 19, 7,254,162,177,172,188, 40, -201, 34,200, 50,216,117,168,110, 75,137,242,229,203,119,152, 82,167,179,103,207,134,114, 25,193, 29, 79,248,224,122,139,108,247, -232,176,148,146, 55,170, 63, 92,170,206,115, 94,160,233, 38, 1, 32,119,133,170, 77,130, 44,199, 97,169, 71,206, 58, 99,136,197, -134,103, 49,218,203,224, 39, 85,225,179, 96,139, 21, 60,102,204, 24,101,151, 33,164,183,193,120,198, 69, 81,122,139,249,118,162, - 89,224,192,203,168, 92, 11,217, 10, 19,197,201,103,120,184,102,156,198,225,167,195, 79, 79, 28, 88, 79,149,130,218, 80,220,131, - 31, 45,109, 91, 74, 10, 3,251,131,127,254,249,103,168,244,227,199,143, 39,208,178,234, 92,212,172,125,230,134, 81,253,223,176, - 57,161,127,171, 86, 22,171,210,140,166, 36,211,140,118,106, 22, 85,155, 86,105, 90,204,162, 18,205,161,105,135, 91,230,113, 29, -126,154,243,136, 59,126,231, 33,204, 69,200,103, 30,221,137, 97,151, 3, 78, 35,180,203, 49,207,241, 29,126, 58,252,244, 22, 7, - 94,102, 91,202,140, 66,104,141,197,141, 60,195,235,229, 83,207, 51,188, 39,227,116, 45,207, 94,102,217,237,212,159,147, 79, 59, -220, 50,143,235,240,211,156, 71,118, 98, 68, 6, 63,237,124,223,137,235,226, 64,100, 84,132, 67,211,187,205,203,225,167,195, 79, -111,113,192,105, 75,222,226,228,115, 58, 14, 63, 29,126,122,139, 3, 81,165, 45,121,171,188,209,138, 78, 84,169, 92, 39,159,222, -109,150, 14, 63, 29,126,122,139, 3, 78, 91,242, 22, 39, 29,240,230,180,165, 87,191, 45,121, 55,135,209,132,154,211,176,189, 91, -209, 14, 63, 29,126,122,139, 3, 78, 91,242, 22, 39, 29, 0,227,180, 37,167, 45,121,151, 3,175, 33, 53,118, 18,189, 96,167,168, - 70, 52, 60, 61, 55,163,239,208,212,175,151,240,214,151,195, 79,135,159, 86,219,128,211, 55,141, 57, 96,149,135,234,120, 14, 63, - 29,126,234,113, 32, 58,183, 37,201,143,240,206,103,102,125, 42, 90,189,119, 86, 58,222,173,110,135,159, 14, 63,189,197, 1,167, - 45,121,139,147,142, 68, 75,175, 45,197, 0, 91, 24, 98,186,130,252,111,149,235, 47,163,125, 50,143,118,175, 23, 85,246,200,224, -231,171, 72,211, 46,255,157,248, 46, 73,153, 30, 35, 88,193,177, 92, 29,209, 46,163, 94, 70, 7,180,155, 71,198,143,234,249,212, - 14,146,118,120, 16,213,203,110,167,172,218,184, 78,217, 35,194,189,176,105, 29,126, 70, 61,126,202,177,227, 77,100, 61, 54, 66, - 28, 4,254, 38,232,178, 10,102, 94,100,189, 51, 95,111,184,242,104,119, 94,210,230, 51, 50,202, 30,157,104,122,183,181, 71, 1, -106, 69, 18, 36, 72,176, 36, 89,178,100,255,226,240,212,125,113,226,196,153,137, 60,151,181,153,111,189,206, 50, 13,222,144,131, -223,120,227,141,167, 56,150,227, 41,232, 62,141, 27, 55,238, 83,248,149,121,154, 56,113,226, 59, 22,232,235,118,192,148, 5, 63, -236,145,182,208, 71,231, 82, 21,252,224, 27, 53, 13,163,231,154,239,188,200, 78,109,161,136,134, 81, 94, 84, 62, 99,160,110,234, -195,223, 79,219, 88,177, 98,181,121,243,205, 55,149,128,186,106, 3,207,214,109, 80, 79,173, 76, 10, 17, 42,159, 73,147, 38,221, -145, 35, 71,142,227,185,115,231, 62,142, 51,229,142,195,233,228,241, 84,169, 82,237,144, 52, 80,255,155, 83,164, 72,113, 20,223, - 59, 10,103,145, 71, 51,101,202,116, 20,109,110,179, 83, 71,110, 14,188,168,122,143, 72,219, 12,181,184,248,253,247,223, 99,221, -221,154, 48,247,131, 45,177, 26, 63,218, 22,179, 3,239,252,207,231, 86,130, 42, 35, 81,174,236, 17,101,226,203, 40, 59,252,134, -141, 66,191,187,143,190,122, 5, 99,126, 32,250, 95, 32,250,164, 18,224, 88, 85, 9,232,179, 74,192,187, 93, 30,250,166, 4, 5, - 32, 25,123, 60, 28, 84,222, 7,141, 43,116,206,202,180, 24,251, 3,209,207,149,144, 54,109, 90,119, 64, 28, 79, 52, 67,125, 14, -180, 38,131,110,144,139,238,101,252,119, 7, 60,187,164, 10, 27, 77,198, 16, 37,175,200,231, 88, 85,217,175,120,171,236,164, 9, - 94,146,222, 21, 61, 62,146, 23, 12, 38,101, 15,197,207,200,202,167,171,222,189, 90,246,112,210,244, 98,247,137, 2,164,138, 22, - 45,122,244,201,147, 39,110,239,205, 15, 30, 60, 80, 78,229, 70,214,135,218,200,190,118,144,156,249,238,187,239, 42, 68,121,192, - 36, 15,112,189,116,233,146,114,122,253,153, 51,103,196,219,111,191,253,212, 2,109,221,129, 55,103,217,230,215,239,221,127, 16, -148,189, 76, 51,158,167,230,190,140,158,123,232,128, 69,240,110, 33,194, 62,155, 97, 21,226, 23, 51, 26, 36,209,232,182,176, 3, -219, 9, 76,227,105,160,136, 12,154,248, 30, 65, 86,131, 42, 85,170,180, 69, 53,181,131, 7,238,118,215,174, 93,107,119,229,202, -149,118,168, 43,229, 63,206,167,106, 99, 7,104,225,236,171,163,211,166, 77, 83,142, 78, 25, 59,118,172,224, 17, 36, 5, 11, 22, - 60, 42,105, 16,100,129,190,120,246,236,153,242,142, 94,191,113,232,174,251,189, 43, 94,148,155,112, 75, 23,205, 48,168, 76,241, -140, 19,101, 40, 93, 56,221, 32, 11,237, 91, 47, 74,168,178, 99,240,222, 13,103,154, 23,205, 2, 64,235, 69, 25,152,198,100,210, -225,107,122,114,238, 2,112, 61, 30,147,207, 63, 8,167,241,251, 33, 3,192,240,105, 44,188,248,108, 60,227,184,226,106,243,234, -206, 39, 65,213,189,141, 49,191, 11, 92,229,179,253,222,169, 31,110, 43,119,252,183, 10,182,140,250, 81, 56,249,103,152, 79, 3, -122, 60, 35,113, 63, 2,251, 31,157, 45, 90,185, 60,181, 79,122,193,254, 2, 97, 44,250,214,114,220,103, 32,116, 66,200,229, 34, -156, 25, 96,129,227,195, 90,252,207,172, 87,118,180,161, 93,229, 74,102, 14, 44, 87,226,121, 40, 83, 60,131, 22,152, 88,201, 35, -227,132,201,103,204,152, 49, 71,215,175, 95,255, 46,199,101, 30, 63,196,177,158, 71, 34, 61,126,252, 88, 57, 42,136,255,213,129, -224,192, 67, 91,162,116,232, 45,208,156,216,188,121,243, 59,164,201,227,140, 56,151,176,127,243, 20,128,144,144, 16,247,188, 34, -127, 16,116,121,160,233,126,133,118, 60,173, 69,139, 22,202, 28,194,163, 93,182,108,217, 34,142, 29, 59,166,124, 67, 27,208, 63, - 46,152,208,140,133,124,142,107,212,168,145,146,207,109,219,182,137,160,160, 32,175,148, 29,199,204, 40, 52,247,237,219,231,230, - 39,121, 64,158,170,195,211,167, 79,121,248,185, 37,126,226,140, 64,133,102, 64, 64,128,146, 79,214, 13,235, 41, 34,117,244, 10, -210,180,218,142, 95,143,120, 0, 90,167,239,223,191, 47, 86,173, 90, 37,214,172, 89, 35,246,238,221, 43, 56, 25,190,247,222,123, - 4, 91, 86, 37, 91,234, 78, 61, 77,130, 44, 54,150,230,241,125,196,176,196, 62, 74,163,227,117,226,196, 9,145, 36, 73,146, 39, - 22,184, 23,106,160,128,148,165, 37, 6,255,255,210,101,204,121,255,202,213, 59, 65,188, 67,234,114, 90,134,116,153, 92,207,113, -199,179,255, 0, 18, 90,234,124,195, 77, 19, 7,203, 30,146,121, 10, 51, 26,120,120, 64, 94, 97, 16, 56,174, 55, 72,242, 25, 86, -115,231,216, 33, 56,200,112,176, 97, 7, 99,199,147, 29,133, 29,135, 52,238,221,187,167,128, 13,128, 27,193, 52,158, 6, 10, 79, - 52, 73,139,223,145, 23,191, 99,129,166, 34,201,146, 32,139, 64,107,232,208,161,237,102,204,152,209, 14,135,236,182,219,180,105, - 83,187,221,187,119,183, 75,148, 40,145, 45,160, 5,158, 30, 37,168,230,201,237,183,110,221, 18,237,218,181, 19,133, 10, 21,114, - 3, 41, 12,178, 71, 57, 8,227,212,118,177,113,227, 70,229, 80, 95,156,147, 21,229,129, 22, 1, 22,120,232, 39, 67,141,202,121, -126, 41, 93, 44,211,132,231, 33,195,132,178, 37, 50,240, 62,158, 1, 19,231,184, 18,133,210, 13, 48,104,255,161,218, 60,165, 11, -234, 69,144, 89, 59,101, 91, 99, 26,147, 73,167,118,129, 2, 5, 30, 77,156, 56, 49,132,199,195,160,174,149,137,135, 19, 47,195, -142, 29, 59,196,246,237,219,197,214,173, 91,197,162, 69,139, 66, 42, 85,170,244, 24,244,106, 27,209,164, 4,139,224,234,247, 31, -124,148,236,241,206,255,124,254,138, 75,180,114,131, 15, 15,216, 31,217, 86, 33,133,189,143, 50, 90, 57,156, 90, 15,104, 37, 69, -218, 95,251,244,233,243,140,139, 73,246, 73,214,197,141, 27, 55, 20, 94,226, 72,146, 16,130, 47,132,153,252,222, 63,255,252,195, -177,149,142, 87,229,229,166, 89,174,100,150, 64,117, 61,191, 95,189,224,205,178, 37, 50, 5, 50,148, 41,174, 13, 25, 3, 75, 21, - 73,111, 4,196,180,249,252,233,227,143, 63,190, 46,105,183,110,221, 90, 57,227,145,249,251,247,223,127, 21, 16,115,234,212, 41, -229,136, 36,142,255,228,137, 7,160, 69,233, 11, 85,132,163,154, 54,109,234,166, 57, 96,192, 0,133, 22, 23, 90, 44, 39,251,186, -246,178, 2,180, 8,178,234,213,170,229, 78,154, 47,115,102,209, 19,231,230, 13,248,172,181, 24,254,101, 71, 37, 12,235,212, 81, -140,237,210, 89, 57, 53,192, 4,104, 17, 16,142,196, 57,155,215, 36, 65, 46, 2, 9,222, 88,246, 3, 7, 14,132, 42, 59,199, 47, -171,101, 7, 77,119,217,187,118,237,170, 28, 45,133,113, 83,153,227,216, 14, 36, 31,201, 11,182, 7, 15,101,119,243, 19, 64,216, - 77,179, 83,167, 78, 98,233,210,165, 74, 31,221,191,127,191, 56,122,244,104,184,234,232, 21,165,105, 1, 2,188, 94, 81, 40,157, -161,148,102, 31,128,204,217, 79, 63,253, 84,169, 88, 30,157,193,129,193, 98, 81,101,167,142, 65,117,161,186,115, 53,136, 23, 26, -104,177, 1,162, 35,133, 7,104,253,119,160,115,231,160,166, 53, 63, 13, 90,226,191, 61, 40,123,198,220, 65, 23, 38, 76, 8, 58, -241,213, 87, 65, 71, 59,118, 12,106, 90,181,217,243,231,233,114, 4,157,248,246,235, 32,172,202,255,243, 4,180, 32, 73, 57, 73, -160,195,142,102, 39,240, 72, 16, 0,197, 3, 70, 64, 11,229, 63, 71,224,195, 21, 14, 65,171, 89,112,117,106,143, 64,203, 19, 77, - 0, 36, 5,200,241, 76, 57,249, 45, 11, 52, 99, 82, 93, 72,128, 37, 3, 78, 97,111,135,137,177, 29,192,118,123, 76,188, 29,144, -255, 14,144,164,181, 67, 57, 61,217, 90,132, 26,204, 49, 89, 29,165, 52,244,246,237,219, 10,200,226,165, 6, 90, 25, 51,102, 60, -202,201,135,171, 83,158, 47, 71, 64,168,150,120,185,120, 26,245, 36, 90,197, 66, 3,173,195,251, 87,251, 29,222,187,202,239, 32, -194,129, 61,127,249, 29, 8,248,203,111,127,192, 74,191,189,187,150,251,173, 92, 60,202,175,100,161,116, 19,173, 2, 45,242,144, -147, 32,195,241,227,199,149, 65,156, 3,174, 60,214,230,228,201,147,202,224,203,192,139,106, 27, 79, 64, 11, 0, 59,128,105,251, -245,235, 39, 42, 84,168, 32, 42, 86,172, 40,106,212,168, 33, 48, 24,139,182,109,219, 10,128, 5, 49,124,248,112, 49,115,230, 76, - 5, 16, 80,122, 0,192, 29, 96, 68,147,234, 66, 74,178,212,125,254,198,209, 65,143,249,252, 21, 6, 90,185,209, 46,175, 17, 16, -241, 60,194,192,192, 64, 65, 62,226,200, 31, 30,197, 99, 6,182,194,180, 79,156,107,184,137, 18,123, 2,139,235,215,175, 43, 18, -124, 74,238, 57,214,145,246,221,187,119,197, 95,127,253,197,186,121, 64, 62,145,255,248,206, 18,189, 49,164, 44,164, 88,106, 94, -158, 61,177, 89,156, 57,190, 89,156, 62,190, 73,156, 58,186, 81,156, 60,186, 65,252,119,120,189, 56,113,120,157,216,190,110,186, - 40, 93, 36,131,182,190,195,128, 55, 62, 64,223, 83, 36, 89,242,250,238,187,239,196,234,213,171,197,158, 61,123,194,128,172,155, - 55,111, 42, 96,209,131, 4,134,224, 37, 54,212, 91,161,104, 2,188, 43,253,154, 60,224, 34,150,139,205, 13, 27, 54,136, 26,149, -203,138,166,141, 27, 40,207,205,128, 22,213,133,159,124,242,201,243, 85,185,235,106, 90,165,138,216, 48,110,148, 56, 58,255, 87, -113, 99,245, 66, 37, 92,255,123,145, 88, 51,106,152, 25,208,226,216,245,134,182,236, 19, 38, 76, 16, 43, 86,172, 80, 64, 17,199, -126,242,128,139, 12, 46, 46,120,246,101,120,202, 62,120,240, 96, 37, 45,199, 97,214, 61,235,157,227, 48, 65,150, 92, 44,121, 40, -187,194, 79,109, 62,125,125,125, 5, 22,190,202,226,135,103,124,178,141,254, 48,190, 95,168, 96, 86, 71, 86,104, 74,112,109,181, -222,181, 52,107,215,174, 45, 74,149, 42, 37,222,121,231, 29,129,133,153, 34,164,169, 90,181,170,168, 86,173,154, 32,160, 55,224, -167, 33,180, 64,181,151, 68,168,163, 10, 85, 93,191,229,189, 36, 19,235,196,147,207,223, 84,189,171,137,223,229, 12,232, 25,209, - 41,165,161, 45,191, 43,243,164,164, 51,188, 40, 73,112,133,138,170, 72, 89, 33, 45,154, 74, 27, 45, 6, 52,116,101,133,203,202, -133, 42,225,182,124,174,190,187,236,184, 82,235,124, 40, 22,108,124,158, 18,217, 83,146, 69,144, 69, 32,192,198,183, 52,133,143, -248, 19,129,147, 43, 42, 42, 68,218,110, 1,220, 89,178,221,162, 74,227, 68,183,110, 65, 99, 19,164, 8,202,134,208, 52,117,250, -160,125,149, 42, 4,109,124,211, 39,104,115,236, 24, 65,147,147,165, 12,202,241,118,138,160,150, 25, 50, 4,157,235,241, 69, 16, -212,147,103, 76, 64,162, 27, 96, 34,222, 62, 27,129,234, 70,170, 29,117, 47, 52,252,115, 28,112,217, 14, 98,196,136, 33,192, 15, -129,188, 11, 72,216, 8,208, 40,113,224, 96, 67, 30,112, 96,151,171, 39,143, 7,218,170,105,146, 46, 64, 36, 87,155, 10, 95, 37, -208,226,127, 76,136, 86,105,198,164, 77, 22, 58,152, 34,201, 34,200,162, 52, 11, 43,220,246, 24,228,206,180,105,211, 38,184, 89, -179,102,138, 61, 29,234,231, 17,242,255, 8,191, 31,129,254,117, 79, 60,133, 77,214, 81, 74,234, 40,209,226,165,149,104, 97, 66, - 58,202, 78, 77,192,192, 65,151, 3,177, 26,136,153,212,215, 43,251, 26,147,221,196, 3, 0, 82,126,211,186,249,205,158,242,149, -223,204, 73, 93,252,102, 76,236,228, 55,125,108, 39,191,207,235, 22,219, 93, 47,111,234, 43, 31,228, 77,117,229,131,220,207,195, -187,169,227, 93,172,152, 60,246,122,132,175, 60, 21,138,210, 41,242,145, 3, 44,235,122,224,192,129,162, 73,147, 38, 84,189, 11, -244, 31, 78,132, 2,182,112,202, 96,198, 9,205, 0,104,133,250, 4,218,227,151, 0, 80,138, 52,171, 75,151, 46, 2,245,173,128, -172, 15, 63,252, 80,112,145,197, 9,152, 19,209,130, 5, 11,148,193, 29, 33, 4,109,224, 75,163,124,234, 73,180,246,206,141,115, -243,231,110,137,119,150, 43,145,105, 17,194, 66, 72, 98,148, 80,174,120,166, 63, 74,130, 87,106, 0,246, 18, 42, 53, 20,200,146, -128,149,160,136, 19, 47,164, 35, 52, 73, 48, 3, 91,161,178,141, 54,124,158,210, 11, 78,216,108,243,236,215,144,170,223,128,189, - 98, 48,255,147,143, 4,116,156,220, 13,128,150,155, 30,165, 86,167, 0,166,214, 46, 27, 36, 86, 47, 25, 40,254, 94,212, 95,172, -252,195, 87, 44,255,253,123,225, 63,239, 91,177,212,175,175, 88, 60,187,143, 88,248,219,215, 98,193,140,158,162,148, 49,208, 10, -149, 71,218,209,176,124, 29, 59,118, 84, 64,246,175,191,254,170, 0, 11, 2, 35,130,116, 41,129,145,147, 45,129,146, 14, 48,144, - 52, 21, 96, 64,219, 41,166, 37,200,152, 60,121,178, 2, 38, 41,165,230, 24, 32,165,236, 24, 75,196,205,141,227,197,238,201,237, -196, 59,165,139,122,162,169,208,198, 24, 17,164, 6, 89,252,221,173, 97, 67,177,101,242, 24,113, 98,209, 12,247,171, 27,107, 22, -138, 53, 99, 12,129,150,204,167, 34, 41,130,173,233, 21,206,105, 60,240,120,212,168, 81,138,148,136,237,155,117, 79, 80,204,186, -153, 61,123,182, 2, 8, 38, 77,154,164,128, 68,179,178,147,159, 92, 76,247,236,217, 83,252,240,195, 15, 98,214,172, 89, 98,231, -206,157,202, 66,136, 18, 61,130, 44,210,163,134, 33, 67,134, 12,202,248,111,133, 38, 1,223, 87, 95,125, 37, 40, 29,156, 58,117, -170,210,175,249, 29,230,149,117,148, 36,159, 79,168,224, 13,154,108,187,118,234,157,101, 55,203,167, 25, 77, 3, 44,162,212, 27, - 65, 17,111, 50,200,255,154,187, 81, 60, 62,175,210,187,119,239, 62, 76, 95,182,108, 89,106, 26, 60,209,211,165, 35,211, 63,207, -142,110,122,227,161,139,133,227, 91,121,199,207,172, 56,113,251, 58, 37, 59,234,139,136,156,210, 17, 2, 3,174,108,217,121,212, - 42, 12,174,168,145,118,140,206,151, 98, 16, 56,177,129, 81, 93,200,192, 9,130,244,253, 93, 64,139,239,126,250,233,167, 80,234, - 46, 78,184,124,238,201,118,139, 42, 66, 2,173,245, 49,125,130,246,191, 87, 33,232,223, 42, 21,130,182, 39,137, 19,180, 61, 65, -140,160,157,137, 98, 6, 5, 36,141, 25,116,162, 94,165,160,255, 16, 78,188, 87,132, 64,235,244, 75, 24,196,125, 8,138, 40, 38, -102,135, 35,160, 48, 11,148,254, 0, 36,157,247,148, 87, 79, 52,217,201,249, 61, 78,198,242, 91, 22,104,198,160,209, 59,226, 41, - 0,139,146, 44,130, 44,216, 90,156,255,254,251,239,131, 89, 95,172,115, 78,184,236, 48, 28, 56,104, 79, 5,158, 62,242,148, 79, -170, 1,217,182, 36,200,226, 93, 13,164, 48,241, 40,170, 69,230, 79, 94,175, 3,208, 34,120, 8,216,190,204,239,151, 81, 29,252, -166,140,108,239, 55,105,120, 91,191,241, 63,181,246,107, 87,179,200,238,247, 82,199,123,242, 96,221, 34,193,112,227,251,230,161, - 66,197,228,111, 6, 86, 76,250,102,105, 35,158, 82, 58, 69, 62,145,247,232,167,138,106,159, 18, 38, 2, 45, 14,196,148,162, 48, -176,126,184,130,230,165,163,238,209,146,143, 13,123,174,131,152,120,130,101, 90, 78, 10,236,223,108, 71,148,190,112,226,225, 24, -128,213,116, 48,226, 30,226,164,106,148, 71,105,163,181,103,206, 27, 55,238,157,252,233,233,229,245, 89,238, 4,238,108,112,234, -228,222, 41, 59, 14, 31, 88,189,254,240,254, 85,235, 15,237, 93,181,254,223, 61,171,214,239,218,186,104,125,169,162, 25, 22,191, - 68,160,229, 6, 89, 92,240, 17, 24,176,220,156,196,248,155,188, 37, 0, 5,223,237,130,173,230,152,240,110, 96, 50,165, 73, 1, -109,180,146,184,248,197,131,117,255,193,162,234, 25,109, 23, 41, 65, 82, 1, 45,127, 61,158,150, 41,150, 49,240,216,191,107,117, - 65,213,252,233, 61,196,220,169,221,196,156, 41, 95,137, 89,147, 58,139,153, 19,190, 20, 37, 11,167, 51,146,104,133, 34, 79,195, -119,218, 95, 81, 66,194,118, 68,224,193,177, 89, 11,178, 8,146,164, 52,202,195, 36,174, 0, 24, 26,190, 51, 46,129, 0,193, 36, -219,169,108, 75,210, 62,139, 54,186,205,171,228, 23, 15,150,117, 17,135, 38, 52, 49, 5, 90, 92, 92,176, 14,138,100,207, 46, 90, - 67,125,248, 53, 22, 22,163, 59,119, 18,123,103, 78, 22,103,253,231,252, 31,104,173,253,195, 10,208, 34, 15, 98,209, 80,157,146, - 37,230,133,210,218,145, 35, 71,138,209,163, 71, 43,125,134, 0,131,109, 30,227,158,232,213,171,151,232,220,185,179,178, 0, 52, - 43, 59,105,146,159,108, 55,148,100, 17,100,113, 94, 36, 24,162,212,158,243, 25,219, 22, 23,148,149, 43, 87, 86,190, 97,133, 38, -243, 73,181, 38, 65, 57, 65, 22,193, 59,199,117,142,199, 28,139, 9,180,236,212,145, 44,187,164,217,197,119,162, 40,221,208, 87, - 20,254,224, 59,145,165, 74,239, 80,161, 92,147,161,150,203, 46,243, 73,105, 22,192,140,128,185,144, 82, 78,152,163, 40,146, 44, - 74,201,107,214,172,169, 44,186,245,248,169,131, 69,220,237, 85, 13,168,248,219, 12,104,201, 56,184, 23, 87, 3, 53,213,115, 5, -104,233,253,183, 24, 95,145,104,169,104, 40,223, 49,188,180,133,163, 36,139, 13,128,149, 72,132,202, 21, 15, 59, 13, 3,117,237, -144, 98, 40, 43, 92,170,203,248,158,207,216,161, 8,194,240, 17,173, 1,183,242, 93,238, 44,100, 67, 96, 35, 99,160, 36,139, 32, - 75, 94,148,246, 80, 10, 51,127,254,124,165, 49,109,222,188, 89,209, 63,115,144,195,202,195,208, 72,158, 64,235,143,122,117,131, -198, 65,122, 53, 33,110,140,160,137,241, 33,197, 2,200,154,146, 40, 70,208,212, 36, 49,130,166, 39,139, 25, 52, 35,101,204,160, -153,169, 98, 6, 45,204,151,220, 46,208, 50, 51,140,215, 26,192, 27,242, 24,157,233, 28,203, 77,222, 81,194,132,134,174, 72,159, - 48, 97, 9,236,160, 17, 0, 27, 34, 79,158, 60, 2,246, 33, 2,246,113, 10, 8, 53, 3, 90,146, 38, 43,218,181, 50,162, 17,185, -194, 51, 9,180,176, 18, 84,164,100, 86,105, 18,104, 97,144, 81,108,178,168, 46,164, 36, 11,162,106, 5,100,113,144,224,160,244, -249,231,159, 43, 3, 51, 85,201,108, 27,168, 31,143, 64, 11,210,128,127, 0,182, 14,169, 3,159, 73,102, 97, 16,221, 76, 48, 70, -112, 37, 3,202,166,221,117,232,177, 13,191,138, 47,139, 67, 21,184,125,227, 34,191, 81, 67, 91,250, 13,236, 83,223,175, 95,175, - 15,253,190,237, 86,215,239,131,130,105, 78,173,250,249, 27, 49, 32, 95, 34, 37, 4,173,158, 37, 46,215, 79,235, 14, 55,135,126, - 34, 42, 38,127,107,137, 81,153, 36,208,226,132, 8,105,161, 2,126,230,204,153,163,172,244,216, 31, 9,176, 8,138, 56,152, 51, - 88, 4, 90,252, 92, 98, 24,100, 31,199, 42, 60,132, 3, 57,237,229, 88,207, 92,229, 3,120,139,113,227,198, 81,141, 24,130, 54, - 76,224,144,216, 19,207,229,174,195,159, 32,193,186,184,179,245,177, 29,139,170, 30, 90, 62,187,197, 14,191, 41, 93,215,207,154, -220,121,253,111, 19, 58,175,255,117, 66,167,245,211,199,124,190,254,151, 49, 29,215,151, 44,156,254,165, 1, 45,140, 33,171, 57, -222, 17,100,177,188,224,193, 35, 9,124,248,155,207, 8,186, 40,145,135,212, 88,109, 30, 16,174,102, 71,163,119, 78, 72,234,139, - 96,214,165, 58,164, 65,124,152,171,116,145,140,129, 7,247,252, 37, 8,170, 38,143,104, 39,198,252,240,169, 24, 57,248, 19, 49, -108, 64,115,241,163,111, 99, 49,228,219,134, 2,109, 76,248,246,250, 80,124,219,253,125,241, 78,201, 76, 15,138, 21, 76,115,175, -104,129,212,247,138, 23, 76, 99, 40, 25,231,230, 28, 2, 3,182, 27,105,239,195,197,153, 84,111, 18,112,168, 39,112,230,217, 4, - 24,196,100,251,228, 88, 39, 85, 79, 4, 49, 45, 62,172, 42,218,212,175, 34, 62,173, 87, 65,180,168, 93, 70, 52,173, 86, 84,180, -172, 94, 72, 44,243,173, 43, 30,205,111,102, 10,180, 64,243, 50,213,121,223, 65,210,186, 19,210,165, 93, 8,251, 32,217, 57, 57, -127,182,162, 46,164, 36,139, 65, 81, 29,142, 54,149,104,145,191, 49,100,217, 9, 46,251,246,237,171, 0, 44,218, 84,177, 45, 72, -163,120, 74,117, 41,133,163,218,203, 74,217, 73,147,182,184, 52, 88,231,188, 72,201, 96,189,122,245, 68,137, 18, 37, 20,211, 8, -181, 77, 50,231, 80,130, 37, 51,126,146, 38,243,195,241,150, 26, 37,206,195, 76, 71, 0, 43, 65, 33,129,150, 4,194, 86,243,169, -165,153,249,189, 94, 34,203,123, 95,187,105,202,122, 31, 53,243,249, 66,192, 27,249, 52,107, 75, 86,128,150, 26, 28,201,223,170, -123, 40, 73,148, 11, 8, 41,253, 9,191, 43, 75,137, 20,239, 18, 36, 25,208, 11, 67, 71, 3,236, 36, 77, 55,208, 50, 29, 12,180, -133,163, 58,144,140,101, 99,225, 64, 3, 2,251, 48, 1, 63,164,196,129, 54, 33,248,127,151,207, 16,142,151, 41, 83, 70,105,148, -108, 80,221,186,117,227,187,238,122, 31,164,186, 73, 45, 33,163,186,144, 65,125,213,173, 91, 87,104, 3,209, 58, 68,146, 30,129, - 22,104, 4, 33,175, 65,104,128, 65,104,220, 65, 0,125, 65,104,136, 65, 24, 48,130,208, 24,131,208,225,131, 48,249, 4, 33,255, -182,128,150,153, 97,188,142, 1,188, 33,175, 37, 40,226,224, 99, 37,176,179, 67, 98,229, 81,162,229,137, 38,109,162, 8, 94, 57, -233,202,239, 89,161, 73, 23, 14,220,101,136, 85,147, 98,147, 69,117,161, 4, 89, 28, 64, 8,130, 41,194,230,106,141,131, 51, 39, -123, 72, 56, 61, 2, 45,211, 6,248,154, 70, 32,208,218,184,118,190,223,144,111, 27,251,245,236, 84,203,239,193,189, 43, 97, 66, -171,114,133,174,216, 5, 90,148, 78,177,223, 16, 24, 48, 16, 76,125,240,193, 7, 4,188, 10,128,167,138,106,202,148, 41,138,132, - 80,246, 57, 11, 18, 45, 89, 11, 41, 65,227,204,244,233,211, 21, 9, 7, 87,188, 4,113, 84, 1, 81,165,136,126,124, 6, 17, 83, -154, 85,153,148, 78,149, 42,150, 97,241,222,157,203, 21, 80, 53,228,187,198,235, 7,244,105,176, 30,128,115,125,223,110,239,175, -239,253, 85,157,245, 61, 59,213, 88,223,181, 67,213,245,229, 75,102,250, 7,155, 1,214, 22, 43,148,118,109,137, 34,233, 86,152, -209,247,230,123,128,254, 64,130, 28, 26,129, 99,188,187, 4,218,202,204,226, 2, 62,171,249,140,239, 56,198,161, 79,158,181,240, -237,132,136,243, 53, 2, 23, 19, 75, 84, 97, 26,126, 43, 59, 12, 41,149,144,234, 73,121,167,116, 11,239, 7,235,209,167, 42,112, -239,142, 63,197,175,227,191, 16, 3,251,214, 23,151,207,237, 83,194, 37, 37,236, 21,151,206,254, 63, 92, 60,187, 71, 92, 60,243, - 60,236,219, 62, 95, 20,201,159,202,112,252,228, 36,206,113,140, 32,134,146, 23, 61,144, 69, 53,151,122,167,160,135, 9,151, 89, -143, 65,160, 69,224,200,182, 71, 16, 87,253,157, 98,226,233,206, 95,196,211,109,227,197,147,141, 63,139, 39,107,250,137, 39, 43, -186,139, 71,139, 59,136,199,203,187,137,199, 75, 58,152, 2, 45,180,223, 75, 92, 64,254,212,161,131, 56,139,197,248,153,121,243, -196, 5, 44, 0,174, 44, 89, 44,174,254,185, 88, 92, 91,241, 60,240,247,170, 17,150,128,150,143, 44, 59, 1, 38, 85,239, 31,125, -244,145,168, 83,167,142, 2,170,202,151, 47, 47,138, 21, 43,166, 44,126,185, 16,134, 58,212, 12,108, 40,101,167, 27, 7,206,135, -114, 39, 36, 65, 22, 85,168,228, 47,165, 57, 95,124,241,133, 50,102, 18,216,205,157, 59, 87, 17, 78,152,241,147,249, 36, 64, 33, -192, 58,116,232,144,162, 21,161, 16, 68,130, 44,190, 35,208,178, 83, 71,122, 52,165, 36, 75,130,107,187,245,174,166,137, 93,151, -186,146, 44, 74,186, 56,199, 83, 85,173, 7,222,172, 0, 45, 2, 30,132,226, 26,224, 67,114,110,251, 45,212,133,250,191,180,185, - 42, 43,227,200,247,154,120,134, 18, 46,109, 58,215,127,197,102, 76, 69,203,243,208,160,213,139, 74,160,197, 6,136,129,229, 17, -255, 67, 34,162, 24, 34,178,177, 99,160,160,191,171,220, 24,116,231, 73, 3,191,133, 11, 23,210, 62,100, 27,158,211,241, 91,152, - 11, 18,151,167, 20, 31,107, 1,150,250, 63, 13,237, 41, 30,230, 4,206, 78, 79, 21, 6, 27, 17,190,111, 56, 80, 32, 15,167, 9, -180,144,215, 32, 52,194, 32,164, 11, 98,193, 9,178,176, 42, 83,126, 19,100, 65,108, 27, 4, 90,182,128,150,153, 97,188,142, 1, -188, 33,163, 49,152, 43,170, 67,105,135, 5,151, 7,138,244, 9,146, 28, 81,184,112, 97,101,197, 35, 69,173,236,232, 46, 67, 65, -237,246,228, 80,244, 37, 77, 74,200, 40, 25,163, 93, 78,233,210,165, 21, 81,178, 4, 90,164, 13,195,114,101,240,176, 66,147,126, -178, 8,180, 80, 7,237,105,248, 78,155, 44,174,110, 41,201,146,146, 70, 26, 70,115,101,197, 1,131,147,132, 11,140, 91,152,127, -162, 87, 20, 72, 20, 38,174,254,107, 54,164, 88,239,251,117,104,249,142, 2,178,246,111, 25, 31, 42, 52, 45,150, 57,220, 64,139, - 64,138,129,147, 35, 84,243,138,145, 58,251, 11, 3,235,154, 3,190,148,156,232, 24,199,122,170,140, 12,232,115, 23,104,196, 12, -192,164,216,237,112, 98, 64, 31,102,123,204, 96,165, 22,221, 64, 11, 42,193,157, 91,150,174,159,240,115,155,245,189, 58,215, 90, -255,224,222, 85,143,225,252,127, 27,214, 23,201,151, 74, 87,170, 99,229,187,225,140,211, 20,252, 57,141,177,100, 15,210,103, 39, - 48, 82, 1,173, 37,124,134,177,205,159, 82, 21,252,110,102,225, 27,131, 57, 78,106, 47, 46, 84, 64,131, 18,255,204, 8, 4, 93, -164, 45, 3, 65, 25,193, 25, 65, 90,152,139,170,192,157,155,151,136,241, 63,127, 38,122,125, 89, 75,128,143,226,248,254,223, 77, -195,225, 93, 51, 68,225,188, 41, 12,199, 79, 2, 3, 46,192, 8, 34,217,142,228, 4, 78, 53, 23,219,145,118,178,213,155, 28,181, -153, 37,168,231, 88,199,242,114,177, 71,117, 92,213,226,217, 68,189, 50,217,196,225, 41, 45,197,227, 5, 8, 0, 88, 33, 55,255, -207, 35, 19,176,225, 35,129, 22,199,243, 70, 48,172,102,232,209,168,145,184,130,113,137, 97, 49,236, 20,249,140,247, 85,195,172, - 1, 45,117,217,169,130,167, 68,136,227,178,218, 5, 5,191,199, 75,222,205,242, 73, 21, 39,251, 28,165, 77,156,191,104, 12, 46, - 65, 44,129,209, 60, 0, 68,170,206, 40, 37,230, 2,137,128,219,140,166,204, 39,181, 70, 28,111,245,234,136, 64, 75,125,133,135, -166, 4, 90,225,173,119, 43,249,212,186,246,208,230,211,138,141,150, 11,220,184, 37, 78, 18,236,176,142, 92,245,164,103,123, 21, - 74, 66,165,149,104,121, 72, 23,202, 38, 76,107,163,101, 11,104,233,244,235, 41, 52,136,100, 3, 81,219,205,176, 97,176, 1,173, - 95,191,158, 43,219,115, 28,136,169,203, 39,210,134,138,138, 82, 46, 14, 32,186, 23,192,128, 34,209,242, 4,180,244, 36, 90,108, -244,168, 64, 83,160,133,129, 66,145, 98, 33, 63, 65,144,128, 41,146, 45, 52,108,229, 55, 26,167, 2,178,208,241,131,176,234,231, -138,212,208,182, 68,147,121, 51,195,120,143, 6,240,106, 90, 18, 20,113,181, 96, 37,112, 37,136,193,229,162,167, 65,221, 19, 77, - 2, 45,242,142,245, 39,191,103,133, 38,129, 22,125,102, 1,180,182, 3, 63,219,183,108,217,242, 41,211, 83,141, 68,123, 3,105, -124,205,182,193, 78, 79,105, 25,234,199,163, 68,203,204, 33, 41,222,239, 0,141,227,152,236,142, 3, 48, 30, 71, 91, 58,142,137, -222,237,208,212,194,196,246, 74, 70, 41, 82, 48,245,196,149,203,102,248,117,235, 80,213,175,217,135,197,188, 14,180, 8,168,217, -167,104, 12, 79, 32,205,137, 77,250,214,145,190,122,164, 13,165, 77,160, 69,126,230,192,110,209, 27, 4,215,148,180, 32,253, 45, - 62,179,202,104, 9,180,168, 18,220,178,110,193,250,159, 7, 52, 95,255,249,167, 21, 21,144,117, 96,235, 4,143,225, 37, 0, 45, -109,177,180, 64,203,106,177,101,188,181,156,244,164,173,156,188,115, 76,117,249,202,210,210,163, 55,114,143, 87,137, 66,105, 3, - 55,175, 91, 32,126,238,223, 76,116,108, 85, 65, 1, 90, 0,237,150,130, 25,208,146, 96, 93, 61,129, 19,124, 17,100,169, 93,196, -200,137,220,108, 18, 39,208, 34,192,146,110, 28, 72,163, 53, 54, 84,248,125,251,145,120,236,255,165,120, 52,251, 67,128,172, 83, - 98,247,209, 43,162,201,119,127, 42,193, 2, 77, 69,162, 37, 39, 83,179,187,129,123,135, 80, 60, 38, 48,144,101,231, 70, 34,108, - 4,114, 3, 42, 89, 86,245,119,172,128, 76, 2, 45, 46,114,168, 73, 32, 88,101,157, 87,175, 94, 93,249, 79,213, 51, 37, 93,124, - 78,208, 68,137, 49, 23,235,102,101, 87,231, 83,214,209,250, 45,107,196, 55, 63,117, 19,205,190,172, 39, 42,214, 47,170, 72,180, -236, 2, 45,109,189, 75,160, 37,235,125,193,223, 1,225,166, 9, 95,103,161,108,178, 40,201,162,180, 80,206,241, 70, 18, 45, 79, -157, 0,153,225,174, 63, 69,154,197,120,170,255,218,221,127,218,255,218,248,164, 81, 2,161,180,139,158,148,132,153,209,225,247, -213,105, 40, 85, 11,149, 39,179,126,172,125,159,149, 6,141, 68,223, 20, 83,178,129, 83,100, 73, 38,113,194,229,228, 10,113,106, - 8,223,115,242,133, 31, 22, 54,208,198,158, 62, 2,245,146, 98,163,197, 14,108,228,167,138, 82, 19,105,151, 69, 80, 39, 39, 9, -228,197, 35,208, 66,188, 32, 72, 97,130, 32, 93, 83,164, 88,159,125,246,217, 35,168, 59, 20, 41, 22, 84, 95,143,254,248,227,143, - 32, 52,158, 32,172,178,130,144, 87,218, 88,244,181, 1,182,236,242, 78, 55, 62, 0,132,178,235, 80, 74, 28,204,238,108,236,102, - 64,203, 19, 77,110, 44, 32,175,165,111, 46,185, 74, 49,163, 73,103,164,116, 76,138,129,138,206, 73,219,195, 38,231, 41, 59,164, -244,169,195,182,128,221,136,110,144,197,122,194, 42,221, 35,208, 50,115, 72,138,201,231,168,172,111,214, 57, 13,227,233, 18,194, - 43,140,127,137, 68,138,228, 79, 61,113,233,162,105,126,109, 63, 41,239,247,126,245,220, 94, 3, 90, 4, 77, 28, 1,105,248, 14, -103,139,226,253,247,223, 87, 6,110, 74, 17,164, 83, 72,173, 99, 72,179,193, 92,143, 77,144, 98, 43, 62,134, 56, 89, 0,252,210, -197,129,229, 75, 2,173,226,133,210, 46, 94,183,122,238,250, 1,189, 63, 90,223,162, 65,241,232, 2,180,148,157, 31, 4, 88, 52, -116,231,100, 90,178,100,201,103, 96,222,106,132,108, 46, 38,114,135, 94, 11,184,209, 56,131, 9,136, 26,130, 86,158,152, 11, 59, -171, 64,240, 81,244,255,250, 35,209,188,126, 49,175, 1, 45, 2, 3,246,111, 78,224, 18, 28,120, 2, 89, 86,192, 6,219,167,148, - 92,176, 29,126,134,221,175,115, 9,178,160, 34,188, 49,185, 26,108,178,154, 43, 19, 56, 1, 86,254,166, 51,148, 96,214, 62, 57, -110,113,236,169, 89,177,158,232,243,249,224, 48, 97,197,162, 53,130,129,239, 62,109,240,185,145,123,135, 80, 44, 86,151,253,249, -188,253,127,201,149, 26,104,169,159,155,229,147,106, 83, 74,180, 8,166, 36, 31,105, 72,239,231,231,167,128, 44, 41,177,225, 78, - 71,204, 83,202,174, 94, 51,154,218, 58,154, 56,115,148, 24, 60,246, 59, 49, 96, 84, 31, 81,163,121, 57,145,185,116, 98,145,167, - 66, 26, 91,160, 72,175,222,181, 70,240,229,155,254, 16, 97,154, 17,109, 75,150, 7,156, 40, 28, 49, 43,242, 62, 5, 97,159, 43, -172,199,189, 35, 84, 20,127,195,184,250, 41,117,176, 4, 70,220,169,129,231,191,154,149, 19, 29,229, 14, 38,212,167,148, 78, 17, - 56,225,255, 83,116,200,167,152, 80, 67,184,173, 86, 79,154,197,103,188, 24,215,136, 62, 85,135, 48,252, 85, 36, 89,144,188, 40, - 82, 44, 2,171,254,253,251, 43, 82, 44, 52,236, 32, 24,217, 7,161,195,211,250,148,113,110, 65,116, 75,239,204, 27,204,242,172, -121, 47, 13,227, 45, 27,192,171,211, 19, 20,113,208, 33,128,178, 18, 56,105,154,129,162,200,160, 9, 73, 82, 43, 72, 1,219, 48, -160,190,218,112,199, 39,183, 54,131,159, 98,200,144, 33, 10,200,226,127,130,109,130, 35,151, 58,210, 35,208,194, 64,226,209, 33, - 41,202,169,236, 58,164,189, 31,213,167, 52,196,166, 75, 8,155,245,243,202, 69, 47,146, 55,229,164,127, 86, 47,245,235,215,167, -141,223, 55, 61,155,249,221,191,115,201, 43,170, 67, 9,180,164,247,110,185,193,196,232,110,101,114,212, 99, 94,145, 34, 69, 20, -160, 69, 35,222,240, 2, 45,216, 92, 45, 94,181, 98,214,250,222, 80, 27,126, 88, 51, 95,148, 3, 90,174,157,134, 75,192, 31,117, - 80,108,173, 60, 52, 56, 69, 34, 70,160, 69,105, 32,219, 54,251, 10,237,230,176,178,127,152, 61,123,246, 99, 0,200, 15,169,234, -229,152, 64,149, 18,250,178, 71,219,175, 98, 5,210, 4,130,143,226,235,206,181, 68,189, 26,121,188, 14,180,212, 32,139, 82, 81, - 61, 73,150,156,117,205,128,129,108,159,140,255,205, 55,125,197,188,111, 63, 20,143, 23,126, 42,166,124,150, 95, 4,141, 47, 41, - 30,253,246,190,109,160,133,111, 42, 64,171,121,179,110, 98,202,196,127,194,132,127,214, 30, 18, 12,124,247, 77,159, 73,182,128, - 22,203, 78,160,101, 22,172,244, 35, 9,180,212, 0,131,210,127,170, 11, 9,190, 8,180,122,244,232,161, 44,142, 40,209,162, 84, -218,140,159, 18, 20,201, 58, 34,184, 42,243, 65, 62, 81,174, 94, 1,145,187, 98, 26,145,170,240, 91, 98,194,204, 17,225, 2, 69, -234,122,151, 64, 75, 18,178, 43,209, 82,231,147,174,101, 88,102,181, 36, 75, 74,177,212, 25, 53, 43,251, 43, 55,168,191,192, 12, -125,205, 29, 72, 52, 14,165, 90,129, 59,218, 48, 57,159,160, 29, 23,143,232, 64, 62, 12,143,161,209,203, 35, 36, 40, 79,216,177, -181,118, 89,154,202, 80, 3,173, 80,142, 1,145,254, 52, 6,180, 32,236, 14, 81, 84,135,144,150, 41,210, 43,222, 41,233,194, 10, - 95, 1, 88,218, 0, 95, 86,106,213,148,169, 51, 76,105, 24,111,195, 0, 62, 20, 77,248, 76, 57,199, 85, 30,253,231,112,208,229, -221, 83, 96, 92,218, 37,104,120, 22,233, 52,181,117, 68, 63, 89,220,193,198,141, 17,210, 38, 75, 13,178, 40, 65, 65,103,209, 2, -173, 80,249, 52,115, 72, 10, 21,232, 81, 14,236,180,207,163, 68,147,223,211,113,239, 96, 90, 71,225,232, 3,145, 74,179, 96,158, -228,109,106,190, 87,112,102,224,165,211,126,183,111,156,246, 91,181,108,140,223,130, 25,125, 66,133,143, 10,164,115,219,104,113, -183, 33,119, 31,234,236, 58, 12,149, 79, 14, 78,236, 31,108, 63,156,204,205,218,146,193, 4, 97, 90,118, 53,208,130, 4,219,138, - 68,203, 77, 83, 74,180, 0, 16,150,108,217,184,124,125,255,190,109,215,127,215,171,249,250,251,119, 47,217, 85, 29,154,230, 51, - 18,234,189, 47,189,131, 83,253,164,231,129,159, 18, 11, 26,180,123,232,155,110,160,133,254,243,144,187,169,105,203,202,126, 47, -119, 93, 17, 36,115, 50,230,115,250, 69,130,195,216,149, 58,229,112,151, 29,210,209, 43,155, 55,252, 41,250,245,109, 35,190,237, -213, 76, 0,180, 91, 82, 27, 82,189,168, 81, 29,134,226, 39,129, 1,213,207,204, 27,243, 99, 6,178,172,180, 37,217, 62, 25,183, -106,169,188,226,241,188,198, 98,242,167,121, 68,190,188,121,196,206, 30,153,196,131,159, 50,139,224, 43,135,204, 84,135,218, 54, -127,129,102, 42, 70, 64,107,185,255, 94,193, 96, 2,180, 12,203, 78,144,165,150, 92,217,144,104,133,162, 73,181, 41,235,150,109, -132,227, 24,165, 88,221,187,119, 87,108, 29, 41,117,166, 36,139, 2, 4,206, 35, 30,128,171,199, 58, 90,189, 97,133, 40, 85, 55, -183, 40, 93, 55,175,248,176,109, 85,177, 99,239,150, 80, 32,203, 74, 29,233,213,187, 22,104,105,137,234,128,162,200,104, 75,225, -232,206,175, 97, 18, 72,164,246,113,112,160,241, 36, 17,186,122,229,195, 65, 9, 3,144,218,243,186,233, 32, 9,155,169, 39, 28, -124,168,154,164,248,154, 98,108, 73, 83, 74,180, 48, 17,123, 4, 90, 4, 81,216,241, 24, 84,171, 86,173, 32,136,225,131,176, 90, - 8,194,110,143, 32,136,101,131,176,147, 68, 1, 97, 56,211, 41,168, 85,171, 86, 65,144,210,252,231, 2, 89,106,127, 53,166,249, -148,134,241, 54, 12,224,181,141,112, 51,120, 22,246,236,137, 48, 93,228,249, 3,216,193, 81,234,167,149,186, 69, 58, 77,109,147, - 5,120,126,196, 85,151, 17,200, 98, 94,177, 26,247, 8,180,204, 28,146,242, 16,105,214,127,185,114,229,148,221, 62, 92,225,191, - 14, 64,139,188, 44,156, 47,101, 47,216, 41,205,129, 79,173, 57,133,243,166, 12, 19,222, 73, 29, 87, 1, 90, 46,112,165,220,205, -128, 22, 36, 6,155, 96, 68,251,212,160,233,132,121,204,184, 76,227, 9,180,235, 13, 85,216, 72,161, 72,180,184,195, 20,253, 58, - 92, 64,171,104,254,212, 61,235, 84, 47,178,250,230,181, 75,235,111, 93, 63,189, 30, 96,115,253,239, 51,251,234,134,165,126,223, -175,175, 91, 61,223,154, 82,133,211, 78, 87,229,199,180,111,134, 99,152, 53,163,153, 8,252,250, 23,146,241, 48, 59, 3, 9,190, - 40,137,210,177,181, 82,211, 28, 73,123, 72,154, 85, 32,111,191, 33, 76,101,187,166,244,159,246,173,220,154,207, 59, 55,255,224, - 57,143,225,153,143,144,220, 19,208, 42,156, 47,213,228, 58,213, 10, 63,186,113, 13, 71,193, 92, 63, 45,192, 71,241,251,140, 62, - 30,195, 18,191,239, 69,221,106,249, 30,151, 44,156,118,159, 17, 63, 57,225, 74,147, 14,105,188,110,214,174,204, 38, 92, 53,208, -162, 75,144,218,101,114, 98,199,106,103, 69,154,211,190,116, 92, 17,212, 63,145,120, 56,182,176, 8, 14, 60, 96, 25,108,128,166, - 2,180, 62,109,217, 91,145, 88,105,195,143, 67,103, 10, 6,249,220,194, 17, 60, 60, 22,205, 93,118,181, 52, 75, 93,126,237,115, -179,178, 19,104,113, 30,228,166, 39,250,144,226, 38, 18,170, 13, 9,100, 41,193,162,164, 71,250, 77,179, 3,180,188, 93, 71,122, -245,238, 13,160,101, 37,159,148,108,133,199, 70, 43, 28,253, 60,234, 38,193,202,107, 6, 27,188, 20, 57,114, 53, 36, 3,165, 17, - 24,128,120, 24,171,188,204, 6, 52, 31,168,168,158,176, 17, 82, 44, 76,224,166,183,130,132, 52,200, 16,104,241, 72, 29,164, 15, - 90,182,108, 89, 16,182,162, 7, 65,157, 25,132,179,216,130,176, 11, 82, 81, 33, 98,119,135, 59,208,110, 11,170, 48,143, 71,240, -120,168, 25,105, 24,111,213, 0, 94, 91,246, 4,152,172,182,178,163, 90, 9,232,176,220,193, 25,223,100,114,140, 12,154,161, 62, - 73,103,164,172,107,105,248, 46,213,133,234,243,202, 80, 63, 30,129,150,153, 67, 82, 30, 58,205, 77, 22, 92, 1,202,235,117, 1, - 90,102, 61,157,158,224, 9,180,224, 55,235, 12,227,242,110, 6,180, 16, 45, 30,128,192,122, 74, 73,173, 4,198,101, 26,187, 64, -139,199,209, 96, 21, 30,140,250,161,243,203,119,205,202,130,247, 97, 36, 90,148,108, 1,108,254, 88,170, 72,166,117,165,138,101, - 90, 7,192, 96, 20,254,161, 17,124, 9,128, 44,166,177, 51,134, 88,200,151, 54,138,233,184,132, 4,137, 16,104,203,185, 68, 39, -240, 60,194,204, 30,248,153,153, 64, 76,181,195,144, 81,105,122,208,155,180, 96,116,189, 19,247, 69, 8, 63,186,158, 27, 21, 33, - 84, 62, 33,153, 90, 81,178,112,134,144,146, 69, 50, 6, 23,202,155,210, 99, 0,207,159, 81,146,165, 1, 89,252, 78, 24, 9,140, - 60,160, 88,239, 12, 66, 61,208,101, 6, 54,212, 64, 75,157,158, 82,122, 26,134,207,248, 56,158, 8, 26,152, 76, 4, 13, 72, 36, - 30,140, 46,168, 4, 51,154, 60,183,144,243,142,214, 37,134,167,255,102,135, 74, 19, 20,201,178,131, 47, 94,145,104, 81,109, 74, - 65, 1, 79,254,160,132,144,160,154, 46, 28,184,187,144, 26, 32,186,123,224,194, 85,125,153,149, 93,157, 79,111,213,145, 30,205, -136, 2, 45, 47,229, 51, 28,221,249,245, 76,146, 9,197,154,131,157, 98,251, 1,186,246,163, 65,237,199, 9,232,251, 32, 37,218, -135,231, 90, 16, 98, 58,160, 97, 48,186, 67,247, 13, 90,219, 45, 52,190,167,144,148, 60, 37,200,130, 47, 19, 26,139,202, 43, 20, - 77,236,102,252, 12,234,195,255,232,241, 93, 29,240,252,180, 12,144,154,157,102, 32,200, 2,176,251, 76,167, 90, 76,243, 25,142, -170,124, 45,104,162,110,174,211, 79, 22, 93, 56,112,119, 33, 13,223,233,242,131,234, 66, 74,178, 8,178, 32,237,211, 30,193, 19, -170,236,102, 14, 73, 65,243, 31,212,177,161, 67, 83, 23,239, 95, 11,126,106,219, 81,197, 20,111,205,144, 32, 75,190,227,255,138, -201,222, 28,101,212,230,195,209, 22,245,146,152,242, 19,139,152, 11,232, 51, 60,215, 84, 11,248, 77,129,129,149,243, 12, 61,197, -121,217,101, 15, 7,143, 77,249,249, 42,210, 68,191,222, 69,112,192, 96,101, 1,200, 56, 24, 7,180, 7, 86,135, 42, 59,223, 91, -165, 37,227,153,209,196,184,189, 31, 19,249, 21, 59, 1,101,219,173,225,121,168,124, 70,149,178, 71, 70, 62, 95, 97,154,225,232, - 38, 78,146, 40, 57,248,120,169,218,156,178,123,137,145,175, 51,208,178,200,162,151,213,150, 76,221, 14,120,154,200, 44,150,205, - 44,218,203, 42,187, 89,190,180,239,157,124,218,229,152,231,248, 14, 63,163, 39, 63,189, 91,234,104, 66,205,233, 44,222,173,104, -135,159, 14, 63,189,197, 1,167, 45,121,139,147,207,233, 56,252,116,248,233, 45, 14, 68,231,182,228, 45, 30,190,114,116, 88,169, -122,193, 78, 70,141,104,120,122,110, 70,223,161,169, 95, 47,225,173, 47,135,159, 14, 63,173,182, 1,167,111, 26,115,192, 42, 15, -213,241, 28,126, 58,252,212,227, 64,116,110, 75,146, 31,225,157,207,204,250, 84,180,122, 31,157,145,185, 83,118,239, 54,117,135, -159, 14, 63,189,197, 1,167, 45,121,139,147,142, 52,207,105, 75,222,109, 75, 14,181,112,112,192,105,132,225, 96,154,135, 36, 14, - 63, 29,126,122,139, 3, 78, 91,242, 22, 39, 29,176,225,180, 37,167, 45,121,151, 3, 14, 53, 91, 28,112, 58,160, 45,118,153, 70, -118,248,105,202, 34, 91, 17, 28,126,218, 98,151,105,100,135,159,166, 44,178, 21,193,225,167, 45,118,153, 70,118,248,105,202, 34, - 91, 17, 34,131,159,182, 50,224, 68,118, 86,121,145,209, 8, 29,154,222,237, 89, 14, 63, 29,126,122,139, 3, 78, 91,242, 22, 39, -157,185, 35, 58,183, 37,239,182,162,104, 66, 45, 58, 55, 24,167,236,222,109,228, 14, 63, 29,126,122,139, 3, 78, 91,242, 22, 39, - 29, 80,228,180, 37,239,182, 37,135, 90, 56, 56,224, 52,194,112, 48,205, 67, 18,135,159, 14, 63,189,197, 1,167, 45,121,139,147, - 14,216,112,218,146,211,150,188,203, 1,135,154,195, 1,135, 3, 14, 7, 28, 14, 56, 28,112, 56,224,112,192,225,128,195, 1,203, - 28,224, 97,159, 50, 88, 78,228, 68,116, 56,224,112,192,225,128,195, 1,135, 3, 14, 7, 28, 14,120,137, 3,175, 53, 22, 97,225, -188,196, 39,135,140,195, 1,135, 3, 14, 7, 28, 14, 56, 28,112, 56,224,112,192, 54, 7, 94,107, 44,226, 72,179,108,183, 7, 39, -129,195, 1,135, 3, 14, 7, 28, 14, 56, 28,112, 56,224, 69, 14,188,214, 88,228,181, 70,145, 94,108, 4, 14, 41,135, 3, 14, 7, - 28, 14, 56, 28,112, 56,224,112, 32,114, 56,240, 90, 99,145,215, 90, 47, 26, 57,237,193,161,234,112,192,225,128,195, 1,135, 3, - 14, 7, 28, 14,120,145, 3, 81, 28,139,208, 4, 75,109,134,229,152,100,121,177,109, 56,164, 28, 14, 56, 28,112, 56,224,112,192, -225,128,195,129,232,201, 1, 9,168,140,238,209,147, 43, 78,169, 29, 14, 56, 28,112, 56,224,112,192,225,128,195, 1,135, 3, 94, -228,128, 86,154,245,194, 36, 90,142, 35, 59, 47,214, 34, 72, 57,252,116,248,233, 45, 14, 56,109,201, 91,156,124, 78,199,225,167, -195, 79,111,113, 32, 58,183, 37,111,241, 48, 90,209,137,206, 13,198, 41,187,119,155,186,195, 79,135,159,222,226,128,211,150,188, -197, 73, 7,100, 58,109,201,187,109, 41,170, 83,147,118, 90, 47, 76,154,229,172,242,188,223,100,156, 78,237, 93,158, 58,252,116, -248,233, 45, 14, 56,109,201, 91,156,116,192, 91,116,110, 75,222,109, 69, 47,150,154, 22, 92,189, 48,176, 21,157, 27,140, 83,118, -239, 54,114,135,159, 14, 63,189,197, 1,167, 45,121,139,147, 14, 40,114,218,146,119,219, 82, 84,166,230, 0, 45,147,218,115, 58, -139,119,155,183,195, 79,135,159,222,226,128,211,150,188,197, 73, 7, 20, 57,109,233,213,111, 75,222,205,225,139,167,230,168, 14, - 61,240,220,233,128,222,109,144, 14, 63, 29,126,122,139, 3, 78, 91,242, 22, 39, 29,160,229,180,165, 87,191, 45,121, 55,135,175, - 16, 53, 54, 62,189, 96, 39,139, 70, 52, 60, 61, 55,163,239,208,212,175,151,240,214,151,195, 79,135,159, 86,219,128,211, 55,141, - 57, 96,149,135,234,120, 14, 63, 29,126,234,113, 32, 58,183, 37,201,143,240,206,103,102,125,234,101,188,175,136,143, 82,162, 37, -239,142,141,150,166, 22,156,149,142,119,155,165,195, 79,135,159,222,226,128,211,150,188,197, 73, 71,162,229,180,165, 87,191, 45, -121, 55,135, 47,150,154,214, 97,233, 11,251,186,211,176,189,203,234,151,193,207, 55, 80, 4, 6,163, 75,239,253,203,200,103,120, - 56,237,228, 51, 60, 92,243, 44,157,240, 46, 69,199, 63,149,195, 79,239,113,192,233,239,222,227, 37, 41, 69, 6, 63,189,155,195, - 23, 75, 77,109,159,165, 61,142, 71, 55, 39, 57,241,116, 6,194, 18, 85,232,163, 19,115,142, 38,206,108,252,103, 90,121, 25, 86, -132, 16,226, 45,132,148, 8, 25, 17,114, 34,100, 71, 72,135,144, 12,225, 77, 15,252,137,140,202,117,104,234, 51,188, 44, 30, 15, -117, 5,254,214, 94, 70,239, 95, 75,126,166, 77,155, 54, 94,254,252,249, 63,124,252,248,113,227, 61,123,246, 52, 30, 53,106, 84, - 35,254,231,115, 43,109, 62, 2,125,254,181,228,167, 69,126,188,232,178,215, 64,190,214,187, 2,127, 91,189,140,242, 25, 35,126, -252,248, 93, 82,165, 74,181, 42, 83,166, 76,135,210,165, 75,119, 56,113,226,196,171,223,120,227,141,158, 32, 28,211,132,184, 17, -205,122,201,146, 37,243, 47, 95,190,252, 49,208, 91, 11, 26,173, 17, 18,240,206,255,124,206,247,248, 95, 79,135,254,139,204,167, - 85,222,233,197,123,209,245, 30,222,188, 58,249, 12, 47,231,156,116, 62,179, 1,118, 66, 93,224,201, 18, 45, 95,222,123,239,189, -251,207,158, 61, 19, 79,158, 60, 17,143, 30, 61, 18, 15, 30, 60, 32,138,155, 97, 54,233,128,112,242,205,155, 55, 23, 47, 88,176, -224, 16, 12, 8,171,223,124,243,205,187, 12, 24,128, 86,229,202,149,107,208, 95,127,253,149, 15,113,222, 54,168, 7, 79, 13,251, - 13,208,105,139, 65,109, 9,232,158, 79,154, 52,233,121,254,198,179, 14,160, 21, 94,240, 22, 27,131, 98,183, 4, 9, 18,172,138, - 19, 39,206, 21, 6,254,230, 51,208,140,237,161,173,120,202,103,220,216,177, 99,247, 72,153, 50,229,170, 68,137, 18, 93, 97,224, -111, 62, 3,189,184,225,164, 25,222,102,107,148, 79, 74,170,134,162, 30,134, 49,196,140, 25,243,167, 50,101,202, 52, 45, 91,182, -108,227,114,229,202, 53,226,157,207,228,123,198, 69,144,146,175, 40, 55,248,164, 72,145,130,109,113,166,167,144, 45, 91,182,195, - 0, 89,226,183,223,126,123,134,201,236,218,244,233,211, 31, 77,152, 48,225, 89,222,188,121, 71,235,181,249,228,201,147,143, 64, -189,206,178, 18, 24,247,101,214,123,203,150, 15,133, 58, 32, 47,217, 77,218,183,233,228, 24, 41, 52, 31,182, 20, 45, 17,152, 63, -222,229,111,155,121,245,212, 62,215, 79, 88,125, 87,140, 95,117,151,223,216,104,163, 83,233,210, 76,159, 62,253,111,223,124,243, -205,211,223,127,255, 93,204,159, 63, 95,204,158, 61, 91, 76,157, 58, 85,180,110,221,250,217,219,111,191,253,187, 9,125, 61,154, -109,191,254,250,235, 43, 24,115, 67, 56, 64,243, 62,107,214,172,219,241,226,197, 59,192,187,250,121,239,222,189,175,128,126,119, -205, 55, 94, 84, 62,109,176, 78, 55,106,148, 27, 67, 34, 90, 96,179,121, 51,130,244,163, 10, 63, 35, 88,204,151,154,188, 34,190, -174,182,209,234,103,150,155, 37,236,196,136,116, 25, 97,137, 43,152, 73,180, 46,223,191,127,159,105, 24, 95, 94, 97, 42, 23,100, -179, 52,111,222,188, 25, 64,197,217, 79, 62,249,100, 59, 38,239, 91,195,134, 13,187, 48,124,248,240,203, 37, 75,150,188,222,180, -105,211,205,111,189,245,214,217,154, 53,107,214,167,196, 75, 39,163, 70, 13, 38, 63, 38,201, 99,211,166, 77,123,124,241,226, 69, - 5,252,113, 82, 60,117,234,148, 24, 51,102,204, 99,188, 59, 1, 90,249, 13, 10,110, 68,179, 36, 6,176,179, 63,255,252,243,211, -131, 7, 15,138, 27, 55,110,136, 11, 23, 46,136,191,255,254, 91,116,237,218,245, 49,223,129, 94, 73,155, 52, 75, 1, 80,158, 95, - 60,116,232,211,192,192, 64,241,244,233, 83, 37,175,164, 59,119,200,144,167,124, 7,122,165,108,210, 52,171, 79, 79,239, 45, 1, -173,184,113,227, 14,251,239,191,255,126, 62,127,254,188, 18,248,155,207, 94, 23,160, 69, 48,132,197,130,127, 72, 72,136,110, 64, - 61,249, 3, 92, 62, 98,191, 40, 84,168,208, 67, 72,177, 50, 20, 41, 82,228,234,145, 35, 71, 68,190,124,249, 46,233,181,121,210, - 68, 27,244, 71,146, 48, 1, 11, 20,127, 44, 76,252,239,222,189,235,127,237,218, 53,127,198,245, 80, 73, 47, 98,144, 76,143,239, -143,144,224, 8,191,151, 34, 16,108,197,176,209,184,180,249,244, 54,205, 24, 42,112,181, 76,245,219,110, 94, 61,241,243, 12,129, - 86,173,159,174,112, 44, 59, 20,129,178, 43, 73,115,231,206, 29,112,232,208, 33,177,110,221, 58,129,197,165,248,231,159,127,196, -156, 57,115,196,200,145, 35, 5,198,185, 3, 38,244,195,228, 51, 71,142, 28,219,216, 6,255,252,243,207,199,141, 26, 53,186,139, -241,238, 33,255,159, 59,119, 46,152,119,254,231,115,190,231,127, 72, 92, 55,104,190,161, 91,118,111,231,211, 6,223,140,162,190, -136, 54,239,133,108, 70,138,250, 44, 58,151,221, 27,117,242,178,104,216, 62, 84, 90, 2,173, 37, 50,199,144, 10, 21,205,144, 33, -195,204, 52,105,210,172, 98,224,111, 62, 83,149,104, 9, 38, 13,143, 64,139,146, 44,130, 44, 72,154, 46,239,222,189,251, 8, 0, -203,217,207, 63,255,252, 18,158,111, 98,224,111, 72,179,206,108,221,186,117,115,194,132, 9, 47, 86,170, 84,233, 35, 60,167, 72, - 92,125,233, 53,194,252, 5, 10, 20,184,115,243,230, 77,173, 32,206,253,255,236,217,179, 2,131,212,109, 16, 42,168, 83, 11,122, - 52, 75,229,204,153,243, 46, 64,133, 8, 10, 10, 82,128, 16,193,214,142, 29, 59,196,246,237,219,149,176,116,209, 66,145, 33,125, -250, 59,160,167, 7,182,116,105,150,207,159,255,238, 57,127,127,113,114,220, 56, 65,126, 49,207, 12,252,253,223,188,121,226,196, -178,101,162,100,238,220,119, 65, 83, 15,108,189,136, 14, 24, 7,223,102,224, 85,150, 82, 43, 2,170, 38, 77,154, 12,155, 56,113, -226,176, 17, 35, 70,140, 98,224,111, 62,227, 59,198, 97, 92, 21, 95, 95, 68, 62,189,209,153,220,249, 36,208, 33, 32, 58,126,252, -120,168, 16, 16, 16,224,191, 98,197, 10,127, 72,177,252,139, 22, 45,250,136,117,133,182,246, 40,123,246,236,177, 1,184,174, 30, - 59,118,140, 64,139, 11, 18,121,133,161, 9, 48,230,175, 14,255,254,251,175,255,182,109,219,252, 49,249,250,163, 15,248, 47, 88, -176, 96, 45,232, 29, 3,157,243, 8, 99, 83,167, 78,157,217, 66,155,143,104,249,181,117, 20, 91, 5,178,184, 40,249, 11, 33,162, - 64,203,219, 52, 9,250, 20, 73, 22,238,123,228, 61, 28,121,245,212, 62, 55,212,252,241,138, 64,120, 4,186, 84,191, 89,189,140, - 0,204, 78, 2,173,254,253,251,139,142, 29, 59,138,250,245,235,139,119,223,125, 87, 52,107,214, 76, 96,252,220,103, 66, 92,143, -102, 11,180,191,237, 72,215, 15, 33, 57, 66,143,159,126,250,233, 58, 7, 58,222,249,223,245,252, 91, 72, 90,183,225,119, 83, 43, -109, 9, 64,203,219,249,180,202, 55,163,120, 81,110, 12,137,104,129,163,242,248,233,197,178, 27,146, 66, 19, 47,137, 80,199, 21, - 74,225, 94, 90,243, 95,209, 48,169,226, 85,117,189,215,222, 37, 13,249, 92,153,191, 85,233,140,132, 39,102,197,244,108,163,229, -143,137, 95, 6, 23,165, 80, 64, 11,234,183,206, 53,106,212,248,231,202,149, 43, 1,200,140, 18,248,155,207,248, 78,166,185,115, -231,142, 22,104,185, 51,134, 52,111, 81, 93,136,137,249, 60, 65, 22,254,239,235,213,171,215,201,165, 75,151,238,197,239,117, 12, -252,205,103,248,189,103,211,166, 77,219, 48, 16,157,129,200,157,182, 91,177, 60,148,240,205, 36, 73,146,156,160,180,201,236, 58, -122,244,168, 64,220, 83,160,245,150, 9,199,144,205,184,231, 9,174, 88, 38, 74,197, 80, 94, 1,201,131, 34,205, 90,188,104,145, -152, 55,115,166,240,159,235, 39,254,152,249,171,112, 73,182, 60,169, 17,249,185,184,148, 86,157, 3,144,218,211,185,179,248, 35, -117,106,113,253,250,245, 80, 97, 70,210,164, 98, 11,222, 29,244,243, 19, 46,201,150, 39, 53,162, 89,165,135,231,253,231, 72, 20, -228, 10,252,237, 3, 48,209, 16,229, 87, 64, 22,128,239,154, 88,177, 98, 61, 97,224,111, 62,227, 59,198, 9,207,199, 94,165, 52, - 18,104,105, 65,209,206,157, 59,221, 64,171,110,221,186,103,127,249,229, 23, 49,104,208,160, 39, 0, 68, 55,134, 14, 29,122, 23, -106,160, 16,252,158,162, 87, 22, 79, 52,215,174, 93,139, 46,231,239, 15,213,227,218, 18, 37, 74, 60,129, 74, 41,228,210,165, 75, -148,118, 60,131, 74,253,134, 14,216,138,108,118,197, 80, 1, 45, 74,114,170, 35, 72,192, 29,222,111, 71, 6,205, 56, 82,146,229, - 2, 90,127,123, 41,175,178,140,243, 0,178, 30, 35, 16,180,140, 13,111,193,153, 14,166, 21, 5,209,102,206,125, 63,239,178,232, - 50,244,119,209,190, 75, 95,241, 81,211,182,162,220, 71, 61, 68,201,214,115, 4,192,117, 32, 22,148,122,182,143,118, 63,251, 37, - 18, 80,114,213,197,110,194, 23,156,207,240,100,207, 73, 19,141, 56,160,131, 69,220,165, 39,104,194, 31, 5,204, 64, 45,222, 71, -231,127,101, 70,150,207,141,238,146,134,250,189, 4,108,207,147, 43,223,241,254,197,194,105,168, 82, 77,184, 4,161, 15,165, 86, - 4, 84, 18, 96,169,239,247,238,221, 11,192, 96,242,143, 75,178,229, 78,163,151, 67,164, 75, 69,155,172,246,237,219, 31,196,111, - 2,173,117,181,106,213, 10,188,122,245,234, 38,168,101,214, 51,240, 55,159, 65,149,182, 30, 42,151,127,161, 62, 92, 7, 27,135, -254,136,171,149,106,169, 63,209,114,202,148, 41,138, 74,199,232,130, 58, 72, 1, 76,183,111,223, 22,176,151,120,136,252,118,244, -196, 69,216, 95,245,128,186,241, 9, 37, 89,167, 79,159, 86,212,123, 16,205, 11,128, 63,177,100,225, 31,226,247, 25,191,138, 89, - 99, 70,137,105, 3,251,137,181,126,179, 68,251, 38,141, 30,187,108,182, 12,201,210,254,106, 33, 84,131, 39, 70,143, 22, 11, 0, -178,230, 39, 79, 30, 6,104, 77, 77,144, 64, 76,136, 27, 87,236,250,241, 71, 49,169, 71,143,167, 46,155, 45,239, 87,184, 62, 69, - 78,170, 65,146,135, 49, 98,196,120, 10, 85,217,108,168,118,215,183,109,219,246, 96,189,122,245, 14, 65,114,165,168, 39,120, 17, -108, 81,178, 5,112, 48,172, 88,177, 98, 13, 94, 84, 38, 35,235, 59, 70,160,104,239,222,189,254,107,214,172,241,255,227,143, 63, -252, 33, 49, 88, 91,170, 84,169, 39, 51, 1,178,169, 50,132,148, 43,164,112,225,194, 55, 32,221,205,166,151, 47, 61,154,251,247, -239,247,223,184,113,163, 2,178,176,136,240,255,248,227,143, 79,131, 94, 8, 0,220,211,226,197,139, 95,159, 49, 99,198,125,128, -174,103,148,108, 69, 86, 89,245,232,106, 64, 22,193, 75, 14, 4, 59,106,195, 48,100, 35,131,166, 43, 79,106,251,172, 61,120,150, - 47,162,121, 85,101,126, 54, 65, 22,194, 25, 60,251, 89,245,156,253,163, 16,130,101,240, 9, 9,232, 54,140,105,162,223,146, 71, -162,104,191, 32,241,246,151, 79, 69,252,207, 31,139,236,221, 2, 69, 93,223,157,226,187,239,190, 19,176,247,100,254, 95,234,245, - 2,242,153, 25,229,252, 29, 54,105,155,120, 71, 97, 51, 71,180,192,213,114,248, 84,253, 32,111,204,243,213,178,251, 8,229,142, -255, 17,165,233,164,127,249, 28,208,193, 34,238, 76, 97,218,113, 75,180,240, 80, 2, 34,237,221, 20,104, 73, 80,101, 2,200,194, -195, 12,107, 18, 45, 61,202, 84, 17,170, 37, 89, 18,104,193, 14, 42,224,240,225,195, 1, 80,127, 4, 48,142, 89,174,144, 46, 35, - 12,142,255,198, 36,115, 18, 32,106,215,195,135, 15, 55,192,168,250, 58, 65,149, 4, 90,252,141,201,253, 6,212, 51,155, 32, 61, -218, 53,119,238,220,173,216,177,179, 2,105, 19, 25,209,199,100, 54,135, 54, 89, 70, 23,237,159,168,238, 33, 80,130, 93,145,128, -106, 82,208, 64,222, 83,126,105,236, 78,233, 23,211,220,186,117, 75,156, 56,113, 66,145,100, 45,253, 3, 32,235,215,105, 98,246, -152,145,226,215, 65,253,196,212, 30, 95,137,249,253,250,138, 25, 0, 92, 76,227,137, 38,141,221, 41,177,160,138, 80, 74,178,126, - 75,153, 82,192,250, 90,252,154, 56,177, 32,200,162, 4,141,192,142,106, 78,236,106, 19, 76, 99,198, 87, 47,190, 15, 5,180, 32, -209, 19, 39, 79,158, 12, 65,158, 66,168, 62, 37,239,248, 44,186, 1, 45,180,113,255, 45, 91,182, 40, 82, 45,168,248,252, 1,192, -215, 65,165,124, 10,170,150,171, 88, 56,204,132,173, 86, 46, 15,109, 83, 81, 71,170,165,100, 84, 69,174, 94,189, 90, 1,110, 0, - 85,254,144, 6, 62, 34,128,167, 58, 50,107,214,172,137, 48,233, 93,165,228, 20,255,213,118, 95, 94,172,102,125, 82, 58,134,235, - 4, 47,102, 82, 90,143,249,138, 12,154,174, 15,198,118, 73,179, 14,226,127,120, 84,156, 70,249,102,121,255,236, 48,237,198,153, - 47,103,220,248, 23,191, 39,187, 64, 65,119, 44, 60,254,128,189,211, 63,188,227, 25, 13,204,211,154, 85, 10, 64,248,118,218, 97, - 94,190,124, 89, 16,112,113,156,162, 26,113,249,242,229,226, 71, 44,166, 62,252,240,195,112, 1, 45,108,200,249, 12, 99,233,239, - 25, 51,102,220,133,246,183, 27, 82,177,133, 88, 4,113,195, 79,184,128,113,100,229, 83,242,135,224,106,200,144, 33,151, 32,189, -189,212,166, 77,155, 75, 46,176,101,198, 62,143,239, 9,174, 78,174,154, 32, 30,239,159, 43,118,140,105,162,128,173, 8, 17,116, - 18,191, 18, 28,208,104,214,194,228, 73, 13,142, 12,128,146, 41,208,146, 32, 45, 18,128, 22,243,107,236,164,212, 19,138,164, 61, -150, 4, 87,188, 67, 58, 20,128,201, 55, 0, 54, 74, 1,203,150, 45, 11,128, 58, 48,128, 91,151,205,106, 9,105,115, 66, 66,115, - 27, 19,215, 69,208,216, 4,195,249, 13,213,170, 85,187,138,231,235, 24, 8,182, 96,140,188,190, 74,149, 42, 87, 1, 72, 54, 99, - 96,218,138, 1,233, 95, 72, 78,110,225,125, 50, 35,250, 24,112,254,163,209,187,222, 5, 48,167, 12,112, 84,253, 65,146,160,216, - 87,237,219,183, 79,112, 71,162,167,252,114,103, 33,193, 25,108,105, 20, 80, 68, 3,214,101,127, 44, 16, 11,166, 79, 19,126, 99, - 70,136,153, 3,190, 23,211,186,119, 17, 83,218,183, 18,179,191,108, 43,214,140, 27, 41,152,198, 19, 77,238, 44,148,160, 79, 2, - 45,130,172,233,137, 18,137, 41,241,227,139, 9,113,226, 40,249, 36,192, 3,143, 4,193, 13,211,152,241,213,203,239, 63,167, 36, -139,128,170, 91,183,110,138, 4, 79, 29,248,140,239, 40,217,146,170, 67,240,115, 24,164, 47, 90, 59, 16, 47,103, 43,242,201, 25, - 73,180, 8,146, 96, 51,232,143,182,238, 15,224,175, 4,168,159,253,172,228, 72,143, 38,109,179, 8,218, 32,181,162,218,208, 31, - 96,237,209,104, 72, 57,177, 17, 36, 24, 54, 53,231,240, 63,136,146, 87, 0,176, 64, 43,223,240, 98, 28,218, 99,209,168,156, 18, -150,101, 8,220, 5, 73, 99,118,245,101,103, 34, 87,236,169, 44,208,180, 93, 4,149, 17, 60, 65,150, 55, 84,156,204, 67,165, 60, - 73, 98,239, 93, 82, 43,227,153,179,215, 30, 31,188,126,247,217,182, 47,250, 21, 89, 21, 47,254,155,219, 59,116,232,112, 24,227, -200, 3,142, 49,176,225,123,208,162, 69, 11,242,136,182, 80, 30, 47,180,147, 94,216, 93,120, 98,225,194,133, 33, 4, 87,210, 8, - 30,187, 6, 69,131, 6, 13, 66,178,100,201,114, 28,146,240,222,102,116,212,239, 1,172,166,246,232,209,227,201, 60,216,115, 50, - 64,170, 42,208,142, 68,195,134, 13,159, 1,192, 88,106,151,218,239,193,102,182,219,103,159,125,118, 16,249, 12,246, 86, 62,213, -223,128, 36,107,227,216,177, 99, 47, 1, 88, 94, 2, 63, 46,241,191,157, 50,235,197,165, 36,235,209,191,191,139,219, 19, 75,139, -187,243, 26, 11,254,143, 40, 77, 39,253,203,231,128,151, 36, 90,149,169, 90, 68,105, 66,169, 24,181, 32, 13,255,107,170,227,169, -226, 87,137, 32, 39,244,219,162, 85,160, 21, 28, 28, 28, 0,105, 75, 0, 38,158, 0,168, 61, 2,208,193, 3,176,187, 37, 0, 19, -202,106,179,140,161, 80, 57, 0, 70,110,194,247,208, 67,168, 73,142, 1,248,108, 39,168,146, 32, 11, 59,176, 54, 64, 21,185, 1, - 19,248, 53,208,223,137, 21,223,137,150, 45, 91,222, 3,208,162,161,103, 18, 35,250, 4, 90,116, 45,161,189, 40, 57,162, 4, 9, - 3,163, 34, 29,130, 36, 77,145, 74,241,110, 5,104, 49, 45,129,217, 42, 72,192,252, 23,252, 46,254,152, 62, 85,248,141, 26, 46, -102,246,255, 78, 76,239,246,165,152,218,174,165,152,249, 89, 83,177,160,125, 75,177,246,231, 65,150,128, 22,243, 73, 0, 39,129, -150, 4, 89,227, 98,199, 22,163,222,120, 67, 81, 71, 29, 56,112, 64, 1,131,148,108,189, 4,160,229,131,157,116,211,248,109, 45, -200,146,255,249,174,118,237,218,255,210, 62, 11,170, 93, 26,194, 15, 67,221, 80,197, 82,203,172, 13,188,202,239, 61,169, 14,105, -180, 78,105, 22,220, 57,248, 79,154, 52,137, 64,107,174,149,178,144, 38,119, 49,170, 37, 90,148,142, 17,180, 81,154, 5,213,171, - 63,220,153, 60,174, 80,225, 93,197, 61, 74, 64,192, 46, 1,123, 45,165,238, 33,209,122,209, 64,139,210, 28, 2, 35, 74,178,242, - 34, 80, 29,170, 72,180,212,110, 20, 84,191,221,239, 61,240,194,144,166, 21,254, 25,197,193,142, 61,218, 4, 78, 69,160,116,201, -174,193,190,150,108,173,216, 49, 99, 92,232, 89, 36,249,141,192, 79,115,159,189,213, 54,207,193,109,131,187,111,155, 51,123,192, -234,129,211,203,251,231, 42,144,242,252,205,155, 55,130,177,160, 12,106,215,174,221, 65, 44,186,174,161,127, 62,198,130,131, 96, -212,112, 92,194,187,184,173, 90,181,122,167, 79,159, 62,147,170, 86,173,186, 25,245,124, 24, 18,203,115, 48,133, 56, 3,251,203, -127,176,227,144, 19, 65,113,187,124,224,238, 64,110,202, 97,127, 4,104, 23, 27, 54,108, 16,116, 29, 1, 73,171,192, 66,214,108, - 23,163,167,207, 21, 65,153,122,195, 54,240,143,204,153, 51,111, 65,216, 8, 0,246,123,120,243,169,254, 16,180, 18,191, 99, 44, -191, 4,126, 92,130,169,201, 37,254,183, 91,110,109,124, 72,176,206,238, 24,215, 76,220,155,223, 84,172,232,156,133, 18, 45,238, - 0,119,174, 40,206, 1, 19,160,101,102,163,165, 0, 36, 96,129,216,158, 36, 95,140,242, 60,218,115,195,122,249, 91,245,236,205, - 8,176, 49,124,128, 95,170, 14, 33,141, 9,192, 4, 16,128, 14, 30,128,149, 84, 0,220, 49, 4,140, 27, 55, 78, 9, 22, 85,135, -233,209,113,169, 58, 60,251,235,175,191,158,198,238,155, 75, 24,112, 30, 67,125,120, 3, 3,209, 85,130, 46,170, 18,249,236,163, -143, 62,186, 4,160,117, 26, 64,110, 61,192, 25, 85,135,134, 54, 90, 84, 29, 82, 18, 36, 47,218, 83, 81,221, 71,137, 16,129, 11, -140,153,159, 75,164, 96,132,206,128,111, 91, 82, 29, 50,205,142,109, 91,133,255,239,243,197,194,105, 83,196,188,145,195,196,172, -254,223,138,233, 93, 59,137,233,109, 91,136, 89,159, 54, 17,243, 62,169, 47,150,119,250, 76,204,236,220,222,146,234,240,204,153, - 51,138,173,152, 4, 90,147, 33,201, 34,200, 26, 9,144,245, 3, 42,158, 82,183, 93,187,118, 41, 64,139, 3,232, 11, 86, 29, 42, -109, 11,246, 86, 83, 8, 50,141,128, 22,223, 97,245,187,159,146, 44,130, 44,240, 93, 9, 72, 74,176,149, 48, 2, 13,244,165, 38, - 37, 40,162, 11, 7,173, 49, 60,129, 17, 47,216, 81,249, 67,242,228,239,235,235,187, 18, 78, 33,247, 2, 8,109,131, 10,177, 43, -213,125, 70, 25,151, 46, 35, 36, 77,170, 33,193, 87,127,108,250,240,199, 54,124,127,180,113,127,208, 81,182,231,255, 60,226, 71, -110,197, 15,129, 13,161,192, 98,132, 59, 25,119,189, 4,134, 80, 10,165, 14,204,130,145, 75,133, 37,120,103, 5,228,232,209,148, - 69,147,239,140,254, 27,177,128, 62,246, 42, 34,232,169, 55,237,210, 60,242, 96,254,144, 27, 15,230, 12, 60,123, 19, 32,107,236, -187,105,183,167,136, 27,107,204,219,137,223, 26,248, 94,189,140,203,106,125,240, 46,119, 69,139,102, 45, 26,112, 34, 95, 92,189, -122,245, 45, 84,163, 99, 65, 66,169, 76, 1,163, 12, 2, 76, 20, 66, 93, 79, 67, 93,207,130, 20,138,198,234,165, 17,180,227, 24, - 7,249, 25, 8, 4,238,235, 16,168, 25,248,206, 83,189, 71,112,119,160, 39,210,149, 33, 77,221,139,124,171,125,194,185,227, 3, -112, 13, 64, 91,221,137, 7,181,195,209, 46, 51, 99,195,208, 2,168, 56,183,242,142,244,153,195, 65, 35, 84, 18,218,100,213,203, - 23,235, 12, 37, 89,202,221,177,209,138, 40, 75, 95,249,244,232,134,234, 93,135,252,205,157,135,114, 7, 33,255,187, 1,146, 42, - 46,159,203,116,114,151,161, 58,141,246, 93,120,119, 28,146,127,182, 61,195,135, 50,134,199,224,242, 15,192, 65, 0, 38,215, 0, -172,236, 3, 48,225, 40, 1, 14,242, 2, 96, 44,189,209,162, 49,124, 50, 58, 35,133, 97,245, 1, 20,252, 48, 86,250,138, 49, 60, -192,199, 22,170, 10, 1,140,182,192, 22,106,107,229,202,149,175, 66,106,182, 5,234,201,125, 0, 94, 27,224,200,209, 23,241, 61, - 25,160,182, 4,232, 83, 38, 43, 74, 5,104,223, 66,137, 0,213,126, 92,241,193, 30, 70, 44,194, 46, 65,138,216,137,150, 1, 18, - 30, 89, 49,134,239,217,189,219,227,253,187,118,138, 69, 83, 1,178, 70,252, 44,102,251,126, 43,102,116,253, 66,252,218,166,185, -152,253,105, 99,177,168,125, 67,177,109, 80, 11,177,169,239, 87,162, 99,149, 10, 79,172, 24,195,207,234,223,255,233,113, 24, 82, - 83,146, 53, 41, 94, 60,183,221, 24, 85,133, 4, 87,253, 81, 81,223,199,136, 33, 22,183,111, 47,126,252,236,179, 23,109, 12,175, -116, 52, 43, 64, 11,113, 86, 1, 8, 52, 70,244,159, 95, 39,160, 69,191, 86,106,160, 69, 96, 68,195,245,197,139, 23,251, 67, 10, -235,223,183,111,223, 85,152,140, 30, 83,181, 71,201, 40,118, 31, 62,202,147, 39,207, 85,120,252, 78,163, 55, 74, 17,104, 65, 69, - 30,138,166, 14,208,122,194,182, 91,188,120, 49,129, 69, 11, 55,107, 8, 24,220, 11,208,125,161, 54, 90,204, 63,109,170,112,203, -128,160,182,205,210,115,169,176, 27,113, 86, 34,152, 2, 45, 3,154, 62, 15, 91,182, 20, 12, 46, 26,177, 85,255, 77, 37,101, 42, - 39,165,106,143,252,225,165,185,139, 32,139,146,172,178,105,227,109, 69,126,106, 34, 40, 42, 82, 44, 32,247,125,248, 97,189,167, -172,159,143,235,127,244, 4,192,250, 22,164,185, 15, 8,180,224,162,225, 1,198,166, 77, 6,179, 83,172,198,141, 27,119,128, 52, -125, 47, 36, 90,211, 17,167,162, 94, 60,236, 58,220, 46, 29,140,202,133, 34,226, 25,154, 97, 84,172, 88, 49, 55, 54, 38,157,250, -105,209, 69,209,109,168,159,232,208,169,171,168,223,184,133, 40,247, 65,103, 81,238,211,201, 2,160,255, 2, 22,170, 69,194, 49, - 99, 86,198,226,246, 12, 52, 10,193,232,219, 84,139,134,241, 88, 15,181,246, 14,190, 71,185,104,118, 81, 55, 28,223,112,146, 56, - 28,112, 56,160,225,192, 18,238,212,195,179, 37,124, 78, 23, 14, 16,249,174,195,238, 43,197,248,157,182, 89, 16, 85, 43, 32, 75, -237,222,129,198,158, 50,141,150,163, 68,155, 80,221,229,135,120,251, 60,164, 54,199, 48,192,236,233,222,189,251, 73,216, 45, 28, - 0, 56,218, 4,131,251, 77,176,127,217, 15,241,252, 89, 24,161,239,134,106,101, 13, 36, 38,103,176,234, 79,143,180,158,142,170, - 80,220, 59,112,240,227, 4,200, 59,118,138, 41, 18,153,149, 43, 87, 42, 98,117,168,124, 4,104, 11,236, 78,164,219, 4,203,238, - 29, 86,254,241,187, 88, 59,119, 54, 64, 86, 95, 49,179, 75, 7, 49,227,179,102,194,175,101, 67,177,164, 93, 3, 17, 48,172,149, -216, 55,178,147, 88,240,197,103, 34, 94,220,184, 92,237,154, 25, 14, 43,238, 29, 14, 35, 31,255,180,109, 43,198, 64,146, 69, 35, -123, 9,178, 40,121, 35,200,154, 86,181,170, 88, 10, 27, 14,168, 13, 57,160,189,104,247, 14,150, 84,135, 84, 47,186,234,151,234, - 66, 74,178, 94, 11,213, 33,164,141,254,176,157,241,199, 38, 0,229,206,240,254,251,239,251,195,150,208,191, 66,133, 10,180,167, -250,143, 18, 73, 72, 41, 66,160, 54,189, 10,201,238, 83,168,177,158, 2, 20,209,143, 88,152,139, 64, 11,210, 85,127,108,241,247, - 71,223, 80,238,218, 0, 67,228, 71,231,206,157,133, 4, 43,111, 8, 38,114,250,209, 10,162,143, 54, 72, 15,212,190,185, 94,196, - 0,165,184, 98,192,135,104,155, 69,176,163,182,199, 10,175, 75, 5, 79, 52, 51, 72,112,165, 2, 89,180, 17, 27,143, 64,176,103, -116, 41, 18, 54,131,124,134,135,102, 53,208, 90,225, 26,183, 42,169, 63, 10, 9,227,113,183,168, 28, 63, 56, 38,210,206, 18,128, - 67, 89, 36,193, 24,253,184, 81, 38, 33,137,111,133, 5,227,121,180, 37, 58, 98,230, 56,202,197, 43, 85, 27,116,154,204,221,139, -252,238, 84,244,243, 35,216,160,115,207, 10,208,194, 70,137, 45, 52,174,255,122,193, 35,145,235,155, 71, 34,238,231,207, 68,156, -142, 79, 69,186, 46, 55, 68,181,111,247,136,111,191,253, 86, 64,106, 20, 96,179,177, 52,133,237,212, 57,130, 40, 56, 58,189,224, -226, 5,157,231,106,195,159,136,119, 94, 21,175,190,205,239, 56,209, 29, 14,188,238, 28,168,136, 2,106,165, 90, 30,203,188,132, - 71,235,184, 6, 31, 37,162,116, 88, 74,123, 44, 26,191,235, 57, 44,165,186, 78,157, 6,191, 67,109,185,197, 96,146,136, 30,223, - 49,184, 92,134, 68, 96, 31,236,187, 78, 66,119,143, 77, 57,151,183, 97, 34,218, 10,103,166,151, 96, 36,124, 2,106,154, 13, 0, -100, 23, 49,129,213, 70, 26,173,207, 43, 93,135,165,116, 70, 74,213, 27, 7, 64,170,223,184,187, 16, 59,187,148, 99, 47, 40,209, -130,109,141,128,202,231, 54,242,100,217, 97,105, 22, 56, 35, 93, 6,181,225,166,153, 83,197,226,222, 93,197,130,118, 45,196,146, -214,141,197,158, 17, 29,196,193,241,221,196,162, 47,219,136, 76,201,146,216,114, 88, 90, 2, 78, 80,119,195, 23,211,102,108,237, -166,202,147,146, 55,248, 21, 83,192,225,130, 86,173,196,210, 94,189, 68,129, 76,153,238, 33,159, 47,195, 97,169, 37, 99,120, 26, -204, 35,127,138,159, 45, 92, 84, 23,106, 85,134,145,177,213, 58, 82,105,194,110,111, 52,108,242,150, 65,194,170, 56, 44,165, 52, -139,174, 29, 24, 80, 63, 74, 40, 93,186,180, 34, 57, 5,208,124, 8, 91,155, 2,220, 33,200, 93,100,152,144, 57, 65,201,203,157, - 79, 72, 60,134,173, 95,191,126, 41, 65, 22, 38, 93,127, 0,235, 48,170, 73, 44, 86, 30,113,113, 0, 16,247,144,106, 72, 0,175, -171,252, 15,154,186,222,230,189, 56, 82,105,249, 41, 65, 17,237,103,168,146, 83, 47,110,220, 82, 45,149,147, 80, 61,151, 10,118, -104,114, 97, 82, 81, 5,178,184,131,144,110, 37, 56, 88,169, 23, 45, 97,105, 62, 7, 90,234,124, 74, 80, 24, 94,154,186,108,213, - 2, 45,233,238,133,139, 34, 46,146, 96,204, 78,199,174, 97,234,221,245,160, 40,129, 58, 22,127,143, 48,150,134,192,111,218, 93, - 30,137, 3,137,208, 69,184,244,184,240,229,151, 95, 6, 98, 17,120, 7, 52, 97,250, 26, 44, 32, 45,165,189, 42,203, 53,199,136, - 38,218,219,118,250,243,227, 6, 31,250, 13,188,116,233, 50,118, 49, 30, 86,108, 79, 33,213, 23,160,107,101, 23,163,154,159,116, -120,122, 8,154, 0,229, 56, 31,171,151,107,110, 56,140,180, 18, 16, 71,106,223,140,196, 54,239, 13,210, 78,217,189,193,197,215, -131,134,214, 51,188,105,169,150,208,214, 9,177,204,142,224,145, 42,198, 37,140, 75,183, 4,184,243,183,209,224, 67, 11,180,148, -176,199,250,136,199,236, 96,117,191, 13,162,234,171, 61,123,246,188,128, 35,109, 78, 97,146, 9,132,218,100, 53, 37, 89, 46,144, - 21, 95, 39,167, 70, 13, 91, 57,130, 7,162,250, 71,180,197,162, 68, 11, 18, 56, 49,121,242,100,129, 93, 67,143, 40,245, 2, 45, -187, 71,240,148,162,227,210, 46, 77, 27, 61,154, 59,208, 87,108, 24,243,179,216,240, 67,127, 49, 7,210,173, 78,213, 42, 61,198, -170, 53, 60,199,229, 40, 71,240,140,233,212,233, 41,143,228, 32,216,162,193, 62,129,225,144, 79, 62,121,234,146,100,189,140, 35, -120,194,184,119,160, 10,150, 54, 89, 12,252,173,118,239, 0, 94,210,177,169,145, 74, 55, 42, 14, 62, 9,209,126,198, 97, 17, 49, -199, 40,160, 77, 62,164, 68, 11,210,166,251, 40,251, 27, 0, 71, 87, 89,119,144, 66,169, 13,215,213,101,143, 67,176,229,233,172, - 67, 44, 16,142,162,141,134, 96, 87,214, 99, 76,164,215, 97,151,120, 31,255,181,126,180, 94, 4, 63, 99,192,110, 76, 57, 59,208, -192,224, 93,145,106,161,220,158, 92, 42,132, 1, 69,164,169,150, 92, 33,189, 91, 53,168, 35,209,250, 12,239,181, 54,111, 47,130, -166, 37,160,197, 35,198,216, 15, 8,180,184, 48,210, 72,180,244,234,168, 50,140,202,119,224, 8,175,235, 88, 76, 42, 42, 72,245, - 69,144, 5, 73,251, 29,168, 33, 41, 17, 95, 15,128,253, 24,119,170, 26,117,199, 79,180,207,111,187,116,233,114,116,213,170, 85, -130, 65,238, 98,196,152, 39,112, 74, 3, 79,190, 56,141,113,213,215,100,116,215,230,179, 81, 56, 37, 90, 77, 60,141,243,166, 51, -140,121,132, 23,209,230,205,115, 97, 30,195,201,167, 57,143,162, 75,140,138, 40,168, 45,137,214, 12,186, 76,160,123, 4,174,226, - 40, 42,215, 0, 40,201,184, 37, 84, 23, 82,146, 69,144,197, 65, 8, 47,102,155,117, 64, 12, 54, 9, 48, 72,228,160, 51, 82, 24, - 95,254,133,157,133,119, 24, 0, 92, 86,210, 38,203,165, 46, 52,242,222,238,169, 97, 71,198,161,210,113,233,192, 84,231, 80,233, -136, 28, 0,253, 42, 30, 42, 29,198, 97, 41, 36, 55,147, 0,132, 39, 48, 0, 4, 79,161, 36, 75,165,226,120,221,128,150,233, 96, - 0,128, 53,139, 78, 74,161,162,185, 3,123,195, 27,188,243, 63,159,155,181,121, 35,226,244, 0,143,244, 55, 96, 3,246,140,174, - 61,120,231,127,141,103,248, 23, 49,152, 75,119, 12, 52, 86,166, 10,143, 18, 35,233,226, 65,109, 16,239,201,165, 66, 24, 80, 4, - 26,180,227,210,210,116,171,248,240,142, 82,172, 67, 42,201, 22, 7, 43,143, 18,173, 72,160,169, 91, 61, 90,137, 22,199, 68, 74, -147, 88, 79,180,209,131, 84, 95,173, 58, 52,170, 35, 74,141,218, 35, 44,131,171,156,195,240, 19,120, 22, 7,146,159, 5, 0, 59, - 9, 45, 1,109,194,250, 33,208,168,158,129, 42,120,181, 95, 54, 61,154,101,177,104, 28,130,111, 47,133,170,121, 51,164,106, 91, - 1,192,252,177, 8,194,126, 26,159,114,166,141, 88,163,101,112,197,119,219,104,193,105, 46, 37, 85, 97, 46,216,104,109,242, 96, -163,245, 34,218,167,133,162,153, 70,113,242,105,202, 34, 91, 17, 34,131,159,182, 50, 16,213, 35,231, 68, 1, 8,152,150,168,130, -222,161,210,106,137, 22,227,206, 64, 96, 90,121, 25, 86, 4, 38,236, 88, 4, 92, 8,137, 17,146, 33, 36, 65, 72,136, 16,199,196, - 38, 43, 50, 42,215,161,249,188,198,194, 28,193,163,105,200,102,239, 77,235, 61, 2, 29,227,165,215, 17, 22, 6, 73, 97,111,211, - 9,170,232, 30,144, 62,244,224,157,255,249,220, 74,155, 55, 42, 59, 65, 21, 61,193, 99, 50,123,153,103, 29, 50,123,210, 29, 3, -221, 59,168, 93, 60, 16,132, 81, 77, 52, 30,129, 0,204,200, 8, 94,175,142,140,104, 74,122, 4,117, 53, 92, 65,207, 70,235, 69, -209, 12, 83, 61, 80,229,174,128, 63,179,227, 88,100,156, 64, 56, 78,224, 5,169,230,113, 24,177, 31,167, 52, 11,174,101,104,219, -101,183,205,211, 39, 32,157,157,154, 29, 3, 70,186, 47,178,205, 87,226, 78, 90,158, 93,170,215, 78,177,216, 28, 0, 30,236,199, - 59,189,227, 73, 94,100, 62, 35, 48,132,188, 80,126, 58,249,140, 8, 7,156,180,182, 56,224,116, 64, 91,236, 50,141,252, 34,248, -169, 62, 84, 90, 47, 67,102,239, 95,244, 4, 97,202, 52, 15, 17, 94, 4, 63, 35,146, 63,187,147,184,157,111, 25,149,221,200, 29, - 3, 1, 19,213,126, 4, 89, 70, 27, 63,236,208, 84,211,147,109,138,180,181,187, 14, 95, 36, 77, 59,252,211,198,117,218, 82, 68, -184, 23, 54,173,195,207,232,201, 79,239,150, 58,154, 80,115, 58,139,119, 43,218,225,167,195, 79,111,113,192,105, 75,222,226,228, -115, 58, 14, 63, 29,126,122,139, 3,209,185, 45,121,139,135, 47,131,142,214, 62,171,162, 58, 19,172, 84,189, 96, 39,163, 70, 52, - 60, 61, 55,163,239,208,212,175,151,240,214,151,195, 79,135,159, 86,219,128,211, 55,141, 57, 96,149,135,234,120, 14, 63, 29,126, -234,113, 32, 58,183, 37,201,143,145,248,161, 23,218,225,185, 58,152,245,161, 87,241,125,248,188,196,135,163, 36,209, 25,153, 59, -101, 15, 71,131,241,144,196,225,167,195, 79,111,113,192,105, 75,222,226,164, 35,205,115,218,146,119,219,146, 30, 53, 2,174,168, -118, 17,100,133,146,104, 69,102, 1,156, 70,232, 93,238, 58,252,116,248,233, 45, 14, 56,109,201, 91,156,116,192,134,211,150,156, -182,228, 93, 14,132,166, 22, 21,129,150, 57, 63,224, 72, 47,150, 12,112,187,208, 22, 41,184,219, 68, 9,252,175,126,175,247, 91, -245, 5,119, 7, 52, 75, 99,246, 29, 61,154,249,115, 37,234, 88,177, 84,218,163,133,114, 37,234, 0,247, 11,121, 65,163,129, 12, -252,111,246,205,240,228, 83,239, 59, 5,242, 36,249,130,249, 40,144, 51,161,186, 65, 56,131,143,121, 83,179, 19,195,140,159, 41, - 64,172,245,219,113,223, 90, 90, 54,109,130,107, 9,222,138,181,132,255, 17,212, 59, 2,181,223, 51,163,105, 39,127, 50,238, 11, -163, 9,119, 1,121,112,246,221, 16,132,101,216,238,191,131,119,254,231,115, 11, 25,119,231,179, 98, 22,159, 51, 8,194, 21,206, -168,211,122,122,167,243,141, 80,101,175,158,221,231, 33,207,162,171,158,195,135,254,161,220, 87,141, 28,250,207, 25, 79,137,143, -116,122,125,211, 66,153,172, 70,121, 97,117,228,202, 16,125,131, 53, 64, 24,128,240, 17,130,158,127, 64,189,188,191,232,124, 90, -229,223,107,213,143,194, 91,104, 87, 58,167,142, 34,200, 64, 11,201,163, 10,208,210,170, 10, 61,171, 14, 1, 38, 42, 39, 77,156, -240, 80,146,196, 9, 46,197,138, 21,243, 9,207, 16,228,197, 59,255, 39,121, 59,193, 37,188, 59,196,120, 17, 1, 90,118,190,163, - 55,240,190, 91, 50,205, 13,113,101,180,120,183, 68,218,219,240, 73,211, 14, 62,191, 58,192,203,114, 7,222,249, 63, 89,226,196, -159,164, 72,145,168, 17, 60,194,167,143, 72, 62,153, 62, 69,138,164,141,146, 37, 75,252,137,222,119,222, 41,158,250, 62,243, 81, -161,100, 26,245,177, 41, 78, 7,180,208,131,108, 68,241,196,207,216,153,147, 38, 56,180,228,139,186,226,234,196,238, 34,240,139, -226,226,116,155,130, 98,122,245, 44, 34, 67,194,183,232, 96,211,238, 46, 57, 27,217, 10, 19,245, 69,212,123,172,108,217,178,117, -134, 87,249,173, 7, 14, 28, 8, 64,123, 15,192,241, 48, 1,112,168,169,156, 71,202,231,124,143,156,197,242, 80, 16, 53,208, 18, - 98,195,119, 74, 40,151, 81,113,184, 71, 31,113, 29, 25, 8,190,228, 59,254,198,179,158,242,157,235,254,129, 17, 40, 2,104, 10, -121,188,117,152,168,145,221, 39, 88,157,166,118, 46,159,135, 98,215,232, 48,207, 25,143,241,153,206,136,102,141,156, 49,158, 18, -140, 25, 5,190, 71,218, 86, 58,129, 46, 36,228,165,174, 35, 62, 55,140, 95, 39, 79,172, 64,163,111,241,157, 30,205,150, 69,125, -158, 54, 45,228, 35, 24, 90, 21,243,121, 6, 7,197,171,225,180,116, 29,252,111,173,235,209,163,199,186,183,223,126,155,190,200, -200,227, 28, 38, 13,237, 69,180,165,136,180,117, 61,126,122,131, 30,105, 56,101,247, 22, 39,159,211,137, 42,252,212, 43,117, 84, - 3, 90,214, 60,196, 39, 78,148,224,248,166, 53, 11,196,130, 57, 19, 68,188,120,113,149,179, 2,135, 13, 27,166,220,227,197,141, - 35,102, 78,254, 81, 44,153, 55, 94, 36,122, 59,254,241,136, 0, 24, 59,223,209, 27,208, 8,108, 8,112, 42,151, 78, 31, 4,208, -214, 1, 94,168, 59, 32,159,202, 61, 65,130,120, 29,126,155,244, 99,135,165,115, 39,116, 72,158,228,237, 38, 17,201,103,242,228, -111, 55,217,184,234,143, 14,127,204,158, 64,201, 89,152,239,188, 87, 54,227, 29, 5,240,149, 76,115,211,104,130,240, 82,159,137, - 42,157,229, 69,231,115,192,223,190,159,139,203,195, 63, 23, 23, 62, 47, 37,174,124, 89, 74, 92,237, 81, 81, 92,232, 80, 68,204, -172,145,133,141, 30,231,117,235, 94, 47, 58,159,225,109, 6,161,242, 73, 16, 5,111,224, 91,177,168, 8,192,250, 71, 9,112, 38, - 25,128,227, 89, 2,120,248, 59, 22, 68, 1,152,208, 37,216, 50,250,166, 33,208,194,177, 80,227,239,222,189, 59,140, 65, 11,180, -212,239,248, 30,196, 9,200,116, 39, 92, 9,180,154,151, 72, 16,164, 78,215,162,228,219,247, 9,180,244,158,155, 1, 45,130, 30, -177,178,163, 97,104, 83,238,237,135, 0,155, 63,130, 31,190,234,224, 2, 83,122,249,108,165,141,203,255, 50,190,167,239,241,157, - 94,217, 9,176,196,193, 57, 74, 24, 86,195, 71,224,148,141,117,168, 35,119,192,225,229,235,224,131,109, 93,189,122,245,214, 33, -189, 26,168,106,235, 42, 74,182,207,240, 54,114, 77, 58,167,236, 94, 98,164,139, 76, 84,225,103, 84, 7, 90,214, 61,195, 67,154, - 21,120, 96,231, 95, 34,117,202,164, 2,103,181,133, 58, 54,130,255, 83, 38, 79, 44,214,254,249, 43,129, 22,207,235,114,171, 25, -229,111,189,193, 71, 47,158,157,239,232,209,164,170,174, 70,165,236, 87,178,101, 74,180, 24,135, 93, 43,210, 44, 25,248, 63, 77, -202,228, 29,214,250,255,218, 33, 89,226,132, 45, 35,146,207, 20,201, 18,183,220,183,227,175, 14,233,210, 36,239,160,247,157, 28, -153, 18,207,174, 94, 33,235,149,156, 89, 19,246,118,128,214,139, 95, 61,229, 72,147,124, 71,224,252,177,226,112,195,220, 98, 78, -213, 76,162, 89,222,148,226,159,175,222, 23,215,190,169,165, 72,182,210, 36,120,115,243,235, 2,180,168, 22,164,196, 74, 13,178, -112, 44, 80,192,133, 11, 23, 2,112,238, 98,192,182,109,219, 2,112,102, 99, 0, 60,152, 7,192,203,247, 86, 15,106,196, 80,170, - 67, 74,178,148,144,229,205,187, 56,146,101, 56,142,173, 26,132, 67,223, 7, 86,201, 21,231,142, 84, 43, 86,206,241,214,157,207, - 62,251,108,132,175,175,239, 64, 92, 63, 89, 5, 90,245, 11,188,113, 95, 77,179, 97,161,183, 20,160,197,231, 56,223,116, 4, 64, -225, 32,210,108, 84, 56,246,125,171, 64,107,223,248,134,226,232, 47, 77,196,153,153,205,197,149,121,159,138,135, 59, 38, 42,224, -171, 85,169,120, 15,155, 54,109, 58, 16,121,239,253,253,247,223,127, 61,120,240,224,239,212,192, 73,103,210, 81,128, 22,206, 37, -252, 30, 7,218,247,198, 81, 96,223,235, 1,173, 53, 67,235,138,173, 35, 62, 18,251, 39, 52, 20, 15,255,234,174,124,203, 42,208, -130,180, 49, 20,208,226,255,107,215,174,173,195,241, 77, 4, 90,163, 60,204,167, 81,101,114,116,242, 25, 61, 65, 81,100,212,123, - 84, 6, 90,158, 91,129,191,191,127, 69, 4,193,192,152, 4, 64,255,238, 92, 41,134,247,111, 39,178,101, 78, 35, 50,103, 72, 37, - 50,165, 79,169,132,204, 25, 83,137,126, 61,155,137,213,203,166, 90, 1, 90,238, 15, 27, 1, 45,171,223,209, 43, 1,109,180, 8, -180,106, 84,200,179, 40, 71,214,116, 29,178,102, 78,211, 33,107, 6, 87,192,239,126,189, 90,116, 88,181,116,154, 21,160,229, 49, -159, 4, 90,255,238, 88,222, 97,196,128,246, 29,244,190, 83,187, 74, 62,191,234,239,102,189,146, 43,115,252, 94,222,237,111, 14, - 53, 43, 28,248,176, 84,193, 27,231,127,253, 81,236,174,155, 77, 84, 75,159, 32, 8,105, 18,180, 40, 87,224,193,205, 81,237,196, -185,182,133, 68,153,180, 9,174, 90,161, 19, 21,226,208, 6,139,234, 66, 41,201,146, 32, 43, 32, 32, 96, 15, 22, 1,123,112,192, -112,192,130, 5, 11, 2,182,110,221, 26,128, 67,213,119, 49, 62,202,101,197,201,108, 79, 74,157,222,127,255,253,145,227,198,141, -235,188, 98,197,138,214,160,213, 26,135, 21, 15,224,243, 70,141, 26,141,196,113, 67,157,113,116, 86,103, 28,218,222, 26, 82,227, - 1, 58, 64, 43, 20, 11,165, 68,139,128, 74, 77, 19,128,234, 30,129, 86,131,130,111,222, 39,205,237,219,183,183, 38,205,198, 69, -226,220,211, 1, 90, 90,154, 10,200, 57, 52,185,241,255,165, 90,127,125, 46,196,191,179,221, 64,107,198,140, 25,237, 0, 54,155, -128,102,147,169, 83,167,246,210, 1, 90,106,154, 10,208,194,225,246,125,176,136,108, 50,113,226,196, 80,241,165, 68,107,253, 79, - 31,252,255,123, 7,253,244,128,150,155, 38, 85,135,223, 84,240, 81,164, 89,227, 26,166,120,120,235,214,173,117, 4, 87, 12,144, - 54,174, 67,221, 16, 96, 9,140,137,102, 64, 43, 42, 52, 73, 39,143, 14, 7,188,198, 1, 45, 22,113, 17,142, 74,170, 67,181,148, - 59,180,141,150, 4, 88,146, 91, 4, 90,251,182,249,139,197, 51,190, 23,127, 76,251, 70,204,159,210, 71,248, 77,236, 37,126, 27, -215, 67,252, 58,186,171,152, 58,162,179, 88,241,199, 4,175, 0, 45,171,223,209,171, 73,105,163, 85,185,108,250,187,200,103,135, -249, 83,190,233, 48,119, 82,175, 14,191,141,237,213, 1,249,236, 48,109, 68,231, 14,203,255,152,224, 21,160,181,103,155,127,135, - 69,191,246,235,160,247,157,202,165,211, 41, 54, 90,200,207, 21,175,181, 56,135,144,101, 14, 52,125,167,228,157,115,179,198,136, -173,213, 50,137,210, 41,226, 41,234,219,250, 37,243,221,190, 49,245, 27, 5,104,189,147, 62,161, 90,165,107,153,238,171, 24,145, - 6,239,180,201, 34,208,146, 32,235,171,175,190, 58,139,195,132,131, 25, 32,205, 57, 11, 21,127, 0, 3, 14, 42, 15,192, 57,120, - 7, 80, 14,130, 79, 6, 30,161,100,116,117, 36,112,106,211,166,205, 32, 9,178, 86,175, 94,221,122,244,232,209, 10,160,234,220, -185,243, 32, 2,162, 61,123,246,180,134,106,174,245,175,191,254,106, 25,104, 17, 80, 1,192,116, 38,112, 35, 77, 53,208, 34,112, -147, 52,237, 0,173,227,211,154,170,212,135,161,129,214,172, 89,179,218, 17,100,129,110, 19,240,193, 18,208,130, 4,175, 55,129, - 22, 14,244,214, 5, 90,155,134,213,251,255,247,142, 46,244, 8,180, 92, 12, 86,164, 88, 0,192, 74, 0, 56, 86,164, 88, 95,126, -249,229,186,182,109,219, 42, 64,203, 21, 70,189,138,237,204,201,147,195,129,151,193, 1, 45, 22,137,130, 64,139, 89,214,183,209, -146,133, 35,154,100, 44, 2,173,221,155, 23, 27,130,172,137, 63,126, 46,150,206, 29, 37, 18, 37,140,103,166, 58,116,215,149,145, - 68,203,211,119, 38,255,220,201,253, 29,189, 74,151, 54, 90, 21, 75,167,123,160, 7,178, 38, 13,235, 4, 27,173,209, 94, 1, 90, - 1,155, 23,233,130, 44,130,185,247,202,100,120,110,163, 85, 34,205,173,151,209, 56,163,251, 55,187, 55,111,120,239,228,198, 63, -197, 15,149, 83,138,250,121,146, 18, 80,248,124,253, 73,131,123,171, 71,247, 18,190, 37,222, 16, 31,229, 73,118,255,117,225, 17, -119, 23,210,240,157, 54, 89, 84, 23, 82,146, 69,128, 37,245,251,177, 98,189, 17, 82,165,113,175,171,149, 26,246,186,250, 97,219, - 65, 87, 99,196,136, 21, 98,241, 32,112, 5,104,125,254,249,231,131, 36, 32,218,176, 97, 67,235,177, 99,199, 42,128,170, 87,175, - 94,131, 40,117, 34,200,130,132,171,245,204,153, 51,109, 1, 45, 0,152,206, 4, 89,164,169, 6, 90,115,231,206,237, 44,105,218, - 1, 90, 84, 25,134,178,213,162, 77,148, 75,117, 72,160, 69,144,181,127,255,254, 38,144,152, 89, 2, 90, 93,186,116,233, 13, 73, - 83, 24, 9,152,148,104,109, 27,249,209,255,191,119,226, 79,219, 64,139, 96,235,212,169, 83,235,160, 42,117, 3, 45,214,139,106, - 80,126, 93,154,168, 83, 14,135, 3,225,230,128, 22,139, 68, 81,160, 37,193,150,190, 68, 75,173, 58,220,177,110,190,174, 36,171, - 90,197,162, 34, 87,174,156,162, 98,249, 98,226,237,132,241,174,152,216, 62,133, 2, 90, 49, 99,198,156,133, 3,120,255,147, 33, -109,218,180,207,138, 21, 41, 36, 10, 21,200, 35,222, 41,149, 47,148,196,140, 32,107,194, 15, 29,197, 31, 51,127,228,119,212,187, -123,220, 52, 21, 27,173, 10,217,174,212,171, 94,104,177, 86,146,149,189, 80,217,181, 73, 51, 23, 61,158, 60,107,201,227, 49,146, -228, 58,226,147, 36,239, 6, 25, 98, 38,203, 63,154,249,214,107, 13,122,229, 73,158, 60,105,155, 44, 5, 42,236,201, 92,164,206, -227,124,197,222, 93,165,150,152, 17,204, 53,172, 83,120,118,181,119,179,104,109,180,194,221,216,156,132,246, 56,208,191, 83,251, -160, 39, 15,131,196,218,165,243, 69,213,188,153, 21, 80,245,115,239,174, 65,193,207,158,138,237, 91, 55,139,106,249,178,220,181, - 71,241,213,141, 77,137,150, 52,124,167, 77,214,218,181,107, 67, 1,173,216,113,226,138,223,215,159, 19,139,183, 94, 81,238,252, -111, 6,180,212, 46, 28,222,203, 25,251, 14,213,133,148,100, 17,100, 85,205, 29,207,109,163, 85, 45, 79,252,219,148,100, 17,100, - 1, 56,233,217,104,133, 98,156, 84, 29, 82,162,245,205, 55,223,252, 44,105,210, 22,139,170, 67,218,106,193,134,106,152,164, 9, -160,165,103,163,165,165,169,128,156,171,127, 64,138,181,125, 24, 84,134,179,158, 7, 23,208,250,180,116,252,135, 3, 6, 12,232, - 79, 73, 22, 65,214, 47,191,252,162,103,163,165,166,169,168, 14,105,155, 69,181,225,248,241,227, 67,197,151, 64,235,158,255,151, - 66,236,155, 42,196,145, 63,132,176, 8,180,168, 42,148, 18, 45, 35,160,229,128,173, 87,183,175, 57, 57,123,241, 28, 80, 1, 45, - 53, 72,137, 42,170, 67,207, 12, 11,107,163,149, 32,112,203,170,217, 46,117, 97,119,183,186,144,224, 39, 95,222, 60,202,184, 61, -114,228, 72,241, 70,172, 88,143, 11, 22, 44, 24,159,224, 4, 32,106, 52,190,178,193,117, 15,243, 65, 23,176,217, 16, 24, 24, 40, -100, 56,127,254,188,128,250, 67,161,151, 59, 71,250, 80,223, 33,200, 26, 59,184,157,240,251,101,160, 33,208, 82,108,180, 0,180, - 62,172, 86, 96,209,111, 99,187,187,213,133, 4, 63, 4, 89,155, 78, 8,161, 23, 8,184,140,128, 22, 65, 24,223, 75, 48, 86,176, - 90,181,248, 49,147,228, 62,240,229,128,223, 20, 90, 25, 10,214,124, 50,101, 88,151,207, 41,201,226,119, 38,252,216,177,195,135, -181, 10,251, 85,123, 39,139, 99,163,245,226,251,165,242,197,230,205,154,221,102, 27,218,185,115,167,200,152, 33,195, 19,248, 82, -219,209,190,125,187,167,242, 89,218, 52,169,111,188,164,172,121,253,179,180,185,130,180, 70,217, 93, 72, 59, 44,218,100, 81, 93, - 72, 73, 22, 65, 85,253, 79,123, 6,143,158,187,237,209,216,249, 59, 31,141,153,183,237,209,135,159,116,123,204,231, 49, 98,196, -164,219, 3, 93,213,161,167,157,133, 54,119, 29,234, 2,173, 8,238, 58,212, 5, 90,138, 52,139,182, 89,127,125,241,255,128,103, - 22,119, 29,134, 1, 90, 70,187, 20,109,236, 58,116,211, 84,219,104,141,109,144,252,161, 4, 91,122, 18, 45, 21, 8,126, 97,199, -117,120,189, 81, 58, 4, 29, 14,120,137, 3, 81,220, 70,171, 34,216, 32, 61,194,155, 75,171,147, 38, 74, 16,184,126,197,116, 72, -152, 66,131, 44,130,159,194,249,178, 40, 32, 75,130,173, 24, 49, 98,252, 77,176, 69,144,229, 90,157,109,208,227,185, 11,140,245, - 3, 16,155,143, 52,139, 48, 25, 94,159, 52,105,146, 32,216,226,149, 43, 91, 58,197,246, 75, 74,178, 8,178, 70, 13,104, 35,102, -140,255, 86,188,157, 64, 95,162,229,182,209, 42,147,254,174,180,201,146,224, 39,105,198, 34, 10,208, 90,188,249,188,232,208,119, -172,240, 73,146,239,134, 79,210,188,155,212, 32, 74,183,109, 0,100, 49, 29,227, 17,100,197, 72,154,255,111, 9,178,120,207,148, -183,244, 54, 53,200, 26, 59,168,125,135, 74,142,141,150,151,186, 89,184,200, 36, 75,145, 34,197, 29,168,100,130, 97,200, 29,156, - 61,123,246, 71, 84,173, 97,103,222, 35,168,131,130, 27, 54,108, 24, 28, 63,126,252, 59,160,156, 44, 92,212, 95,177, 68,220, 69, - 88,170, 84,169,173,116,225, 0,155,169, 0,244,171, 0, 24,124, 7, 80, 93, 72, 9,214,200, 57, 91, 31,207, 88,186,235,182,223, -202,125,183, 71,206,248,251,230,232,249,187, 47,240,121,218,114, 29,199, 25, 21, 69, 11,166,212, 59, 1,181,239, 96,171, 53,226, -167,159,126, 26, 56,102,204, 24, 91, 18, 45,208, 28,174,222, 93, 40,141,225,185,139,177, 95,191,126,131, 72,211,138, 68,139,126, -178, 8,166,184,187, 80, 6, 74,177, 24,248,188,101,153, 68, 87, 65,115, 32,104,246,134,239,170,175, 33,149,179, 36,209,130, 49, -252,247,144,106,245,254,238,187,239,194,187,235,208,205, 94,173,123, 7,238, 46,148, 18,173, 22, 45, 90,172,195, 14, 75,197, 70, - 75,123,185, 6,233, 87,172,197, 57,217,113, 56,240,210, 57, 16, 85, 36, 90,214,252,103, 73,118,194,191,213,137,121,216,197,181, -242,143,113,194,127,222, 40,177,120,246, 48,177, 96,198, 80, 49,247,151, 1, 98,250,152,190, 34,127,158,172, 97,192, 22,210,110, - 50, 3, 90, 4, 91, 80, 27, 38,125,227,141, 55,118,206,158,141, 93, 66,184, 48,248, 42,247,252,121,179,135,250,206,172,137,223, -139, 95,199,246, 21, 63,251,118, 20, 9, 19,196, 61,161, 87,213,210, 70,171, 82,233,244, 15,252, 97,139,181,104,246,176, 14,127, -252, 58,180,195,220, 41, 3, 58, 36,203, 82, 66, 1, 90, 4, 89,188, 19, 36, 17, 52, 17, 60,233,184,161,248, 63,121, 9,180, 0, -202,180, 32, 43, 77,142, 50,135,252,166,253,240,165,250, 59,191, 77,234,215,193,237, 71,203,177,209,122,209, 61, 50, 89,156, 56, -113,254,129, 36,107, 23,221, 29,208, 56,156,146, 30,250,147,186,124,249,114,192,165, 75,151, 20,159, 82, 11, 23, 46,220,201,120, -175, 11,216,162, 31,173,110,221,186,109,163, 11, 7, 74,181,104,248, 94,165,201,215, 87,168, 46, 28, 61,119,251,227, 57, 43,246, -222,158, 48,119,195,205, 41, 11,119, 30, 28,247,199,190,211,124,158,254,221, 46,148, 56,235, 94,106,213, 33, 93, 56,200,157,128, - 52, 82,167,186, 80,186,119,168,150, 39,222,141,229,203,151,119, 62,115,230, 76,107,236,108, 52,181,209,130,135,247, 39,181,114, -198, 12,110, 80, 56,126,160,154,230, 39,101,146, 93,164,148,171, 97,145, 4,129, 75,150, 44,233,124,242,228,201,214,164,217,178, -108,242,139,140,207,116, 30, 26, 82, 43,250,201,130, 59,134, 65,220, 93, 72,123, 44, 24,212,183, 27, 52,104, 80,127, 62, 7, 96, - 26,180,120,241,226,118,160,217,228,244,233,211, 77,144, 79, 75, 54, 90, 29, 59,118,236,115,240,224,193, 38,126,126,126, 17,222, -117,168, 7,180, 80, 87,235, 32,201, 95, 7, 53,233,186, 9, 19, 38,232, 2, 45, 71,141,248,162,135, 15,231,123, 81,132, 3, 81, - 9,104, 89,247,163, 21, 63,126,236,234,137,222,142,119,130,126,178,220, 1,118, 82,180,149, 82, 66,130,120, 87,224, 33, 62, 72, - 45,217, 66,133,221, 48, 3, 90, 90,144,213,187,119,111,168, 52, 98, 60, 99, 58,208,123,172,124, 43,244,119, 2, 9,178,226,199, -142, 93, 93,175, 65,208, 70,235,157, 18,105, 46,103,201,240,246,239,244,149, 37, 67, 98,252,166, 93,150, 75, 50,117, 79, 45,145, - 82,131, 45,207, 18,173,124, 55,212,233, 98, 38,201,181, 63,105,210, 68,109,180,223,225,183,178,101, 76,248, 43,243,161,241,163, - 21, 69,218,112,212,205,102,236,216,177, 39,108,217,178,101,231,227,199,143, 21,112, 69, 96,197,128, 73, 91,241,144,190,113,227, -198,128, 85,171, 86, 5,156, 61,123, 54, 96,202,148, 41, 59, 25, 63,234,150, 54, 84,206, 21,207,240, 69,139, 22,221,138, 69,195, -174,149, 43, 87, 6,212,239, 56, 68,145,104, 81,109, 72, 73, 22, 65,214,226, 45,151,151, 19,104,153, 73,180, 92,148,123,208,141, - 3,128,202, 8,245, 78, 64,218, 79,241, 57,124, 76,141,128, 88,191, 51,190,213,249,220,185,115,173, 1, 94, 77,129, 22,232,118, -180, 66,147, 32, 75,210,100,124,164,163,247,121,163, 75,177,169,162,241, 58, 93, 56, 72,163,119,128, 46, 5, 32,125,253,245,215, -189, 33, 65, 82, 64, 22,104, 54, 65, 62, 45, 1, 45,250,221, 34,208,154, 63,127,126,132,119, 29,106, 61,195,163, 32,115, 40,201, -218,187,119,239,186,242,229,203, 19,100,253,129, 16, 74,160, 85,161, 66, 5, 14,208,253,248,252, 53,105,163, 78, 49, 28, 14,120, -139, 3, 81, 5,104,217, 43,175,217, 25,129,124, 79,117, 33,213,134, 18,108,193,168, 85, 25, 56,240, 37,181,234,208,237,208, 76, - 15,100, 65,141, 56, 7,241, 55,202,116,158,190,171, 42,129,155, 38,109,180, 42,148, 74,123, 60, 55, 28,133,106,211, 82,245,167, - 0, 45, 29,201,148, 4, 91,122, 52,101, 58, 79,146, 48,237,183,120,214, 33,243,161,241,163, 21, 25,206,220, 28,154,255,175,180, -202,173, 91,183, 86, 28,119,170, 65, 22, 38, 88, 55,200, 2, 48, 8,128,228, 84,145,248, 96,242, 13,128,202,141,142, 75, 43,235, -214,187,189, 46,226, 41,246, 11,171, 35,121,214, 33, 93, 56,192, 6, 75,177,209,170, 7,155,172, 81,243, 3,206,141,253, 99,223, -201, 49, 11,246,158,250,176, 85,143,187, 6, 54, 90,218,124, 42,187, 14,185,187, 80,186, 91, 80,239, 46,236,223,191,255, 32, 9, -136, 46, 94,188,216,122,233,210,165,122, 64,235, 69,208, 84,128, 86,207,158, 61,123,211,133, 3,119, 22, 18, 32,201,221,133, 48, -132,239, 45, 65, 22,242,217, 4,249,212, 3, 90,234,124, 42,244,224,105,191,247,145, 35, 71,194, 72,192,108,236, 58,244, 84,239, -220,120,195,163,126,190, 67,168,141,240,134, 4, 90,242,238, 2, 90,218,118,245,194,218, 82, 4,155,191,147,207, 8, 50, 80,147, - 60, 58,243, 83,143,147, 81, 5,104, 85,116, 45,148,164, 84,139,255,141, 47, 51,160, 37, 13,223, 65, 97, 19,194, 13,130, 44,172, - 30, 61, 2, 45,216,100, 45,150,234, 66, 74,178, 8,178, 32,254,127,139,192,140,198,241,188,219, 5, 90,210, 70, 11, 42,196, 48, -110, 38,220, 64,203,192,214, 10, 96,107,161, 1,208,218,104,102,219,165,205,167, 58, 31,175,203, 36, 30,193,113, 35,210, 7, 10, -184, 52, 24, 72,240, 68,117,161,148,100, 73,144, 5, 23, 2, 1, 18,100, 97, 23, 89,192,144, 33, 67, 20, 91, 38,236, 42, 11, 96, -186,215,172,142,232,140, 52, 72,138, 71,108,236, 58,212, 5, 69,125,251,246,253,137,206, 72,229, 78, 64,236,218, 83,108,177,208, -199,127,162,186,144,146, 44,130,172,121,243,230,153,122,134, 71,190, 20,240,230,101,154, 18, 24,125, 79,103,164,148,100,169,119, - 23,162,174,191,167,186,144,146, 44,130, 44, 72,168, 44,121,134,135, 77,215,247, 84, 27, 66, 21, 25,222, 93,135,118,219,188,218, - 88, 86,142,157, 90,105,150, 93,154, 86,186,173, 67,211, 10,151,172,199,113,248,105,157, 87,225,141, 25, 85,128,150,182,255,122, -150, 78,155, 1, 45,130,162, 48,150,156,174, 7,124,167, 51,145,189,145, 37, 75,150, 7,144, 62, 8, 53,200, 82, 27,200, 3,120, -245,179, 11,180,164,141, 22,129,142, 54,173,222,238, 65,181,205, 85,134,194,181, 21,127, 75,174,235,255,157,197, 37, 9,243,180, - 91, 81,251, 45,117, 62, 94,179, 73, 60,188, 29, 35,210, 7, 31,168, 1,127,130,227,206,233,176,201,154, 14,123,172,233, 0, 89, -211,161, 46,156, 14,117,225,116,128,172,233,152, 48,167,195, 27,249,116, 76,188,211, 49,137, 42,191,249, 28,233,126,124,205,234, - 40, 20,208,138, 17, 51,214,211,172,149, 58, 79,205, 81,181,199,164,108,239,117,158,204,255,170,157,109,108,243,140,207, 75, 23, -104,201, 51, 14,173,222, 9,166, 60,240, 83, 1, 90,118,131, 9, 77,221,179, 9,245,206, 43,124, 89,103, 29,134,163,211, 56, 64, - 43, 44,211, 34,125, 12, 9, 71, 61,233, 37,113,242,233, 37, 70,122, 32, 19,149,128,150,117, 27, 45, 51,160,165,146,104, 17, 84, -201,176,145,191, 53,238, 29,220,141, 16,207,191,198,169,245,167,112, 31, 79, 73,150,217, 55,194,168, 2,117, 64, 17,109,180, 42, -150, 74,123,148,170, 59, 43,244, 20, 87, 13,201,242,207, 76, 87,160,230,131,152, 73,243,255,172, 55, 65, 72,128,166,246,187,165, -245,191,165,253, 86,161, 92,137, 58, 48, 31, 84,101,190,102,147,120,120,187, 80,164, 15, 62,216, 80,241, 30,102,167, 42, 80, 27, - 86,129,225,115, 21,168,187,170,224, 8,154, 42, 48,174,174, 2, 63, 79, 85, 96,112, 92,101,232,208,161, 85, 0,178,148,192,223, -155, 54,109,170,194,116,175, 97, 29,209,109, 3, 65, 20,131,214,133,131,209, 59,109, 29,125,224, 2, 56,108,195,118, 2,211,201, -235, 69,208,164, 10,174, 85, 56, 2,211,233,229,211,136,158, 18,191, 78,158, 88,129, 84, 31,234, 5,190,243, 98, 91,146, 54, 90, -234, 62, 23,233,253, 40,188, 29, 92,147,206,201,167,151, 24,233, 34, 19,157,249,169,199,201,168, 2,180,188,219, 10,108, 80,139, -206, 13,198, 41,187,141,134, 98, 33,170,195, 79,207, 76,242,116,158,161,222, 59,135,159, 22, 26,157,141, 40, 14, 63,109, 48,203, - 66, 84,135,159, 22,152,100, 35, 74, 84,225,103, 84, 6, 90, 90,105,214, 11,219,216, 18, 85, 42,215,201,167,141, 30,107, 33,170, -195, 79, 11, 76,178, 17,197,225,167, 13,102, 89,136,234,240,211, 2,147,108, 68,113,248,105,131, 89, 22,162, 70,103,126, 70,101, -160, 37,243,174, 11,176, 88,169,122,193, 66,123,112, 71, 49,162,225,233,185, 25,125,135,166,126,189,132,183,190, 28,126, 58,252, -180,218, 6,156,190,105,204, 1,171, 60, 84,199,115,248,233,240, 83,143, 3,209,185, 45, 73,126, 88,153,207,162,146,234,240,133, - 73,177,212, 13, 42, 58, 35,115,167,236,102,211,139,189,247, 14, 63,237,241,203, 44,182,195, 79, 51, 14,217,123,239,240,211, 30, -191,204, 98, 59,252, 52,227,144,189,247, 81,133,159, 81, 89,162,229,168, 14, 77,218,100, 84,105,132, 78, 62,237, 13, 46,102,177, - 29,126,154,113,200,222,123,135,159,246,248,101, 22,219,225,167, 25,135,236,189,119,248,105,143, 95,102,177, 35,131,159, 81, 25, -104,153,241, 43,210,222, 71, 70, 69,188, 28,154,153,234,125,235,147,161,222, 3, 37,100,172,215,207, 2,199, 94, 78, 62, 45,100, - 76, 19,197,157, 79,236, 6,141,101, 39, 20, 43,214,238, 77,159, 98,253,198, 36,170, 48,228, 76,204, 98,253,191, 84,209, 53, 42, -123,140, 20,217,138,181,204,156,255,221, 29,105,114,148,186,150,179, 88,213,131,201, 50, 21,234,132,116, 49, 84, 33, 49,206,240, -203,139,255,137, 84,207, 72, 58,202,241,211,126, 85, 24,166,112,202,238, 69,102, 58,109,201,197,204, 36,249, 50,250, 36,205,223, -207, 39,105,190,225,238,144, 56,239,167, 97, 88,205,103,234, 56, 73,243, 13,196,217,177, 25, 61,244,119,217,159,147,158, 56,113, -162, 40,226, 37,213,244,113,190,215,123,167,254,180,211,230,163,103,155,143,202, 64,171, 34, 50,111,221,189,131,173,250,205,249, -113, 86,159,172, 13,250,251,100,105,112, 18,119, 30, 45, 17,190,206,146,253,163,244, 62, 89, 27,126,140, 48, 4,116,254, 78,144, -255,147,107, 49,115, 52, 62,232,147,189, 17, 59,170,125,154, 89, 27,116, 4,157, 64,131,160,118,195, 96,109, 18,207,240,193,195, -157,167,158,137, 19, 87,130,133, 2,182,204, 47, 43, 3, 69,108, 14,250,112,121,209, 53, 97,194,132, 63,227,222, 19,255, 27,185, - 6, 38,189, 47, 88,161, 25, 19, 9,219, 38, 76,144, 96, 81,129,180,201,206,190,253,102,172, 45,248, 63,212, 10, 77,251, 32,203, -247,215,175,134,255, 37,158, 60, 13, 22,241,203, 15, 57,239, 97,224,229,171, 24, 25,114,151, 91,218,179,255,232,187,103, 46,223, - 17,207,130, 67,196,185,192,187,162,207,224,241,143,210,231, 46,251, 55, 92, 48,196,100,128, 99,219, 79,225,128,116, 0,238,173, -248, 31, 46, 28,228,160,173, 87,246,180,160,171, 30,240, 19,224,127, 25,132,230,174, 59,255,123,186,172,240, 51, 74,208,196,201, - 11,233,210,166, 77,235,139, 99,121,118,241,206,255, 94, 40,187,121, 43,247,208, 55, 81,119,147,241,154, 62,162,236,220,181,223, -244, 88, 71,113,227,198,165,139, 5,101,112,115,253,182,146,103, 43,245, 30,134,142,201,183,194, 69,243,165,214, 17, 0,211,223, -135, 68,128, 58, 40,128, 74,123,225, 89,216,120, 0,104,255,191,212,101,143,193, 62,203,190,139,171, 59,235,158,227,155,236,223, -242,174,125,167,234,231,146,106,212,227,167,149,150,103, 45, 78,116, 46,187, 30,135,162,138,141,150,189, 67,165, 77,219, 66,190, - 6, 9,124,178,214,255, 20, 32,102, 67,197,230, 67, 67,230,174, 58, 36,252,214,158, 18,248,127, 76,147,214,188,193,100,110, 21, -199, 39, 91,195, 97,133,234,125, 31, 60,120,250, 38,177,106,215, 5,113,240,236,125,113,240,252, 99,241,229,164,163,164,185,221, - 54, 77, 38, 0,200,250, 47,240,169,216,120,228,145,216,116,244,145,216,124,236,145,216,122,252,145,248,123,255, 3,210, 84,251, -191, 97,108,243,124,102,168,247,152, 32,171,206,200,251, 4, 90,143, 77,121,100, 78, 51, 75,202,148, 41, 7,192,227,246,136,101, -203,150,253,186,122,245,106, 63,220,103, 13, 31, 62,252,231,120,241,226, 13, 2,253,146, 58,223, 48,203,103,166, 28, 25,210,109, -255,107,196,247, 34,112,233,116,113,227,247,209,226,218,111,131,197,230,239, 90,138,252,201,226, 94, 55, 40,167,169, 68,171, 98, -197,138,111, 48, 72, 32,246, 92,146,245, 28,100,241,226, 29,255, 9,230, 12, 7,201,100, 89,138,124,210,165,239,207,119,159, 60, - 11, 17,167, 2, 31,137, 93, 39,238, 43,247, 71, 79, 66, 68,215,239, 70,221, 75,153,181, 88, 7,250, 39, 3,129,217, 0, 90,108, - 71,179,229,160,140,223, 4, 91,218,178, 15,192,179,103, 8,193, 8,191, 1,152, 53,175, 90,181,234,247,240, 4,238, 11,191, 90, -190,188,127,240,193, 7,223,243, 57,222, 23, 64,120,211, 6, 63, 25,183,192,171, 78, 19,128, 42, 30,142,223,233, 88,184,112,225, -189, 95,124,241, 69,200,223,127,255, 45,112,174,163,248,235,175,191, 68,231,206,157, 67,248,156,239, 25,207, 70,217, 45, 52,109, -195, 40,218, 58,226,192, 67, 48,108, 53,200,248,234, 15,152,181,121,183,239,100, 36,178,106,136,106, 70,211,168,128,158,190,165, -165,121, 8, 71,148, 5, 50, 0, 84, 40, 1,237, 73, 9,240,229,166,132, 55,223,124, 83, 9,112,162,203,231,255, 89,168,163,220, -136, 67,105,175,213,144,199, 35, 77, 23,128,130,116,234,111,203, 18, 45,196, 37,232,210, 0,178, 80, 64,203,181, 64,226,130, 79, -113,108,205,187,142, 95, 68,247, 59, 68, 81, 22, 89,174,126,110, 56,134, 68,164, 97,186,210,134,183,222, 61,125,218,161,233,133, -138, 49, 33, 17, 85,128, 86, 69,215, 24,164,150,106,217,230, 78, 12,159,236,245, 43,250,100,169, 63, 35,115,133, 78, 65, 35,102, -109, 18,171,119, 7,138,101,187,131,196,232,191,238,138,106, 95,206, 35,128,233,175,161,234,185, 17,102,109, 84,226,141,156,141, - 14,143,240,219, 37, 2, 78, 62, 18,211, 55,220, 19,131, 23,223, 22,125,231,223, 18,223, 45,184, 37, 62,159,112, 68, 64, 82,198, - 67, 88,237, 12,188,207,227, 2, 76,173, 59,252, 80, 12, 88,116, 91, 12, 2,205,161, 75,111,139, 31,253,239,136, 97,203,239,132, - 15,104,165,171,121,224,147, 31,118,138, 82, 95,109, 23, 62,248,109,129,123,158,202,158, 63, 87,174, 92, 63, 2, 12, 76, 25, 53, -106,148,223,247,223,127,239, 7, 15,230,126,147, 38, 77,242,155, 59,119, 46,239, 83,113, 84, 12,129, 68, 10, 27,101,207, 91,187, - 68,161, 91, 23,215, 45, 19,103,134,118, 16, 71, 26,231, 21,199,155,230, 17,103,218,149, 20,151,190,170, 40,206,181, 45, 40, 74, -165, 78,112, 23,244,210, 27,209, 84, 75,180,242,229,203,247, 22, 14, 46,110, 9, 9,201, 36,156, 17,184,164, 98,205,198,139,202, - 54, 25, 62, 37,123,211, 37, 95, 39,172, 53,103, 69,183,145,107,213, 32,235, 87, 5,124,253,255, 10, 83,246,140,249,223,221,114, -242,194, 45,113,242,242, 35,241,233,184,243,194,167,193, 65,209,114,236, 57,177,239,228, 93, 17,112, 36, 80,164,203, 83,110,175, - 6,104,125,195,255,170, 1, 88, 77,147,170, 8,156, 37,253, 56,132,153,136, 19, 39,142, 0, 64,157, 10, 15,241,190,218,112,236, -216, 49, 95, 28,189,227, 91,182,108,217,111,144,166,158, 39,126,198,141, 27,239, 44, 59, 74,220,120,241,238,227,104,151,254,240, - 54, 31,134, 30,233,219,161,201,239, 37, 78,156,248, 23,212,247, 84,111,210,196, 73, 11,127, 55,110,220,248, 41,142,202, 17, 80, -207,136, 7, 15, 30,132, 9, 71,143, 30, 21, 56, 76, 91,124,252,241,199, 79, 25,223, 70, 91,178,208,188,117,163,132,170,119,151, - 36,139, 32,203,210,101, 16,223,108, 34,123, 37,129, 22, 0,214, 57,242, 30,117, 46,112, 68,144,192,177, 70, 74, 93,224, 72, 40, - 49,102,204, 24,193, 51, 98,135, 13, 27, 38,126,250,233, 39, 1,103,186, 34, 65,130, 4, 23,117,152,164, 45,123,110, 20, 54, 35, - 66, 38,215, 61, 3,238,233, 17,210, 34,164, 65, 72,133,144, 18, 33, 57, 66, 50,140, 33, 4,102,218,235,255, 52, 37,208,194, 29, - 96,252,175,156, 57,115, 30,245, 20, 24,135, 0,203, 4,104, 37,165, 4, 11, 31,165, 35,235,229, 46,160,117,219,245, 95,237,224, -250,182,235,221,114,190,163,132, 11,119,246,107,121,153,213,187,165, 54,245,162,219,124,120, 50,101,161,222,189, 65, 54,170,240, - 83,175,172, 10,208, 66,123, 41,137, 80, 71, 21,170,170,126,151,194,239,210,174,255,234,231,140, 47,255,203, 59,233, 72, 90, 76, -167,166,171, 39,224,240, 6,255,125,124,112, 52,137,178, 18,148,119, 93,170, 89, 27,172,248,236,251,217, 98,241,198,211, 98,233, -174, 59,226,167, 63,239,136,254, 0, 49,131,151, 0,196, 44,185, 37,222, 46,210, 46,196,135,106, 68,171, 87,150,250,221, 11,125, -208,255,217,174, 99,183,197,140,141,247,197, 23,191,222, 16,109, 39,156, 17, 31,124,183, 65,148,110, 61, 83,100,172,250,189,136, -153,179,217, 62,159, 44, 13,223,181, 74, 50, 84, 60, 0,173,127, 14, 61, 20,190,127,220, 14, 3,182,116, 36, 90,230,159, 72,241, -206,188,254, 75, 30, 62,151,104,225,183,121, 2,195, 24, 5, 49,152,253,128,193,119,234,183,223,126,235,215,181,107,215,233,152, -132,123, 98, 80, 28,148, 57,115,230,174, 63,254,248,227, 68,156, 9,233,215,164, 73, 19, 30, 21, 99, 21,201, 23,248,160, 76,209, -123,215,119,109, 16, 71,123,214, 23,251,235,101, 23, 67, 74,166, 22,181, 50, 38, 12,249,178, 96, 10,113,236,147,124,226, 82,187, - 66, 98, 85,253, 92,226,205,231, 7,121,235, 94, 18,104, 97, 64,205,144, 35, 71,142, 5,190,190,190, 91,112,196,205,238, 43,183, -131,247,143, 91,113,229,108,252, 58,139,159,249, 84,249, 93, 52, 29,178, 85, 92,184, 22, 36,186,142, 92, 67, 73,150, 2,178,152, -214, 19, 79,210,228, 44,125,249,201,211, 16,177,227, 56,248, 7,144,181,102,223, 45,229,190,108,235, 37,241,223,197,123, 34, 85, -182,146, 15,145,126, 54, 2,207, 46,156,197, 59,255, 83,149,136,123, 98, 13,237, 48, 64, 11,158,224,117,129,214,181,107,215,124, -113, 88,176, 47,206, 63,244, 5, 13, 6,195, 11,223,122, 26, 2,232,150, 32, 65,194,144, 63,255,252,115,236,141, 27, 55,116,129, -150, 29,154,252, 24, 0,235,173,246,237,219,223,171, 86,173,218, 41,130,106, 0,160,129, 90, 64,136, 3,144,125,215,174, 93,235, -187,114,229, 74,211,124,146,102,153, 50,101,196,211,167, 79,197,179,103,207, 4, 0,167, 46,208,122,244,232,145,192, 89,144, 2, -180, 5,227, 71,160,205,134, 55,105, 24, 9,149,137,250, 77, 79,162,229,241,219,225, 84, 29, 26,210,116,129, 61, 98,128, 48,234, - 78, 2,122, 36,180,164,166, 36,208,194, 89,140, 2, 42, 92,145, 33, 67, 6,145, 53,107, 86,145, 59,119,110, 81,160, 64, 1, 81, -172, 88, 49, 81,186,116,105,241,238,187,239,138,247,222,123, 79, 12, 26, 52,200, 8,104,105,243, 41,129, 22, 37,188,177, 48,102, -244,133,244,155,167,109, 60,141, 31, 63,254, 25,228,175, 31,158, 43, 11, 30,228, 63, 9,110,122, 64,235,255, 52, 85,160,137, 0, -203,141, 88,117,126, 60,124,248, 80, 48,142, 1,208,114,211,164, 77, 22,121,167, 34,177,222, 3, 93,245,187,201, 46,123,174,240, -182, 53, 39,221,107,192, 1, 3, 44, 34,129, 86, 29,217,255,158, 55,113,225,254,143,163,253,250,200,255,234,231,234,120,234,247, -234,223, 76, 43,233,186,158, 71, 14, 39, 45, 2,173, 45,117,123, 46, 17, 93,103,221, 20, 61,253,110,138, 62,243,158, 75,157,250, - 47,188, 45, 62, 29,182,147, 82, 34,245, 25,135,158, 51,154,181, 65,249, 34, 31, 15, 12, 62, 12,245, 96,143, 57, 55,197,103,147, -175,137, 50,237,127, 23,177,114, 54,185, 4, 27,173,241, 62,217, 26,180,242,201,214, 40,191,143,143,231,201,219,227, 71,178,213, -191,190,246,224, 67,241,237,239,183,194,128,173,151, 8,180, 10,231,201,147,231, 7, 28, 94, 59,173,123,247,238,126,159,125,246, -217, 36, 12,142,223,161, 28,245, 17,104, 11, 84, 2, 32,167, 55,129, 22, 86,185,179, 48,128, 82,170,101,118, 21,238,217,170,217, -131, 99,123,118,137, 13, 95,183, 18,219,107,101, 22, 85,210,198,167, 74,237,107, 4,218,128,189,215, 40, 71,146,224, 75,109, 11, -137, 19,173, 11,136,188,201,226, 94, 50, 34, 72,176, 68, 73, 22, 65, 22, 12,210,119,133,132,132,236,102, 88,127,248,201, 49,130, -172, 77,255, 94, 11,102,235, 14,188,249, 80, 52, 26,184, 85, 36,172, 57,103,133, 4, 89,102, 64, 43, 87,241,106,251,165, 68,235, -147, 49,103, 21,144,213,224,167,255,196,170,128,203,194,127,211,113, 81,190,122,163, 71, 84, 25, 18,100,185,238,252,205, 48,192, -101, 28,175,205, 54,121, 19,130, 9, 45, 4, 18,183,221,155, 55,111, 30, 9,192,225,123,235,214, 45, 5, 28, 17, 36,157, 63,127, -222,119,219,182,109,190,144, 30,248,226, 88, 30, 83, 0,163, 6, 90,144, 44,142, 5,144,241,141, 40, 77,102, 26, 0, 90, 89,189, - 31, 56,112, 64,124,247,221,119, 15,106,214,172,121,174, 71,143, 30, 11, 3, 2, 2,134, 50,143,232,127,190,232,236,190,237,218, -181,243,133,132,202, 52,159,164, 9, 73,163, 50,127,225,188, 71,193, 51, 68, 25, 8,184, 56, 33, 18, 96,241, 57, 0,161,160, 84, -235,212,169, 83,130,241,205, 26,146,183,223,187,192,138, 86,162,229,158,119, 93,131,155,251,179, 6,241,189,157, 45, 51,122,134, -234, 78,180, 45, 46, 0, 44, 73,232,208,119,207, 81,218, 72,128, 5,160, 45, 90,183,110, 45,182,108,217,162,212,205,191,255,254, - 43,112,208,182,168, 82,165,138, 64, 91, 80,128, 22,108, 52,245, 36, 90,218,188, 42, 64,139,106,124, 0,204, 29,144,104, 62, 32, -173,251,247,239,139, 29, 59,118,136, 15, 63,252,240, 33, 36, 99,251,144,232, 77,196,227,102, 18,207, 64, 75, 26,185,227, 78, 16, -197,182,131, 54,105, 24, 20,160,165, 74, 99,192, 72, 74,180, 40,157,226,124, 16, 74,106,229,122, 38,165, 90,161,164, 93, 46, 41, -152, 90,162,101, 86, 79,206,251,215,144, 3, 86,128,150, 75,106,165, 72,182, 56,134,232,221,141, 64,149,107,204, 49, 76,131, 23, -101, 35,192,214,138,146,190,235,206,255,255,191, 88, 56, 25, 12, 63,146,185, 65,106,128,160,211, 85,186,132, 5, 91, 5,234,143, - 4,208,130,205,150,149, 43,109,221,120, 49,115, 52,249,111, 7, 36, 89, 93,126,187, 41, 62, 28,122, 68,164, 44,255, 53,210, 55, -156, 14, 0,196,193, 33,226, 87,150,143, 11,166, 42,213, 49,248,207, 61, 15, 20, 53,164, 22,108,189, 36,160, 85, 12, 43,218,161, - 24,172,167, 1, 60,248,117,236,216,241, 23,172, 72, 57,169,150, 87, 21, 56, 38,108, 55,126, 38,208,130,138,193, 15,239, 41,213, -226,234,213,232, 42,214,179, 77,203, 7, 33,144,106, 28, 5,208,250, 40,107, 10, 81, 41, 85, 60,130,172,186,234, 4,217, 19,199, - 62,123, 17,170,195, 51,109, 10,138, 42,153,222,230, 68, 18, 87,143, 32,193, 18, 38,133, 86,148,100, 73,144,197,251,130,237, 65, - 39, 41,201,226, 85,172, 82, 3,229,206,255, 84, 35,170,213,141,158, 42, 46, 73,134,252, 29, 59,125,253,195,163,160, 71,193, 80, - 23,222, 17,254,219, 46,137, 53,187, 47,139, 93, 71,175,139,122,159,244,124, 18, 55, 81,106,218,226, 81,189, 71,137, 22,109,180, -164, 68,171, 21,126, 27,181,139, 41,148, 12, 66, 45, 51, 18,147,218, 72,218,102, 1, 96,248, 34,123,190,135, 14, 29,242, 29, 61, -122,180,111,135, 14, 29, 20, 0, 67,245, 33,232, 88,150,104,141,197,181,107,215, 46,223,148, 41, 83,221,102,167, 73,154, 44,249, -189,240,208, 36, 79, 50,102,204,120,199,141, 46,240, 3,224, 74, 64, 2,247,184, 94,189,122,199,191,250,234, 43, 37,127, 50, 88, -201, 39,105, 2, 16, 43, 36, 33,113, 20, 0,149, 2, 7, 40, 43,210, 45, 94,183,111,223, 86, 0,214,206,157, 59,149, 64,213, 34, -227, 71,188, 99,217,166,160, 39,161, 50, 4, 90,228, 51,130, 37, 32, 99, 59, 39, 22, 19,152,128, 61,203,249, 3,104, 63,247,203, - 47,191, 40, 82,172, 86,173, 90, 41,192, 23,103,113, 10, 0,120,177,117,235, 86,113,252,248,113, 1,137,182,128, 29,161, 93,160, -149, 30,227,194, 55,141, 26, 53,122, 64, 96, 13, 53,182, 64, 59, 85,232, 93,184,112, 65,212,170, 85, 43, 8,139,183,129, 40,199, -219, 40,178,103,160,165,226,137,145,234,176, 66,133, 10,129, 18,128, 41, 64,203,252, 82, 12,225, 93,102, 0,161,236,176,164,157, - 22,242, 22,198,126, 75,199, 70,203,252, 75, 78,140,215,142, 3, 6, 88,132, 18,173,118, 18, 60,113,156,144, 96, 75,254,214,222, - 61, 1, 45, 45, 29,153,214, 37, 21,171, 28, 78,166, 86,116,141, 95,234,228, 28, 47,248,252,249,101, 73,162,133,221,127,105,202, -124,126,119,205,222,235,162,203,204,155,207, 37, 91,144, 70,117,157,113, 17, 42,190, 38,247,125,104, 32,111,229,202, 90,127,220, -144, 25, 59,196,164, 53,119, 69,253, 81,129, 34, 73,169,175, 66,148,221,134,222,186,178, 52, 42,132,124,222, 92,187,239,186,248, - 30, 18,183,175,231,222,122,110,243,165,146,108,189, 4,160,149, 6,134,239, 35, 8,178, 48,104,249, 97,192,157, 13, 35,101,130, - 40, 45,122,126, 23, 42,158,161, 75,151, 46,245,131, 10,113, 6,222,247,243,192,150, 12,149,138, 21,190, 79,144,197, 65,124,251, -230, 77,162, 65,201,252, 97, 64, 22,210,151,107, 87, 42, 91,240,165,206,229,197,105, 0,173,108,137,227, 92, 48,162,233,146,104, -205,161,186, 80, 13,180,254, 47,209,186,170, 72,180, 54, 28,184, 26, 28,183,214,194,103,180,217,178, 10,180,240,205, 24,233,114, -151, 91,214,161,231,208,187, 91,246,159, 23, 71,206,221, 22,139,215, 29, 17,245, 90,246,124,146, 50,123, 41,101,215,161,214, 24, - 94, 99,163,165,151,109, 95, 72,114,124,177,154, 15, 21, 40,205, 82,131, 23,254, 38,232, 2, 1, 91, 64,139,116, 1,124,149, 50, -179, 19, 1, 24,141, 84,211,181, 66,147,153, 78,151, 46,221, 93, 53,208,146,191, 97,188,127, 13, 82,136, 17,225,161,153, 61,123, -118,129, 58, 82,128,150, 58, 80, 98, 34, 1,150,188, 19,116, 49,190,183,186,152, 85, 58,106,208,162, 86,241, 73, 21,156,118,151, -160, 9,200,177,250, 89,159, 8,170, 19, 13,193,148,157,252, 17,104,193,214, 82, 20, 44, 88, 80,224, 48,115,241,207, 63,255, 40, - 54, 90,104,211, 98,213,170, 85, 98,239,222,189, 98,227,198,141,162, 97,195,134, 10,208,122,251,237,183,173, 74,180,210, 65,106, -117,100,255,254,253, 2, 42,113, 1, 73,174,216,189,123,183, 56,124,248,176,178, 17, 2,155,106, 4,108, 2, 79, 35,175, 9,193, - 48,203, 64,203,136,185, 82,165, 72, 73, 87, 68,128, 22,251, 50, 1, 22,131, 22,132, 89,232,231,150,235,222,137, 24,181, 57,240, - 34, 36, 90,102, 32, 45,156, 28,148,227,107, 69, 87,122,121,255,255,184,107, 10,180, 0,178, 82,151,254,252,246,170, 61, 4, 89, - 55,196, 71, 3,119,139,242, 29, 23, 42, 96,171, 90,183, 63, 97,176,222,112,166,165,204,101,105,144, 43,111,157,126, 33, 91,143, - 63, 20,245,134, 95, 21,121,154,204, 96,218, 49,150,210, 90,137,148,185, 65, 97,228,243,230,106,228,179,251,236,155,162,193,144, - 61,226,205,220, 45, 0,228, 26,220,208,184,121,208,186,119, 48,165, 30, 47, 89,201,197, 61,126, 61, 45,170,246,255, 79,196, 77, - 85,116,169,105, 2, 77, 4, 0,173,122,176,207, 25, 7, 27,156,217, 73,147, 38,253, 25,175,233,134, 64,125, 41, 6,242, 24,208, -102, 46, 90,180,200, 15,106, 5,238,226,107,225,233, 59, 16,183,255,180,106,250, 68,177,121,195,122,209,160, 92,177,167,136, 91, - 75, 19, 63,111,213, 66,185,110, 94, 93, 48, 70, 4,246,174, 41, 22,191,175, 76,182, 51,140,104, 82, 37, 1, 53,215, 22,128, 23, - 55,208,226,239,227,231,110,238,239, 63,235,240, 89,130, 43, 74,178,226,212,252,227,217,215,147, 3,206,210, 64, 94,189, 27,209, -132, 39,202, 74, 55, 69,182, 18,173, 0,184,118,166,200, 92,244,209,187, 53,155, 62,132, 36,107,155,220, 93, 24, 14,160, 53, 12, -210,129, 17, 90,160, 69,117,156, 22,104, 1,184,122, 29,104, 89,161, 73,158,164, 78,157,250,158, 30,208,170, 84,169,210,117, 45, -208,178, 74,147,182, 63, 84, 23,106,129, 22, 65,183, 22,104,113, 18,102,124,187,109,214, 11,241,213,160,197,205, 2, 15,182, 78, -150, 37, 70, 38,121,243, 36, 53,243,152,212, 91, 18, 45,236, 38, 60, 7,169,165, 40, 94,188,184,162,218,163, 36,107,225,194,133, - 98,205,154, 53,138, 4,138,146, 40, 74, 54, 91,180,104,161, 0, 45,128, 35,171, 64, 43, 45,192,255, 3, 74, 45, 89,207, 18,100, - 97,227,134,184,114,229,138, 8, 12, 12, 20,120,255, 20,229,136,143,130, 58, 64,203, 11,141,216, 33,241,226, 56, 96, 5,104, 33, - 55,202,194, 87, 45,153,210,218,104,153, 73,180,212,239,189,100,163, 37,199, 87,163,187, 9, 19, 93, 32,107,101,192, 53,209, 97, -234,117, 81,219,119, 23,193,203, 29,170, 17,203,182,159, 39, 82,189, 11,181, 95,182,134,149, 44, 85, 69,182,250,159,244,157,184, - 81,244,131, 93, 87,165,111, 15,138, 24,217, 27,159,242, 73,213,130, 3, 66,196, 47, 23,200,250,123,247, 53,241,229,140, 27,226, -131, 1,187,145,207, 79,110,251, 96,103, 99, 68,137, 55,127,235,173,122,173,139,164,122,118,244,228,102,113,232,212, 6, 81,164, - 97,156,167,105,223, 9,179,131,205,244, 51,176,195,248, 16,171,237,209,136, 88, 74, 19,185, 32, 36, 14, 67, 97,176, 61,149, 32, - 11, 6,242, 83, 0,162,134, 32,142, 21, 85,234,240, 98, 89,210, 63, 65,220,154, 26,154, 5,234, 22,207,127,231,234,234,223,197, - 69,223, 6,226, 40, 12,226,115, 39,141,125, 27,113,210, 88, 5, 90, 80, 77,236,198,224,189, 27, 42,179,221, 43,214,238,216,255, -227,140,205,199,186,142, 88,125,178,215,176, 37,199,102,206, 91,190,191, 68,137, 18, 75,237, 2, 45,169, 62, 64, 30,164, 27, 7, -101,119,161,106, 85,235,118,239, 96,178,210,165,141, 86, 48,109,180, 32, 5,220,170, 6, 91, 80,149,133, 1, 90, 3, 7, 14,244, - 58,208,178, 66,147,188, 6,200, 14,210, 3, 90,229,203,151,191,161, 5, 90, 86,105,166, 72,145, 66, 81, 21,106,129,214,221,187, -119,195, 0, 45,218,241, 48,190,105, 3,245,114, 4, 13,104, 9, 5,126,228, 31,215,160,169,124,217,142,196,200, 36,171,225, 6, - 90,174,252,232,170, 47,237,228, 15,234,189,115,208, 62, 11,236,118, 85, 36, 90,180,207,162,234,144,192,136,170, 92, 2, 34,170, -251,104,187, 5, 23, 47,118,128, 86,106,140, 35, 71, 40,201, 98,122, 74,181,206,156, 57,163,128, 44,214, 61, 65,156, 75,162, 69, -151, 30,150,129,150, 39,213, 33,153, 25, 81,137,150,148,100, 73,201, 22,242, 22,202,245,131,163, 58,244,114,231,123,189,200, 89, -217,117,200,157,131,220, 65, 72,219, 45,245,174, 66,245,111,189, 93,135,220,169, 40,211, 41,105,195,201, 58,181, 68, 75,173, 50, -180, 48,238, 2,100,193,214,233,246,159, 59,174,138, 86,147,174,137, 42,125,119,138, 55,114,181,184,165, 56, 17, 85,108,182, 26, -108,130,225,250, 95,200,152, 39, 59,162,255,231, 59, 75,253,209, 11, 55,158, 19,205,199, 95, 19,249, 90, 46, 36, 64,163, 33,120, -196,175,236, 31, 23, 73, 85,234,243, 91, 43,119, 93, 21,237, 1, 6,107,125,191, 11,249, 36,200,250,184,120, 68,136,127,134,237, -198,237, 18,196,157,183,170,110,121,113,188,107, 19,113,244,191,117,226,223,243,255,136, 65, 1, 25, 68,243,201, 73, 69,198,106, - 49,231,165, 47, 19,106, 75,178,149,207,105,221, 43, 20,134, 72,126, 40, 86,186,211,104,155, 5,144, 53, 21, 59,137, 6,130, 80, - 17, 43,196, 92,113,180,254,114, 10,247,108,221,236,193,190, 77,235,196,246,239, 91,139,227,205,243,138, 58,153, 19, 81,173,168, -149,120,133,250,132, 90,117, 8, 21,212,110,216,124,236,134,138, 98, 55, 0,224,110, 0,192,221,176,133,218,141,237,232,187, 97, - 92,174,220,233,250,193,134,234, 48, 25,192, 99,111, 2, 44, 87, 8,181,187, 80,245,124,178,198, 70,203,210,174, 67, 12,212, 83, - 37,216,162, 45,149, 90,162, 5,159, 82,190, 48, 62,182, 5,180,176, 99,108,172, 39,213,161, 85,154,100, 48,212,196, 15,244,128, - 22, 0,226, 77, 53,208,178, 73, 83, 1, 90,148,108,168,193,150,148,116, 72,169, 22, 39,118,170,153,144, 7, 11, 29,222, 70,139, -179, 22,213, 45,161, 82,171,243,158, 99,170,231,151, 26,104,121, 2, 57,234,207,153,169, 6,205,222,123,202,186,183, 36, 90, 4, - 90, 80, 45, 11, 44, 68, 4, 54, 62, 8,180, 73,101, 51, 4,236, 8,197,213,171, 87,149, 93,162,116,245, 0, 27, 66,197,189,131, - 13,137, 86, 42, 72, 4,191,169, 93,187,118, 16, 37, 98,231,206,157,115,131, 44,238, 66,229,115,142, 31, 40, 7,237, 48,109, 25, -195,235,181, 81,249,204, 13,180,172, 25,195, 75,247, 14,118,140,225,181,238, 29,172,181, 48, 39, 86,116,224,128,213,221,247, 47, -147, 23, 21, 53, 99, 25,243, 18,218, 70, 75, 55,119, 0, 47, 41, 75,118,184,189,108,251, 21,209,100,236, 53,241,110,207,237,216, - 21,216,252, 57,200, 10,239,149,181,193,230,237,199,238,137,154, 63, 94, 17,233,107,141,160, 1,188,199,137,223,210,103,148,124, -118,188,181,124,231, 85,241,233,228,235,162,170, 4,131,217, 26, 20,179,148,222, 32, 18,165, 88, 63,230,202,112,227, 28, 0,214, -221,110, 13,196,205,143, 10,137,159,202,167, 20, 13,127, 74, 44,198,156,203, 44,198, 94,200, 44,250,239, 74, 39, 74,182,139,115, - 61, 60,210, 45,215,103,139, 97, 87,210, 80,216, 20, 77,197, 14, 49,191,111,190,249,102, 26, 6,201,193,120,167, 54,144,183, 91, -140, 98,189,219,181,122, 16, 18,252, 76, 28,216,177, 21, 6,242,201, 69,141, 12, 9, 9,178, 62, 50, 35,164, 54,134,127,242,228, -137, 2,178, 0, 0,119, 99, 21,186,123,242,228,201,187,225,235,107,119,159, 62,125,118,195, 15,208,238,234,213,171,111,165,159, - 45,171, 64, 11, 43,250, 18, 0, 80,191,169,118, 20,106,119, 23,202, 93,134,218,157,135,122,187, 14,195,184,119, 24, 49, 98,196, - 84,216,189, 40,182, 90, 0, 23, 10,208, 34,112,129,186,214,247,243,207, 63,247, 5,159, 9,180,120,220,143,225, 37,253,104,197, -139, 31,255,193,156, 57,115, 70, 83, 5,169,181,209,178, 75,147, 31, 3,200, 57,134,221,101, 15, 40,109, 80, 95, 80, 43,221, 34, -208, 10, 15, 77,168,159,239,211, 53, 0, 39,112,170, 11,111,222,188,169, 0, 46,222, 9,178, 56, 49,114, 98,135,155, 10,197,149, - 0,227,155,213,191,183,223, 27,129, 22, 35, 32,100, 67, 98, 20, 17,137, 85,152, 98,106,237,199, 92,187, 11,249, 13, 61,143,246, -150,140,245,225,132,244, 28,125,101,193,165,135,178,179,176, 87,175, 94, 2, 11, 22,197, 96,157, 54,115,148,118, 97, 67,140,232, -210,165,139,248,225,135, 31, 68,146, 36, 73,172,170, 14, 83, 80,138, 12,169,214,142,119,222,121, 39, 8,246,156,130,106, 67,210, - 70,123,120,144, 40, 81,162,125, 40, 32,119, 29,114,199,177, 45,247, 14,150,118, 29,234,251,209,114,243,212,113,239,224,237, 94, -228,208, 3, 7,162, 2,208, 98, 69, 85,116,129, 43,185,128,228,127,147, 11,160,136, 32,171,225,232,107,162,116,215,173,225, 5, - 89,161,156,164,197,205,255,233, 93,122,103, 39,208, 74, 88,226, 43,216,103, 53, 73,101,150, 13,157,247,161, 29,175, 33,159,254, -200,103, 51, 72,201, 42,126,189,253,185,196,205, 62,200,114,211, 4,192,250,238,211,184,177, 31,207,171, 90, 70, 92,132,187,132, - 59,173, 42,136, 99,239,101, 23,253, 83,191,125,157,224,139,160,138,224,138, 32,139, 96,107,224,158,244,162, 86,191,132, 34, 93, -229, 24,143,211,150, 15,101,188,110,230, 32, 46, 13, 12, 96,135, 19,100, 97,117,235,135,129,114,118,242,228,201,245, 12,228,213, - 44, 48,163,153,161,100,174,236,247, 66,176,178,165,255,164,173, 27,215,139,166,101, 11, 18,100,213,243,192,103, 55, 77,181,123, - 7, 24,239,238,162, 81, 60,238,138, 36,235,231,159,127, 86,128, 22,165, 89,240, 9,181,139, 46, 32,232, 10,194, 0,104,233,229, -147, 18, 45,250, 43,161, 68, 43,204,238, 66,215,115,233, 71,139,187, 14, 57,201,209,143, 86, 43,220,169, 66,213,210,148,158,225, -233,226, 97, 59,108, 93, 70,210, 95, 22,157,137, 18,104, 65, 29,227,219,191,127,127,223,146, 37, 75,250,186,182,155, 19,120,115, -183,147, 25, 63, 25,167, 24, 0, 86,119, 76,142,161,128, 22,202, 61, 50,156, 52,223, 0,205, 30,176,213,186, 12,151, 30, 15, 41, -213,224, 85,164, 72,145, 59,144,104,140, 8, 47, 77, 72, 65, 70, 1, 64, 61,109,214,172,153, 98, 8,205, 58, 39,208, 58,120,240, -160,162,170,122,255,253,247, 57,129, 63,101, 60,124,159,121, 48, 43,123, 56,186,163, 71,154,118,109,174,244,226,235,181,165,136, - 2, 45, 45, 77, 45, 61, 51, 79,246,122,124, 10, 69,147, 64, 11, 78,116, 69,157, 58,117,148,157,133,232, 39,162,105,211,166,162, -101,203,150,162,109,219,182, 2,224, 95, 1, 89, 61,123,246, 20,176,203, 35, 16,182,234,176,148,206, 72, 21, 63, 90,144,108,245, - 5,176, 58, 69,183, 36,184,159,193, 34,173, 31,158, 75, 63, 90,111,225,247,203,114, 88, 42,221, 59,216,113, 88, 74, 41,152,227, -176,244,121,203, 50, 27,231,195,211, 79,163, 10, 77,189,178, 69, 21,160,101,179, 94,224,128,242,205, 60,159,222,235, 49,235,106, - 68, 64, 86,152, 6, 19, 35, 91,195,221, 85,250, 29, 19,239,244,222, 39, 98,228,104,124,196,102,174,100,244,255, 55, 24, 85, 62, -203,118,223, 22, 94, 48, 24, 42,159, 45,222,122,235,193, 35,120, 87,127,188,119,139,216, 81, 33,167, 88, 84, 48,173,104, 19, 63, -206, 60,170, 17,101, 6,168, 46,164,218,144,234,195,174,203, 83,137,163, 65, 11,197,217, 71, 27, 68,234,242, 62,234, 51, 16, 77, - 27,118,170, 84,169, 62,160,129, 60,164, 70, 70, 6,242, 90, 22,153,210, 68,130,159,150,141,253, 1, 32,107,131,104, 90,161,164, -222, 46, 68, 67,154, 90,135,165,152, 12,182,226, 88, 23, 69,170, 5, 9,207,110, 0,130,221, 53,106,212,216, 74,144, 69,167,166, -218,179, 17, 85,132,245,242,169, 24,195, 27,237, 46,212,177,221, 50, 59,130,135,159,147,103, 29,114,114,169,128, 85,126, 31, 74, -176, 40,213,194, 4,231, 11,245, 13,129, 93, 5, 57,249,232,180, 55, 79,252, 84,104, 98, 18,115,239, 58, 44, 87,174,220,200, 8, -210,140, 79,151, 29,112,247,112, 13,254,180,158,228,207,159,255, 14,164, 18, 35, 34, 66, 19,182, 87, 9, 0,164,254, 0, 72, 15, -134,218, 89,145,110, 0, 16, 82, 85, 24,140,231, 11,249,222,160,159, 89,105, 75,118,187,104, 40,154, 6, 18, 33, 35, 73,145,124, -174,149, 24,133,201,103, 68, 84,131,174, 2,153, 1, 45,187,229, 14, 51,214, 1, 4, 41, 64,139, 1,139, 20, 37,208, 11, 60, 65, -149, 12,252,207,231,140, 99, 3,104, 37, 3,163,146, 34, 36, 70, 72,132,144, 16, 33, 1, 66, 60,170, 11, 17,226, 32,188,133,192, -246,107, 13,104, 57, 71,240,132,167,190,195,206, 71, 17,161, 18, 58,109,164,247, 77, 47,101, 53, 50,242, 25,141,128, 22,139,154, -173,254,151,111,230,105,117, 61, 70,246, 38,255,249, 64, 61, 23,206,138, 9, 93, 17, 89, 26, 84,141,145,163,201, 81,208,220,138, -163,124,222,241, 10, 77, 47,231,147, 64,139, 32,235,218,135, 5, 69,207,164,241, 67, 40,197, 50,202, 39,165, 91,249, 27,191, 25, - 66,144, 53,254, 98, 38,219, 64,139,116,105, 32, 15,175,206,122, 6,242,122,159,181,218,176,135,151,202,153,153, 6,242, 86, 84, -179,161, 36, 90, 18, 60,185,142,224,105,133,251,156, 76,153, 50,109,225,110, 68,254,166,159, 45,173, 36, 75,166, 49, 3, 90, 92, -137,171, 14,143,110,229, 58, 60,250, 83,245,129,179,148, 96,169,159,187, 86,239,122,103, 29,234,241,135, 27, 43, 88,102, 74,204, -120, 55,219,104, 97,202, 79,168, 19,207,129,142,120, 43,118,156,123,222,162, 9, 58,169, 80,231, 83, 1,180,121,148,147, 87,242, - 9, 96,149, 14,147,245, 22, 72, 73, 67,120,231,127,147,254,101, 90,246,112,244, 79, 61,154,102,210, 33,189,247,234, 79, 71,122, - 62,189, 0,220,194, 0, 45,236, 58, 60, 68,186, 50, 64,218, 20,200,128,122, 15,132,123, 6,119, 64,255, 15, 68,157, 5, 2,152, -189,132,179, 14,243,247, 11,255,161,210,249,104, 71,170, 7, 54,212,135, 74,119, 37,216,166, 68, 89,231, 80,233, 80,239, 84,253, - 92,143,102, 56,154,162,110,146, 72,111, 75, 94,202,104,116,206,167, 30, 11, 95, 83,137, 86,168,162, 42,135,125,134,247,122,129, - 13,198, 59,249,108,246,214, 91,253, 9,182, 16, 30, 2,100, 13, 54, 43,120,154,114, 62,131, 41,201, 98, 72, 83,222,231, 91, 19, -176, 97, 68, 78,107, 32,111, 20,207, 14, 63,245, 14,148,213,163,171, 11,180,212,210, 42,237,161,210, 90, 73,150, 69,160,197,111, - 19, 48,201,144,200,229,241, 61,177,133,231, 97, 38, 50,147,122,241,120, 28, 80, 56,235, 40, 74,208,196,238, 85,218,230, 88,185, -236,180, 37, 43,244,236,214,145, 67,211,156, 3,145, 91, 71, 73,242,101,196,145, 58, 3,221, 7, 74,195,254, 74,241,252,174,189, -164, 1, 60,223, 43, 33,127, 63, 28, 68,157,209, 67, 63,146,125, 60,169,235, 88, 29,106, 3,212,125,159,191,245,222,169,191, 28, -185,101, 55,231,189,213, 24, 78, 62,173,114, 42,252,241,162, 3,208, 10, 63,119,144,210,105,132, 17, 98, 95,152,196, 14, 63, 29, -126,122,139, 3, 78, 91,242, 22, 39,159,211,113,248,233,240,211, 91, 28,136,206,109, 73,143,135, 14,208, 50,105, 89,209,185,193, - 56,101,247,214,176,227, 76,100, 78, 91,114,218,146,183, 56,224,180, 37,111,113,210, 25,151, 34,163, 45,189,182, 64,139,204,210, - 11,118,154,163, 17, 13, 79,207,205,232, 59, 52,245,235, 37,188,245,229,240,211,225,167,213, 54,224,244, 77, 99, 14, 88,229,161, - 58,158,195, 79,135,159,122, 28,136,206,109, 73,242,195,202,124, 22, 85, 37, 90, 47, 44,223,145,129,120, 29,154,102,195,182,189, -247, 14, 63,237,241,203, 44,182,195, 79, 51, 14,217,123,239,240,211, 30,191,204, 98, 59,252, 52,227,144,189,247, 14, 63,237,241, - 43, 60,177, 95, 24, 96, 9, 79,230, 94,133, 52, 78, 35,244,110, 45, 56,252,116,248,233, 45, 14, 56,109,201, 91,156,116, 84, 72, - 78, 91,122,193,109,169,106, 46,159,180, 53,179,251, 88,221, 68,197,220,121,172, 35,210,178, 73,207,148,166, 23, 89, 18, 85,128, - 22,119, 80, 51,175, 50, 88,114,110,236, 13, 62, 57, 29,208, 27, 92,252, 63, 13, 53, 63,115,226,241, 12,132, 37,170, 64,191, 81, -218,107,142, 38, 14,157,130, 50,173,188, 44,213, 17,182,104, 15,197, 33,200,119,224,200,243,123, 11, 69,210,163,153, 25,190,183, -230,167, 75,151,238, 36,194, 57, 28,114,252, 15,104, 89,250,182,235,123,122,113,179,165, 73,147,102, 1,130,164,185, 22, 52,173, -157,187,105, 60, 57,190, 13,199,162,181,224,122,225, 51,132,118,200, 39, 61,234,219,233, 48,161,242,217,160,223,161,183,170,245, -216, 31,159,129,191,249, 89,171,207,236,214,145,133,122, 81, 71,177,195,123,171,164, 29,154, 86, 57,101, 45,158,195, 79,107,124, -178, 26, 43,202,241, 19, 30,124, 99,105, 67,245,236, 62, 63, 84,203,230,243, 12, 33,184,122, 86,159,145,122,113,228, 51,189, 49, -196, 3,189,103,164,237,137, 30,223, 89,161, 41,105,192,235,244,155,102,244, 52, 52,245,234, 50,170, 0, 45,109, 62,173,229,187, - 49, 80,115,131,124, 62,234,109,188,111,131, 11,116, 0,217,214,117,231,127, 79,151,149,134, 29, 85,104, 90,237,204,182, 0,140, - 77,162,106,126,206, 14,117,158, 11,254,128,214, 18, 45, 61, 28,203,113,159,103,226,225, 72, 29,129,243, 11,149, 51,214, 16,103, -134,205, 73, 60, 21,189, 90, 51,109,221,186,117,233,159, 43,161,157,122,135, 95,167, 6,240,191, 21, 8, 47,243, 33, 15, 31, 62, - 18, 33, 33, 66, 57, 16, 23,192,237, 58,192,204, 84,139, 60, 8,213,150,224, 39,170, 57, 92, 25, 92, 93,187,118,173, 82, 54,158, -243,182,109,219, 54, 81,170, 84,169,155, 0, 74,227,195, 67, 19, 78, 63,115,129,102,199,191,254,250,171,251,253,251,247,187, 7, - 7, 7,119,199, 81, 54,221,113, 84,206, 23,160, 89,209, 46, 77, 2,170,156,117,134, 54,202, 90,205,247, 44, 3,127,151, 25,177, - 53,174,149,103, 18,148,185,190,105,165, 31, 89,204,158, 59,154, 67,211, 46,199, 34, 62,214,217,253,162, 83, 71,118, 57,246,154, -213,145, 22,164, 52, 75,231,147,158, 0, 75,108,248, 78, 48,240, 55,159, 25,129, 25, 51, 80,164, 67,239,217, 39,233,125,210, 69, - 20,188, 17, 96,197,197,233, 26, 21,203,151,255,225, 77, 31,159,207,204,192,150, 73, 53, 91, 3, 44,222,109, 43,225,161,166,150, -102,201,223,158,233,212,207,231, 51, 0,225, 25, 66,112,205, 28,202, 81, 40,237,112,110,215,207,243,231,207, 31,246,223,127,255, - 13,155, 55,111,222, 48, 28, 45,241, 51,159,131, 18,207, 63, 4, 63,195, 92, 70, 3, 5,227, 22,141, 2, 52,195,195,108,153, 38, -178, 7,201, 37, 4, 90,248,216,101,132, 37,174, 96, 38,209,186, 12, 0,161, 5,100, 86,242, 89,154, 71,136,240,128, 98, 30, 39, -130,111, 21,178, 1,180, 50,224,186,118,229,250, 45,113,245,246, 99,113,241,230,243,112,246,242, 93,113,242,204, 5,210,187, 13, -135,141,159, 88, 96,180, 58,159, 89,225, 68,245, 26,203,194, 11,128, 72,224,124, 58,113,230,204, 25,229,124,191, 42, 85,170,220, -134,163,200,250, 54,105,190, 77,144, 5, 48,217, 29, 36,149, 0, 96,218,253,202,149, 43,221,113,172, 79,119,156,237,248, 5,142, - 85,201,102,135, 38,165, 88, 4, 88,155, 78, 8,193,192,223, 21,251, 29, 74, 96,229, 25,211,234, 13,146, 22,190,111, 53,138,149, -122,183, 74,235, 69,181,121,187,249, 49,138,239,148,221,152,147,197,113,154,192,105,188,254, 21,193, 91,190,227,114,161, 63, 54, - 66,255,249, 10,247,175,224,176,181, 17,104,231,178, 49,134,132,137,154, 60,123,165,247,147,231,175,179, 56,121,190, 90,103, 82, - 34,164, 42,128,223,185, 42,189, 31, 97,154,249,106, 47, 1,205,179,160,121,154, 52, 83,228,169,100,230,244, 57, 82,219,146, 22, -160,100,141,239, 83,165, 90,246, 24, 33,222, 2, 90, 58,244,194, 0,173,198,217,124, 50, 52,205,226,147,201,142,148, 12,162,251, -122, 61,187,119, 31,118,230,228,201,225,149,222,121,231,199,117, 56, 2,204, 34,120,211,171,194,168, 2,180,236,141, 79,144, 98, - 37, 5,192,122,252,244,159,190, 74,133, 54, 41,252,134,152, 49,105,148, 31, 60,118, 15,211, 6, 76, 66,195,112, 10,253,176,178, -101,203,254,128,175, 52,214,124, 41, 84, 35,172,145,221,231, 65,181,236, 62,162, 78,158, 55,238,249,249,249, 13, 59,117,234, 84, - 24,122,164,111,135, 38,191, 87, 45, 71,204,147,181, 75,231, 88, 56,103,206,172,225,222,162,105,143, 99,186,177, 35,181, 3, 18, - 88,185,128, 22, 65,150,188,146,226,120,151,242, 80,209, 85,101,224,111,188, 80,159, 31,182,228,238,221,187,118,128, 22,157,213, -246, 7, 24, 10,230,161,181, 60,180,152, 18,164, 90,181,106, 61,197,115,130, 58, 58, 30,212,187,220,101,135,196,234, 23,127,127, -255,144, 27,247,158,138,204,159, 31, 19,111, 53, 57,164,132,100,159, 30, 18,155,119, 30, 84,232, 33,175,244,190,110,118,169,105, -206, 94,181,106, 21,228, 98, 2,210,177, 16,113,251,246,109,229,172,191,127,255,253, 87, 57,227,111,241,226,197,130,234, 68, 51, -130,120,239,166, 73,117, 33, 37, 89, 4, 88,224, 81, 31,148,181, 47,218, 82, 95,208,236, 67,169, 22, 14,103,238,142,124,182,177, - 67,211, 1, 90, 22,184,101, 30,197, 83, 63, 34, 16,104, 0, 47,236,243,242,230,205,123, 18,106,227, 5,174, 49, 72,111,209,167, -254,146,149,190, 89, 5, 42,238, 29, 72,212,194, 60,139, 74, 12, 43, 52, 45,146,114, 71,123,225, 52,209, 15,206,242, 44,206,238, -221,187,115,156,176,178, 88,241, 84,118,156, 46,245, 86, 83, 44,208,123,227, 8, 47, 95,244,117,223,229,203,151,251,226, 64,109, -223,242,229,203,127, 13, 47,249, 77,145, 88, 81,167,235, 92,186,101, 79,158,171, 92, 66, 0,161, 63,223,111, 55,228,206,156, 85, - 71,197,218, 61,129,194,127,219, 69, 49,124,238, 46, 81,165,249,183,183,210, 22,168,253, 39,227,132,135,102,195, 47, 71,220,249, -101,233, 1,177, 96,227, 57,241,203,138,255,196,215,227,215,139, 18, 31,116,187,145,166, 64,237, 69,169, 10, 86, 51, 58,101, 34, - 82,235, 72, 13, 78,190,244,241,137,157, 50,121,242, 30, 95,183,172,190,131, 96,171,106, 54,159, 16, 61,213, 33,227, 89, 1, 69, - 90,122,138, 42, 82,163, 58,212, 83, 83,170,120,235, 46,187, 58,159,213,112, 34, 71,170,100,201,126, 56,121,236,216,240, 3,123, -246, 12, 79,156, 32,193,247, 90,144, 53, 34,189, 79,220, 15, 50,250,228,213,201,167, 94,213, 69, 21,160,101, 79,117,168, 7,180, - 22,204,250, 69, 23,104, 97,197, 63, 12,135,249, 14,195, 68, 60, 12, 28, 98, 48,188, 0,178, 66, 30,175,233, 35,154,151, 72, 16, -132, 9,113, 10, 14, 84,214, 5, 90,118,104,242, 99, 4,111, 67, 26,101,127,216,165,122,134, 27,147, 7,118,250,251,248,209, 67, -163,245, 64, 33, 58,250,176, 21, 43, 86,152,230,211,238,104,248,146,226,135, 2, 90, 0, 22,121,222,125,247,221,106, 39, 78,157, -170, 11,176,160,132, 35, 39, 78,212, 5, 0,174,198,119,174, 60, 46,225,193,195,248,189,196, 98,158, 7, 3, 68,187, 53,148, 4, - 53,242,226,249,108,160,241,157, 25, 29,124,251, 40,191,121,227,238, 19, 17,187,233, 33,177,231, 76,136, 56,116, 17, 7,177, 53, - 62, 40,150,174,218, 34,252,253,255, 20, 56, 59,241, 26,232,152,169,161,221,159, 2,120, 59, 45,165, 89,164,125,254,252,121,128, - 44, 30,164,188, 85,252,245,215,223, 98,222,188,249, 34, 75,150, 44,164, 25,215, 44,127,242, 61,109,178,168, 46, 36,208, 34,200, -146, 64,107,227,198,141,125,113,214, 99,247,133, 11, 23,118,135, 20,237,115,196,215, 30,206,108,248, 9, 47,170, 14,173, 22,195, -155,241, 82,194, 46,111, 58,164,124,135,112,159, 9,194,105, 34, 72,188, 36,210, 15,193, 49, 52,171, 1,138,206, 97,146, 93,139, -255, 92,156,149, 13, 39,221,216,160,177, 30, 7,157, 43, 0, 27,253, 93, 28, 58,116, 72, 57, 79, 16,199,218,108, 3, 77,179,227, -151, 60,126, 54,107,214,172,103,217,174,112,190,229, 99, 68,140, 19,206, 60,106,147, 17, 24, 82,250,111,180, 64,241,210,103,194, - 77, 38, 93,237,218,181, 21, 94, 98,209,193,254,109, 85, 5,175,251, 65,130,172, 1, 3, 6,124,191,105,211, 38, 95,156,233,232, -219,183,111, 95, 95,158, 69,138,131,233,125, 9,188,112,150,234,119,144,102, 19,108, 89,190, 8,178, 6,254,178, 58,120,211,193, -107,162,231, 47, 7, 68,243, 31,119,136,214,195,119,137, 94, 83, 15,136, 49, 75, 78,136,214,223,205,122,150,174, 80,237, 63, 45, - 19, 68, 68,210, 28,246,219,134,224, 53,123,175,136, 46, 19,247,185,104, 6,136,238, 83,246,139,126,179, 14,139, 90, 29,199, 61, - 73, 87,176, 54, 65,252, 11,191,212, 0, 5,141,176,226,224,129, 3,127,186,113,237,218,240, 79,155,126, 60,170, 80, 18,159,242, -234,247, 48,188, 77,158, 52, 65,130, 6, 85, 42, 86,236,132,129,175,180,145,237,147, 76, 19,138, 94,227, 15, 71,107,233,189,155, -204, 39,143,158,154, 82,143, 9,234,124, 96,149,211,122,200,160, 65,195,153,207,246,159,125, 54, 28,223,121, 71,253,254,189,140, - 62,117,106,230,122,227,122,183, 26, 25, 68,165,204, 49,182, 24,229, 83,245,157,168, 6,180,100,126,195,230, 27, 82, 7,118, 44, -247, 69,213,225,199,121,125, 66,234,231,143, 17,210,179, 73,249, 3,176,127,153, 2, 91,152, 97, 80,209, 12,187,124,249,242, 48, -130,164, 11, 23, 46, 12,195,243, 97, 35, 70,140, 24, 54, 99,198, 12, 83, 0,163, 6, 90, 0, 60, 10,189,136,210,100,134, 9,180, -196,202,142,226,196,228,143,197,216, 86,249, 30,127, 81, 57,245,221,145, 61,154,108,250, 55, 96,219,248,115,231,206, 13, 67,217, -134,245,238,221,123, 88,187,118,237,134, 77,159, 62,221, 52,159, 47,188, 55,133,239,131,148, 40, 45, 65,224, 61, 41, 65,214,131, -199,162,241,149,219,193,237, 79, 93,126,210,233,191,139,143, 58,157,187, 20,212,225,220,197,107,141,203,148, 41, 83,157,113, 92, -113,101, 26, 79, 95, 37, 64, 41, 10,117,161,114,160, 50,237,169, 42, 84,168, 16,132,243,216,206,194,230, 43, 8,146, 30, 5,111, -193, 94,139,135, 86,231, 67, 48, 4, 52, 88, 33,159,122,248,240,161, 27,104,109, 63,249, 76, 1, 91, 4, 90,191, 45, 88, 33,102, -206,252, 77,224,236,196,155,160,145,221, 42, 27,160,218,184,248,248,241, 99, 65,233, 28,218,160,216,188,235,160,152,243,231, 14, - 49, 97,238, 58, 49,108,218,114, 49,120,236, 60,145, 61,127,137, 91,160,151,197, 42, 77, 26,190,211, 38, 11,182, 94,221, 41,201, - 98,216,191,127,127, 95, 72,178,250, 18,100, 77,155, 54,173, 59, 38,223,175, 65, 47,153, 85,154,140,167, 54,124, 79,156, 58,115, -102, 60,138,165, 99, 12, 31, 55,121,134, 34,105,181, 70,243,118,190,227,229,184,113, 82,166, 76,121,112,253,250,245,202,164,187, -121,243,102, 74, 29,143,225, 27,225, 1, 47,241, 1,212,198,125,250,233,167, 33,171, 87,175, 22,232,143, 10, 77,222, 41,205, 68, -159, 20, 48, 33,152, 2,218,102,118,127,234, 34,198,132, 26,106,241,236,217,179, 5,204, 24, 4, 14,232, 22,144,154, 4,127,251, -237,183, 74, 91,197, 1,229, 2,109,117, 21, 18,152, 73,182,140,216,150,185,121,243,230, 74, 62,123,245,234,197,113,177,156, 23, -248,155, 16, 42,244,221,159,124,242, 9,165,173, 1, 54,203,203,207,215,131,132,237, 56,250,202,117,171, 1, 27, 57,206,178, 9, -218,200,123,125, 95, 95, 95,177,117,235, 86, 69, 66, 12,160,180, 23,105,219, 35,112,204, 96, 63,183,115,229,130,228,187, 55, 65, - 86,231,206,157,125, 59,117,234, 68, 96,165,220, 9,184,176,128,243,157, 53,107,150,111,201,146, 37,123,129,168,153, 26, 81,249, - 46,213,133, 31,116,248,233,206,198,127,175,137,122,190, 91, 68,221,239, 54,138,122,223,255, 35,234,251,174, 17,173,126,216, 44, -190,255,237,144,248,241,247,163,162, 76,189,238,215,147,231,170,106,166, 70,116,211,108,209,109,212,221,149,187, 2, 69,221,239, -183,136,242,173,167, 60,203, 92,186,217,229,172,229, 90, 92,174,219,101,198,179, 30, 0,115,223,206, 60, 36, 10, 85,111,127, 35, -105,142, 10,145, 33,189,242,200, 83, 9, 80,250, 65,242,151, 35,125,138, 49, 7,118,108,158,244,239,190,125,195,226,189,249,102, -107,249,142,106,185,120, 62, 62,197,203,148, 42,213, 99,195,186,117, 63,156,128, 36,169,116,177, 98, 29,104, 39,165, 71,156,233, - 72, 47, 67,154, 52,131, 9,134,180,244,248, 30,244,138,150, 45,156,215, 87, 79, 77,105, 68,147,233,234,250,248,196, 3, 93, 5, -100, 29,220,183,111,120,156,183,222,234, 39,243, 73, 41, 86,133, 76, 62,211,190,120, 47, 77,200,217,185, 29, 20, 27,179,246, 21, - 83,137, 74,105, 67,215,191, 22,139,224,123, 81, 9,104,105,237,180, 66,179, 75,167,112, 62,111,191,229, 51,123,229,226,185,126, - 51,103,206,156,242,219,111,191, 77,161,109, 22,108, 88,134, 97,142, 29,134, 85,228,176, 81,163, 70, 13,235,208,161,131, 2, 96, - 38, 78,156,104, 10, 96,212, 64,139, 52,119,238,220,169,216,123, 69,132, 38, 75, 33,129, 22,193, 22,195,229, 89, 77,197,111,157, -138, 62,253,178,106,186, 91, 93,186,116, 81,242, 39,131,149,124,218, 25, 77, 94,133,184, 84, 17, 66,220, 95,231,102,144,104,151, -184,209,166,187,111,188,191, 62,132,129,191,255, 59,123,173, 45, 36, 50,117, 92,106, 68,211,236, 98,112, 29,140, 1,242, 73,205, -154, 53,149, 9,150, 23,128,218,109, 36, 76,229, 74,156, 14, 70,236,138,113, 20,140,219, 5,227, 1,112,133,224, 29,250,110,216, -139, 59, 13, 73,231,244,133,235, 34, 87,231, 35, 80, 27, 30, 84, 66,154,207, 14,136,193, 63,141, 17,205,154, 53,163, 77, 85, 72, -213,170, 85, 31,231,206,157,251, 30,236, 55, 40, 53,242,120, 97,194,249,147, 42,194,139, 23, 47, 10, 72, 83,197,220,229, 59,160, -138, 60, 40,222,104,244, 60,196,109,180, 83,148,171,213, 34,184, 96,193,130, 87, 1,160, 46, 36, 78,156, 56,236,249,109,154, 47, -112,119,225,158, 61,123,186, 99, 1,209, 29,146,145, 62,148,100, 97, 49,208, 23, 42,238,111,176, 17, 96, 51,206,123,124,130,124, - 62, 5,224,124, 12, 9,220, 45,139, 54, 96,242, 43,177,160,214, 26,133,137,230, 50,128,231, 50, 60, 84,159, 31,154,184, 64,129, - 2,219, 91,180,104,113, 30,207,123,154,149,253, 5,189,239,136,190,173, 72,138,222,127,255,125,177,119,239, 94, 49,105,210, 36, - 2,142,174, 54,191, 31, 15,160,226, 16,129, 15, 65,203, 47,191,252, 34, 0,184, 4, 22, 5, 79, 91,181,106,165,208,100, 29, 46, - 90,180, 72, 16, 68,128,182, 85,176,213,134,146, 44,130, 1,180,197,135, 72,199, 73,149,103, 60,214,130, 74, 42,136,182,122, 88, -252, 49,191,208,142,132,235,234,202,188, 50,207,174,113, 81,125,128,114,120, 8,198,198, 70,139, 13,236, 47,164, 73,192,137, 13, - 34, 27, 92,121,182, 68, 15,237,243, 24, 84,216, 74,123,183, 26, 88,111,144,236, 90, 81,161,203, 60, 12,103,121,191,248,226, 11, -113,250,244,105,110, 44, 17, 95,125,245,149,242,189,252,249,243,223, 71,164, 4,150, 50,139, 72,180,201, 34,144,162, 36,139, 64, -107,242,228,201,190,187,118,237,242, 93,176, 96,129, 47,192,171, 47, 36,226,190, 88,192,248,254,248,227,143,190, 88, 56,209,102, -203,244, 74, 9,155,172, 95,151, 31, 82, 36, 77,117,191,219, 32, 6,252,182, 79,172, 10,184, 44, 70, 47, 62, 42, 90, 12, 90, 45, -190,249,101,167,152,180,252,148,232, 62,106,149,200, 92,188,222, 98, 83,130,136, 64, 59,175, 37, 27,255, 19, 29, 70,239, 22,229, - 63,251, 37, 36,101,190, 26,127, 39,201, 90, 62, 35, 67,234,124,213, 87,180, 27,248,251,179, 95, 86,158, 22, 95, 13, 95, 33, 50, - 20,123,223,207, 10, 77,111,198,145, 32,165, 98, 70,159, 95,169, 42,172,145, 61,102,112,221,146,153,182,166,246,241,201, 44,223, -161,225,215,254,190,111,223, 65,231,206,156, 25,126,230,212,169,225,131,250,245,251, 30, 82,164, 10,158, 36, 90,201,177,243,252, -139,142, 29,135, 63,125,242,100,120,139, 38, 77,134,105,232, 85,255,186,103,207,129,164,215,183,117,173, 29,213,179,199, 8, 86, -171, 41,245,202,167,150,146, 73,186,205,155, 54, 29, 46, 37,107,124, 95, 41,179,207,182,153, 93,223, 21,207,214,125, 35,130,215, -125, 43,230,244,168, 72,137,214, 62,109, 62,163, 48,208, 50,175,122, 61,160,133, 84,195,176,194, 31,134,195,127, 67, 5, 74,179, -212,224,133,191, 9,186, 24,223,211,151,180, 64, 75, 77, 55,188, 52,249, 61, 45,208,146,128,171,109,249, 68,143,154, 52,105, 50, - 94,157, 87, 43,249, 52,231,214,171, 21,131,246, 88,192, 61,117,110, 7,137,246, 62,117,254, 17,215,238, 9, 37,240,247,161,227, - 23,218,239,216,177,163, 14, 36, 20, 86, 86, 99,111,214,171, 87,239, 9,119, 39, 2,116, 40, 18, 35, 74,142, 80,218,127,213, 37, -134,132,226,152, 52, 64,223,183,111,159,178,235, 15, 64,137, 19,158,222, 1,228, 69,185, 2, 63,120,248,152, 88,191,117,183, 88, -186,226, 31, 49,123,254, 82,209,253,235,111, 69,183,110,221, 69, 80, 80,144,178, 11,145, 1,146, 82,209,184,113,227,103,152, 84, -252, 77, 56, 92,166,112,225,194, 55, 57, 1,160,108, 98,218,130,245,194,167,193, 65, 69, 37,201,192,223,251, 78,129, 1,184,168, - 98,132, 20,225, 22,120, 52,205,132,102, 90,168, 89, 63,135, 36,171, 59, 1,215,186,117,235,186,255,241,199, 31, 61, 1, 34,175, - 99,162, 8, 81,231,147,210, 24,168, 88,158, 1, 52,205,176,208, 18, 32,176,137, 53,118,238,220,185,119,152, 31,240,247, 20,210, - 96,193,232,190,242,194, 30,230, 10,223, 65,237,117, 29, 79,251, 90,160, 25,169, 81, 48,241, 29, 38, 88,193, 34, 74, 1, 87, 4, - 71, 44, 51, 93,115,224,191, 29,181,215,120,108,154, 17, 7, 15, 30,100,251,120,132,180,221, 16, 40,101, 36,141,204, 8,157, 1, - 96, 31, 64,114,168,128, 45,180, 43,179, 58, 82,202, 13,190, 31, 98,254,190,252,242, 75,230,175,182,134, 25,239, 81, 74,198,252, - 66,130,244, 95, 56, 24,149,144, 18, 86, 74, 74,153,119, 2, 35,180,139, 32,208, 73, 17, 14, 90, 76, 18, 19,170,204,197, 28, 95, - 9, 94, 0,182,149, 59,237, 8,177,168, 32, 24,208,235, 51, 97, 62, 5,160,115,137,237, 29,192, 55,196,138, 68, 11, 11,160, 16, -198, 47, 86,172,216, 13,139,249,142, 7,112,180,157,224,181,104,209,162, 2,192, 72, 1,153,252, 79,251,204,193,131, 7,147,215, -166, 11, 22,249, 45,208,234,252,247,223,127,251, 66,202,168, 0, 45,104, 62, 20,176, 69, 73, 22,109,180,122,244,232,225, 11,186, -190, 75,151, 46,245,197, 14,226,206, 86,242,152, 50,127,237,147,127,110,191, 40,154,255,176, 67,124,248,221, 90,177, 98,199, 69, -209,123,250,191,162,219,228,253,162,199,164, 0,209,122,208,159,226,207, 29, 0, 94,139,142,137, 76,197,222,183, 4, 48,211, 21, -122,255,252, 95,187, 46,137, 6, 3,183,137,204,165,155, 94, 77,156,187, 34,219,165,114, 37,205,246,110,134, 34,213,218, 4, 82, -165, 56, 98,193, 65,145,177,104, 29, 75, 52,173,148,197,106, 28,130,144, 6,153,124,178,212,201,253,134, 98, 47,253,116,221, 55, - 33, 85,179,250, 60,251, 52,181, 79, 10,190, 67,163,204, 1,160, 52,228,206,141, 27,195,119,110,223,254,115,185,146, 37,251, 2, -220,148,161,148,203, 19,208, 2, 56,171,179,116,241,226,225,193, 0, 90,201,147, 38,117, 75,157,176,154,206,210,240,163,143, 20, -122,187, 3, 2,126,134, 33,123,223, 12, 9,125,234, 53,206,252,127, 96,167,151,119, 9,180, 32, 66,235,162,162, 59, 76, 5, 20, -187,252,208,188,128, 34,197, 58, 55,175,163,232, 84, 37,173,120, 39,131,207,202, 15,211,249, 36,123,141,128,150,185,228,205, 8, -104, 81,181,167, 5, 90, 84,199,105,129, 22, 86, 38, 17, 2, 90,225,165,201, 74,183, 3,180,172,228,211,106, 39,120, 85,226, 73, -160,117,237,246, 19, 5,104, 93,184, 25,172, 4,254,222,125,224,191,246, 0, 13, 86,129,150, 15, 84, 46,191,112,162,162,234, 4, - 43, 80, 5,172, 64, 50,196,193, 90, 74, 27, 18, 67,220,127,155,207,169, 98,128, 36,134,113, 67, 96,123, 51,206,136, 31,152, 24, -251,193,214,229, 38, 39, 83,128, 23, 65,251, 46,174,154, 31, 60,126, 22,106, 39,226,149, 91, 79,196,237,123, 15, 5,118,248, 61, - 3, 56,129, 20,218,248, 2,205, 31, 49, 73,223, 92,178,100,137, 24, 59,115,133, 2,174,168,146,100, 80, 3, 45,230,243,230,205, -155,148,124,220,128, 84,169,178, 39,154, 0,120, 21,241,237, 78,144,100,117,199, 68,216, 29,101,219, 68,144,197,124, 94,185,133, -221,146, 55,158, 7,254,190, 7, 61, 45,190,255, 20, 52, 61,217, 24,133, 2, 89, 46, 32,213, 93,147,135, 24,136, 52, 70, 2,177, - 87, 0,108, 85, 38,128,161,122, 24, 82,151,125,204,107,162, 68,137,118, 80, 37,135,201,145,147,173,217, 46, 44, 89,188,146,148, - 86, 18,168, 64, 18, 72, 59,167,252, 6,188,207, 5, 9,215, 67, 74,182, 90,183,166, 54,196,231, 93,147,126, 85,174, 91,183,110, - 74,254, 32, 37,162,106, 43,204,149, 36, 73,146,173, 39, 78,156, 16,125,250,244, 33,189,247,108,244,211,183,208,254, 87,178,157, - 98,204,163,234,236, 33,213,155,216,120, 33, 32, 21,221,169,234, 3,150, 73,130,222, 84,170, 56, 9,252,106,212,168, 65,176,249, - 37, 64,208, 35,218,127, 65,170, 47,160, 2,181,228,222, 68, 2, 45,171,192,201, 70,252,248, 0,130, 91, 33, 85,125, 10, 9, 86, - 48, 13,225, 81,238, 19, 0,151,193, 4, 89, 61,123,246,228,162, 66,217,205,139,118,186,194,106,193, 1, 34, 59, 99, 78,241, 29, - 58,116,168, 47,234, 75, 81, 19, 66,155,224,251,235,175,191, 42,128,139, 64, 11,187,152,125, 33,221,163, 68,203,146,228, 49, 85, -129,218,255,205, 89,123, 70,124, 10,155,172, 6,190,171,197,176,249,135, 20,144,245,205,175, 7, 69,159,169,187, 69,235,129,203, -196,150, 67,215,197,148,229,255,137, 44,197, 63, 56, 97, 37,175,233, 11,191,127,126,222,186, 51,138, 93, 86,142,119, 63,189,150, - 52,251, 59,121,101, 58, 24,213,231, 42, 87,239,139, 43,251, 79,221, 17, 19,151, 30,126,117,128, 86, 54,159,167, 4, 90,173, 96, - 59,152, 37, 83,166,111,175, 92,186, 52,156,210,167,140,233,211,247,134,195,191, 12, 18,220,120, 2, 90,116,189,112,247,214,173, -225, 59,182,109, 27,142,221, 8, 77, 25,151,198,241, 25,211,165,235,115,233,220,185,225,151, 47, 92, 24, 14,218,125, 65, 47,163, -154,158, 39,154,124, 7, 85,225, 15,146, 46,140, 89,251,242, 25, 93, 72, 52, 46,158,240,225,189,149, 61,197,157, 21, 61, 68,227, - 34, 9,130,203,164,245,249,194, 40,159, 81, 88,162,101,238,222,193, 8,104, 65,186, 17, 6,104, 97, 16, 11, 3,180,250,247,239, - 31, 33,160, 21, 94,154,236, 20, 70, 64,171, 77,185,183,195, 72,180,172,228,211, 74, 7,125,149,226, 80, 45,136,213,107,157, 75, -215,238,182, 77,222,116,211,141, 55,235,173, 15,102, 72,214,100,227,141,109,123,143,180,197, 64,111, 89,117,232, 42, 87, 38,220, -107, 67,189,163, 88,191, 83,226,128, 85,116, 32,158, 5, 96, 64,190, 78,163, 99, 94,144, 62, 81,101,136, 77, 38,230,134,210,116, - 78, 74,195,248,204,153, 51, 95,197, 36, 16, 66,240,163,221,137,152,226,179, 35,226,240,127,151, 4, 84, 10, 2,160,231,160, 25, -143, 49, 73,213, 6,205, 99,121, 74,214,190,149,160,225, 22,247,142, 70,238,110, 60,112,230,185, 68,139,223, 57,122,244,168,128, -202,130, 52,255,182, 64, 51, 27,119, 23,194,240,253, 11,148,249,177, 52,228, 79,211,238,255, 59, 38,249,251,194,149, 59, 10,104, - 68,220, 77, 70, 52, 33,161, 25,174, 1, 80,171, 17,119,130, 78,152,136, 73,108,147,140,139,197, 0, 37, 91,180,141,121,225, 23, - 64,213, 78, 74,160,168,154,195,199, 49,150, 43, 87, 99,218,238, 96, 55,176,128,100,244, 0,254, 91,145,106,245,131,125,155,152, - 58,117, 42,233,208, 14,199,211,213,153,155, 46,160,226,102,220,161, 38,113,251, 19,248, 64, 42,194,184, 70,187, 64,155, 15, 27, - 54, 76,145,196, 32,206,143, 22,153,152, 23, 96,106, 7,193, 15,193, 70,233,210,165, 31, 32, 93, 5, 72,119,238,176,253, 64,242, - 34,160,134, 62,132,103,101, 44,210,243, 65,253, 15, 97,185, 8, 34, 27, 53,106,196,157,186,180,149,228, 85, 3,146,246,103, 4, -161, 44, 7,227,153,209,180, 1,156, 20, 82, 54,226,143, 0,248, 81, 0, 49,212,229,130,160, 16,201,185,201,229, 93,244, 47,170, - 55,187, 3, 52, 29,160, 4,177, 68,137, 18, 4,204,150,236,244,144,166,225,232,209,163, 21,112, 53,112,224, 64, 5, 88, 81,146, - 69,144, 69,213, 33,129, 23, 84,211,202, 29, 64,171,161, 89,249,249, 62,117,193,186, 11,251, 77,221, 34,122,252,178, 95,124,250, -211,102,209,180,223, 95,226,171,241, 59, 69,239, 41, 1,162,101,255,101, 98,244,239,123,197,214,195, 55,196,143, 51, 55,137,172, - 37,234, 45,180, 66, 51, 77,161, 58,139,127,156,189, 67,124, 53,113,191,168,255,245, 60,145,182, 96,237,221,137,178,149, 47,150, - 44,231, 59, 37,211, 21,170,181,119,250,146, 93, 33,123,255,187, 45,134, 76,251, 71,100, 45,254,242, 84,135, 21,178, 39, 12,160, -189, 84,245,108, 49,130,203,101,240, 97,167,162, 29, 85,137,169, 83,166, 12, 15,126,250,116,120,227,134, 13,127,198,255, 98, 86, - 65, 81,254,188,121,127,134, 95,156,225,195,127,254,217,173,222, 67,250, 34,227, 70,143, 86,232,181,252,228,147,159, 33, 25, 43, -165,165,103, 6,180,242,229,205, 59, 92,210, 5,128,107,204,248,149, 50,250,252,180, 98, 96,109, 69,154, 53,184, 73, 62, 81, 54, -189, 15, 27, 89, 40, 71,172,234,186,138,226, 64,203, 74,179, 11, 19, 71,177,159,162, 61,150, 90,170,197,255,106,137, 22,237,160, - 32, 34,182, 5,180,224,143,107,138, 55,104, 50,199, 86,129,150,213,124,134,139, 83, 47, 62, 81, 40, 99,120,238, 46, 60,119,241, -106,163, 99,167, 46,181, 61,112,228,108,187, 93,251,142,183,219,184,237, 64,219, 53,235, 54, 55,130, 4,202,174, 49,188, 44,205, - 56,212,147, 2, 88,164, 26, 78,254,134,205, 30, 7,100,143,170, 98, 3,150, 36,122,231,157,119, 30,147,142,118, 39, 34,221, 62, -108,220,117, 88,172, 95,191,129,192,142, 19,157,165, 43, 87,141, 30, 5,139, 85,106,112,235,192,233,123,130,225,208,217,251,226, -250,157, 39, 2,234,104, 5,100,113, 2, 33, 40,162,189,150, 37,130,207, 35,165,131,225,191,146,207,235,216, 49,169, 85, 77, 30, - 58,113, 94,241, 43, 6,187,178, 59, 6, 52, 99, 2, 0, 31,117, 51,207,198, 15,170,101, 65,115,177,141,188,122, 35, 42,119,196, -125, 65,169, 21,129, 6, 0, 36,213,110,114,135,101, 76,170, 19, 9,180, 6, 13, 26,196,188, 81, 42,231,209,199, 18,164, 34,127, - 82, 69,230,146, 82,153,109,116, 72, 67,135,184,148,250, 64,229,196,221,136,158,174, 89,172, 83,170,224, 16,137, 59,248,244,174, -188,159,125,246,153,162,162,139, 17, 35,134,149,221, 98,245, 32,201,124, 74,117, 57,141,235, 33,169,164,228, 73,158, 48, 80, 12, - 14,107,239,241,155, 84,197, 81,122, 11, 96, 52,200, 2,195, 91,147, 87, 4, 48,237,219,183,231,130, 68, 11, 38,154, 66,170, 27, -194,247, 0, 34, 44, 75, 71, 79, 52,177, 64, 57, 76, 0,156, 43, 87,174, 75, 22,190,237, 99, 53, 62,234,245, 40,243,192,122,162, -148,176, 97,195,134,204,107, 97,205, 55,250,195, 86, 81,124,243,205, 55,204,167, 37,123, 42,196,203,133,113,231,107, 44, 30,220, -210, 44, 26,193, 99, 83,146,178,227, 16,188,244,133, 13,153, 47,108, 30,123, 1,208, 89, 51,134,135,159,172,178,245,186,221,250, - 97,254, 49,241,253,204,131,226,155,169,187,196,103,131,150,139,214,253,151,138,177,127,236, 23,251, 79,221, 22, 75,183, 94, 18, -149,234,127,117,195,178, 49, 60,104, 86,105,246,205,173, 1,115,142,136,111,103, 28, 18,189, 70,255, 45, 42, 53,236,113,163, 86, -139, 62, 55,253, 86,238, 19,231,174, 62, 16,203,182, 93, 22,229,235,117,122,105,198,240,253, 96,184, 94,178,120,241,225, 39, 14, -238,158,210,189, 83,187,201, 73,128,163, 9, 84,222,140, 21,171, 37, 37, 79,180,203,130,202,174,171, 85, 80, 36,233, 17, 16,125, -247,205, 55,195, 37, 61, 74,182,232,247,234, 50, 36,100,111,196,140,217,115,157,129,239, 43,189,246,199,111,211, 16,158,249,148, -116,161,158,172,201,231,149,179,250, 28,186,177,180,171,184,178,168,179,120, 47,107,140,187,205,146,250,188,109, 5, 16,170,190, - 99,174,146,179,210, 41, 94,225, 56, 95,211,216,157,210, 38,170,246, 96,143,163, 0, 46, 12, 72, 10,208,130,138, 97, 88,191,126, -253,134, 97,192, 24, 6,207,223,156,116,185, 43,203,240,162, 31,173, 26, 57,124,130,235, 23,142,127, 21,226,249, 41,222,160,201, -143,213,200, 25,243,225,199, 5, 98, 7,175,248,246, 93,197, 24, 94, 6, 41,209,178,155,207, 87,184, 62,212, 89, 91, 66,119, 11, -120,176,132, 15,233,194,129,187, 11, 97, 23, 81, 7, 42,189, 58, 52,128,167, 36,139, 32, 75,237,222,129,171,107,153,198, 66, 57, -233,227,102, 66,155, 54,109, 66, 56, 9,209,222,137,234,196,150, 45, 91,114, 48, 30,137, 96,217,213,129,234, 91,177,160,254,120, -164, 6, 90,114, 39, 34,129,150,255,154,109, 98,206, 28, 63, 1,183, 2, 70, 0, 70, 47,219,111, 81, 82,166,198, 50, 4, 89,156, - 24, 37,200, 26, 55,110, 28,129,150, 37,117,130,235, 3, 9,160,238, 84,242, 41,129,150, 90, 53,185, 53,224,160,160,196, 6,134, -241, 87,141,248,136, 9,121, 84, 4, 36, 90, 86,124,118, 89,168, 66, 75, 81, 62, 44, 84,168,208, 29,170,218,168,210,162,186, 8, -169,180, 62,148,234, 64,141,170, 72,103,176, 69,159,182, 63, 52,142,110,110, 68, 29,210,195,253,164, 5,186,183,173,228, 0, 0, -226, 50,227, 99, 28,225, 78, 57,195, 11,246, 60,219, 9, 12,104,164,143, 72,137, 13, 34,198,133,154, 78, 1, 49,204,135,217,247, -161, 34,221, 42, 85,121,104, 71,244,233,166, 85, 95, 22, 1,240, 60, 2, 9,141, 82,126, 43,234, 59,208,217,201,239,187,212,151, - 70,210,201, 78,148, 20, 50, 30,118,180,110, 49,201,103, 93,128,162, 93,136,243,161, 89,121, 92,239,173,196,175, 12, 27,196, 96, -130, 75, 0,210, 19,144,170,210,111,216, 87, 58,244, 11,127,252,241,199,202,162,165, 72,145, 34, 92, 0, 89,114,201, 0,247, 27, - 77, 48,118,124,135,197,154,239,202,149, 43, 21, 59, 45, 74,177, 32, 17,247,133,148,156,246, 91,223, 65,205,219,196, 98,121,148, -104,169, 11,214,242,111,208,117,202,147, 1,179, 15,139, 41, 43, 78,137,229,176,201,162, 20,107, 27,194,210,109,151, 68,231,129, - 51,158,100, 42, 90,199,204,198, 51,212, 39,211,194, 29, 68,131,110, 83,158,246, 7,205, 25,171,206,136,181,251,174, 10, 74,177, -118,159,184, 5,144,117, 73,116,234, 55,237, 73,150, 98,239, 91, 1,236,118,138, 98, 41, 46, 1, 73, 69,108, 66,120,175,124,137, -201,167, 14,239,157,242, 85,231,206,195,105,200,206,231,197, 10, 21, 26, 74, 80, 51,110,204,152,225, 0, 53,213,172, 2, 45,133, - 94,165, 74, 10, 32, 82,211,203,151, 39,207, 64, 62,163,148, 12,244,106,233,209,243, 36,209,194,106, 42,133,154, 46,221, 71,116, -204,232,147, 4, 59, 11, 21,251,178,165,223,215, 16,144,198,173,182,154, 79, 21,131,162, 10,208, 50, 87, 29, 26,212, 58, 13, 53, -203, 64,237, 67,113,239, 48,116, 16,197,153, 40,129, 22, 86, 97, 10,200,130, 94,127, 24, 38, 20, 95,198, 67,208, 26,118,234, 25, - 96,123,157, 38,246, 47,191, 85, 41,139,207,252, 26, 57, 99, 60,107, 86, 60,126,240,174, 17, 16, 83, 2,112, 17,104,117,237,218, -117,124, 56,243,105,169, 35,120,136,100,197,248,220,238, 55,212, 52,151,240,104, 29, 16, 88,162, 34,162, 56, 44,165,225, 59,131, -158,195, 82, 78, 40,154, 52, 86,242, 89,189,126,253,250,138,225,185,107,130,163, 35, 84, 79,151, 71,154,216, 9,117,153, 54, 48, - 55,225,196, 52,111,215,227,138,127, 45,238, 68, 76,219,230, 95, 49,103,193,159,138,179, 68,228, 95,171,230,243, 72,147,238, 7, - 2, 3, 3, 21,172, 69,199,170, 4, 89, 84, 29, 81,101, 72,195, 94,168,140, 67, 96,215,165, 53,182,246, 72, 19, 96,239, 6,213, -164, 84,113,102,239,116, 92,188,229,202,103,166, 14,135,197, 95,107,183, 8,172,208, 5, 38,191,249, 26, 70,168,105,234,217,104, -133,217, 89,136,254, 53,210,196, 70,203, 74, 29,133,187, 45,193,214,105, 51,219, 5, 37, 89, 4, 89,200,180,174,221, 16,221, 52, -112, 23, 26, 39,102, 2, 14,240,124,143,135,178,215, 5,176,181, 5, 12, 16,159, 19,253,199, 30,104,250, 64,165,123,144,121,133, -106,204,163,145,119,206,156, 57,207, 49, 30, 0,156,158, 20, 83,203,207, 58,104, 27,116,185, 48, 24,193,200, 85, 9, 23, 21, 93, -177,104,217,140,251, 23, 58,204,214,210,172, 7,105,231,110,196, 51,179, 63,106, 7,144,181, 23,241,234, 88,160,105,183,142,245, -226,187,243,137,122,254,139,237,219,101,123,231, 81, 85,141,186,159, 1,255, 87,130,182,111,176, 59,163, 74, 81,125, 25,181,207, -183,224, 39,171, 9, 36,130,189,168, 54,164, 61, 22, 13,224, 41,229,162, 36,203, 5,178,184,152,243,152, 79,245, 75, 58, 35, 77, - 11,176, 85,188, 86,167, 27, 61,199,174, 17, 99,151, 28, 19,191,192, 38,235, 39,168, 11, 41,201, 34,200, 10,143,195,210,116,133, -107,255, 89,186,222, 87, 55,190, 30,179, 90, 76,244, 63, 33,126,253,251,164,248,121,230, 6, 81,185, 65,215,235,153,139,189,255, - 82, 29,150,190,151,213,103, 20,252, 89,133, 80,117, 88,175,100,198, 0, 56,180,203, 4,127, 35, 9,107, 84,175,174,128,165, 47, -191,248,194, 13,190, 60, 72,138,220,117,148, 27, 46,106,222,175, 83, 71, 73,219, 22,126,174, 72,175, 21,236,189, 42, 85,168,160, - 60,235,209,173,219,112,248, 2,202,103, 1,104,185,105, 50, 46, 13,233,213,116,169,218,108,144,213,167, 64,223, 15,178, 41,106, -195,113,109,139,139,226,169,125,124, 95, 99,160, 37,155,106,184,129, 33, 59, 67, 85, 24, 77, 14,198,106, 86,145,106, 97, 37, 52, - 12, 29,142, 3, 19,153,109,171,179,184,114,227,117,154, 37,177,131,161,114,246, 24, 27,170,231,136, 17,210,225,221,164,193,173, - 74, 39,120, 12,245,207,248, 8,230, 51,188,131, 91,164, 78,142,200,212, 18,158,239,135,187,217, 17, 60, 82,197,184,132,113,105, -224,202,180,170, 66, 89,201,103, 10,218, 99,113, 23, 34,108, 77, 60, 73, 18, 36, 89,143, 52, 81, 31,149, 49,208, 62, 13,188, 10, -169,211,201, 11, 98, 27,164, 67, 4, 46,115, 23,254, 41,198,142,159, 44,176,163,144,182, 32,153, 45, 14,230, 74, 52,128,149,247, - 42, 87,174,124,157, 96,235,240,225,195,161, 64, 22,236, 68, 4, 64, 39,109,204,176,139,217,210, 4,161, 68,130,129,127, 61,122, -193,191,117, 39, 72,156,130,123,138,253,135, 79,137,205, 59,246,139,149,107, 55,139,217,126,191,115,178,231, 78, 75, 51,154,218, - 93,135,116,227,160,158,204,179, 89,216,117,104,165,142,236,182, 83, 53,205,154,144,252, 28,161,186, 15, 68,204,142, 67,106, 2, - 94, 47, 3,224,160,113, 56, 15,220, 86, 95,145,157, 79,126,139, 0,142, 14, 73, 63, 48, 41,176,140,167, 39, 1,122, 17,249,180, - 91, 31,122,241, 35, 59,159,239,161, 46, 9,154,190,177,144, 89,142,215, 3,209,152,151,227, 94,197,102,189,231,162, 11, 7, 72, - 14,191, 98, 64,253,241, 56, 30, 51,117,161,199,178, 83, 53,152,169,216, 7,139, 51, 22,169,115, 38, 83,209,186,103,178,194,157, -131, 5,117,161, 41, 77,184,133, 88, 2,122,103, 51, 21,125,255,116,182,146,245,112, 4, 79, 85,179,205, 31,145, 90, 71, 60,119, -144, 7, 72,203, 35,119,232,102,161,108, 18,159,252,165,224,224,185, 70,213,170, 10, 48,250,248,195, 15,135,231,132,167, 10, 19, - 0,227,206,103, 49,236,111,113,167,173, 87,111, 56, 37, 81, 48,180,141, 95,241,221,119,135,145, 94,243, 38, 77,134,103,130,146, -196, 46,208, 74, 15,115, 11, 53,221, 20,216, 17, 73,160,213,231,253,172, 10,208,234,223, 48, 55,129,214, 39,175, 49,208, 10,183, - 68, 75,219,255,232, 71,133,131, 43, 13, 86,121, 55,243,171, 98,165, 17,122,157, 38,118, 52,228,174,154, 35,198,225,218,121,222, -224,170,183,129,151,242,105, 97, 44,122,161,147,206, 12,186, 94,160, 51, 80,186, 30,184,119,239,158,145, 74,112, 9,165, 15, 92, -221, 19,100,209,110, 5,185,156,173,202,169,149, 58,226,206,179,169,176,223, 8,198,113, 39, 99, 45, 48,194,148, 38, 84, 64, 67, - 97,112,252,132,234, 24,110,117,167,223, 34, 56, 51,228, 14,199, 71, 88,233,234,169, 38, 76,105, 98,242,255, 54, 79,158, 60,215, -225, 92, 84, 49,234,165, 47, 40,216,149, 4, 99,155,255,101,172,172,107,232,228,219,148, 38, 38,133, 41,176, 41,123, 50,101,202, - 20,101,247, 25,236, 75, 20,137, 27,188,155, 63,130,193,175,222, 17, 37,122, 52,233, 71,107, 56,212,240,151,233, 3, 76,147,143, -248, 0,108, 59, 97,251,115, 17,207,141, 84,239,166,249,180, 80, 39,218, 40, 14,205,112, 48,205, 67, 18,135,159, 14, 63,189,197, - 1,119, 91,210, 3, 90,242, 16,233,248,111,189,213,132,224, 8, 8,184,137, 93, 80, 20, 55, 86,172, 6,229, 75,151,102, 90,101, -199, 33, 3,159,145, 30,108,191, 90, 24,209,211,168, 14, 67, 73,180,248,238,173, 55,222,248,186,124,217,178,195,229,142, 67, 62, -123, 47, 91,140, 67,221,107,102, 20,239,102,142,113,188, 69, 42,159,248,175, 49,208,242, 86,253,187,233, 88,181,205,177, 51,248, - 68, 21,154, 86,153,105,167,236,225,161,137, 69,140, 2,152,150,168, 2,165, 87,218, 75, 45,209, 98,220, 25, 8, 76, 43, 47, 59, -249, 84,251,127,242,148,103,171, 52, 11, 97,165,187, 2,106,158,171, 80, 39, 94,196,106,215, 15, 68, 51, 24, 16,182, 74,179, 0, - 0,215,111, 80, 5, 29,131,106,107, 31,232,143, 4,189,148, 17,161, 9,112, 89, 26,244,214, 65,197,115, 11,182, 55,129,160, 57, - 23,244,180,146, 44, 43,252,196,110,105, 93, 35,114, 74, 11,248,206,232,178, 90,118,171,237,136,241, 28,154,118,184,101, 30,215, -225,167, 57,143,236,196,112,248, 9,110, 17,148,232,157, 55, 40,193, 10, 13,208,195, 11,138, 90, 65, 93,168, 77,107, 70,207, 12, -104,241, 61,213,154, 90,186,181, 51, 60, 55,224,183, 0, 8,245,218, 72,184, 85,113,118, 26,156, 23,226,202,124,114, 44,151,210, - 45, 47,144, 53, 39,225,116, 22,115, 30,217,137,225,240,211, 14,183,204,227, 58,252, 52,231,145,157, 24, 14, 63,237,112,203, 60, -174,195, 79,115, 30,217,137, 17,101,249, 89, 53,151, 79,218,154,217,125,160,157, 11,247, 21, 85,202,254, 58, 0, 45, 89,134, 23, - 6, 16,163, 74,229, 58,249, 12,119,255,213, 77,232,240,211,225,167,183, 56,224,180, 37,111,113,242, 57, 29,135,159, 14, 63,189, -197,129,200,104, 75, 81, 25,104,169, 37, 89, 4, 89,161,180, 20,100,150, 94,176, 83, 25, 70, 52, 60, 61, 55,163,239,208,212,175, -151,240,214,151,195, 79,135,159, 86,219,128,211, 55,141, 57, 96,149,135,234,120, 14, 63, 29,126,234,113, 32, 58,183, 37,201, 15, -154,118,232, 5,173, 97,185, 89, 31,138,214,239, 35, 3,241, 58, 52,189,219,164, 28,126, 58,252,244, 22, 7,156,182,228, 45, 78, - 58,210, 39,167, 45, 69,207,182,228,221, 82,191, 88,106, 94,219,117,104, 55,219, 78,103,177,203, 49,207,241, 29,126, 58,252,244, - 22, 7,156,182,228, 45, 78, 58,160,200,105, 75, 78, 91,242, 46, 7, 28,106,182, 56,224,116, 64, 91,236, 50,141,236,240,211,148, - 69,182, 34, 56,252,180,197, 46,211,200, 14, 63, 77, 89,100, 43,130,195, 79, 91,236, 50,141,236,240,211,148, 69,182, 34, 68, 6, - 63,109,101,224, 21,139, 44,109,180, 34,182,235,240,135, 31,126,136,137,173,248, 9,225,108,174, 32,188, 67,199,196,121, 99,102, -135,203,154, 86,196,176,145, 99, 99, 98,203,124, 66, 48,172,224,245,155,119, 99,182,110,211, 51,194, 52,195,193,124,211,124, 58, - 52,109,113,192,225,167, 45,118,153, 70,118,248,105,202, 34, 91, 17, 28,126,218, 98,151,105,100,135,159,166, 44,178, 21, 33, 58, -243,211, 22,163, 94,177,200,114,151, 97,196,118, 27,194, 65, 99, 76,128,172, 52, 8, 67,112,248,171,226,221, 26,231, 88,121, 2, - 70,166, 13, 6,222,168,121, 36, 15, 78, 1,240, 25, 2,175,195, 10,205,223,151,109,138, 16,205,112, 48,223, 52,159, 14, 77, 91, - 28,112,248,105,139, 93,166,145, 29,126,154,178,200, 86, 4,135,159,182,216,101, 26,217,225,167, 41,139,108, 69,136,206,252,180, -197,168, 87, 44,178,119,108,180, 18, 39, 78,252, 38, 60,108,191, 3,140,181, 15,206, 37, 43, 88, 40,164,105,131,193, 49, 39,111, -198,142, 19,231, 29,128,172,125,241,227, 39,240, 10, 77, 11,249,210, 70, 49,205,167, 67,211, 22, 7, 28,126,218, 98,151,105,100, -135,159,166, 44,178, 21,193,225,167, 45,118,153, 70,118,248,105,202, 34, 91, 17,162, 51, 63,109, 49, 42, 74, 70,246,247,247,231, -241, 44,186, 23,164, 88, 49, 11, 20, 40,240, 14,212,124,155,243,229,203,247, 24,199,154, 44,192,233,236,102, 71,240,152,241, 33, -102,206,220,121,223, 73,151, 54,245,230,162,217,211, 62,198,113, 39, 11,224,133, 59,162, 52,205,190,233,188,119, 56,224,112,192, -225,128,195, 1,135, 3, 14, 7, 94, 81, 14,120,194, 34,175,104,150,153, 45, 41,209,242,116,202,135,143,143, 9,208, 42,134,163, - 71, 14,116,237,218, 53,152,231,190, 1,112,237, 0, 48, 42,139,103,161,142,206,249,244,211, 79,205,108,172,212,124, 42,246,118, -162,196, 7,102,116,169, 25,252, 96,122, 61,145, 62,109,170, 29, 56,231,174, 44,206,213, 11, 69,179,121,235,246,118,104,190,194, -245,224,100,205,225,128,195, 1,135, 3, 14, 7, 28, 14, 56, 28,240,196,129, 40, 10,180,100,145,212, 42,196,176,197,212, 22,174, -100,201,146,113,112,198, 91, 89,168, 11, 63, 76,158, 60,249,246, 54,109,218,136,205,155, 55,139, 49, 99,198, 60,171, 91,183,238, -133, 50,101,202,204,205,149, 43, 87,107,168, 18, 11, 67,226,213, 2, 0, 41,173,217,169,236,133,138,148,136,147, 36, 73,210,178, -177, 99,199,249, 48, 97,194,183,183,247,106,243,177, 8, 57, 59, 77, 60,155, 88,232, 89,203, 90, 37, 47, 84, 40,145,111,110,238, - 44,233, 90,191, 17, 43,102,225, 24, 49, 98,180, 0,109,162, 67,179,147,222,157, 86,235,112,192,225,128,195, 1,135, 3, 14, 7, - 28, 14,188, 6, 28,136,162, 64,203,179, 68, 75, 22, 74, 93, 56, 0,166, 9, 0, 88, 7,112,216,239, 3,168, 9,239,245,234,213, -235,233,129, 3, 7,196,154, 53,107,130, 7, 15, 30, 44,250,245,235,247,172, 86,173, 90,119, 74,148, 40,113, 17,135,247, 30, 7, - 32,186,133, 52, 59, 16, 74,122,168,231, 9,113,226,196, 62,144, 62,109,218, 7,169, 83,166,184, 55,168, 79,215,167, 33,183, 87, - 9, 17, 56, 36,248,113,191,116,226,220,247,249,159,117,125, 47,211,157,154,133, 82, 95, 76,159, 44,254,113,216,109,221, 2,216, -218, 1,122,158,104,190, 6,205,202, 41,130,195, 1,135, 3, 14, 7, 28, 14, 56, 28,136,222, 28,208,195, 34,175, 13, 71, 80,184, -138, 44, 32,239,255, 99,239, 42,192,170,104,186,240,181, 81, 64, 66, 65, 4, 68, 4, 68, 16,196,110, 69,236,238,238,248,236,238, -238,238,238,238,238,238,110,177,187, 91, 17, 19, 16,131, 58,255,121, 87, 46,255,229,122, 99, 47, 94, 3,157,229,153,103, 47,187, -179,103,103,222, 57,187,243,238, 57,103,102,148,149, 98,194,148,215,205,205,109, 83,246,236,217, 35,103,205,154, 69,235,215,175, -167, 5, 11, 22, 68, 78,153, 50,133,198,142, 29, 43,165, 9, 19, 38, 68,141, 25, 51, 38,194,215,215, 55, 50,109,218,180, 47,217, -234, 85, 65, 15, 40,121,179,164,181,216,148,215, 43, 67,228,171,197,117,137, 78, 54, 36, 90, 93, 48, 50,106,158, 27, 69, 14,180, -167,207, 99, 51, 83,212, 16,231,168,231, 83, 10, 68, 84,205,231, 22,153, 42, 85,170,151, 76,246,244,201,252,107,218, 65, 84, 68, - 32, 32, 16, 16, 8, 8, 4, 4, 2,255, 42, 2,154,184, 72, 60,194, 66,117, 30, 45,121,197,102,151, 97, 2,184, 2,153,104, 13, - 46, 93,186,244,253,106,213,170,133,130,100, 77,156, 56, 17, 4, 75, 34, 93, 7, 15, 30, 12,103,119,226,103,118, 31,222,153, 49, - 99,134, 23, 36,151, 47, 95, 30,211, 53,104,220,172,172, 83, 37, 48, 79,150,216,222,219, 43,235,224,250, 69,125,238, 15,168,234, - 17, 26,182, 56, 39, 69, 13,116,162,200,105, 46, 20,185,182, 68, 36,221, 26, 23, 62,178, 69,137,207, 25,156, 51,220,153,181, 96, -181, 36,179,100,105,237, 50,229,213, 70,228, 18, 8, 8, 4, 4, 2, 2, 1,129,128, 64, 64, 32,240,211, 16, 48,124, 30,173, 66, -133, 10,129,104, 37,204,154, 53,171,185,131,131, 67,126, 78,167, 39, 77,154, 4,162, 21, 49,123,246,108, 90,186,116,105, 68,147, - 38, 77,130,120,110,173,237,108,253,178, 70,209, 93, 92, 92,116, 6,173,231,201, 95, 32, 65,138,228, 38, 9, 61, 61,189,205,109, - 82,167,206,111,155, 58,213,233,176,137, 62, 68, 67, 28, 35,104,126, 14,162,181,101, 35,198,213,206, 27,148, 36, 73,210,237, 44, - 78,146,153,206,193, 94, 4,194,255, 52,189, 16,130, 5, 2, 2, 1,129,128, 64, 64, 32, 32, 16, 48, 2, 2,113,159, 71,139,221, -119, 41,216,125, 87,166, 82,165, 74,119, 56, 8,158, 86,174, 92, 73,243,230,205,139,156, 57,115, 38,245,232,209,227, 6,143, 18, -172,131, 2, 86,173, 90, 85, 54, 33, 50, 51, 75,153, 34, 69,178, 36,101,186,151,112,191, 19, 53,214,131, 34,183,215,161, 15, 43, -235, 70, 70, 46,206, 75, 59,186, 20,185,193,211, 70, 72, 50,171, 85,172, 32, 91,166, 17, 64, 18, 34, 4, 2, 2, 1,129,128, 64, - 64, 32, 32, 16, 16, 8,252, 90, 4, 76, 76, 76, 28, 57,246,106, 2, 7,192,135,143, 28, 57, 50, 50,115,230,204,143,189,189,189, - 23,119,238,220, 57,140,255, 15,131,165,171, 78,157, 58, 54, 40, 21,199,106,169, 19, 35,141, 19,175, 37, 76,152,192,209,218, 60, -197,132,103,253,115,133, 63, 26, 94, 32,210,195, 45,195,227,108,110, 78,139,215,117, 43, 24,246,108,120,238, 48, 39,107, 51,150, - 89, 91,146, 89,160, 64,126, 89, 50,127, 16,149,127,121,130, 56, 81,247, 31, 84, 30,181,203, 5,158, 2, 79, 99, 33, 32,116,201, - 88, 72,126,147, 35,240,252,243,241, 52,110, 9,127,189, 52,221, 83, 59,104, 43, 15,207, 6, 95, 63,103,206,156,103,153, 76,125, -113,114,114,122,205,243,103,245,110,215,174,157, 43,143, 68,188,149, 45, 91,182,247, 60,197,195, 35, 38, 98,181,181, 92,175, 81, -177,205, 82, 36,171, 95, 34,179,253,217,129,229,115,126,113,180, 77,245, 58,109, 90,135,222,237, 58,116,114, 77,107,155,250, 86, - 46, 47,151,247, 85,188, 29, 30,241,212, 15, 6,201,252, 65, 60,197, 3,248,131, 0, 10,178, 17,131,128,208, 37,161, 75,198, 66, - 64,232,146,177,144, 20, 68, 43,190,232,146,113, 91,252,215, 74, 83, 95,227, 80,222,154,135, 28,123,229,200,174,195, 81,182,182, -182,107,205,205,205,207,213,168, 81, 35, 55,202,205,139, 73, 39,244,240,240,240,229,101,120, 78,179, 69,235, 54, 47,163,115,200, - 0,162,229,104,102,102, 62,202,194,194,114, 45,203, 63, 87,190, 74,125, 73,102,235,246, 29, 19, 58,103,112,245,229,152,175,211, -105,108, 82,221, 78,156, 56,177, 33, 50,127, 20,206,248,162,132,162,156, 63,218,210,177,175, 23,120, 10, 60,141,133,128,208, 37, - 99, 33, 41, 72,209,191,172, 75,198,213,162, 95, 43, 45,206, 68,203,150, 45, 90,214, 28, 51,229,182,103,207, 30, 19,213, 50,255, -247,223,127, 9,138, 20, 41, 98,198,214,172, 90,174,174,174,169, 56,105,138,167,210,164, 48,182, 76,204,172,121,169, 29,183, 35, -199, 46,199,146, 89,183,101,167, 4,185, 11, 21, 51, 51, 79,105, 81,139, 45,102,169,236,211,102,144, 43,243, 71,225,252,151, 21, - 91,212,253, 71,181, 71,144, 55, 37, 2, 66,151,132, 46, 25, 11, 1,161, 75,198, 66, 50,126, 17, 87,227,214,250,215, 75,139,155, -235,240, 7,203, 41, 30,150, 31, 4, 80,237,114,129,167,192,211, 88, 8, 8, 93, 50, 22,146,241,171, 35, 19,237, 46,218,221, 88, - 8,252, 12, 93, 50, 86,217,254, 41, 57, 63,163, 33,132, 76,227,170,144,192, 83,224,105, 44, 4,132, 46, 25, 11, 73, 65,222,132, - 46,253,155,186,100,220, 90,255, 90,105, 58, 93,135, 80,104, 77,201,144, 34,106,147,161,235,184, 62,249, 66,166,230,118,137,107, -123, 9, 60, 5,158,114,117, 64, 60,155,218, 17,144,139,161,106, 62,129,167,192, 83, 19, 2,255,178, 46, 41,241,136,107,127,166, -239,153,250, 29,231,227, 22,163,101,132,146,138,175, 18, 35,128,168, 34, 66,224, 41,240, 52, 22, 2, 66,151,140,133,164,176, 62, - 9, 93, 18,186,100, 92, 4,226,167, 52,229, 18, 60,186, 23,151,254, 9,117, 19, 15,160,113, 65, 21,120, 10, 60,191, 67,128,214, - 42, 18,209,108,207,140, 52,203,195,143,230,102,117,167,193, 10,173,203, 96,201, 37,237,146,204,169,222,174, 52, 63, 83, 65,154, -157, 45,163, 49,100,198,177,233,132,206,199, 17, 56, 45,151, 9, 60, 5,158,198, 66, 64,210,165,180, 5,219, 86,179, 47,220,225, -149, 67,161,118,175,172,220,138, 6,165,177,119,142, 48,214, 13,132, 28,121, 8,136,135, 90, 30, 78,114,115, 9, 60,229, 34, 37, - 47,223, 95,129, 39, 77,207,236, 69,179, 51,111,165, 57,158,254,156, 86,209, 76,111, 31, 25,213,215, 89,247,104,153,155, 36,153, -179, 50, 47,167, 89,158,222, 63, 42, 83,198,245,154,178,252, 21,109,244, 39,215,189, 67,251, 54, 84,204, 55, 59,185,166,183,165, -210, 37,178, 81,167,142,237,200,192,242,138, 54, 50, 16, 48, 61,217,227, 21,158,105, 11,180,123,211,120,220, 25,106, 51,243,166, -148, 90, 77,189, 66, 60, 61,211, 94,174, 99,125, 78, 41,140, 11,141,144, 38,235, 37,201,211, 58, 4,112,198,168,228,201,147,111, -224, 61, 76,109,134,110,241, 74, 9, 13,173,220,223,244, 0,254, 1,117,183,143,214,179,168,104,189, 83, 47,146, 46, 93, 50,231, -151,197, 64,158,218,228, 32,175,142,240, 10,137,231,120, 59,136, 99, 44,196, 92, 71,221,126,169,126,210, 82, 31, 83,154,153,169, -199,151,105, 30, 23,118,182,181,123,250,113,138,251, 69,154,237,209,135, 22,100,210, 85, 70, 20, 95,107, 57, 37,153,179,189,186, -126,154,234,113, 97, 89, 51,167,103, 33,147, 89,230, 76,207, 94, 63, 34, 83, 5, 47,171,164, 73,147,238,226,255,109,100,234,199, - 47,197, 83,102,153,100,189,235,126, 64,150,242,210, 95, 82,247,138,101, 11,210,231,160,131,180,106, 73, 15,122,241, 96, 54,149, - 42,158,227,135,136,150,151, 66,145, 59,119,226,196,221, 51, 43, 20,197,185, 34,113, 93, 70,237,151,212, 61,190,180,209,159, 92, -206, 88, 22, 45,215, 34, 81,105,210,166, 39, 44,209,215,184,113, 99, 74,159, 62,253, 71, 46,123, 45, 35,148, 95,136, 48,176,211, -161,215,175, 95,211,218,181,107, 35,120,142,174, 80,238,184,250,240,245, 73, 13, 64, 49, 94, 63,128, 60,241,235, 9, 94,172, 59, -128,235, 30,192,251,243,202,122,107, 59,174,134, 75,188,174,187, 74, 93, 60,120, 18,220, 71, 60, 25,238, 45,213,250,217,102,171, - 86,208,189, 80,163, 65,169,189,171,248,105,208, 7, 67,234,158, 20,122, 5,253,130,158, 61,123,246, 12, 29,135,166,206, 67,155, -204, 34, 60, 25,239, 19,127,127,255,240, 79,159, 62, 69, 5, 94, 92, 65,239, 47, 45,161, 55,231,230,208,197, 61,179,194,173,172, - 44, 31,179,188, 34, 90,116,214,144,114,202, 85,123,237,164,104, 14,187,247,102,103,222,117,174, 79,186,219,243,235,167, 10, 63, -220,217,225, 62,147,164,189, 76,190, 50,233, 17,174, 93, 38, 92,134,179, 51,239, 56,209,195,233, 78,235,202,185, 34,118,180,119, -122,192, 50,247,208,116, 15,247,184,202, 84, 94,151, 48, 97,194,190,220, 54,145, 76,182, 70,200,172,252, 47,197, 83,102,153,254, - 42,162, 85,179,106, 81,250,252,225, 0,109,223, 48,144,137,214, 44, 42, 83,226,199,136, 86,142,132, 9,187,132, 85,175,254,101, - 73,182,108,155,153,108, 85,214, 66,182, 64,192, 58,242,146,110, 59,121, 95,247, 7,159,119,213,203,199,120,122,122, 62,227, 3, -157,226, 32, 83,227,123, 41, 87,174, 92, 5,139, 21, 43, 54, 40, 71,142, 28,113,121, 47,105,148,249,163,207, 81, 28,244,244, 87, - 61, 71,237,179,103,207, 30,217,173, 91, 55, 90,183,110, 29,109,219,182,141,178,100,201,242,149,203,235, 16,135, 50,199,183, 75, -114, 70, 23, 88, 25,171,101,184, 33,169,166,139,162, 80, 61, 87,197,225,218, 46,138,224, 58,174,138,144,134,174,138, 99, 53, 92, -164, 47, 22, 93,155,166,198, 37,108,175, 94,189,162,143, 31, 63, 82,175, 94,189,190,176,213, 1, 15, 70, 25,153,168,198,146,201, -147,159,158, 99,171,195, 19,126,121,199, 42, 11, 31, 59,199, 22, 8, 28, 47,161, 42,151, 23,200,150,136, 14,239, 99, 72, 14,159, -143,145,137, 25,240,113, 30,123,213,235, 32,135,143, 61,229,235,212,143, 23,231, 99, 79,212,143,171,202, 84,149,131, 14, 60, 40, - 40,136, 66, 66, 66,136,201,198,115,229, 57, 28,255,240,225, 3, 5, 7, 7,199, 58,174,134,137,206,135, 5, 24,160,206,168,187, - 90,217,165,227,234,117,138,206,243,157, 76, 21,236,180, 97, 26,151,118, 87, 22,201,163,116,233,210,175, 35, 34, 34,200,205,205, -237,149,106, 57, 61,253,254, 27,118,250,118, 72, 80,243, 94,179,214,216,122, 85,205,106, 72,221, 85,242,150,129, 62, 65,175,160, - 95, 32, 89, 47, 94,188, 48,132,104,149,172, 82,165,202,251,176,176,176,168,200,200,200, 40,110,143,168, 3,131, 93, 41,108,177, - 21,133,174,201, 78,111,143, 13, 97,194, 53, 59,170,116,209,220,239,181,180,241,175,122,161, 41,104,173, 87, 82,154,155,185, 89, -228, 44,207,243,139, 27,166,126, 31,176,182, 13, 77,172,102, 21, 18, 54,195,227, 60,205,204,220,154, 22, 57,199,154, 16, 88, 14, -158,146,204,153,153,154, 66,230,144, 26,174, 31,214,174, 92, 66, 93,203,187,124,252, 38,211,163,101, 92,100,170,220,151, 13,139, - 73,222, 76,153, 50,133,152,104, 5,241,241,100, 50,158,249, 95,134,167,140,178, 24,250,174,139,149, 63,175,131,194,177,120,198, - 68,103,114,218, 43, 10,201,188,151,156,186,103,137,126,222, 61,226, 42, 83, 73,180,170, 84,200, 69,101, 75,102,255, 97,215, 33, - 91,180,202,128,100, 69,213,172, 25,169,133,108,129,100,245, 30, 61,122,180, 63, 63, 99,254, 60,217,245, 97,254, 95, 61,174, 80, - 78,221,213,171, 60,153,101, 18,222, 45, 46, 46, 46, 31, 12,148,169,245,189, 84,170, 84,169, 97, 15, 30, 60, 8, 26, 56,112,224, - 26, 38, 93,134,188,151,180,202,212,211, 86,113,169,187,190,230,255,149, 50, 29,185, 48,189,184, 79,252, 0,162,213,165, 75, 23, -188,127,107,234, 43,160,190,243, 76, 27,146,113, 42,198,169, 2,167, 18,156,242, 70,255,206,195,123, 36, 28, 47,169,182,207, 3, -185, 42,231,243,105,145,129,107, 85,175, 87,149,137,227,170,255,199,250,173, 82,110,229,168, 67,245,253,183, 44, 0, 67,117,175, - 94,225, 58, 46,138,193, 29, 10, 58,134, 94,223,186,130, 66,158,220,167,119, 55, 46,208,133,185, 35,169, 67, 30,219,208,250,174, -138, 49,250, 0, 82, 59, 47, 17,173,227,199,143,211,213,171, 87, 37,194,113,251,246,109,202,151, 47,223, 39,126, 97,236,231,188, - 46,134,200,227,198, 12,216,191,127, 63,113,231,253,129,137,196,120,229,195, 5,178,132,123,224, 56,231,153,204,199, 19, 65, 46, - 47, 35,244, 10,247, 87, 37, 57,170,247,227, 78,246, 29,206,195,226, 20,125, 60, 17,174,231,245, 29, 67,206,158, 61, 75, 76,136, -148,199, 19,242, 61,198,183,111,223, 62,132, 45, 31,170,199,117, 22,159,173, 56, 79,248,229, 66, 91,183,110,165, 52,105,210,196, - 34, 90, 56,190,121,243,102, 93, 68, 75,155,236,132, 92,247,113, 13, 27, 54, 12,126,248,240, 33,241,108,253, 49,101, 4, 38,108, -194, 13,126,252,248, 49,217,216,216, 40,143,235, 44, 35,174, 63,113,226, 4, 85,175, 94, 61, 72, 21, 83, 28, 63,121,242,164,242, -248, 56, 13, 47,178,239,228,242, 18, 77,173, 80, 79, 36, 43, 43,171, 17,246,246,246, 47, 3, 3, 3, 37, 29, 80, 18, 45,165, 37, - 43, 77,150,202, 93,102,175, 61,121,250,200,149, 55,129,217, 74,181, 25,103,153,173,138,165, 1,186,224, 2,253,241,243,243,251, -244,228,201, 19,137,196, 95,186,116, 73,210,179, 59,119,238,104, 35, 90,234,226, 83,114,125,159,125,249,242, 37, 10,137,203, 25, -201, 31, 4,145, 55,198,219, 19, 45, 76, 18,147,222,111,174, 68, 47,143,140,138,178, 48, 55,125,202, 2, 82, 26, 80, 70,163,102, -165, 25,222,233, 16,147,117,109, 96,250, 27, 71, 70,151, 13,167,135, 7,104, 69, 83,219,240,195, 93, 28,239,114, 92,213,122,154, -227,229,100,232, 13, 37,153,179,188, 86, 92,234,151,254,230,180, 33, 29,195, 31, 61,122, 68,221, 27,151,141,216,211,193,241, 30, - 91,185,214,198, 69,166, 74, 25,234, 85,171, 86, 45, 4,186,200, 11,211,127, 76,148, 40,209,127,134,150, 47,190,230, 7,201, 42, -233,145,236,217,165,229,221,163, 42,101, 49,125, 99, 0,217,210, 85,229, 44,252, 92,189, 94,188,120, 49,241, 59, 10, 31, 45,114, -201, 86, 44,153, 32, 90,159, 62,236,167,170, 21,243,234,116, 25,214,174, 93,155,216,178, 67, 29, 58,116,208,231, 90, 76, 0, 75, -150, 22,178, 37,145,172,177, 99,199,250,135,135,135,251, 47, 90,180,200,191,114,229,202,254,124,172,251, 15,182,237,148, 49, 99, -198, 16,203, 36,150, 73, 44, 19,101,156,170, 77,166,156,247,146,210,146,197,107,253,118,217,180,105,211,233,155, 55,111, 6, 86, -172, 88,113, 28,175,241,171,241,189, 36, 71,230, 15,214,241,167, 92,206,239, 60,247,172, 89,179, 46,227,103,242, 49, 91,163,190, -122,121,121,125,230, 37,246, 30,178, 37,106, 49,135, 76, 24,212, 31,171, 20, 48,127,161, 66,133, 34, 15, 31, 62, 76,252,204,163, - 45,148,214, 30,157,117,208,197, 69, 64,172,122,247,238, 13, 15, 24, 97, 15, 98,132,223,209, 4, 41,230,183,242,152,202, 57,137, -124, 41,255,215, 36, 3,231, 52, 92, 39, 93,163,233, 30,170,242, 84, 42,164,110,201,138, 61,221, 3, 42,199,201,143,211, 97,117, - 20,106,185, 42, 10, 50,201,250,244, 41,240, 5, 93, 25,217,153, 14, 22, 75, 71,199,139,166,165, 91, 93,171,209,139,229,147,169, -109, 14,235,208,154,174,138, 98, 6,104,128,212,201,130,156, 32,157, 63,127,158,248,107,129, 96,205, 89,189,122,117, 36,119,230, -159,184,113, 71,179, 60, 89, 65,116, 32, 84,144,199, 29, 35,141, 24, 49,226,115,180,165,202, 14, 68, 9,199,223,191,127, 79,252, -149,243,153,255,191,196, 50, 29,152,108, 60,185,127,255, 62,217,217,217,197,144, 28,213,178,131, 72,241, 3,165, 36, 78,142,252, -255,149, 45, 91,182,132, 65,214,211,167, 79,137,137, 18,200,138, 29,151,243, 2,227, 37, 29,127,254,252,185,242,184, 94, 24, 64, -180,216, 29, 69,188,164, 81,172, 50, 40,143,239,220,185, 51, 22, 1,211, 43,144,203,194,117,243,103,236,190,130,168, 93,185,114, - 69, 73, 18,237,152,216,156,103,215,153,116,252,198,141, 27,178,201, 96,134, 12, 25, 36, 50,138, 47,195,217,179,103,127, 81, 98, -170, 60,254,245,235, 87,248,224,191, 48,246,120, 65,218,233, 42, 35,227,253, 28,249,209, 14, 76,166, 67, 64,124, 96,209,195, 6, -121,184, 86,105,201,106,214,115,198, 26,151,188,245, 71,238, 62,243,236,233,252, 77,231,252,109,178, 84, 41, 43,163,254, 41,160, - 47, 76,224, 62, 31, 61,122, 52,146, 45, 81,132,142, 28,122,165,212,177,203,151, 47,203, 34, 90,136,191, 58,125,250,116, 24, 44, - 89,236,222,150, 72, 22,167, 8,117,162, 5,210,245,122,103, 11,218, 62,183,211, 87,182,204, 32,102,235,151,111,210,168,192, 57, -158, 85, 16,172,190,184,161,205,235,224,243, 43,137,246,118,162,123,195, 92,105, 96,217,148,193, 81, 82, 96,124,230,154, 52,216, - 47,177,220,194, 73, 50,231,122, 85,130,204, 49,181,156,223, 92,240, 63, 75,120, 81,206,156, 60,150, 58,148,116,252, 40,201,156, -229, 85,221, 16,153,170,247,230,118,186,125,236,216, 49, 58,114,228, 8, 13, 25, 50,132,152, 24,195, 5,251, 67,155,100,129,155, -229,225, 76,243,120,196,229,130, 76,246,116, 72,126,125,127,232,198, 6, 92, 12,146, 85,202, 35,217,211,215, 23, 54, 17,189,189, - 67, 47,199,123, 83, 89,207, 36, 63, 74,182, 64,178, 2,241, 97,245,242,229, 75,154, 56,113, 34,241,243, 24, 39,178, 37, 17,173, -247,251,116, 18, 45,254, 0,165, 73,147, 38, 73, 68, 38,127,254,252,250,136, 22,208,249,142,108,121, 42, 20, 85,248,120,159,113, -227,198,197,144,172, 25, 51,102,248,243,243,233,207,177, 60, 59, 12,128, 84, 61,235, 84,150, 25, 67,178, 88, 38,225,153,119,118, -118,126,162, 77,166,156,247,146,210,146,213,191,127,255, 53,188,220,220,200, 11, 23, 46, 60,221,190,125,187, 63, 19, 47,141,239, - 37, 57, 50,127,160,142,210,165,252,218, 76,204, 9,150, 29, 36,254,250, 35, 16, 87, 36, 60,231, 73, 56, 73, 6, 5, 57, 27,127, -152,155, 22, 44, 88,208,191, 65,131, 6,161, 32,235,208, 37,124,156, 2,203, 65,131, 6,209,194,133, 11,241, 81,253,145,223,219, -167,107,214,172,153, 92,142,204,232, 60,222,176, 40,194,104,176, 98,197, 10, 88,175,183,203,189, 86, 23, 23, 81, 35, 55, 18,193, - 2, 36,223, 96,249, 63,145, 82,253, 95,219,111,109, 36, 77,147, 28,245, 99, 26,238,135,234,233, 95, 64, 58,186,114, 26, 31,158, -122, 46,138, 3, 87, 55, 46,162,107, 99,187,211, 94,159,196,116, 36,123, 18, 58,147, 51, 9, 93,202,157,148, 30,183, 42, 74,167, -219, 87,160,198,110, 9, 78,202, 5, 50,186,144,146, 53, 75, 53, 93,191,126, 93, 34, 44,232, 36, 59,117,234,244,153, 93,130,175, - 57,111, 85,125,114,149,132,234,192,129, 3, 4, 75, 9,147,162, 40,182, 86,189,100,150,254, 30,232,195, 50,131,175,114, 38, 48, - 81,252,197,129,184,168,183,184, 15,255,214, 72,180, 64,164, 64,252,248,250, 15,153, 50,101,122,131,242, 68, 69, 69, 73, 74,136, - 78,135, 73,199,123,102,251,175,112, 28, 27,246,184,135,138, 21, 73,103,145, 57,223, 19,144, 14,116, 54, 76, 14, 98,202,128,227, -239,222,189, 35,212, 67, 27, 9, 84, 23, 12, 87, 33,199, 56,188, 66,217, 64, 52, 79,157, 58, 69, 59,118,236, 64,217,223,243, 87, -201, 43,212, 27, 36, 7,164,227,224,193,131,178,203,200,166,124,137,104,157, 59,119, 78,178, 12,161,126, 92,214, 0, 94,127,242, - 3,142,195,178,135,178,226,126, 78, 78, 78, 1,234,110, 91,213,114,194,138,134, 50,160,109,240,165,169,108,115,144, 63,190, 86, - 34, 90, 54, 62,149,107,204, 90,123,226,212,225, 75,175, 95,217,101,175, 62,112,224,212, 77,187,241,219,214,167,114, 91, 61,237, - 95,149, 93,162,175,167, 79,159,206,183,248, 74,111,222,188,145, 8,165,186,110,225,255,232, 7, 82,167, 56,238,248, 15,113,125, -163,144,148, 36, 11,132, 75, 19,209,250,184,194,131, 30,110,109, 23,197,250,167,109,241,115,125,170,251, 67,231,105,158,119, 26, - 30, 9, 56,243,225, 48,151,107,171, 59,230,248, 74, 47, 47, 16,205,203, 70,108,113,162, 33,229,173,194, 79,247,116,186,197,132, -105, 30, 45,242,210, 73,132, 85, 11, 33,201,156,237, 57,253,222, 80,151,107,195,219, 84,250, 10,247,254,250,245,235,137, 59, 23, -106, 94, 33, 71,248,177,110,233,110,179, 85,107,142, 33, 50, 85,228,251,242, 87,115,176,170, 76,214,167, 16, 62, 95, 42,174, 64, -192,141, 73,243,188,138, 73,214,187,217,158, 71, 56,142,108, 9,147,203,188, 52, 39, 39, 58,156, 63, 98, 83,146,172, 55, 23,191, -145, 44, 90, 82,136,104, 65, 46,122, 49, 53, 31,149,205,108, 18, 87,178,149,133,223, 17, 18,201, 10, 8, 8,144,218,103,239,222, -189,180, 96,193, 2,124, 76, 25, 76,182,190, 17,173,189, 84,165,146,102,139,150, 42,201, 66,231, 91,161, 66, 5,226,206,217, 96, -178, 53,194,195,227,122,235,186,117,239,241,179,234,207, 31,197,146, 37, 11, 36, 43,111,222,188,167,184,177,226, 26, 48, 61,125, -252,248,241,132, 15, 44,150, 41, 89,178, 64,178, 88, 38,226,130,218,105, 83, 2, 57,239, 37,142,201,170,177,113,227,198, 83,252, - 78,121,149, 39, 79,158,129,179,102,205,218,141,223, 76,180, 52,190,151,228,200,140,171, 82,130, 80,113, 74,206,201,130,147, 53, -167, 84,156, 44,153,200, 88,113,251, 88,178, 92,139,232,132, 65, 48,186, 66, 6,164, 34,176,245, 42, 29,215,233,253,134, 13, 27, -164,126, 12,241, 84, 76, 36,137, 61, 55, 24, 49, 72,131, 7, 15,150,244, 9, 31,197,115,230,204, 33,182,226,189,101,226, 42,231, - 93, 98,194,253,207,141, 85,171, 86, 17, 99, 71,142,142,142,129,124, 59,231,232,122,247,231,143,127,180,117, 21,109, 56,232,226, - 34,170,196, 10,239,115, 25, 4, 72, 39, 1, 83,202,208, 70,186, 52,157, 87,189,175,202,111, 84, 71,105,205,210,222,196,186, 88, -100, 93, 23,197,219, 55,151, 78,211,241, 18, 78,116, 60, 71, 18, 58,151, 43, 41, 93,205,147,148,238,228, 79, 70, 79,139, 91,211, -139, 30, 85,137, 99,183,240,194,148,187, 73, 13, 11,119,142,166, 4,146,131,151, 7,190,124, 57,112, 54, 82,159, 80, 16, 35,200, - 3, 65, 97,139, 6,221,187,119,143,216, 42, 65,125,250,244,249,138,227,176,106,128,165,227, 56, 30, 64, 54, 89,135,161, 67,102, - 5,208, 72,180, 64,152, 16,215,195, 95, 49, 97,176,178,193,170,131,114, 42,173,111, 3, 6, 12,248,170, 60,142,178, 66, 38,172, - 72,114,221,114,176,168,161,126, 32, 41,170,100, 79,121, 28, 22, 31, 85, 2,166,171,254, 40, 43,172, 99, 32,110,168, 51, 48, 3, - 41,234,219,183,239,215,207,159, 63, 75, 15,201,197,139, 23, 99,202, 46,183,140,112,233, 1,187, 51,103,206, 72,164, 10, 49, 78, -119,239,222,197,139, 76,194, 20,247, 66, 2, 78,120,217,171,184, 89,191, 43, 46,218, 7,121,208, 62,253,250,245,147,246, 32,125, - 40, 51,215, 83, 34, 90,206,206,126, 38,133,171,247,154,121,246, 78,232,199, 18,117,251, 46,168,220,124,216, 18,252,206, 83,177, - 35,155,254, 7,107,157, 19, 10,250,129,182, 12, 13, 13,149,200,180, 54,157,146,235, 58, 76,150, 44, 89, 32, 8, 32,147, 72,201, -146,133,196, 49, 90,145,165,179, 91,144,151, 99,146, 88,169, 98,110, 43,122,176,169, 37, 70,207,226, 69,242, 75, 55,238,225, 18, -208,252,140,190, 76,122,206,172,108,108,251,242,197,190,241,236,139, 31, 33,145, 44,154,151,149,142,246,243,161,222,165,173, 63, - 48,249, 56,199, 22, 40,142,105,208, 63,242, 75,146, 57,207,189, 48,100,206,168,239, 20,112,120,223, 46,137,160,195,197, 13,215, -252,172, 73, 35,169, 77, 49,187, 96, 38, 50,103,249, 62, 69,229,200, 84, 5,133, 63,156,246,241,139, 55, 74, 85, 38, 94,230,172, - 59, 39,226, 2,158, 68,178,166, 73, 36,107,203,149,126,233,207, 15,175, 96,249,230,206,144, 12,103,185,206,107,104,142,143, 49, -200, 86, 81,182,192,221,231,178, 21,142, 75,249,112,141, 68,178, 60,147, 61,121, 27,139,100,229, 36, 90,234, 75,180,186, 44,189, -152, 87,142,202,122,165, 48,148,108,129,100, 73, 31, 87,170, 36, 11,207, 62,222, 81,232, 48,249,153, 51,136,108,129,104,133,190, -223, 67, 85, 52,184, 14,171, 86,173, 42, 89,178, 64,100,230,207,159, 79, 76, 54,164,119, 30,187,133,228, 16, 45,192,144, 0,150, - 44,144,172,200,154, 53,105, 79,139, 22,239,155,215,172,121,143,143, 15,226,212,142,201, 54, 70,160,198,133,100,193,138, 51, 99, -194,132, 9, 82,217,134, 15, 31,142,242, 44,224, 52,146,101,226,221,174,149,100,161, 80,114,222, 75, 76, 46, 76,234,213,171, 55, -147,223, 45, 31, 57,252, 98, 65,155, 54,109,150,224, 55,187,194,166,114,136,194,119,239, 37, 57, 50,227,162, 75,108,185, 44,193, - 33, 27, 89,162, 73, 86, 26,222,167,227,148,158,219, 33, 3,123, 22, 92,216, 50,149,129,223,165,233, 88, 54, 58,251, 52, 92,190, -180, 76,150,116,234, 45, 91, 16, 47,224,217, 86,110, 32,208,136,157,228, 15, 87, 60,147,177,136, 22,244, 12, 86,194,180,105,211, - 30,151, 81,254, 86,221,187,119,167, 67,135, 14, 17, 92,144,156, 95, 57,213,140,101,201,146, 37, 37,175, 80, 52, 9,206,165, 73, - 86, 92, 44, 90, 32, 74,234,164, 75,157, 60,233, 59,207,101,145, 72,153,166,124, 50,142,201,128,133,179,232,242,139,130,104,189, - 56,176,153,252, 75, 56,208, 5,182, 98,221,200,155,140,238, 51,201,122, 86,200,132,222, 22,183,164,192, 22, 5,168,190,155,225, - 68, 11,150, 32, 93,137,125,226,178,136, 22,200,134,146, 80,129, 84,128,244,128,172, 12, 29, 58, 84, 34, 5, 32, 88,120, 41,225, - 94,176,118, 76,155, 54, 45, 12, 86, 26,182,166,104, 36, 90,108, 13, 11,128,245,133,221,141, 97,200,143,235,111,221,186, 37,197, -145, 33,241, 3,253, 21,214, 55,200,131, 11, 18, 9,132,139, 31, 6, 89,241, 79, 32, 84,176,168,225,235, 65,157,104, 65, 9, 97, - 69,210,102,109, 83,111, 77, 16, 28,228, 7,145,196,203, 15,150,155,107,215,174, 73,117,199,255, 40, 55, 72, 6, 72, 18,202,137, -186,201,209, 8,119,119,119,137,104,193,133, 10,121, 72,184, 7,187, 39, 36, 76, 85,143,131,112,169,196,173,125, 39, 30,101, 68, -123,224, 11,135, 95, 8,112, 15, 75, 9,229, 66,135,129, 11,126,132,104,161, 94,250,116, 9,231,241, 32,233,171, 59, 7,106, 7, -130, 0,178, 85, 48,138,221, 49, 17,140, 95,216,189,219,183,195,182,216,218,210,221,249,243,163, 24,223, 79,140,107, 40, 31, 15, -229, 56,176, 80,206, 19,246, 91,136,214,204, 44, 86, 76, 48, 70, 4,142,203,120,121,114, 93,199,207, 81, 1,151,217, 82, 82, 80, - 34, 89,180,188, 40,133,175,169, 74,117,114, 91, 68,220, 24,236,114,141,173, 60, 99,121,180, 96, 42,125,117, 39,200,156,237, 53, -236,213,216,140,151,187,215,204,245, 25, 35,131, 97, 29,133,165, 4,237,231,207,122, 86,202,199, 38,242,234, 0,231,235,156,111, -180, 28,153, 42,247,116,227,231, 35, 84, 93, 38,116,151,191,112, 49,252,155, 67,122,228,111, 52,213, 45,153, 68,246,152,100, 93, - 29,144,222,127,104, 69,219,208, 43, 11,154, 83,187, 66, 41, 66,175, 13,202,112,142,201,214, 90,154,157, 37,255, 15, 88,182,252, -216,114,253,113,222,188,121,196,237,139,143, 72, 95,249,165,251,127,206, 18, 25, 19,109, 63, 54,189,105, 84,140, 37,107,126,118, -110,167,194, 68,171,202, 16,173,175, 78,180,181, 49,157,159, 92,133,124, 93,147,196, 26, 20,162,235, 94, 76, 88,175,194, 10,161, -137,100,225,189,132,119, 17, 58, 76,238,244, 85, 7,251,104, 21, 57,126,220, 88, 42, 81, 52, 59,133,190,219, 67, 69,125, 51, 19, -255,255, 78,153, 25,177, 53, 74,146, 5, 87, 47, 72, 23,222, 3,220, 81, 18, 70,149,233,193,164, 52, 63,251,203,184,115, 61,205, - 88,238,104,215,160,193, 61,144, 44,144,173,225,153, 50,221,136,118, 35, 26, 58,245, 67, 93,132, 43,148, 40, 81, 34, 12, 3,144, -224, 46,133, 37, 59,154,100,205,229,242,200,150, 39,231,189,100, 40,209,146, 35, 51, 46,122,196,125,156,123,231,206,157,155,115, - 93,189,249,245,235,200, 41, 35,127, 12,250,240, 7,107,214,201,147, 39,251,212,175, 95, 63, 11,147, 26, 60, 67, 25, 27, 53,106, -228,192,239,111, 12, 0,203,160,235, 94,236,206,227,193,153,158,220,213,125,139,151,197, 7, 16, 62,124, 84, 19,250, 83, 24, 21, -208,230, 28,230,241,146,229,185,201, 40,255,120, 60, 55,208, 65,206,187,149, 19,230,223,147,226, 88, 89, 39, 47,224, 62,232, 83, -163, 13, 29, 54,234,242,244,196,104,233,138,195,210,122, 14,247,136, 11,209, 82, 94,243,237,242,216, 36, 76, 77,158,178, 26,250, -221,135,218, 0,108,224,170, 56,112,106,116, 23,122,216,165, 50,221,202,151,140, 30, 21, 48,161,151,133, 77,232,125,145,228,244, -185,154, 51,157, 42,109, 79, 77,227,224, 58,196,139, 66, 83, 66,227,150, 47, 95, 62, 84,174,235, 16,228, 65,149, 80,173, 92,185, - 50,138, 95,234, 47, 89,233,223,227, 56, 44, 30,112,115,113, 76, 84, 20,127,233, 4, 48, 41,120, 11, 43, 21,155, 65, 53, 18, 45, - 16, 38, 40, 23, 95,255,129,127,191, 98,194, 23, 5,203, 13,200, 17, 44, 59,144, 11,249,252,229, 8,247,146,228, 18, 67, 7,194, -164, 65, 22,137,225,107,185,143,126, 66,120, 41,170, 90,213,112, 28,132, 0, 68, 81,155,181, 77,189,141,224,178, 67, 89, 80,103, - 92, 11,185, 40,171,122, 25, 81, 62,224, 32,183,140,236, 50,149,136, 22,234, 12,242,199,196, 72,194,148, 49,147, 92,135,202,227, -107,214,172,145,142,235,114, 29, 98,176, 2,252,255, 48, 63,215,173, 91, 87,114, 31, 50,217,149,172, 36, 76, 58,165, 14,198,214, -187,114,213,184,186, 14,161, 39,208, 23,232,141, 54,157,194,113, 60, 44,250, 94, 18,252, 53,119,152, 7,103, 68,113,138,228, 47, -215,112, 38, 25,161,108,121,252, 4,146,181,209,220,156,238, 47, 92, 24,197, 29,217, 39, 38,238,161,220,246,159,217,138,240,133, - 95, 30,135,245,201, 53,246,121, 38, 58,153,153, 76, 28, 93,223,220,238,201,141, 85,221,163,232,226, 92, 38, 89, 62, 68,203,216, -208,132, 14,124, 71, 11, 90,218,173, 40,245, 44,157,234, 45,187, 23, 79,208,220,108,217,244,149,129,221,134,158,112,191, 45,107, -230,248,116,203,218, 37, 81, 32,233,187,119,239,150,172,196,176,148,128, 92,143, 29,212,141,186,148,178,123,199, 86,175,227, 52, -195, 75,175, 76,229, 61,217, 82, 56,151,221,187,225,248, 80,217,181,107, 87,140, 76,124,200,176,229, 57,130, 59,207,149,250,202, -167, 60,255, 45, 38,203,219,143, 45,107, 91,110, 12,204,224, 63,188,146, 77,104,232,245,109, 68, 23,231,209,149, 1, 25,168, 65, -206, 20, 95, 46,244, 77,127, 94, 10,220,159,225, 93, 32, 14,100,203, 23, 36, 11,101,197,243,142, 47,121,214, 49,144,193, 34,114, -203,168,204,151,207, 78,225, 92,210, 61,209,139,139,253, 93,190,185,117, 65,134, 87,150,230, 54,170, 70,180,165, 33, 5,172,104, - 72,229,179,152,191,207,239, 20,123,196,180,158,251,228, 96,114,250, 26,229, 2, 9, 86, 90,178,148, 36, 11,207, 21,191, 19,223, -176,140, 44,250,202, 59,113,194,120,255, 70,245,202,208,147,123,219,152,104,237,166,107,254,211,168, 90,197,236, 84,212,175, 8, - 58, 86, 66,112, 57,136, 12,143,182,163, 58,117,234, 80,203,150, 45,165,248, 44, 30,209,171,239, 89, 42,205,131,132,252,249, 57, -242,231,215,133, 63,135, 53, 72, 9,150, 44,144, 44, 29,163, 17,117, 21,185, 46,220, 90, 24,149,141, 13,161, 18, 42, 36,107, 54, - 95, 40,155,100,225, 38,114,222, 75,236, 34,172,106,136,235, 80,142, 76,125,109,162,229,124, 2,126, 87, 22, 98,252, 27,243, 59, -158, 21,136,242,243,251,169, 0,199, 64,229,229, 54,202,199,131, 19,138,240, 71,108, 17, 62,159,131, 93,130,165,248,227, 32,175, - 28, 60,248,221,157,151,221,163,239,222,190,125, 75,176,228,227,227, 31,239,105, 16, 37,144, 43,120, 69, 64,138, 56, 60,229, 13, -135, 85,168,143,182,212, 86,149, 86,252,161, 47,189, 51,176,175, 85,171, 22,249,250,250,146,143,143, 79, 40, 19,215, 47, 76, 4, -165,182,195,160, 42,182, 24, 99, 82, 83,217, 27,215, 91,235,200, 66, 93,231,112, 3,153,215,106, 27, 89,104,200,168, 67,229,242, - 59,202,189,188,250, 33, 24,190,117, 14,171, 79, 47, 38,247,160,128,166,249,232,117,113, 43, 10, 42, 97, 65, 95,171,166,163,247, - 85,156,232,191,140, 9, 62,198, 37, 24, 30,150, 3,213, 4,210,194,238,186,112, 86, 18,131,130,225, 65,140,240,224,129,240,240, - 48,210,143,172,144,248,146,179, 99, 51,167,116, 28,102,101,254, 26,251,200,249, 46,241,113, 7, 38, 91, 79,112, 92, 27,209, 2, - 25,129, 59, 46,154,148, 56, 51, 49,187,198,174,184, 16,229,212, 11,209,199,237,112, 31, 54,145,178,113,236,163,164,144,184,159, - 28, 68,249,122,137, 80, 65,129,163, 77,220,210,101, 56, 14,247, 23, 94,240,114,137, 86,244,253, 80, 22,255,174, 93,187, 74,101, -196, 40, 78,213, 50,246,236,217,243, 35, 20, 27,228, 82,110, 25, 17,131, 6,140,224,122,228, 47,215, 24, 76,213,142,135,224,190, - 40,186,174,122,243, 3,250, 28, 95, 55,240,247,195,148,140,224, 72,116, 18,152,208, 46, 58,158, 68,225, 89,164,217, 0, 76,235, -240, 35,193,240,208, 27,232, 15,244, 72, 93,183,240, 63,158, 53,125,237,195,132,113, 48,199,225,125,101,172,162,248, 69,240,153, -221,156,161,108,205, 9,133, 37, 11, 36, 11,150,173,183,129,129, 97, 76, 52, 67,185,221,191,176, 94, 4,241,203, 98,176, 62,185, -198, 62,207, 1,235,185, 17,176, 62,162,162,229,135,135,107, 58,179,133,164, 44,147, 44,191,111, 29, 56,147, 44, 58,216,139, 14, - 78,106, 68, 69, 50,154,132,127,155,217,221,171,180,190, 50, 40,101,246, 40,231, 24,180,115,203, 58,201,244,143,152, 68,184,142, - 97,209,132, 85,120,253,138,133,228,235,110,250, 77,230,108, 47,185,211,177, 40,152,104,189,132, 21, 19, 50,145,148, 50, 97,125, -129, 62, 48,145,137,177,162,232, 45,231, 36, 14,124,159,149,121,221,205,193, 25,206, 13,175, 24, 77,178,174, 44, 37,154,203,158, - 21,142,127, 58, 63,186, 16,187,227,146,135,157,233,149,254,130, 20,179, 53,203,221,144,249,123, 10,131,100,129,100, 34,192, 92, - 73, 50,151, 47, 95,142,192,125,144,173,162,250,202,167,126, 62,134,108, 13, 97, 99,196, 74, 30,252,180,174, 42,147,172, 6,244, -106, 69, 3,170,224,147,242,157,129, 36, 75, 41, 94, 34, 91, 40, 23, 58, 52, 37,201,130, 75, 94, 46,201,130,160,138,229, 75,208, -179, 7,187,104,253,170,145, 84,164,160, 7, 45,153,223,145,252,143, 15,165,106,149,203, 74,150, 49, 88,194,225,238, 7,201, 50, -164,222,176,100,129,100,241,243,227, 95,174, 92, 57,127,254,200,245,231,103,198,159, 49,220, 1, 75,150,158,169, 31, 52,222, 10, -150, 44,144, 44,132, 30,176, 76,105, 48, 17, 62,248, 48,181, 15, 95, 96, 16,201,194, 13,228,188,151, 56, 24,126, 0,166,117,144, - 27, 12,175, 71,230, 29, 67, 48,212,144, 23,117,116,207,152, 49, 99, 53, 38, 43,149,217,146, 85,137,159,157,106,252,110,173,204, - 4,171, 20, 19,166, 98,172, 19,229, 57,143, 28,171, 83,140,120,126,111,230,225,126,232, 26,203, 67, 72, 75,164,196, 98,121,227, -143,140,136, 81,163, 70, 61, 98,151,228,101,182,244,103, 55,160,236, 73,249,157,120,140,251, 35,137,172,225,189,129,118,194,135, - 62,218, 15,125, 17, 98,158,177,113, 60, 93, 20,154,194, 0,217,127,122,214,184, 91,180, 80,179, 6,110,138,193,173,125, 82,134, -158,104,152,159, 94,182, 44, 76, 1,117,188,232,152, 95, 42,137,100, 53,142,227,244, 14, 32, 51,202, 4, 83, 56,147,128,143,252, -146, 51,120,122, 7,144, 7, 16, 2, 14,236,123,203, 47,153,152,233, 29, 16,188, 13, 18,196, 95, 96,111,153,100, 77,230,106, 72, -163, 49,244, 17, 45,200, 83, 35, 37, 73,216,106, 49,139, 71, 94,188,133,101, 4,114,163, 91, 59, 33,238,199,102,116,245,227, 58, -149,129,229, 63,129,149, 8, 73,213,125,137,227, 32, 90, 72,170, 4, 76,166,102,161, 44,227, 52,148, 37, 78,101,100,255,189, 68, - 54,121, 68, 74, 44, 76,113, 28,164, 50,250,184,172,233, 29,184, 19,109,197, 15,243,115, 36,126, 0, 71, 96,164, 33, 91,194,136, - 31,108,229,144,116, 88,180, 10,184, 23,108,210,215,214,187, 74,183, 31,153,222, 1,250, 3, 61,130, 62,169,234, 23,126, 51,142, -114, 58,139,148, 92,222,167,176,106,113, 91,135,131,100,177,123, 43,148,173,140,161,176,100,189,121,245, 42,140,143,127, 98, 66, -251,133, 45,104, 95,248,197,250, 91,166,119,160,185, 30,238,112,155,221,229,160,245, 78, 69, 76, 63, 95, 30,206, 46, 41,137,100, - 53,231, 96,197,158,116,102, 78, 75, 42,232, 98, 18,121,188, 59, 7,196,207,246,220, 40,103, 74, 6,105,141,196, 89,153,119,220, - 30,226,114,213, 99,156,189, 0, 0,255,244, 73, 68, 65, 84,173,177,175,195,231,249, 51, 39, 75,113,120,176,176,226,163, 96,199, -166, 53, 84,208,205,244,155, 76,190,183, 28,153, 42,186, 91,136,219, 62, 4,174, 30,196, 38, 42,101,242,192, 21,116,148,161,156, - 79,214,168,101, 41,142,108,150,119,213,136,153,158, 71,251,149, 50, 15,126,179,173, 39,209,229,197,223, 72,214, 34,158, 30,103, - 13,127,120,110,109, 66,167, 38,215,164, 66, 46, 73,195,165, 0,249, 57,222,178,131,237,185, 67, 9,130,238,160, 99,192, 96, 21, -184, 54, 97,117,195,135, 17, 2,206,249, 60, 98, 78,100,143,226, 84,214, 95, 34, 91,153,146,190,184,200, 36,144, 54,215,163, 64, - 38, 89, 21,125, 82,190,141, 35,201,138, 33, 91,236, 82,122,141,114,129, 20,129, 20, 99,170, 7, 62,169,215,146,165, 20, 80,177, - 28,199,138,125,189, 72,197,138,248,112,176,179, 15,249, 21,202, 68,207,238, 78,165,188,185, 50, 72,177, 88,120,223,193,178, 37, -243, 29, 20,147, 13,238, 66, 88,178,216,210,140, 15,177, 93,252,191, 63,187,248,149, 65,239,186,166,126,208,122, 43,184, 11,209, - 57,179, 76,148,231, 57,226,125, 16, 54, 16, 29,239, 99,104, 17, 21,114,222, 75,108,209, 42, 80,188,120,241,190,188,239, 38,103, -122, 7, 61, 50,101,185,114,101, 84, 4,253, 24, 62, 30,224,146,203, 29,157,120,234, 50,233,152,236, 17,135,106,247,193,117, 77, - 88,191,231,115, 95,119,144, 63,128, 15,240,212, 43,112,197, 54,228, 36,103,221, 84,245, 98,227,154, 86,156,246,112,191,116,135, - 45, 89,159,202,148, 41, 35, 17,100, 88, 37, 65,180,208, 7,192,226,149, 49,117,234,136,201, 10,197,107, 54, 73, 54,149, 81,247, -191, 63, 11, 38, 44,101, 23,225, 97,158, 55, 43, 24,193,239,205, 50, 38,248,161, 9, 75, 1, 54,190, 28,121, 94,150,143,236,178, -137,243,132,165,108, 85, 57, 7,183,155,186,251, 74,229,120,172, 9, 75, 57,239, 9,144, 37, 86, 0,141, 19,150,226, 58,156,199, - 94,181, 85, 89,241,202,243,177,103,234,199,163,221,119, 79,212,143,243,181, 26, 39,136, 3,161,194,139, 28, 22, 56, 38, 46, 49, -238, 75, 37, 1,195,151,180,182,248, 49,109, 50,149,229,212, 86, 22, 29,101,196,165,223,149, 83, 6,166, 63, 52, 97, 41, 91,236, - 94, 33,136,149, 71,167,196,158,176, 52,218,178,245,163, 19,150, 66,159,160, 87,208, 47,232, 25, 18,215, 83, 83,135,161,169,141, -202,230,206,157,251, 13, 70, 27,242, 23, 88, 4,155,234,191,240, 11,253, 19,199,129,132,113,155,125,102, 18,246,149,191,212,190, -176,142, 32, 8, 94,211, 48,239,159, 62, 49,160,228, 62,155,227, 85,136, 45, 54,219,111, 12,114,190,222, 36,159,217, 23,255, 9, -229, 37,146,117,106, 86,115, 42,224,146,236, 27, 33,154,147,121, 39, 45,244, 40,130,152, 38, 13,111,168, 88,229,148,100, 34,192, -158,175,185, 54,208,249,122,181, 92,182, 95, 87, 46,158, 35,197,210,109, 89,183,130,242,187, 70,147, 44,204, 16,143, 0,123, 25, - 50,213,238, 41,145, 45, 88, 54, 33, 19, 35,146,100,146,172,152,114,170, 18,173, 62, 37,205,223, 55,207,151,252, 75,189, 28,201, -190, 86,201,146, 52,172,180,123,210,136,130,206,137, 35,179,219, 39,140,242,178, 85, 80,105,207, 20, 95,162, 71, 34,106,178,188, -105,108, 35,182,188, 97,186, 9,165,174,124,183,231,242,163,205,181, 17, 45,157,237, 46,145, 45, 15,147, 23,251,135, 22,167, 74, -217, 82,190,145, 73,178,244,233, 82, 14,126, 86, 95,195, 29,143, 81,136, 92, 54, 57, 36, 43, 70,102,229,138,165,233,209,221, 29, -180,113,205, 40, 38, 91, 94,180,108, 65, 39, 58,125,100, 16, 85, 40, 87,140, 64,100, 16,114,192, 68, 67, 14,209,138, 85, 78,165, - 69,139, 93,207,254, 32, 89,203,150, 45,243,103, 23, 39, 44, 90,203,162,117,226, 59,178,133, 73, 78,213,244, 37,150, 76,165, 69, - 11,238,108,148,141,101, 74,110, 83,150, 9, 50, 39,119,211,133,167,135,182,247,146,210,178, 21,151, 9, 75, 85,100, 26, 98,209, -210,215,238,114,235,171,154,239,119,203,196, 71,172, 63, 66, 60, 16,202,227, 99,103, 71, 35, 19, 37,162,167, 73,147,210,115, 78, -179, 20,138,183,113,169,212, 31,118,141,186,219,240,199, 44, 92, 6, 84, 78, 83,227, 74,174, 54,118,187,125,101, 43, 71, 40, 7, -229,253, 83, 75,240,240,139,241, 4, 92,123, 72,170,100, 79,245,120,180,251, 83, 19,204,191,251, 97,145,219,244,250,202,233,193, -237,254,136,191,160, 98, 47,193,195,150,173,140,133, 26,247,183,203, 82,185,156, 62, 98,160,167, 32, 44, 62,105, 31,232, 23,244, - 12,238, 84, 3,136, 22, 68,151,226, 23,248,179, 37, 75,150,124, 98, 87,110, 56,199, 48, 68,176,117, 39,156, 45, 28, 95, 57, 88, - 52, 24,231,144, 71, 75, 25,244,213, 93, 46,134, 58, 95,146,209, 1,225, 18,217,186,220,223,249, 70, 37, 31,211,176,185, 93, 75, - 83,129, 12,106, 36, 75,251,236,240,223,149, 83,146, 25, 77,182, 46,244, 75,127,163,152,135,121,196,168,254, 93,152,100,165,136, -182,142, 69,147, 44, 3,100,170,147, 45,198, 46, 24,115,244,200, 36, 89,223,125, 8,208,124,207,244, 76, 6,151,125, 35, 81,122, -210, 44,158,222, 98,186,103,250, 31,212, 37,185,237,165,183,221, 65,182, 74,120,152, 92,149, 73,178,190,171,187,150,130,228, 96, - 11,196,117,153, 36, 43,150,204,233,211,167, 81,131, 58,165,232,238,245, 13, 20,242,102, 7,157, 63, 57,145,170, 87,206,201, 94, - 0, 30,180,201,177, 58,136,203, 99, 79,129,193, 68,139,111, 82,186,117,235,214,146, 21,139,173,161, 18,201,226, 64,122, 16, 34, - 85, 23,118, 12,217,194,114, 61, 88,182, 71, 23,209,226,115,117, 89,166,100,197,130,133, 21, 36, 11,193,249, 56, 46,183,129, 56, -159,190, 54,210,248, 94,130,101,139, 63,220,250,243, 4,166,113,121, 47,105,148,169,167,204,250,202,105, 64,149, 99,178,254,110, -153,102, 60,184, 2,171,109,192,178, 21, 57, 69,161,120, 63, 55, 65,130, 0,164, 57, 10, 69,160,176,104,197,165, 73,255,127,205, -119,141,203,157,159,180,168, 52, 91, 51,196,162,210,134, 99,251,187, 31, 22,185, 37,254, 83,202,105, 31,173,103,152,134, 65, 83, - 12,157,174,114, 90,177, 5, 99, 40,199, 61, 28,103,210,246, 6,137, 59,180,227,252, 85, 54,148, 65,176,210, 1,196, 47,171,187, - 42,217, 58,215, 39,253,205,106,217,205, 62,199,178,100,197,101, 9, 30, 21,178,117,186,119,250,155, 85,115, 88,125,147,169,180, -100,197, 65,166, 58,217, 98,139, 35,166, 77,144,229, 46, 84,239, 28, 37,203,219, 66,119, 23,105,178,214,217,158,181,181,166, 89, - 30, 21,224,222,164,193, 94,154,214, 81,253,101,109, 36,247,129,249, 93,164,125,230,204, 25, 84,181, 10, 79, 51, 81, 50, 47,101, -245,241,224,201, 42,199, 74,113, 80,112,239, 34, 54, 11,129,240, 50,234,160, 9,207,210,252,236, 45,195, 28, 89,209,150, 44, 77, -113,130, 32, 91,197,177, 0, 53, 22,162,214, 67,180,112,186, 46,203,132, 11,242,107,180, 37,203, 16,146, 37,151,184,202,168,110, -172, 44, 66,151,100, 34,198,211,241, 76,226,137, 76, 17, 83, 87, 79,230, 37, 34,155, 76, 4,132, 18,202, 4, 74,102, 54,129,167, - 76,160,100,102,147,139,167,114,246,101, 57, 98,229,202,148, 35, 75,153, 71,171,204,255,147, 45,204, 31,133, 32,245,204,155, 36, -119,161,110, 66,164,179,211,137,177,108, 73,241, 93,144,233,185, 77,114, 23,254,128, 76, 67, 42, 43,163,195,133,127, 47, 1, 13, - 86, 36,212,154,116, 7, 72,255,210, 54, 50,118,221,127, 64,158,206,118,231, 57, 2,137,173, 54,196,179,160, 19,187,207, 9,255, -203,188,151,192, 83, 38, 80, 50,179,253,203,120,202,132, 72,100, 83, 69,224, 95, 86, 24, 81,119,227, 62, 11, 2, 79, 45,120, 74, - 86, 30,105,141, 66,158,246, 0,203,209,104,142,159, 82,191, 90, 39,158, 49, 50,103,123,151,164, 69,198,145, 25, 71,117, 16,237, - 30, 71,224,180, 92, 38,240, 20,120, 26, 11,129,159,161, 75,198, 42,219,239,144,163, 30,147,245, 91, 99,180,126, 20,128,159,209, -184, 66,230,143,182, 74,236,235, 5,158, 2, 79, 99, 33, 32,116,201, 88, 72,126,147, 35,240, 20,120, 26, 11,129,159,161, 75,198, - 42,219,239,144,163, 36, 86,234,251,152, 7, 15,128,169, 39, 67, 10,170,233,122,125,199,244,201,215,119,125, 92,202,252, 55,200, -196,232,156, 58,156,218,112,194,138,247,189,162,147, 62, 60, 17,200,105,104,253,245,201, 52, 84,158,156, 7, 83,200, 52,172,157, - 68, 27,105, 71, 64,232,146,208, 37,185, 58, 32,158,163, 95,251, 28, 41,239,166,173,125,244,181,199,159,120,254,143, 26,117,248, -163, 0,201,233,172, 13,189, 71,124,145, 41,123,146, 72, 3, 0,248, 61,117, 39, 69,118, 14,180,153, 28,157,228, 76,136,247,123, -202,105, 0,144,209, 89, 69, 57, 13,199, 76,215, 21, 2, 79,129,167,177, 16, 16,186,100, 44, 36,191,201,249, 25,120, 26,183,132, -255,136,180,159,209, 16,255,178,204,170, 63, 65,111,126, 13,158, 68,246,188, 14, 66,190,232,148, 66,241, 73, 81,159, 73,214,183, -191, 32, 69, 67, 94,164, 56, 5, 39,158,117, 82, 74, 88, 28, 85,125,251, 53,229,252,113,128, 69, 57,127, 28, 67, 85, 9, 2, 79, -129,167,177, 16, 16,186,100, 44, 36, 5,209,210,132,100,206,232,131,232,191, 96,221,210,212,143, 25,183, 5,228,124,221,167, 72, -157,201, 62,133,157,103, 57, 83, 91,143,238, 72,248,141, 99,122, 74, 34,235, 97, 49,119,240, 72,101,230,144,245, 0,246, 50,106, -166, 87,166,143,135, 69,245, 82,133,211,109,202,226,105, 94, 69,134,188, 88,108,223,210,210,217, 50,173,107,142, 22, 86,233,178, - 76,179,115,205,217,221,218,218, 77, 90,100, 51, 14, 91,115, 93,215,240,154,160, 9,114,182,244, 79,152,191,203,201,196, 21, 7, -251, 39,241, 27,124, 40, 49,254,175, 89,115,173,174, 37, 42, 52,214, 29,237, 96,106,155,169,126, 26,183,220,147,210,103,241, 59, -153,185, 96,181,183, 30, 5,170,189,181,113,201,227,159, 50, 93,142, 73, 56,167,163,173,190,151, 73,212, 27, 11, 78, 73,169, 88, -177,189,138,206,138, 51, 49, 68,171,139,226,100,177, 98,138,125,209,103,145,163,183,129, 68, 11,211, 45,192, 42,150,129,215,212, -178, 53, 0, 87,189,237,110,128, 44,101, 86, 33, 51, 14,160,233,184, 68,224, 41,240, 52, 22, 2, 66,151,140,133,164, 32, 90,154, -144,212, 25,163,165, 17,122,103,239,194,103, 61,115,151,126,131,148, 41, 87,169, 55, 25,115,150,122,147,214, 45,247,110,101,102, -155, 12, 57,119,219,103, 46,246,198,206,179,216, 27, 91,143,162,111, 82,185, 23,125, 99,225,156,239,172,154, 48,173,138,109,102, -235, 81,173,114,253,246, 43,230,175,222,125,225,220,141,151, 33, 72,248,141, 99, 56,247,163, 47, 94, 51,135,236, 51,139, 86,249, - 47,204,204, 33,219, 12, 25,186,165,247, 1, 44, 86,200,241, 48,189,154, 66,197, 11,165,219, 39, 67, 94, 44,162, 5,146,213,166, - 75,191, 89, 15, 30, 62,157, 83,172,122,155,153,102,105, 60,102,155,219,103, 25,101,102,231,225,167, 80, 12, 54,100,137, 3,245, - 73,253,164,162,128, 96,185,117,216,153,200, 50,125,126,155,164,102,169, 59, 36, 73, 97,117, 34,169,169,245,137,228,214,233, 58, -167,207, 83, 47,109,137, 94,254,154,102, 6,215, 74, 12, 44,236,189, 75,186,231, 42, 27, 60,112,230,222,240, 49, 43,175,208,152, - 53,183, 56,221,166,142,163, 55,146, 87,214,220, 52,111,243, 69,106, 60,120, 83,184,131,119,137, 96, 83,206, 43,139, 20, 61,124, - 56, 38,134,104,221,191,159,151, 73,150, 9, 39,187,232,100,242,236,153,130, 23,244,252,150,227,193, 3,197, 88, 89, 50, 57, 83, -153,242,181, 75,121,122,101, 59,157,210,194,170,183,101, 42,155,158,142, 78, 46, 1,169, 83,167,185,203,167,210,197,232,170,141, -141, 25,255, 22,243, 41,197, 6, 85,175,206,203,212,115,213,108, 66,102, 28, 64,251,209,119,157,129,183, 20,109,100, 32, 96,122, -178, 11, 60,141,139,103,124,150,166,110,201,210, 63,234, 16, 4,235,195,199, 48, 90,184,235,158,148,158, 6,134, 82,195,142,163, - 49,175,202, 77,164,202,205, 7,211,229,251,239,104,230,230,155, 52, 99,211, 13, 58,117, 61,144,172, 50,250, 97,213,120,189, 47, -222,228,118, 94,121,154,118, 24,180,225,250,227,224,136, 77,251,252,239,118,233, 63, 97, 7, 18,126,227, 24,206, 33,143, 22,196, -245, 42,118,114, 7, 55,199,220,197,106, 4,191,122,247, 41, 34,115,158,114,239,241,191,220,135,133,103,101,239,196,203,171, 12, - 66,226,217,219, 99, 82,161, 60, 14,183, 65,180,138,228,119, 56, 99,237,224, 25,108,147, 33,199,251,116,158,249,142, 89, 56,122, -105,179, 50,197,148,211,202, 41,203,212,219,119,238,205, 89,191,239,226,156,230,131, 87,205,185,114,231,217,156, 75, 55, 31,206, - 97, 34, 56,227, 27,217,146,189,245, 84,207,233,232,152, 63, 81,162,100,102,101, 19,155,152,173,113, 43,214, 49,108,229,161,103, -116,247,121, 8, 93,125, 20, 68, 99,214,223, 39,231,130, 77,194, 77, 82,218, 97,114, 88,204,100,174,137,212,125,135,167,139, 79, -145, 87, 51, 54,127, 35, 87,202,164, 36, 89, 39, 47, 61,164, 25, 91,239, 75,199,123,207,187, 64, 86,233,115, 61,215, 78,138,136, - 23, 56,165, 38, 10,197,245,110,138, 82, 77,206, 43, 2, 2,134, 51,149,234,173,120,253, 26, 11, 81, 59,115,194, 36,134, 72,206, -175, 95, 43,236, 96,201, 10, 8, 80, 12,111, 82, 74,225,127,129,131,252, 89,217,154,112, 82, 46,146,170,177,221,203,148,171,126, -126,206,178,125,225,155, 78,190,162, 33, 11,206, 83,153,170,205, 40, 71,190, 98, 95,121,114,188,131,206, 30, 57, 15,120,231, 43, -251,193, 33,189,251, 7, 11, 43,155,243,150,150,214, 32, 95,170, 75,168,232,213, 37,217, 45,243,255,140, 66,102, 28, 64, 19,100, - 67, 35, 2, 66,151,132, 46, 25, 11,129,248,162, 75,198,170,111,252,144, 3,162, 21,201,107,196,245,152,126, 76, 74,155,142,220, -163,179,215, 95, 82,217,186, 93,169, 88,205,206,180,229,216,125, 90,184,237, 26,117,152,120,144,218, 79, 56, 64, 7,252, 31,203, - 38, 90,102,118,158,237,142, 93,122,252,118,194,220,117, 39, 82,216,122,180, 50, 77,227,145, 5, 9,191, 71,207, 88,233,127,208, -255, 94,136,153, 93,230,193,113, 37, 90,230,142, 57, 54, 29, 62,123,251,171,255,237,183, 33,115,214, 30,125,107,230,152,125,189, - 92,162, 5,130,197,203, 4,140,103,211, 74,172, 52,122,120,175,185, 37, 11,165,219,234,100,159, 98,240,217,115,254,244,233,243, - 23,186,125,247, 33,253,215,190,215, 71,182,244,157, 48,181,241, 2,121, 80,221, 98, 20, 27, 22,173,122,205,187,205,170,211, 99, -142, 68,178, 88,246,156,167, 1,239,230, 12,158,189,117, 14, 44, 91, 6,104, 4, 70, 24,170,110, 53,109,236, 93, 70,142, 89,125, -237,236,157,167,239,233,222,243, 96,186,120,247, 45,157,184,254,154,142, 94,125, 77,167,110,190,165, 43, 15,130,232,208,149, 55, - 84,124,224, 5, 74,110,233,240,146, 47,174,174,173,156,202,227, 46, 62,190, 17, 91, 79,189,212, 73,178, 64,180, 6, 46, 60, 71, -214,233,115,126,213, 65,180,152,100, 49,125,146,146,191, 52, 27, 48,147,215,154, 89,179,101,127, 86,187,126,211,231,221, 6,140, - 15,105,217,109,100, 72,129, 82,181,159,167, 73,239,249, 44,185,153,117, 77,228,185,174, 80,212,138,190, 8, 23,178, 12,105,211, -248,162,200,224,234,177, 63, 44, 34,146, 78,223,124, 79,227,184, 76, 61,198,111,163, 22, 61,103, 70,245,155,115,236, 83,151,113, -219,104,196,178,171, 84,175,245, 0, 42, 81,182, 54, 21, 44, 86,249, 92,165,166, 99,204, 89,150,210,186, 21, 95, 94, 62,162,156, - 6, 60, 36, 50,178, 10, 60,101,128,100, 64, 22,129,167, 1, 96,201,200,250, 47,227, 41, 3,158, 63, 54,139,238, 81,135,219,182, -109,251,110, 6, 96, 16,173,176,240, 72,170,208,117,141,148,122,207, 58, 73,199,175,189,161,219, 79, 67,232,226,189,247,180,112, -207, 67,170,208,123, 39,149,108,191,130, 74,180, 91, 78,171,247, 94,211, 68,180, 98, 33, 50,126, 84,138,156,147, 38, 89,140,171, - 94, 59,247,250, 27, 79, 66,168,101,135,138,123, 70,143,182,156,138,227,150,150,217, 44,109, 93,115, 45,205, 81,164,242, 23,156, - 75,155, 49,223, 39, 83,199,236, 11,112,220, 16, 88, 83,164,201, 92,185, 65,235,126,193,183,159, 6,125,206,213,102,207,153, 83, -215,223, 4,228, 44, 86, 39, 32, 69,154, 76,149,229,200,129, 21, 11, 36,139, 23,119, 30,255,236,217,179,241,188,174,214,120, 94, -243,107,124,219,150,181,134, 22, 47,232,184,203,193,222,100,232,179,231,175, 40, 44,156, 40, 60,130, 40, 44, 34,138, 22, 44,223, - 20,145, 58, 67,142,211, 44, 95, 99, 44, 20, 98,180, 44, 28,188,251,165,116,200, 54, 19, 68, 43,224,109,240,156,197, 91, 79,207, -169,216,126,186,161, 68, 75,189, 10, 61,191,134, 69,244, 26, 49,114,244,249, 6,141,154, 61, 94,180,122,231,131, 67,231, 95,208, -174,179,207, 57,189,160, 67,151, 2,233,252,221,247,244, 48, 32,148,130, 63, 69,208,222, 11,175, 41, 65,130, 4, 88, 2, 65,231, -102,239,158,255,235,251,160, 16,122,250,250, 51,109, 59,249,156,170, 53,238, 78,115,215, 29,167, 41, 27,110,210,176,197,254, 52, -124,193,113, 26, 53,127, 63,181,233, 63,155, 82, 58,102,251,162, 93, 24,172, 89, 74,162, 69,210,136, 73,103,103,231, 11,247,159, - 4,208,117,182,184,237,191,248,138,150, 31,120, 76,227,215,223,166,246,147,121,129, 88, 43,123, 54,100, 73,171,250,150,209, 64, -180,212,111, 99,194, 7, 48,101,197,174,144,208,176,200, 67,151,223,208,238,211,175,168,198,127, 3,104,232,138, 27,161, 99, 86, -195, 26,199, 86,185,213,183,104,212,170, 27, 84,165,118, 91,170, 90,183, 3,213,239, 60,197,151,175,209,229, 74,213, 7,143, 56, - 47, 16, 16, 8, 8, 4, 4, 2, 63, 1, 1, 77, 92,228, 39,220,230,247,136,212, 70,180,174,223, 15, 36,215,202,147,105,240,252, - 19,180, 96,247, 35,154,176,254, 14, 13, 88,124,157,218, 79,191, 72,245, 71,159,161,114,253,143,147,119,195, 21,148,174,220,120, - 26, 50,247, 16, 89,185,125,231, 58,140, 85, 33,144, 44, 38, 49, 52,116,152,251,243, 25,179,155, 72,123,252,143,227,108, 69,217, - 57,113,214,138, 40,191,114,245,232,226,157, 55, 84,184, 76, 29,234, 51,122, 97,148,149, 75,190,157,114, 81, 73,233,232,101,109, -157, 33,215,235, 71, 1, 65, 97,173,167,156,189,229,209,108,207,129,238,243,174, 29, 95,185,247,198,117, 38, 4, 47,112, 94,159, - 44, 37,209,122,242,228,137, 68,178,174, 95,191, 62,254,242,229,203,227, 43,149,241,186, 12,215,161,111, 62,135,179,111,222, 5, -211, 87, 38, 90,111,130,195,233, 38,147, 66, 16,153, 50, 53, 90,132,154,219,107,117, 35, 42,204,237,179,142, 57,114,246,250,156, -126,211,183,206, 25,187,120,255,156, 42,157,103,206,177,245, 46, 23,203,117,104,110,239,238,193,249, 30,153, 59,100, 11,136, 73, -142, 62,231,116,148,185,103, 68,100, 84,207, 83,103,207,143, 62,118,230,210,226,233,115,151,158,170,223,164,213,211, 37,155,142, - 95, 59,116,233,101,248,217, 91,111,233,240,149,215, 52,104,249, 29, 42, 61,224, 28, 77,220,244, 0,132, 90,211,154,127,177,110, - 97,231,158,191, 93,233, 26,173, 35, 30, 60, 15,146,172,100,159,191, 70,208,171,183,161,116,237,222, 43,218,115,226, 22, 77, 90, -178,159,234,117,157, 70,150, 25,242,133,155,217,231,104,167,131,104, 57, 48,109, 98,130, 37,165,212,200,151, 42, 85,170,226, 53, -234,212,127,117,129,201,250,206,179, 47, 37,194, 62,114,213, 77,242,200, 91,225,149,137,137, 69,241,104,162,149, 58,154,108,129, -112,177, 12,141,219,220,230,109,123,141,159,191,124, 95,228,226,157,143,104,213,129, 23,212, 99,208,116,234, 56,100, 9,141,102, -114, 37,185, 60,215,126,115,125,142, 92,121,157, 90,246,154, 65,101,106,183,163,100, 38,102, 98,157, 45,125, 15,129, 56, 47, 16, - 16, 8, 8, 4,126, 3, 2,241,156,104,169, 90,180,190, 31,212,167,169,114,202, 96,248,194, 21,154,124,189,116,255, 3,205,223, -253,144,122, 77,221, 75, 85,219,142,167, 82, 77, 71, 81,133,110,107,153,104, 29,163,138,131, 78, 80,186, 92, 53,191,166,226,248, - 44, 13,193,240, 49, 77, 85,185,178,125,186, 54, 45, 28, 38,140, 29,227,116,178, 94, 61,179, 48, 16, 44,236,241, 63,142,103,201, - 91, 56,232,253, 39,162,201,179,151, 83,169,170, 77,104,194,140, 37,132,255,237, 61,125,223,203,109,111, 51,199,108, 43,199,205, -223, 17,124,250,230,219,144,236,109, 14, 92,202,217,241,216,169,124,221, 79,237, 91,114,224,197,133,186,157, 38,159, 51, 79,235, -189, 68,159, 44, 37,209,186,123,247,174, 68,178, 46, 93,186, 52,254,236,217,179, 32, 90, 23, 64,180,252, 10, 56,156, 2,209,122, -254,246, 11, 93,184,247,129,118,158, 11,160,173,167, 95,208,188,245,199,217,141,150,235,152, 54,249,112, 17,238, 63,121,105,142, - 71,165, 65,115,216, 45, 58, 75, 61, 24, 30, 36,203, 61,103,201, 87,221, 70, 46,163,190,147, 54, 74,169,253,176,149, 4,194,165, -139,104,193,187,123,226,212,153, 94,135,142,158,238,191,251,192,201,225, 7, 79, 94,157, 48,100,196,184,123, 45,218,118,121,215, -116,226, 69, 42,212, 97, 7, 21,233,122,128,138,245, 62, 73, 35,215,220,151, 69,180,112, 63, 38, 91,237,139, 86,110, 17,177,245, -248, 67,170,212,107, 59,149,238,184,134,138, 52, 95, 64,217,106,140,163, 2,117, 70,146,121,186,188, 32, 89,237,245,225,169,233, -124, 90,123,199,121, 51,151,108,137,220,116,226, 57,205,218,126,159,154,244, 89, 20,105,102,153,102,158, 1,178, 82,112,240,251, -218,147,215,223, 68,222,124,248,133,214, 28,101, 55, 39,147,171,174, 99, 54,211, 40, 38, 85,248, 45, 17, 45,236, 57, 29,184,248, -154,206,223,124, 67,147, 87,159,143,224,123, 44,230,100,106,192,189, 68, 86,129,128, 64, 64, 32, 32, 16,248, 5, 8,196,115,162, -165,138,144,146,116,253,255,152,174,202,121,176, 11,241,254,139,143,180,120,239, 35,106,220, 99, 6,187,160,194, 9, 65,242, 5, -235,142,160,178,253,142, 81,237, 17,167,201, 38, 83, 81,245, 32,248,239,154,164, 74, 21,155,255,162,162,190,110,106,221, 42,221, -117,144, 44,229,134,255,113, 60, 79,193, 44, 65,239, 66, 34,232,126,192, 23, 10, 8,138,160, 83,183,130,104,222,174, 71,148, 50, -125, 94,189, 22, 24,220, 44,133, 77,230,236, 25,178,149,122, 31, 30,193,212,131,183, 58, 99,206, 95, 45,208,237,244,177,194,189, -206,239,174, 62,234,198,182,149, 71, 95,157,182,117,203,255, 12,249,116,233,139,146,104, 93,189,122, 85, 34, 89,167, 79,159, 30, -127,236,216,177,241, 77, 27, 86, 26, 86,178,112,186, 45,238, 25,204, 91, 92,101,203,206,169,155,239,104,211,201, 23, 52,123,199, - 3, 26,197, 46,170,197,187,110, 80, 74,251, 44,193,218,100,155,165,245,246, 4,185,226, 52, 6,164, 74, 53,159,146,100,117, 26, -182,152,114, 85, 27, 72, 41,211,229,122, 43,215,162,197, 85,237,126,250,244,153, 30, 39, 78,158,233,117,244,248,233,190,251, 15, -159, 28, 52,123,254,146, 57, 69,139, 21,123,153,175,229, 58, 42,216,126, 91, 12,209,234,191,244,142,108,162,165, 36, 91,197,107, -117,250, 58,112,254, 89,242,109,179,154,114, 53, 94, 64,109, 71,109,163,180, 89, 43,125, 54,115, 52,152,100, 89, 57, 57, 57, 13, -118,205,152,241, 88,150,108, 57, 31,175,223,119,137,214, 28,121, 66, 83, 54,221,225, 24,191,125,148, 58, 93,230,199, 41,172,211, - 29, 75,106,102, 59,152,239,141,233, 26,180,110,123, 79, 93,171, 88,173, 78, 83,122,244,234, 11, 69,113,115,143, 89,116, 61, 98, -248,178,171, 81,202,192,253,213,135, 3,168,255,132, 85, 84,161, 97,111,234, 55,235, 8, 15,218, 8,165, 7, 79,131,163,250, 13, -157,242,202, 46,173,227, 21,125,242,127,193,251, 68,220, 66, 32, 32, 16, 16, 8, 8, 4,212, 16,248, 11,136,150,146, 96,105,182, -104,161,130,154, 42, 9,162,117,228,194, 99,218,126,234, 25,245,152,188,139, 42,181, 24, 45, 17,173,124,181, 6, 83,153,190,199, -168,250,208,147,178,136,150,100,209,106,229, 48, 97,204, 24,167, 19,245,235,165, 8, 5, 25,194, 30,255,227,184, 71,142, 2,175, - 3, 63,124,165, 37,251, 30, 83,183, 57,151,169,100,239,163, 84,141,101,203, 37, 90,230,142,217,230,174,219,125, 94,146,123,229, - 97,112,112,193, 30,103, 78, 22,238,125,254, 64,153,161,215,118, 85, 24,121,103,221,136, 13, 1,219,235,245,152,123,208,204,206, -107,186, 46,237,182,181,181,149, 98,180, 46, 92,184, 16, 67,178, 14, 28, 56, 48,190, 73,131,138, 67, 49,143,150,155, 75,138,102, - 59, 79, 61, 98,146,240,140, 73,194, 61,234,187,240, 26,181,153,122,129, 70,175,184, 64, 76,162, 52, 18, 45, 16, 41, 71,143,252, -143,210,123, 21, 10,112,202, 92, 40, 32,173, 91,190, 71, 74,178,165, 74,178,242,212, 26, 65, 22,206,249, 95,154,166,241, 44, 33, -243, 9,236, 9,162,117,230,204,153,238,167,207,156,233, 1,194,117,236,196,201,222, 11, 22, 46,158, 90,180,104,209,231,249, 90, -174,141, 69,180,186,204,187,105, 16,209, 66, 25, 80,102,118, 79,210, 35,118,143,142,102, 66,137,196, 46, 67, 89,228, 87,181, 14, -169, 83,167,238, 60,125,250,116,122, 26,240,158,174, 62,252, 64,251,206, 7,208,178,253,143,104,236, 90,182, 68,205,185, 68,245, - 70,159, 38,191,174,123,200,190, 96, 59, 74,146,220,178,179,174,250, 47, 93,186,199,182, 76,197,154,116,249, 97,168, 68,180, 48, -104,163,239,180,221,212,115,234,126,201,130,117,240,226, 59,186,247, 44,136, 22,108, 56, 77, 93,135, 45,164,138,141,122, 80,139, - 78,195, 47,121,249,228, 14, 45, 95,173,158,250,128, 2,153, 80,139,108, 2, 1,129,128, 64, 64, 32,240, 51, 17, 80,242,144,191, -136,112,201,131, 43, 83,174,210,111,230,110,244,167,125,231,158,208,212, 45,247,168, 98,139, 81, 49, 68,171, 52, 19,173,202,236, - 58,148, 99,209,194,221, 38, 76,248, 22,163, 5,114, 5, 75, 22,246,248, 31,199, 93,125,138, 4,188,122,255,133, 22,237,125, 76, - 93,102, 95,166,226,189,142, 80,213, 33, 39, 12, 32, 90, 57, 46,223,123,246,225,203,224,229,183, 30, 21,234,113,246, 76,209,126, - 23,143,212,155,112,235, 96,235,185, 15,247,182,155,255,108,235,128,213,129,235,135, 46, 61,191,203,204,222,251,148,174,154, 51, - 33,144,136,214,169, 83,167,198, 31, 57,114,100,252,254,253,251,199,239,220,185,115,124,133, 82, 30, 82,140,150, 95, 1,199,163, -115,183,220, 96,130,112, 91, 34,132,136, 85,107, 52,246, 44,213,237,187,150,221,105, 57,143,107,146, 13,146,117,212,255, 46, 85, -169,213,132,202, 85,107, 72, 59,142,223, 33, 91,215,188, 18,217,242, 46, 84,249,227,187,119,239, 8, 36,203, 54, 75,149, 23,166, -118,153, 39,200,107, 25, 41, 87, 12,209, 2,217, 58,121,234, 84,207,205,219,118,141,152, 49,119,241, 60, 38, 90,207,212,137, 86, -155, 25,215,227, 68,180,222,135,132,209,212,205,247,168, 96,237, 65, 84,190,197,184, 56, 17, 45, 55, 55,183,121, 87,175, 94,163, -103,111, 62,145,255,157,119,180,253,204, 11,154,191,235, 1, 13, 95,121,131, 99,254, 46, 80,141, 97, 39,169, 96,151,131,148,177, -230, 60, 74,102, 97,175,207,141,152,200, 59,107,174, 53, 21,170,214,163,165, 27,246,211,157, 23, 95,169, 42, 7,193,183, 25,178, -138,134, 45,187, 28, 53,124,195,189,176, 47, 95,195,163, 64, 16,247,156,125, 67,211, 55,222,166, 14, 67,151, 81,246, 92, 5, 47, -121,123,103,203,106, 0,190, 34,171, 64, 64, 32, 32, 16, 16, 8, 8, 4,228, 32,160, 59, 70, 75,151, 4, 16,173,189,231,158,209, -176, 5, 71,105,235,169,231,212,176,251, 12, 58,121,241, 62, 21,172,243,205,117, 88,174,223,113,217, 68, 11,163, 11, 65,170, 96, -193,130,187, 16,123,252,143,227, 32, 90, 1,239,190,112,112,244, 35,234, 52,235, 18, 21,237,121,132, 42, 49,137,147,107,209, 50, -179,207,242,254,227,231,240,240,242,131,253,253,125,123,157, 63, 82,115,220,173, 67, 29, 23, 60, 58, 60,116,221,203, 67,163, 55, - 7,238, 30,190,233,205,250, 37,135,222,111,100, 34,163,211, 26,163, 36, 90,135, 14, 29,146, 72,214,246,237,219,199,111,217,178, -101,124,197,210,153,165, 24, 45,223,124,246, 23,250, 47,240,151, 6, 4,212, 24,118,138,138,245, 56, 66,109,166,156, 39,183,188, - 53, 63,242,204,246, 88,232,249,187, 45,125,150, 34, 31, 94,114,221,206,222,126, 71,135, 47,191,166, 57,236,110,116,244, 42,242, -213,167, 80,245,207,227, 86,158,163, 6, 76,214,230,204,153, 67,166,118, 94, 60,225,107,206, 36,114, 90, 52, 58, 79,207,136,136, -136,238,135, 14, 31,237,187,106,221,230,241,179, 23, 44,159,183,116,229,250, 41,235, 54,108, 30,169,137,104, 53,153,120, 37, 78, - 68, 11, 35, 43, 31,189, 10,149,130,203, 7, 45,189, 30, 87,162,117,240,245,187, 32,122,240,242, 35,157,188,241,134, 54, 30,127, - 70, 51,183,221,163, 1, 75,174, 81,139,201,254, 84,113,224,113,202,221, 97, 63,101,110,182,133,137,150,195, 65,153, 24,120,217, -166,177,191,188,120,219, 13,226,182,151, 70, 23,130, 0, 43, 99,180, 86,238,189, 23, 53,103,199, 99, 26,183,238, 14, 53,237, 52, -129,234,181, 27, 17,201,114, 87,113,194,136, 69,177, 9, 4, 4, 2, 2, 1,129,128, 64,224,247, 35, 0,162,117,234,198, 91, 26, -186,248, 28,117,159,118,152, 70, 46, 62, 65, 45, 7,175,164,166,163, 14, 82,233, 62,135,168, 84,159, 35,100,195,179,194, 27, 82, - 82,184, 17, 17,179,133,189,242, 58, 16, 45,144,145,249,187, 30, 82,199,153,151,200,175,251, 97,170,192,157,175,108,162,229,144, -253,226,149,251,111, 62,116,152,115,203,191,104,255, 43,123,154, 78,123,176,111,240,154,151, 7,103,239,123,119,124,225,161,224, - 67,243, 14,134,108, 30,181,226,194,106, 14, 68,151,101,209,218,187,119,175, 68,178, 54,109,218, 52,126,205,154, 53,227,235,212, - 40, 49,172,120, 1,199,221,233,210,166, 24,214, 98,236, 17,170, 57,252, 52,187, 77, 79, 73, 36,171, 96,157, 33, 17,188,220,207, -121,174,139,198,233, 29,210,121, 21, 9,121, 28,248, 73, 34, 88,163, 57, 72,187,215,252,171, 84,167,195, 4,154,190,245, 30,213, - 26,126,138,106, 12, 62, 74,174,185, 42, 6,153,164,113,119, 49, 4, 71,190, 93,239,227,103, 46, 78, 91,179,113,231,188,245,155, -182,143, 61,122,236,120,111, 88,182,184,236,253, 84,137, 22,176,172, 52,244, 60, 85, 28,114, 30, 68,235,169, 33,247,128,235, 16, - 46,221, 41,209, 22,173,146, 77,199,144, 69, 28, 92,135,153, 51,103,190, 8,151,243,173, 39,193,116,232,114, 32,173, 58,244,132, - 38,109,188,195, 88, 92,161,198,227,206,178, 46, 29,165,172,173,247,146,119,203, 61,148,204, 42,253, 69,185,101,180,176,180,156, - 57,112,236,130,136,160,208, 8,122,241,230, 11,149,168,214,134,154,244,154, 77, 27, 79, 4, 50,169,251, 66,227, 54, 72,163, 14, -131,250, 78,219, 75,125, 56,177,220,193,156,242,203,149, 47,242, 9, 4, 4, 2, 2, 1,129,128, 64, 64, 6, 2,170, 51,195,127, - 31, 12,175, 75, 0,136, 22,230,207,154,181,253, 1, 13, 88,116,145,154,143, 62, 68,117,134, 28,160,202,253, 15, 80,137,158,135, -168,104,143,195,132,229,119,180,200,144, 61,241,154,171,143,111,192,243,183,159,105,238,206,135,212,126,198, 69,242,237,118, 88, - 26,213,168,129,104,105,148,105,110,239, 51,118,216,180,117,143,246, 95,126,247,160,248,160,235,155, 90,205,126,180,109,248,166, -192,221, 11, 15,125, 56,180,252,216,199,221,219,206,127,217, 86,170,118,143, 77,166,105, 51,143,212, 80,214, 24,153,176,104,125, -250,244,233,187, 9, 75, 7,247,239, 52, 23,193,240,142,246, 38, 67,250, 77,217, 70,125,231,158,161,218,125,214, 80,198,124,181, - 62,114,124,216,185,228,169,220,213,167, 33,136,145,153, 46,179,111,208, 5,118,151, 77,222,116,151,122, 50,201,106, 49,249,188, -100, 13,131,123,180,194,128,227,148,171, 66,135, 80, 14,126,111, 34,163, 33,213,227,139,234,123,120,249, 12,216,181,107,119,143, -192,192,192,238, 60,223, 87,119, 30, 33, 25, 67,180,242,183, 90, 71, 37,250,157,165,106, 35, 46,144,119,229, 97,148,212,212, 42, -148,239,209, 72,237, 62, 58,219, 8, 68,235, 43,207,167,134, 24, 45, 88,180,186,207,189,204,113,100,122, 99,180,190,147,153, 59, -119,238,219,112, 13, 95,126,240,129,246,248, 7,112, 44,222, 35,105,158,171,206,179, 47, 81,157,145, 28,159,197,122, 4,146,133, -148,220, 38,211,109, 13, 88, 96,102,123, 77, 91,185,242, 85,234, 80,192,135,112,186,112,247, 3, 21,240, 45,129,185,194,246,213, -107,211, 37, 50,244, 75, 36,193,125,184,251,236,107, 46,251,183, 17,136,101,235,117,231,249, 80, 21,174,209,130,100,235,167,140, -182, 81,102, 17, 50, 13, 0, 75, 70, 86,129,167, 12,144, 12,200, 34,240, 52, 0, 44, 25, 89, 5,158, 50, 64,250, 71,178,168,175, -117, 40,191,218, 88,231, 16, 46,189,192, 15, 95,232, 49, 47,195,115,235,105, 48,199,216,188,231, 33,243,175, 36,247,207,248,117, -183,141, 66,180, 92,178,248, 6, 60,227, 9, 50,231, 49,209,106,199,110, 57, 95,182,194,148,238,123,148,204,191, 31,117,168, 81, -177, 83,167,206,100,110,153, 46,251,227, 93, 39,239,223,220,114,238,253,249, 33,107, 2,182,142,216,252,102,227,226,163, 31,183, -237,186,252,101,247,132, 85,167, 23,176, 53,235, 30,242,233, 34, 90,150,150,150,157,172,173,173, 7, 33,241,239,152, 84, 48,183, -253, 61,105, 9,158,124, 14,167, 82,216,102,250,104,150, 54, 75, 48, 98,178,216, 93,216,150,229,105,178,100,197,148, 51,125,182, -210, 39,103,174, 62, 42,145,139,182,211, 46, 82,221, 81,103, 36,183,104, 77,182,102,229,171, 57,232,171,181, 75,190,133, 50, 91, - 68, 83, 32, 55,172,130, 93,242,231, 47,208,125,215,174, 93,221, 31, 61,122,212,253,240,225,195,253,138, 23, 47,254,172,246,232, - 75,148,187,201, 66, 50, 77,157, 1,211, 26, 96, 16,128,166, 5,151,245, 18, 45,196, 85,205,220,246,128, 10,215, 25, 66,126, 13, - 71,199,133,104, 37, 44, 82,164,200,147,167,175, 63,209, 57,118,159, 98, 58,140,185, 59, 31, 96, 98, 81,198,227,130, 52,232,161, - 64,231,131, 49, 68,203,212,222, 7,147,170,170, 47, 23,164,173,156, 9, 56,210,237, 90,153, 10, 53,168, 86,131, 22, 52, 98,242, -124,184,134, 77, 76, 82,164,152, 93,170, 76,245,247,199, 46, 62,151,134,161,158,187, 25, 76,123,207,125, 32,159, 2,101, 49,147, -189,210,114, 40, 94,146, 50, 21, 79,102, 54,129,167, 76,160,100,102, 19,120,202, 4, 74,102, 54,129,167, 76,160,100,102,251, 25, -120,202,188,245, 31,153, 77,247,204,240,186,138,236,228, 85,248, 44, 22,148,118,205, 94,242,141,115,182,146,111,156,178,148,120, -227,232, 93,252,141,234,130,210, 60, 10, 77,125, 49,105,131,191,238,157,189, 10,110,233, 61, 98,122,196,186,253,215,104, 22,199, -238, 52, 24,188,147, 92, 75,116, 15, 55, 79,151,103,163, 90,249,180, 54,110, 10, 59,247,220, 41, 29,178, 62,236, 48, 96,214,201, -245,135,110, 31, 60,118, 35,120,231,202,189, 55,215,213,108,209,111, 35, 79, 38,122, 15,231,181,212, 85,175,194, 96, 49,105, 16, - 45, 44, 46, 45,179,137, 99,100,166, 72,237,153,214,209,171,216,151, 94,147,183,209,196,245,183, 36,119, 89,205, 65,123,200,171, -100,155,207, 22,233,114,174,208, 66,212, 52,221,166,161,142,123,103,225,115, 61,152, 96,117,103, 87,103,191, 98,197,138, 63, 75, -229,146, 63,138,143,173,225,164, 92, 47, 80,211,229, 58,235,158,206, 51,255,233, 21, 91,143,135,191, 9,250, 74,107,121,164,101, -233, 54,115,194, 44,210,231,193, 44,248,186, 54,117,153,246, 13, 26, 53,121,113,143,167, 9, 57,126,237, 53,173, 63,246,148,166, -111,185, 75,253, 23, 95,165,230, 19,207,177, 85,239, 24,229,108,183, 47,134,104, 89,101, 42,245,130,133,171, 15,143,213, 85,206, - 68,156,191, 5,167, 74,170,133, 74,148, 56,113,111,123, 7,167, 27,109,122, 77, 9,159,185,250, 20, 21, 45, 83,139, 60,178, 23, - 94,169,146, 71,111,187,203,108,107,213,108, 66,102, 28, 64,211,113,137,192, 83,224,105, 44, 4,132, 46, 25, 11,201,111,114,126, - 6,158,198, 45,225, 63, 34, 77,118, 67, 88, 91,187,165,180,203,152,103,170,189, 71,193, 11, 86, 25,114, 5, 90,102, 40,224,207, - 22,163,241, 10,251,156, 41,212,176,210, 41, 19, 22, 43, 14, 42, 31,109,106,159,229, 52, 2,223, 17,147, 5,119,161, 22, 75,150, - 82,180,222,114,250,100,178,168, 1,215,161,143,135,133,250, 90,129,218,154, 50,150, 76,179, 52,174,182,150,206,121,150, 88,187, -228, 15,176, 72,159,247, 45,175,199,200,150, 49,207, 42,124,177,198,184, 46, 45, 66,177,228,140,190, 13, 75,204,244,136, 78,218, -136,165,108, 98, 96, 99,227,101,198, 75,242,156,182,115, 47, 16,192,243,144, 5, 88,103,200,123, 26,199,244, 20, 66, 29,207,124, -131,135,142, 8,186,241, 56,136, 14, 94,122, 69, 43, 14, 62,166, 9, 28, 59,213, 99,222,101,106, 56,246, 12, 79,229,113,132,178, -180,250,230, 54, 68, 74,147,247,191, 32,150,159,207,144,118,215, 81, 30,103, 62,135,245, 36, 65, 56,213, 39, 88,213,219,238,250, -192,214,112, 94,200,140, 3,104, 58, 46, 17,120, 10, 60,141,133,128,208, 37, 99, 33,249, 77,206,207,192,211,184, 37,252,181,210, -148,174, 67,229, 93,213,255,255,105,165,249, 25, 13, 33,100, 26,183,185,126, 5,158,110, 25,221, 61, 78,101,242,204,226,239,238, -149,237,178, 91,230,156, 55,157, 61,115,221,115,204,148,251,113, 26,151,156,143, 45, 28,125,238, 37,183,203,124, 51,185,141,251, -229,228,169, 92,253, 77,172,210, 97,192,130,186, 21,238, 87,148,211, 24,200,138,114, 26, 3,197,255,203, 16,120, 10, 60,141,133, -128,208, 37, 99, 33, 41,136,150, 38, 36,213, 99,180, 4,209, 50,146,181, 68,151,218,138,135,250,207,127,168, 69, 27,137, 54, 50, - 22, 2, 66,151,140,133,228,207,235,196, 69, 27,253,249,109,100,220, 18,254, 90,105, 58, 99,180,160,124,154,146, 33, 69,212, 38, - 67,215,113,125,242,133, 76,205,237,162,138, 11, 92,137, 85, 57,169,143, 36,212,132, 45, 47,236,172,177,157,255,180, 54, 66,192, -191,161,109, 47,116, 73, 59, 2,134, 98, 41,167, 51, 18, 50, 13,211, 81,161,159, 66, 63, 53, 33,240, 47, 63, 71, 74, 60,140,193, - 63,244, 61, 95,127,253,121, 57, 47,109, 67, 65, 16, 50, 13, 69, 76,119,126,129,167,192,211, 88, 8, 8, 93, 50, 22,146,194,170, - 35,116,233,223,212, 37,227,214,250,215, 74,139,251,168,195, 31, 44,167,120, 88,126, 16, 64,181,203, 5,158, 2, 79, 99, 33, 32, -116,201, 88, 72, 10, 82, 20, 47,117, 9, 3,164,244, 12,146,138,165, 33,166, 54, 94,118, 72,226,157, 28,131,192,207,104,119,227, - 62,149,191, 71,154,209, 98,179,146, 36, 76,156,172,135,105,202,212,215,205, 44, 83, 63,211, 81,151,159,209, 16,127,154,204, 4, - 30, 25,204, 58,148, 42,226,178,201,211, 53, 69, 21, 21, 44,244,150,211,212,214, 99, 81,218,140,249, 30,155,165,241,232,160, 97, -116,165, 54, 83,179, 70,184, 49,170,209,220, 41,247,241,148,142, 89,228,140, 76, 84,149,161,183,156,156,217,196,219,219,187, 0, - 18,126,203,208, 93,189, 50, 77,211,120,212, 75,231,158,255, 72, 26,183, 28,188,208,119,166,154,198,144,169, 42,131,215,145, 76, -109,238,148,107, 61, 79, 4,251,206,220, 62, 91,144,121,186, 92,135, 83,218,120,233, 13,176,119,170, 60, 50,243,144,149, 87, 86, - 98,175,169, 76,214,101,167,166, 28,180,234,246,136,212,149,198,104,154,143, 13,151,232,173,187,140,186,170,103,249,171,100, 58, - 21,170,103,101,239,215, 45,181, 76, 28, 98,234,206,107,134, 94,205,144,197,247,149, 67,166,124, 87,100, 94,171, 72,231, 89,224, -188,179,119,161,128,116, 30, 5,206, 25,242,108,202,149,255, 55,202, 76,110,235, 90, 32,185,117,250,237, 38,214,233,119,152,164, -114, 45, 38, 3, 11,157,250,105,111,111,159,130, 87,134, 40,155, 63,127,254, 86, 37, 74,148,232,156, 35, 71,142,150,206,206,206, -165, 89,110,226,223,213,119,240,251,167,143, 89, 90,143, 47, 72,248,173,175,142,102,105, 60,135,243,123, 58,242, 91,242, 28,254, -167,180,187,137,157,135, 51,151,127, 98,202,180,222,103, 82,164,201, 20,107,122, 27, 57,132,144,231,139, 44,109,107,107, 91, 85, -153,240,191, 62, 44,126,114,221, 13,184,253, 31,151,213,168, 22,173, 68, 73, 76, 76, 79, 55,105,219,243, 83, 64,224, 59,234, 61, -106, 1,153,152, 89, 93,211, 82,229,223,222, 65,216,184,230, 61,103,151,177, 64,128,106,194, 49, 57, 74, 40,167, 25, 61, 51,164, -104,190,124, 86,155,135, 81,239, 54, 82,241,130,233, 54, 27,162,132,252,128, 92, 58,122,249, 5, 13,155,188,156,156,179,248,190, -231,233, 30, 6, 88, 56,101,177, 50,244,229, 99, 97,235,230,154,202, 53,255,179, 42,221,150, 71, 58,250,148, 9,228,175,174,108, -114,202, 30,157, 71, 87, 27,217,102,204,152,177,130,135,135, 71, 19, 94,139,177, 37, 18,126,227, 24, 95,171,105,242, 83,229,109, -117,182,187,169,173,103,195,249, 75,215,242,146, 57,161, 60,145,232, 43,170,217, 98, 32,201, 32, 91,178,117,201,202,202,197,194, -202, 57,215,243,193, 51,119, 70,156,185,249,134,246, 95, 8,160,110,147,118, 70,165,113,203,247, 86,141,108,125, 39,211,177, 68, -207,149,115,182, 93,126,143,189, 38, 12,125,106, 77,168, 62, 99,203,141, 11,216,203,209,121,171, 12,133,118,219,122,150,184,101, -231, 85,234,150,189,119,169, 91,142, 62,165,111,165,207, 90,230, 86,134,108,101,110, 57,102,246,221, 45,179,157,100,215, 93,166, - 60,100,139, 37,147, 87, 96,120,153,210,165, 96,184,165,107,161,240, 84,110,133,195,109, 50, 22, 14,183,205,228, 27,110,231,225, - 27,158, 54, 83, 97,185, 75,108,233, 43,167,165,143,187, 85,225,182,205, 42,221,205, 92,164,201, 75,167, 34,157,231,165,247,237, -154, 93, 79,153, 99,100,102,204, 94,236,249,205,167, 31,201,217,187,240,215, 52, 89,170, 28,150,147,220,178, 21,255,250,237,154, - 66,170,107,156,234,209, 79,143, 82, 60, 53,204, 43,158, 26,230, 29,158, 73,243,212, 30,238, 92, 70,125,211,176,124, 39, 51, 69, - 26,207,255,184, 99,158, 45, 55, 33,255,143,188,151, 18,155, 88,148, 72,158,210,102,187,119,158, 18, 47, 45,109,156,182, 38, 54, -177,244,211,128,173,190, 54, 82, 36,183, 74,191,233,248,213,215, 81,167,111,125, 32, 43, 71, 15, 57, 58,170, 83, 38, 19,171,250, - 39, 78,156, 24,196,243, 6, 75, 41, 60, 60,124,208,138, 21, 43, 6,241,187, 68,215, 84, 57,250,202,233,200,228,160, 96,186,116, -233,106, 35,225, 55,215,213, 81,142, 46,153,217,185,217,112,155,132, 95,184,243,138,144,204,236, 60, 34,211, 23,110, 63,206,165, -120,159, 33,154, 82,186, 66,237, 38, 48,185,138,186,250,240, 29, 33,241,181, 17, 42,150, 45,125,229, 52,224,145,140,201,170, 87, -102,242, 52,158,249, 76,211,120,174, 45, 81,171, 99,228,252, 77,231,232,204,141, 64,178,116,204,114,194,208,190, 3, 4,235,225, -195,135, 61, 31, 63,126,220,231,254,253,251,157,241,191, 1, 5,254,174,156, 14, 30, 5, 78, 56,122, 20,122,106,235,150,123, 32, -203, 81,159,116, 26,162, 19, 89, 58,229, 28,104,153, 33,239,211,148,233,115,235, 42,175, 1,197,248, 11,179,178, 37,171, 91,227, - 54, 61, 62, 93,190,255,129,106,247,221, 64,166, 22, 54,129,134, 54,238, 15,194,162, 87, 9, 85,229,131, 96, 93,122, 16, 76,119, -159,135, 74,233,194,189, 32,194, 49,125, 47, 52, 86,132, 67, 60, 99,123, 64,170,232,100,233,148, 35, 40,181,107,254, 0, 27, 36, -158, 79, 10,115, 74,121, 21,169,183, 2,228, 10, 36,107,201,140,214, 79,220,156,146,119, 86,145,171,183,156, 32, 90,199,120,121, -163,253, 23, 95,211,105, 94,104,121,202,194, 45,228,149,167,204, 39, 83, 59,143, 9, 26,150,244,249,174,115,196,129, 20,105, 51, -229,178,117, 47,244,186,205,132, 67,212,100,210, 21,154,187,237, 54,213,111, 51,240, 67,145,242, 13,222,165,247,242,125,238,228, - 93,100,143, 89,218,140,158, 6,180, 81, 34,115,115,243, 76,252, 21, 90,167, 92,185,114, 77, 15, 30, 60,216,146, 95,142,177, 18, -142,225, 28,242, 32, 47, 30, 30,125,120,170,158,119,203, 90,228,204,135,143, 95, 40,103,233,255, 40, 91,201,230, 52,115,211,117, - 50,119,240, 58, 32,231, 37, 41, 71,119,204, 28,179, 79,237, 50,106,117, 56,150,250, 41,207,203, 56,213,228,229,142, 22,236,126, - 72,189,167,108,143,178,113,205,115, 88, 83, 27,193,130, 5,114, 85,174,110, 39, 10,120,251,145,176,199,255,170,150, 45,183,178, - 29, 82,230,169,222,235,197,230,163,183, 35,177,199,255,250, 58, 50,144,172,253, 23,248,133,126,239, 61, 93,225,229,135,174,243, - 92, 98,183,159,133,208, 37,126,126,220,115,149,189, 37,167, 62,156, 71,159, 46, 37,194,215,172, 89,154, 76,155,144,162,191,108, -213,219, 68,253, 86,177,100, 90,184, 20, 14, 63,122,245, 53,221,126, 26, 66,152, 88,246, 97,192, 71,122,194, 43, 65, 28,185,242, -154,220,114, 87,192,202, 2,114, 54,109,229,180, 45, 87, 40, 77,133, 67,211,253,166,127, 57, 90,253,248,226,209, 53, 94, 47, 91, -191,155, 38, 46, 59, 22,158,187,250,144,143, 78,190, 93,246,167, 43,220, 73,219,151,116,140, 76, 88,167,210,123,251,126,116,206, - 86,150,174, 60,252, 64,152,151, 13, 75, 58,157,191,251, 94, 90,176,253,244,173,183,116, 70, 74,239,232, 28,175, 94,113,150,247, - 89, 11, 87, 37, 92, 99,136, 69, 11, 36,235,232,213,119,180,247,194, 27, 42,197,107,123, 22,168,218,141,210,100, 42,244,128,113, -173,108,192,115,164, 0,193,122, 23, 18, 70,211, 86, 30, 97, 28,223,240, 28,114,175,105,223,133, 64,122,198, 43, 36,140, 89,116, -128,182,157,126, 73,155, 79,190,224, 21, 54,158,211, 13, 94, 3, 20,249, 13,121,142, 84,243, 38, 54, 73, 57,176, 68,141,246, 52, -101,237, 5, 90,125,248, 25,173, 61,244,144, 90,116, 27, 78,137,147, 91,116, 55, 84,102,114, 75,199,109, 74,162,101,105,239,190, - 95, 70,195,235,212,207,138, 21, 43,118, 1,185, 82, 18,173,207,159, 63, 15, 58,117,234,212, 32, 51, 51,179,254,134,224, 25,157, -215,148,223, 59,181,249,163,175,227,179,103,207,186, 69, 70, 70, 74, 9,191,231,205,155,215, 17,231, 56,159,169, 22,185, 82, 57, -241,110,229,119,111, 20, 8, 56,146,169,157, 39, 77, 91,115,118,223,186, 99,207,183,105, 74, 51, 54,248,239, 69,158,152,252,124, - 45, 38,161,142,190,199,119,117,103,171, 80,201, 52,105,210, 84,214,148,172,236,221, 71, 91,166,207,243,134,251,150,215,214,174, -156,210,231,188,174,239, 29,162,122,158,203,157,197,210,201,231,120,243,158,147,105,207,153, 71, 76,252, 62,208,196,165,135, 41, -123,177, 6, 97,102,182,134, 19, 87, 16,171, 39, 79,158,244, 61,119,238, 92, 93, 38, 90, 93,127,148,104, 57,101, 46, 24,128,245, -108,167, 45,220,244,201,217,167,232, 75,251, 76,133,159,216,185, 23,122,146,134,147,141, 91,193, 39,233,125,138,191,108,209,111, -238, 39, 76, 86, 45,119, 29, 99, 25,250,247,167,100, 49,154,203, 80,193, 95, 76,103,239, 61,124, 66,141,135,237,250,142,100,153, - 89, 88, 97, 97,101,213, 77, 95, 7, 17,147,215,220,214,163, 0,155, 63,151, 88, 56,102,221, 96,233,148,109,123, 74, 7,159,153, - 41, 82,103, 82,159, 29, 28,249,101,203, 68,102,144, 42,144,171, 81,107, 31,196, 36, 57, 68,203,202, 57,239,243, 29,103, 94,208, -121, 94,163, 16,179,153,179,165,136, 95,148,129,116,237, 81, 16, 47, 35,243,150,106,181,236, 27, 84,182,164,207,126,143, 12,166, -139,139, 23,114,222,157,222, 62,249, 88,190,157,242,225,147, 85, 78, 16,173,125,220, 9,175, 63,246,156,182,156,122, 73,187,207, -189,164,157,199,239,210,172,229,187, 41,111,241, 26,225,252,197,178, 32,185,189,151,147, 10,160,177,234,110,154,214,167,140,189, - 87,177,119,237,167,158,162,146,253,206,241,186,134,254,212, 99,225, 93,218,122,230, 13,191,184, 63,209,147,215, 95,233,208,185, -251,148,211,175,218, 27, 88,189,116,189,124,148,231, 50,100,200, 80,171, 99,199,142, 77,249, 11, 71, 34, 87, 11,151,175, 25, 89, -184,116,205,107, 46, 89, 10, 7,103,240, 46, 20,156,191,120,245,107, 56,134,115,200,211,174, 93,187,198,105,211,166, 85,255, 50, -213,217, 70, 25,124,124,207,188,100,107, 86,182, 18,205, 40, 75,177,102, 52,120,209,121, 67,137, 86, 2, 71, 71,199,228, 92,102, - 85, 43, 3,126, 75,137, 39,131,189,179,227,212, 35,105,105, 31,172,153, 89,123,196,105,234,183,248, 26,109,224, 25,233, 83, 57, -231,192,100,168,202, 45,166,156,112, 23,194,146, 5,146,133, 13,123,252,143,227,112, 19,194,130, 85,160, 70,183, 23,253,198,204, -167,144, 79, 95,169,239,232,249, 84,144,255,199,113,184, 19,181,181, 81, 90,182,100, 93,100,146,213,158,151,149,234,181,224, 42, - 13, 91,121,147, 23,211,190, 75,243,120,241,116,143, 60,229,126,136,104, 65, 55,248,107,124,136,133,131,247,179,214, 93,135,210, -177,115,183,162,142, 93,184, 19,213,161,239,120,178,114,202,250, 28,231,212,244, 71,235,179,105,201, 86,172,219,188,188, 22,150, -134,106, 56,230,172,180, 12, 86,223, 69,215,120,169,173, 64,202,148, 55,206, 68,203,186,117, 21,183,134,151,150,150, 92,244,245, - 72,181,147,167,231, 23,155, 91,191,148, 83, 13,251,220, 77,142, 99,249,174,153,219,238,211,182, 83, 47,104,230,250,115, 81,126, -141,198,145,125,158,102, 55,108,179,213,170,162,235, 29,226,152,191,102,114, 91,239, 42,119,150,236,188, 42,225,216,108,130,191, -180, 8,125, 63, 46,235, 40, 94,203,114,218,150,123,180,104,239, 99,233,153,154,178,242, 24, 57,102,175,113, 84,225,231,167,238, -162,210,109,209, 98,162,181,231,252,107,233,125,209,106,236, 62, 26,178,252, 6,245,157,127,145,138,213,237, 71, 90,214, 74,213, -248,188,131, 56,129,100,241,115,126, 78,105,213,194,111,144, 44,245, 99,131,102,239,141, 51,209, 98,146,213,191,116,189,222, 52, - 98,241, 89, 26, 54,107, 39,213,250,175, 23, 45,220,124,142,142, 92, 15,161,158,195,231, 16, 91,186,138,107,210, 79,243,180,153, - 11, 23, 42, 93,243,113,157,102,157,169, 86,147,206, 84,163,113, 39,170,222,168, 19,149,170,210,152, 10, 20,175, 66,249,138, 85, -166,162, 21, 27, 82,185, 58,237,169,108,237,118, 84,186,102, 91,202, 81,180,102, 8,172, 41,134,188,231,217, 93,216,254,249,243, -231,131,182,109,219, 54,104,220,184,113,131, 26, 53,106, 52,136, 63,212, 6,241, 51,220, 73, 71, 15,169,169,141, 44,178,101,203, -214,246,237,219,183,221,248, 17,141, 73, 95,190,124,233, 22, 28, 28,220,141,215,168,237,198,164,161,155,143,143, 15,150, 69,179, -208, 32, 59, 70,102, 74, 59,207,153,105,220,114, 17,146, 77,166,226,247,220,203,244,159,168, 43,217,120,148,184, 99,237,148,141, -172,211,101,229,118,202, 52, 73,219,243,142,227, 32, 43, 15, 30, 60,232, 1, 43,145, 50,177,213,168, 79,143, 1,163,150,101, 45, - 82,231,211,174,179,207,232, 36,127, 88,111, 62,249,156, 82,187,228,125,175,171,156,170,231,120,185,183,242,165,170,183, 14, 63, -125,237, 57, 93,231,126,104,226,234,243,228,158,191,230, 39,246, 6, 12, 53,181,245, 78,163, 3, 75,173,253,145, 26,209,234, 98, - 12,162,133,247,231, 11, 94,183, 56, 60, 34,138, 62,126, 14, 39, 44,189,118,247,121,136,180,124,223,233,155,111,105, 62,127,244, -110,225,231,222, 80,162,197, 98,243,112,170,128, 61, 42,164,250,191,202,111,233,188,218,255,121,249,255,124,209,215,150,140,222, - 35, 31,146,242,127,109,199,145, 7,215,155,170,200, 44,203,191,173, 53,224,173,221,117,200,202, 79,170, 23,168,255,175, 46,204, - 42,181,253,243, 0, 94, 28,184,209,208, 93,100,102,105, 27, 99,205, 74,147,214,241,205,178, 85,235,201,194, 42,213, 35, 61, 13, - 30,235, 52, 58, 2,115, 7,159,245, 21,107,183, 10,217,121,228,114,200,195,231,239,190,222,123,242,250,203,198,189,167, 67, 42, -213,110,249,201, 34,157, 15, 22,129,214,100,130,148,117, 27,153,174,195,239,100,241, 12,232,207, 79,222,120,203, 11, 64,251, 83, -243, 73,254,148,206,167,180,100,149,192, 11,189, 78,187, 33, 31,150,205,106,247, 12,150, 44,191,252,142,251,249,203,165, 5, 11, -192,154,131, 6,109, 32, 90, 91,249,171,118,249,129, 39,180,234,208, 99,106,208,101, 26,173,216,126,238,219,215,250,147, 16, 90, -178,241, 24, 94,200,251, 52, 9, 77,110,231,158,199,206,179,120, 80,135,233,231,201,183,215, 25, 42,214,247, 28,181,152,118,131, - 70,175,127, 76,235, 78,188,165, 29,254, 31,164,180,253,220, 59, 90,188,253, 42,241, 87, 5,119,234, 94, 73,245, 21,144, 31,180, -134,252,117,211,242,222,189,123, 77,234,253,215,113, 85,209,114,117, 62, 95,189,245,128, 2,223,127,162,135, 47,130,105,221, 30, -127,202, 82,176,226,231, 42,245, 91,175,188,116,233, 82,173,237,219,183,183, 76,149, 42,149,174,165,129,190,187, 37, 92,135, 35, - 38, 47,166, 67,151, 2,104,230,230, 27,148,179,108, 59, 57,174,195, 88,114,250,244,233,147,138, 93, 15,238,166,166,166,120,193, -196,144, 44,254,157,200,194, 41,231,131, 5,219,175, 83, 43, 94,188, 27, 11, 86,119,158,125,153,166,110,190, 71, 91, 79, 62, 37, -155, 12, 57,223,105,194, 64,151, 69, 11, 49, 89,112, 23,110, 62,122, 43, 18, 36, 11, 27,246, 91,248,127, 28,199,121,109,184, 58, -100, 41,125,235,234,195, 32,137,180,100, 47,222, 56, 32, 99,206,178,183,220,115,151,187, 5,146,149,193,167,168, 28,183,140, 70, -209,172, 23,189, 11,151,173, 19,185,114,211, 62,122,242, 42, 56, 10,235,132, 94,100, 43,217,133,123, 31,232,254,203,143,116,235, - 73, 80,212,222, 83,119,168,114,131,174,145,102,182,153, 7,235,107,119,235,140,190,225,120, 25,214, 31,125, 70, 90,127,178, 55, -147, 66, 16,151,237,172,159, 30,249, 42,144, 85,250,156, 31,172,157,115,126, 72,229,172,241, 11, 92,163,248, 84,233,179, 92,112, -201, 82,240, 75,173,242, 57, 15,230,202,102,135,216,193, 84,200,232, 84,164,203,182,213,135,159, 74,139,148, 79,225,133,214, 39, -172, 60, 75, 75, 87,175,163,227,219,198, 83,185,170,117,131,163,219, 83,107,145, 83,251, 84,203,145,173, 76,251,136,253,231, 95, - 82,223,133,215,164,178, 14,103, 2, 59,101,211, 61,182, 92, 62,162, 53,188, 84,212,210, 93,215,201,189,112,163, 23,118,217,107, -218,232,171,187,250,121,214,207,146,108,213,122,195,174,195, 16,142,239,187,225, 81,160,234,167,246,163,183,208, 72,198,163, 72, -205,238, 81,252, 1, 84, 66,142, 76,144, 43, 88,178, 84, 45, 85,248, 13, 75,150,250,177, 21, 7,159,106, 34, 90, 90,111,147, 36, -121,202,246,105, 28,221, 94,250,149,173, 21,229,145,183, 18,213,236, 56,131,254,235, 51,155,146, 91,218, 46, 77,150,204,194,213, - 58,141,243,234,165,219, 47,208, 94, 38,140,169,237, 93, 52, 90,165,184, 12,115,238, 61,125,207,107,216,126,102, 43,102,168,100, -177,185,242, 48, 88,178, 16,238, 61,125,159,118,240, 71,223, 65, 94,211,118,239,249, 64,218,113, 54, 64,178,190,173, 62,244,132, - 93, 84, 62, 75,181, 21,204, 49,179,223,110,151, 28,236, 26,231,228,204,238,241,244, 89, 75,223,114,241, 42,124, 7,214, 44,144, -173,125,251,246, 13,154, 54,109,218,160, 41, 83,166, 12,178,205,144,235,174, 13, 91,124,109, 60,138,223, 74,157,169,248, 45,184, -217,117,225,202, 31,116, 13,213, 73, 22,200,213,171, 87,175,186,173,219,180,109, 88,233,170,141,252, 51,102, 47,250,193,149,215, -205, 77,153,198,109,171,190, 54, 74,151,191,197,236,201,203,143, 31,116, 41,209, 11, 43, 71,232,220,144,103,198,186,115,251,211, - 21,106, 61, 67, 95, 94, 37,121,241,247,247,175,167, 76,141, 91,117,157,228,237, 91,235,227,254,243, 47,104,244,154, 91,210,122, -183,187,217,226,206, 94, 18, 77, 68,235,187, 91,192,221,153,181,112,165, 15,119,159,241, 59,253,204, 75,106, 48,100, 47,165,205, - 94,237,136,130,227,223,244,149, 71,215,121, 53,162,101,168,235,240, 59,209,176,104,225,253,136, 62,109,214,246, 7, 52,105,195, - 29, 26,203,235, 33,227, 67,183,249,164,243,210,250,190,101,250, 30,163, 85,135,159,104, 36, 90,186,248, 8,136, 17,223, 16,226, - 99, 8,146,202,255,210, 57, 77,255,247,238,221,187,143,234,181,202,124,202,188,170,123, 85, 25,202,223,209,215,151,199, 30,199, - 10, 20, 40,176,146,229, 33,156, 64,125,211,110,209, 66,197,148,149, 83,253,173,165,113,220, 76, 45, 82,191,253,252, 53, 82,250, -202,235, 48,118, 59,165,180, 78,243, 42, 77, 90,135, 55,231, 47, 94,161, 61,167, 31,146, 85, 42, 91,109,241, 90,223,137, 52,183, -205, 84,144, 45, 12,239, 23,111, 56,244,254,107,120,100,228,157, 23, 95, 62,108, 58,245,238,241,178,195,175,239,239,189,244,225, -217,149,251,239,130,234,181,234, 19,100,110,231,221, 67,155,178, 88,102,200,125, 78,233,222,147,246,236,218,179,206,144, 71, 61, - 6,203, 96, 93, 4,209,218,115, 62,128, 90, 79,189, 32,117, 60, 78, 89, 75,211, 49,118,173, 12, 92,122, 61,160,116,177,204,251, -163,221,133,207,138, 20,204,178,145, 59,251,206, 6,223,128, 47, 0,209, 66,167, 0,134,223,105,212, 58,154,183,246, 16, 61,122, - 21,202, 95, 43,193,146,235,227,216,213, 55, 32, 90,151, 52,201, 54,119,240, 72,149,198,221, 55,160,253,180,179, 52,110,195, 67, - 90,122,240, 5,237,191,196,214, 55, 94, 60,249,208,213, 96,137,100,173,103,194, 53,110,227, 83, 26,176,252, 62,149,110, 57, 53, -220,219,175, 97, 84,170,244,185, 55,232,121,240, 26,158, 62,125,186,101,255, 33,163, 70, 22, 41, 83,235,243,199,207, 97,244, 32, - 32,148,221, 40,129,180,140, 31,158,101,251,159,208,250, 35,143,201, 53, 71,233,207,157,123,246, 31, 25, 23,162,133,251,251, 20, - 40, 31,122,229,126, 16,181,233, 61, 14, 95,136,170,193,165,114,160, 76,184,118,237, 90, 11,254, 74,180,107,209,162, 69,110,126, - 89,228,231,139,146,113, 74,104,101,101,149, 37,127,137,234, 27,106,181, 27, 23,182,116,255, 99, 26,177,234, 38,205,216,202,157, -198,153, 0,234, 55,110,113,152,163, 71,190,245,186,110,160,140,209, 74, 87,178,247,198, 33,171,110,142, 44,208,122,163, 45, 44, - 86,176, 92,229,173,209, 43,150, 69, 11, 22, 46, 28,215, 17, 24,175, 96,189,185,117,147, 77,233,163,215,220,166,140,242, 93,133, -122, 49, 96,189,184,249,233, 11,127, 45, 6,126,162, 19,215,223,210,218,163,207,248,229,245,148,173,162,175,232, 44,235,206, 30, - 38, 89, 13,219,246,167,180,238,249,200, 44,173,183,174, 1, 43,210,189, 82,187,251,134, 63, 96,130,214,122,202, 5,234, 57,255, - 42,227, 6,235,208,125,218,116,226, 57, 85,109,212,133,142,158,187, 67,168, 71,234, 12,185, 62,232, 45, 92,116,134, 12, 57, 43, -210,153, 43,143,104,244,172, 13,100,155,169,232, 71,254,160, 26,153,210,209,203,154, 93,133,107, 23,239,125, 68,125,230,156,162, -193, 83,215,208,174,141,211,232,236,158,201,180,102,237, 74,114,204,215, 34,214,135,159,182,123,217,100,169,218,187,213,160,229, - 82,249,240, 46,154,184,225, 46, 47, 84,254,144, 86, 30,122, 74, 27,143, 62,166,188,149, 58,132,165,206, 82, 37,167,220,178,234, -202,135,129, 38, 22,246, 89,118,117,159,188,139, 70,175,186,198,164, 51,199, 65, 57,114, 65,166,224, 46, 84, 39, 85, 32, 44,234, -199,240, 92,105,112, 29,106,188, 13,123, 21,166,244, 26, 49,135, 14, 94,121, 47, 89,173,240,220,183,238, 61,133,146,153,167,134, - 27, 42,250,163,212, 58,101,249,218, 45,162,112,190, 88,249,186, 31, 53, 9, 74, 97,239,153,163, 64,169, 90, 65,213, 26,117,164, - 42, 13, 58, 82,165,250, 29,168, 98,189,246,212, 99,216,108, 58,204, 4,177,235,208,185, 84,138,173, 88, 37,106,180,165,226,213, -219, 80,209,170,173, 41, 91,145, 26, 47,248,121,213, 26, 32,239,202, 31, 18,112, 55, 35, 36, 2,214,208,157,231, 2, 40, 83,238, -178, 95, 90,117,234,179,127,235,206, 61,147,246,236,217, 51,184,107,247, 62, 83,242, 21,173,116, 56,181,123,209,175,189, 22, 92, -161,142, 51, 46, 82,163,177,103, 41, 21,147, 45,109,184,114,112,126,129, 2, 21,219, 30,174,217,118,212,233,134, 29,198, 28, 29, - 59, 99,213,162,179, 23,174, 13, 1,201,106,215,101,192, 90,159,252,229, 66, 71, 76,223, 16,181,146,151,247,226,251, 71,177, 5, -254,137,105, 42, 39,157,243, 11,130, 60,109, 58, 25,184, 77, 73,180, 82,216,121,108,192,251, 86, 53,225, 24,202,164,158, 87,207, - 59, 52,198, 29, 7,151, 92,195,150, 93, 38,130,100,237,139, 38, 89,181,216,194,222,104,220, 89,218,202, 86, 29, 14, 67,145, 69, -180,216,109,221,127,237,206,147,146,107,188,219,156,203,148,181, 66,239, 40,107,183,178,142,248,104,197,199, 56,167, 71,216,179, -117,171,134, 66,241,157, 5, 87,107,113, 85,137,214,221,187,119, 37,162, 5,239,135,153,189,119, 71,171, 12,249, 86, 91,187,228, -189,158, 42, 67,222,151,169,100,246,169,233, 84,136,214,184,249, 59,201,198, 37, 23,173, 60,248,132, 58,205,186, 68,221,199,111, -226,247, 71, 78,233, 3, 14,161, 28,154, 44, 90,186,248,136,146, 44,113,101, 36,178,133,189,234,111,165,165, 74,253,152,182,255, -181,229,215, 39, 39,250,188,131,156,119, 64, 76, 30, 85,146,133,131, 58, 44, 90, 30,182,246,206,111, 79,158, 57, 79,207,223,124, -166,177,252, 53, 58,126,253, 29,154,184,226, 20,221,186,115, 79,122,176, 26,183,233,253,198,196,196, 68,151,223, 61,230,190, 48, - 63,167,113,203,253,225,248,165,167, 31, 2,222,135,125, 90,112, 32,240,110,219,185,143,252,149,169,254,240,195, 87, 7, 76,219, - 17,176, 97,207,185, 16, 91,183,188,207,181, 85, 10,228, 10,110, 8,196,193, 28,224,175, 47,188,120, 17, 75,101, 16, 8, 26, 50, - 91, 59,231, 14,112,204, 82, 90,178,100,129,100, 89, 56,248, 80,225,114, 53, 63,253,223, 93,152, 97, 95,174,172, 46, 91,199,143, - 31,223,155, 45, 58,114, 38, 12,253,238, 46,120,160,151,176,155, 99, 58, 19,129,242,255,141,164, 71, 47,130, 36,108,111,113,156, - 12,190, 42,241, 53,169,141,104, 65,152,121, 90,159,194, 22,206,121,110,101,206, 87,241, 77,222, 18,181, 95,151,168,220,248, 77, -151, 62, 35,131,215,110, 61,242,213,255, 46,155,150, 55, 63,165,246,179,111, 83,217, 1,103,168,242,192,227, 52, 98,205, 61,242, -200, 95, 5, 22, 29,173, 22, 66, 88,180, 64,180,242,248, 85,186,118,229,230,125, 41, 94,103, 43,187, 53,231,236,120, 64,131,150, -221,160,150,108, 37,234, 54,247, 10, 53, 27,178,129,220,178,151,186, 22, 87,162,197, 86,129, 53, 91,142,220,164, 57,235,142, 50, - 17,200,124, 20, 1,236, 6,180, 89, 2,118, 15,216,238,220,185,211,145,221, 6,238, 11, 23, 46, 44,130,120, 8,190,222,142, 3, -111,107, 5, 5,133,180,117,205, 86,252,105,173, 54, 35,190, 78, 95,195,241, 89,236, 70,233,216,127,242, 87,118, 19, 60,199,104, - 68, 93,247, 81,142, 58,204,217,116,122,159,137, 27,175, 29,242,109,187, 32,166,109, 17,147,149,159,201, 21, 44, 91,121,107,244, -212, 22,163, 21, 75, 60,130,222,239, 61,255, 40,185,201, 50,177, 37, 75,106, 55,135,108,119,204, 29,179,127, 64, 74,153, 46,251, - 7,139,116, 57, 62,112, 12,224, 7, 43, 78,214,233,115,104,138,217,208,160, 59,158, 55, 96,150,135,181, 97, 3,199,248,128, 84, - 30,186,252,134,214,236,185, 72,149, 26,118, 34, 7,143,252,212,172,235,104,218,120,228, 30,165, 74,159,227,174, 62,108,109, 61, -138,132,131,228,247,152,119,133,134,173,184, 41, 89, 0, 23,239,123,204,207,211, 11,242,171,214,158, 58, 78,220, 47,185,229,248, -197,249, 65,159, 44,229,249,172,126,117,104,207,241, 27, 52,118,193, 62, 10, 10,249, 68,171,182, 28, 36,215, 92, 21,195,173,220, -138,222,235, 59,110, 41, 45, 93, 60,149, 78,236, 24, 79,179,231,207,163,161,115, 15,208,186,195,143,201,201,183,179, 44,162,165, - 80, 12, 78,152, 38,107,149, 19,243,183, 92,162, 37, 92, 78,124, 61,227, 67, 0, 36,166,114,243, 17,196,238, 69,131,172,172,250, -234,100,146,198,221,165,100,157,110,188,224,253, 3,242, 42, 88, 85, 86,231, 8,226,180,159, 63, 80,212, 73, 21, 98,178,212,143, - 45,230,247,128, 28,162,149,212,212,170, 79,223, 49, 11, 37,130, 53,122,214, 38,170,213,118,172, 20,163,179,245, 76, 32,213,107, - 51,144, 18,155,166,196,196,196, 10,184, 19,135, 78, 93, 77,135,174,124, 32,135, 12, 94, 23,245,213, 79,121, 62,133, 77,230,236, -245,218, 14, 98,107,203, 43, 14,143, 24, 64, 32, 99,114,175, 69, 62, 16, 45,196,200, 13,101, 29,234,191,248,186, 68,218, 91,246, -152, 20,212,161,215,168,176,188, 37,107,135,166,203, 92,248,179,103,254,106,161,133,106,246, 9,247, 41,219, 45,164, 84,159,163, -228,215,253,176,228, 53,208, 69,180,210,103, 41,121,120,227,145,187,175,183,156,122,254,122,217,190,251,207,198, 44, 62,114,183, -121,247,169, 23,242,151,251, 47,176, 86,211,110, 95,119,157,121, 42,197,166, 77, 97,189,157,198,105,192,244,109,145,105, 61, 10, -236,213, 85,118,117,242,132,119,237,161, 75,129, 97, 28,247, 23,126,252,250,155,175,172, 75,159,148,239,223,184, 18,173, 24,146, -229,255,205,146,133, 48,134,198,227,206, 81,203, 41,231,105, 29,127, 28,113,172,175, 28, 93, 74,232,234,227,247,236,249,235, 80, - 90,176,231,145,132,105, 70,223,150,220, 47,230,254, 88,186,118,103,234, 55,113,141,212,247,205, 90,117, 88,114,243, 90, 58,122, -191,224,120,173,106,114,218, 77,149,104, 93,184,116,169,155, 85,186,172, 91, 61,185,143,232, 63,117, 75,212,252, 45,231,105,219, - 73,188, 3,158, 19, 98,147,229,200, 3,209,138,140, 34,233,131, 60, 85,250,172,232,191, 56, 6,249,149,228,222,183,118,250,246, -255,210,253,143,248,253,114, 87,167, 69, 75,157,151,224,222,234, 86, 41, 77,255,203,201, 3, 81,223,196, 73,150,177, 24, 43,153, -166,227, 56,166,110,209,138,254, 95,219,199,134,170,251,240,255,144,201,114, 29, 38, 77,234,105, 99,239,252,254,226,149,155, 52, -112,201,117, 42,217,235,168,100,166,199, 75,103, 41, 3,186,106,247, 21,170,223,162,219, 59, 83, 51,179, 75, 44, 25,150, 5,157, - 91, 10, 59,247,220,105, 92,115,127,216,125,234,254,187,219,207, 62,127, 24,184,250,217, 21, 85,146, 85,172,217,148,179,230,246, - 94,111,153, 85, 47,183,113,205,125, 54, 37,175,133,167, 77, 32,136,214,250, 99,207,168, 30,155, 98, 27,242, 87, 81,147,241,231, -140, 66,180, 82,185,230,123,126,232,242,183,152, 44,127, 38, 61, 37,170, 52, 10, 85,117, 23,150, 41, 83,166,119,167, 78,157,122, - 33, 48,156,149, 85, 14,209, 74,204,100, 96, 56,155,191, 31,240,208,230, 55,216, 91,167, 73,255,106,198,150, 59, 52,110,221, 29, -242,171, 51,128, 73,214, 39,201,183,125,159,201,205,177, 43, 1,180,237,196, 99,157, 68, 75, 35, 38,110,110,201,108, 93,243,244, -108,215,119, 98,240,168,117, 15,169,220, 64,144,172, 99, 76,178,238, 83,241, 38,227,162, 56,208,190,177,174,198, 81, 18,173,244, -153, 11, 6, 7,188, 13,149, 92, 6, 32, 9, 3,184,221,155, 79,244,167,114,253,143, 83,161,174,135,168,253,212,211,196, 95, 57, -193,113, 37, 90, 60,138,167,118,155, 62,147, 36, 51,120,223,137,235, 40, 77,198,188, 15,249,107,172,168, 62,221, 81, 57,159, 40, - 75,150, 44, 30, 76, 10, 51,135,133,133,229, 62,127,254,124, 25, 30, 66, 94,243,218,181,107,141, 35, 34, 34,154, 4, 7,127,108, - 92,171,113,251, 77,108, 57,123,196,211, 2, 60,182,115,205, 53, 75, 54,153,243, 26,156,180, 84,155,153,187,150,236,185,241, 6, -123, 5,255,175,188,175,140, 81,135,177,170,128,142, 7, 1,240, 48,165,123,230,173,240,141,104,217,251,124,132,206, 34,248,252, - 20,187,167,207,113, 32, 55, 62, 20, 86,177, 53, 6,238, 57, 57, 24,240, 11,235,218,135,143, 97, 18,177,192, 51, 8,162,181,229, -232, 77,114,241, 41, 74,237,251, 79,163,173,172, 59, 32, 74,125, 22, 94, 37,115,251, 44, 90,159, 31,229,189,236, 60,139,134,163, -156,176, 90,113, 39,195,150,177, 0, 41,142, 2, 68,161,100,173,142,212,119,214, 97,233, 30,236,122,253,196,215, 72, 47,147, 36, - 73,146,232, 36, 51, 62, 69,106,211,221, 39,239,104,211,161, 91,228, 81,126, 40,117, 24,177,150, 62,125,254, 74, 59, 15,158, 37, -247,156, 37,105,198,236,105,212,121,220, 22, 26,182,244,178, 20,111, 5,107,148,147,111,167,207,114,234,143, 60,105, 61,171,165, -207, 85,161,227,167,157,103, 95,240, 66,229, 79, 36,194,217, 97,232, 18,178,241,174, 50, 89,174, 12,185,249, 16, 67, 90,163,213, - 80, 2, 33,114,203, 93, 86, 86,167, 3,226,180,135, 9,139,122, 60,214,186,163,207,191, 59, 6,151,167, 62,162,197,129,237,189, -187, 14,158, 38,145,172,190,163, 23,146, 91,206, 82, 17,141,250,175,225,184,169,218,212,105,228, 74,154,197,110,120,203, 52,206, -123, 17, 0,223,182,215,184,111,249,152,148, 37, 50, 73,217, 64,118, 61,237,189, 22, 45,216,124, 94, 34,216,211,215,158, 37,115, - 59,175, 69,114,175, 69, 62,232, 59, 6, 38,168, 18,173,230, 61,166,188,125,200, 86,241,211, 55,223, 17, 66, 37,102,108,189,199, - 31,107,151,201,181,104,199, 96,185, 68,139, 71,101,127,122, 27,244, 37,188,122,191, 29,247,187,204,190,120,189,231,228, 93, 15, - 11, 85,238,248,101,193,186,163,145,135,241,129,193,158, 1,124, 28,244,103, 23, 21,172, 39,120,175,166,118, 43,168,209,146,167, -172,143, 38,162,133,247,125, 27,246, 98,244,230,231, 6, 46,222,184, 18,173, 71,143, 30,245, 85,183,100, 33,140, 1, 36,171, 21, -147, 44,148, 17,207,123,154,140,250,137, 86,138, 52, 30, 21, 39,206, 93, 75, 15, 94,134,210, 24,182,140, 35, 12,161, 80,245,222, - 84,191,211, 36,250, 26, 30, 33,165, 70, 93,167,210,209,107,239,165,180,229,232,125,148,251,177,156,118, 3,209, 66, 89, 7, 15, - 31,219, 59,127,201,218,239,251, 79,217, 24,129, 0,251, 37,251, 30, 73,150,167, 94,140, 67, 23,182,160, 97,240,151, 28,121, 32, - 90,236,157,146,222, 21,219, 78, 61,161, 3, 23, 94, 72,245,236,192, 86,203,153, 91,110,209,242,125,247, 37, 35, 13, 72,167, 54, -139,150,234,125, 84,249,137,154,235,240, 59,146,164,207, 18,197,114, 99, 44, 97,209,121,165,152, 47, 13,199,181,202, 86,203,175, - 14,137,246, 69,165,245, 17,173,164, 73,205, 50,219,216,103, 8,186,112,249, 6,119,182,215,168, 96,231,195, 52,121,227,125, 26, - 62,255, 32,199, 99,217,188,177,180, 74,253,220, 58,117,154,107, 41, 82,152, 13,225,187,234,141, 1, 74,145,214, 35,167,173, 75, -238, 15,235, 15,220,120,115,254,193,199, 55,253, 87, 62,187,172, 74,178, 90,205,186,123, 30, 36, 11, 49, 72,114, 26,150,205,155, -239,114,214,155, 78, 57,235, 77,163,236,117,166, 80,182, 90,147, 40,173,119,169,143, 24, 25,136,196,163, 59,130,160, 36, 82,226, -192,120, 36, 30,121,166,215,181,152,154,137, 22,130,152,241, 85,198,233,165,170,187, 48,111,142,140, 27, 58,116,232,208,139,135, - 40,183,132,245, 71, 6,209, 74,100,103,103,119,126,250,244,233,159,217, 2, 35,197,248,240, 40, 28,154, 62, 99, 70,100,214, 60, - 69,104,232,178,107, 84,170,241, 8,186,251,244, 3, 61,226,209, 94,231,110,188,164,173,199,238,209,242,221, 55, 13, 39, 90,209, -160,217,123, 20, 62,221,108,212, 65,170, 58, 24,150, 44, 38, 89, 77,199, 71,105, 24, 62,254, 29,196, 74,162,229,228, 89, 32, 24, -241, 0,112,199,224,193,110, 58,225,156,228, 91,207,218,122, 47,101,107,179,143,254, 27,119,252,135,136, 22,223, 56,129,153,189, -215,202,166,221, 38, 73,157,215,152,229,254,228, 93,168, 70,132,134, 64, 91, 93,106,144,204,211,211, 51,223,197,139, 23, 11, 50, -158,190, 12,107,117, 78, 13, 57,213,230,212, 52, 36, 36,164, 21,147, 47,140, 66, 66,108,144,190,225,249,210,125,156,253,154,152, -100, 46, 80,177, 99,139, 30,163,233,196,149,199,132,125,230,124,149,167,216, 22,239, 36, 5,155,194, 77,136,152, 44,181, 0,120, -173,101,116,242,242,219,141,120, 44, 47, 38, 89,174,209, 49, 89,236, 66,251, 8, 55,116,241, 94, 71,168,202,224,147,146,219, 4, -193,231,171, 57,110,129, 99,160, 62,200,209,123,126,145, 94,125, 29,244,133, 9,198, 83,154, 29, 29, 11,177,139,221,134, 7, 46, -191,166,133,140,103, 51,182, 16,228,239,116,144, 63, 60,206,178,197,208,231,190, 62,153, 60,114,245,189,107,238,138,145,238,121, - 43, 69,122,230,175, 76, 53, 57,160,186, 88,173, 46, 84,166, 94, 55, 42,223,184, 55,141, 92,116,156,182, 48,169,227, 57,172, 62, -177,187, 70, 26, 8,193, 50,117,142,178,201, 82,184, 22,189,226,120, 78,196, 27,186,148, 26, 40,165,224, 79,145, 20, 17, 73,148, - 41, 95, 53,106, 55,249, 36, 19,193,107,146,235, 15,241, 90,139,248,107,157,221,138, 26, 99,232, 80,126, 39, 39,167,226,220,158, -149,211,167, 79, 31, 67,200,217,114,213,160,195,176,101,108,217,123, 69,163, 22,236, 39,187,108, 28,183,162, 18,252,206,100, 60, -127,177, 98,197, 74,177, 5, 52,175, 62, 12,116,156, 79,192,241, 90,107, 39, 46, 63,134,209,105,112,117,207,147, 35, 11,196,233, - 25, 91,168, 71, 47, 60, 32, 97,183,145,201, 11,143,106, 99, 50, 27, 66, 3,103,238,149, 44,112,208,125,144, 44, 4, 9,235, 34, - 90,108,169, 42,221,172,211, 16,137, 60, 13,156,184,156, 76,204, 83, 45, 77,157,206,243,124,151,137,123,168, 73,223,133,148,157, -201, 86,239,233,135,200,197, 43,255,231,246,125,198, 75,249, 70,205,218, 72,166, 86,118, 75,228,234, 62, 92,164,190, 21,155,133, -161,140, 11,119,220,146, 58,203,124,101,154,134,225,184,156,250, 34,143, 38,162,213,172,251,228,183, 55,159,124,164,157,252,209, - 6,235, 61, 92, 95, 85,135,156,164, 12, 69, 58, 6,201, 38, 90,153, 11,125, 14, 11,139,160,150, 61, 39, 69, 20,171,222, 53,188, - 89,151,177, 17, 39,175, 60,149, 92,156,107,153,100,193,218,218,159, 63, 6, 97,113,175, 59,234,180,244, 78,181,206,144, 63, 84, - 87,185, 53, 17, 45,124,252, 96,208, 10, 92,253,248,136,137, 43,209,234, 53,104,244, 50,184, 11,247,178, 37,107,204,218, 91, 82, -172, 40,140, 0,112,205,131,100,225, 30,203, 15, 60,102,162, 85, 64,175, 69,203,194, 33,203,190, 7,207,223,115, 93, 95, 75, 94, - 36, 24, 59,254, 27,186,137,122,143,223, 64,133,171,119,151,210,184,133,251, 37,146,181,104,239, 83,198,246, 20,202, 45,139, 24, -129,104, 93,187,113, 99,128,189,135,111,224,241,203,207,121, 84,236, 43,106,207,164, 8,239,123,132,204,116,229,182, 66, 92, 50, -151, 83,150, 60, 16,173,208, 47, 17,146,149, 25,109,173, 36,134,144, 9,146,137, 24,173,146,189,143,114, 8,206,181, 31, 34, 90, -104, 87,117,226,133, 67,223, 14,255,223, 82,133,255, 53,197,104, 69, 95,251,157,149, 76, 85,134, 82,150,234, 94, 69,158,166, 56, - 77,237, 68, 75,151, 34, 38, 53,179,246,178,181,119, 9, 62,127, 9,100,227,255, 36,107,220,242,211, 28,139,101,247,132,175, 85, -159, 0, 82,231,243,136,249,157, 82,115, 71,178,104,235,133,192, 99,215,131, 3,250,174,120, 26,139,100,129,112, 53,159,116,245, - 34,130, 80,229, 62,216,136,201,130,175, 27, 35, 56, 64,178,118,158,125,201,110,204,215,223,190,202, 57,216,208,179,226,112,233, - 24,226, 6,240, 16, 97,200,191, 28,165, 1,209, 66,103, 88,187,117,191, 96,117,119, 97,251,246,237,123,131,100,237,218,181,171, -229,149, 43, 87, 90, 50,137,210,105,209,226,243,131,103,205,154,245, 73, 98, 88,106,219,148,169,211,169,116,221,174,212,160,239, - 10, 26,191, 96, 23,199,103,189,165,131,231, 30, 16, 99, 68, 11,182, 94,142, 51,209,226,151,246,136,178, 45, 39,209,136,213,247, -169,132, 76,146, 5,204,149, 68, 43, 91,161, 10,215, 86,237, 56, 71,243,118, 62,144,226, 9,240,112,120,183,220, 67, 25,155,238, -162,146,108,238, 47,217,118,145, 65,174, 67,158,143,168, 10, 91,211,118,179,213,170,150,106,219,242,176,233,158,185, 74, 54, 12, - 31,178,248, 28,117,155,114,144,135, 90,103,214, 27,196,170,114, 61,200,147, 25,187, 11, 75, 51,129, 45,193,100,171, 12, 91,179, - 42, 49,196,117,249,255, 86,185,115,231, 6,201, 66, 39,161, 12,150,215,170, 86,133,155,174,181,241,109, 51,191,113,201, 86, 51, -247,128, 92,173,218,118, 84,106, 41,236,241,127,201,214, 51,246, 22,106, 61,191, 89,222,230, 43,211,164, 41, 53,206,180,215,194, - 75,253,237, 43, 14,142, 83, 32,170,185, 67,214,143,176,100,161,179, 1,182,120, 9, 33,168,123, 25,119,108, 28,195,240, 65,142, -238,243,139,244,202,139,183,159,164,209,139, 19, 56,224,116, 48,187,117,187,243, 75,177, 62,143, 24, 44,215,239, 56,249,245, 56, - 66,249, 58, 29, 96, 75,239,105, 98, 23,243, 3, 57, 50,149,121, 16,248,126,204,255, 46,117,154,116,144,250,205, 62, 74,163,151, -156,164,217,235,207,179,107,242,181, 68,180, 56, 62,174, 37, 44,185,156, 95, 39,209,242, 42, 88,131,166,243,168, 59, 16,172,219, -207, 48, 93,196,103,233,247, 80, 30, 25,151, 49,111, 21, 42,213,106,206,203, 14, 28, 99,136, 64, 89,184, 43,225,254, 99,215,161, -214,120, 50,182, 8,131, 64,151,225,121,220,234, 57, 56, 56,212,100,226, 85, 3,201, 49,115,225,143,158,121,202, 80, 58,111,191, - 8, 87,143,108,141,221,221,221,171, 32,101,202,148,169,114,161, 66,133,106,226, 26, 38, 90, 21, 13,193, 64, 37,111, 66,182, 40, - 76,235, 60,100,174,100,225,104,216, 97, 4,241, 68,195,178, 38,117, 4,113, 2,201, 82,183,104,129,100,169, 31,235, 62,121,167, - 78,162,149, 50,149,195,190, 29,108,253, 29,191,112, 55, 37,183, 72,131, 57,222, 18, 38, 74,158,178, 78,163,238, 51,105,200,226, - 11,212,184,251,100,202, 94,184,188,100,233, 82,146, 44,115,171, 52,203,144, 79,110,189, 83,216,122, 12, 28, 60, 99, 27,119,146, - 15, 57, 22,171, 22,123, 44,238, 82,151,113,155, 8,199,229,202, 0,209,194,123,246, 56,135,146, 96,148,246, 46,182,140,182,238, - 51, 45, 8,129,246,234, 68, 43, 99,177, 78, 33, 24,200,208,113, 38, 58, 97,221, 49, 90,110,217,138, 62,120, 21,248,150,152,107, -209,187,144,112, 14,175,248, 72, 71, 56,134, 21,238, 55,116,232,176,184,195, 82,132, 15, 23,116,230,245, 6,109,167,212,238,133, - 31,233, 42,183, 38,162, 37, 77,183,193,174, 50,144, 98, 12, 4,137, 11,209,178,178,207, 56,134,173,185,159,246,250, 63,151, 72, - 22, 2,223, 37,146,197,150,178,206,209, 36, 11, 97, 24, 32, 35,105,221,117, 19, 45,196, 75,117,236, 51,134,222, 6,127,149,172, -182,147,121,240, 8, 62, 76,186,205, 57,207,207,229,113, 90,179,255,142, 52,109,200,162,125, 79,169,250,208, 83,228, 90,107, 9, -101,168, 48,222, 32,162,213,178,211,128,147, 3,167,109, 9,199, 72, 72,140, 56,110,193, 65,235,109, 38,159, 38,191,122, 3, 62, -101,204, 93, 41,208,206,189,192,171, 52,110,223,205, 61,169, 17,218,116,153, 11,189, 12, 10, 13,151,234,102,159,163,166,212,239, -226, 99, 10,163,174, 65,180,236,178,213,144,172, 89,176,104, 98,238, 62,185,122,133,124,252, 28,199,117,212, 33,174,195,200, 65, -213, 81,134,234, 35, 23,245,141, 70, 84, 61, 15,121, 73,180,148, 93,179,235, 80, 91, 69, 77,173,108,125,152,100,133,248, 95,186, - 22,139,100,141, 93,118, 58,202,194,202, 22,102, 73, 15, 67, 64, 50,181,205,228,147,138, 59,145,201, 43,142, 7,236,186,240,254, - 89,239,101, 79, 47,169, 90,178,254,255,251,161,191,157,135, 95,160,101,250, 28, 19,109,108,188,204,244,221, 3,241, 88, 32, 89, -255,177, 91, 43,107,205, 9,236,234,122, 41,117, 92,248,106, 0, 27,119, 47, 63, 68, 34, 90,120,153, 15, 90,122, 93, 82, 82, 57, - 68,203,198, 45,223,243,122,237, 99,143, 46,132,187, 16,150,172,101,203,150,181,132,203, 12,214, 44, 14,200,110,201, 47,125,157, - 68, 11,110, 66, 88,176,212,183,128,128, 0,186,113,227, 6,185,121,100,229,145, 83,151,165, 57,123, 70,206,222,193, 83, 60,220, -166,195,231, 31,209,210, 29, 87,226, 68,180,204,236, 60,219, 21,175,215,151, 70, 74,238,194,177,176,100, 53,215,135,163,242,188, -146,104, 33, 24, 62,115,190,242,159, 87, 30,120,200, 15,201, 5,202,217,110, 31,249,180,218, 43,145,172,186, 35,142,147,157, 71, -209, 79,134, 4,195,123,228, 42, 25,178,227,212, 67, 42, 86,185, 73, 24, 2,249, 85,203,195,195,150,203, 85,109, 49,156,221, 13, - 55,200, 53,103,165, 47,114,203, 26,157, 47, 65,202,148, 41,221,186,119,239, 94,145, 73,150,114,200,110,211,209,163, 71, 55,224, -227, 25,229,144, 44,200, 65,224, 59, 98,178,224, 46,132, 37, 75,117,195,255, 56,142,243,200,103,235,215,179,202,156,109, 87, 31, -219, 22,239, 83,197,192,178, 74,217, 83, 50,209,130,187, 16, 47, 30,152,212, 97, 49,196, 23,244, 18,184,230,100,198, 64,113, 7, -112,249,241,171,143,210,151, 60, 72, 74,207,249, 87,164, 23,121, 21,126,217,150,233,123,156,124, 57,238, 37,127,231,131, 84, 99, -216, 73, 16,173,135,134,148, 19,238, 75,140,124,133,108, 88, 53,208,249,128,100, 97, 68,163, 35, 19, 45,144,172,235,215,175,235, - 37, 90,153, 11, 84,167, 9,139, 15, 72,228, 10,163,217, 48,178, 13,191,251, 77,217, 74,110,121, 42, 19, 79, 88,218, 48, 99,137, -158, 27,202,183,155,255,166,215,188,243, 28,208,126, 27, 68,235,142,182,178,242,188, 75, 53,120,222,182,198,236,122,111, 10,242, -164, 76, 24,105,134,142, 60,115,158, 82,239, 85,143,135,134,134,150,205,158, 61,123, 35, 76,104,105, 99, 99, 35,197, 46, 25,176, - 37, 64,156, 11,143,162,186,217,159,227,201,208,153,245, 31,191,156,221,176, 94,139,229,202, 0,209,194,180, 45,223, 5,190,179, - 37, 75,253,216, 12,118,207,235,178,104, 21, 40, 94, 53,100,251,217,215, 84,162,106,211, 40,133,149,149, 50,158, 49, 65, 82,211, - 84,119,154,116, 27,207,131, 33, 94,176, 53,243,131, 68,178, 6, 79, 90, 65,230,150,105,182,113, 57,101,147, 44,133,151, 87, 82, -247,220,101,223, 98,106,140, 14, 67,151,225,189,115,165,229,128, 37,146, 5,197, 57,123,153,183, 56, 47,167,222,154, 70, 29,214, -109,214,249, 13,136, 81, 12,209,226, 78, 22, 31, 25,246,185,234,188,149, 59,234, 48,181,147,215,152,213, 27,119, 68,126, 9,139, -146, 72,251, 81,144, 44,182,188, 97,160, 11, 15, 80,146, 44, 69,144, 89,160,203, 65,106,202,164, 38, 95,237,193,145, 76,136,199, -235, 42,179, 58,209, 98,252, 79,241,136,202,171, 72,108, 69,186,106,158,214,251, 42,142, 65,134, 33, 49, 90,150,233,115,189,223, -125,150, 73, 86,244,232, 66, 88,135,224,142,196,232,103, 16, 75,124, 20,225,121,135, 53,211, 94, 15,209, 50, 77,147,105,205,165, - 91, 79,164,184, 93,196, 61,129, 84, 98,160, 74, 47,142,211,106,195, 22,167,182,211, 46, 82,205, 33,199, 41, 71,147,229,148,161, -244, 32,114, 45, 59,132,242, 52, 95, 35,155,104,165,178, 73,215,174,126,235,254,161,112, 23, 14,230,190, 17, 56, 54, 25,182,147, - 28,188,138,189, 74,229,148,179,163,150,249, 28,181,194,154,222,171,240,229, 39, 1,193,180,134,227,229,142, 95,121,197,100,171, -198,183,148,253, 91,154,184,238,166,244,156, 55, 25,125,140, 44,156,243, 93,150,163, 83,127,117,158,228, 22, 54,207, 46, 94,190, - 38,249,189, 17,147, 5,119,225,216,101,167, 34, 83, 90, 74,211, 55, 24, 68,178, 0, 20, 44, 23,237,134,173, 58,182,253,252,135, -125, 61, 22, 63,157,211,124,250,131,169,218, 82,181, 1,251, 23,165,203, 94,249, 54,191,212,190,112,156, 86, 40,127, 81, 13,210, - 6,182,181, 75,254,247,217,107, 79,146, 72,150, 79,245,113,228, 93,109, 12,101,174, 50, 74,178,100,185, 87, 24, 74, 25, 89,241, - 92, 74, 15, 36,167,146,253,200,177, 88,111,178, 47,210,139,248, 26,189, 22, 51,239, 34,117,167,150, 81, 25, 93,168,116, 23,170, -146, 44,158, 2,161,229,187,119,239, 90,242, 87,181, 78,162,197,231, 95,171,147, 44, 38,104,196, 29, 22,113,108, 17,185,186,103, -166, 46,252, 16,118,159,123,137,106,247, 88, 74, 69,235, 15, 35,191,186,131,169, 66,203, 9, 6, 19, 45, 38, 89,109,139,213,237, - 35,145, 44,191, 90, 61,153,100,121, 96,234, 9,217, 27, 2,251,143, 29, 59, 38,145,200,178, 53,154,110,204,144,189,244,231, 6, - 3, 55, 82,135,233,103,169,249,132, 83, 84,186,253, 82,137,100,249,149,175,191, 17,100,115,211,166, 77, 45, 45, 45, 45,245,198, -168,165,207, 82,228, 1, 2,108,231,173,222,199, 83, 57,120, 30, 50,179,205,212, 6,110,194, 20,182,153, 90, 99,180,204,144, 25, -155, 36, 66,111,231, 81,228,133,236,194,126,203, 40, 89,171,176,116,196,213,171, 87,171,193,109,120,231,206,157,166,209, 29, 43, - 58, 26,189,214, 44, 8,193,232, 66, 85,139,214,202,173,223, 44, 90, 43, 85, 44, 90,249,154,207,105, 99, 95, 98, 96,211,226,213, - 91, 69, 96,158, 45,236,109,139,246,174,110,227, 55, 88,239, 7,129,106,157,120,174,184,143, 8, 94, 85,206,255, 4,243, 58,226, -224, 16,199,101, 43,147,104,113, 7,176,113,217,166,195,210, 68,183, 51,182,221,147,190, 24,225,130,172,196, 95,244,165,216,197, - 91,141, 9, 23,166,106, 40,212,106, 37, 91, 9, 61,244, 77, 6, 27, 11,114,107,231, 28,152, 51,232,163,181, 83,246,143,169,210, -103,251,194,241,109, 95,210,184,230,228,125,206, 47, 60,154,235, 21, 72, 22,220,135,124,145, 78,139, 22,200, 20, 2,236, 49, 77, -138,210,117,248,224,229, 39,250,240, 49,156, 92,114, 85,146,130,222, 93, 11,180,182, 77, 87,168, 83, 91,167,124, 77, 79,180,110, -223,238,115,222, 98, 85,240,126,209,181, 37, 99, 29,173,226,235,235, 91, 63, 48, 48,176, 28,136,149,119,222,210,119,220,179, 23, -125,231,149,183,244, 93, 37,209, 98, 29,174,200,110,198,250,108, 77, 46,194,194,180,125,125,198,220,231,219,148, 14,158,175,121, -158,172,143,118,174,185,175, 21, 40, 89,247,125,231,129, 83,232,200,229,151, 60,210,235, 61, 13,155,178,146, 82, 58,120,175,230, - 11,100,147, 23, 16, 39, 88, 70,190, 11,124,231,175,125,245, 99, 32,181,186,136, 86, 58,183,172,151,214,240,168,210,174, 35,151, - 82,210, 20,150, 3, 20, 10, 27,179, 68, 38, 22,179,203, 55,234, 79,133,235, 12,162, 66,101, 27, 80,165,186,173,201, 59,151,111, -104,146,228, 22, 32, 24,178,203, 41,189,159,121, 73,172, 38,221,167, 74, 86, 69, 88, 99,208,193,122, 23,174,245, 9, 36,190, 82, - 43,201, 66, 82,215,192,231, 50, 38,187,147, 71,158, 7,211, 23,111,138, 88,127,248,158, 68,140, 58,112,124,103,193,134,147,195, - 45, 28, 13,177,180,122, 37,229,229,151, 66, 30, 60, 13,148, 72, 7,230, 73,195, 51, 51,104, 41,147, 3, 38, 49,152, 51, 15,177, -163,149,121, 30,184,218, 3,118,144, 85,134,188, 28,159,165,155, 28, 58, 21,110, 55,117,238,166, 43,123,229, 78,239,128,188,184, - 70, 31, 14, 60, 98,253,253, 41,126, 46, 17, 55,140,121,222, 64,136,240,126, 71,188,164,146,100,193, 50, 5,162,229,144, 73,183, - 69,139,137, 86,224,141,199, 60,178,148, 71,112, 46,231,143,158,169,155,110,211, 16,142,105,108, 51,225, 40, 85,236,186,134,114, -215,157, 66,153,202, 15,166, 28,117,166, 82,229, 62, 59,169,225,136, 67,228, 93,162, 53, 91, 33, 51,233,157,134, 2,245, 72,105, -235, 50,125,202,146,189,145,176,150,225,131,175,203,204,243,100,239,233,251,218,220, 62, 19, 38,162, 54,120,227,153,225,199,111, -221,127, 46, 10,207,252,116, 30,181,124,128,167, 96,217,121,230, 57,109, 58,254,148, 39,209,125, 36,189,227,129, 73,209,230,179, -163,204,211,229,214, 73,132, 13,190,121,124,188, 32, 69, 74, 27,105, 62, 12,219, 44, 85, 88,169, 95,210,232,197, 39, 35,205, 83, - 90,193, 5, 97, 8,201,138, 53,233, 92,211, 25,247,235,182,152,123,191,126,253,105,247,106,203, 73, 85, 71,156,105, 84,105,192, -193,102, 10,103,103,213,245,245, 98,201,132, 69, 75,147,187, 16,102,107, 12,133, 69, 96,230, 97, 14,106, 7,201,226, 17, 37,146, - 57,155, 77,161,186,102,134,143, 89,187,240,219,100,164, 25,246, 21,200,227,185,109,248,240,225,189,121,104,114, 75,144, 16, 38, - 71,152,103, 74, 34, 89, 12,145, 54,162, 21, 83, 78, 88,180,148,177, 89, 60,139, 49,241, 48, 90, 98, 89,180,102,205, 26, 90,189, -122, 53,241,244, 24,225, 5,106,244,163,214, 19, 79, 74, 86, 56,124,173,244,103,165,199, 67,169, 54,234, 80,231, 68,139, 18,201, -170,195,241, 52, 18,201,234, 5,146, 37,103,166,218, 88, 50, 49, 61, 2, 91,181, 26, 12, 24, 48,160,153,114,154, 7,247, 92,101, -174,241,196,122,193, 8,126,199, 72, 67, 88,178,182,110,221,218,178,115,231,206,205,145, 23,215,168,233,248,119,229, 4, 89,238, - 62,106,165, 52,130,113,245,238,139,212,143,173, 3,181, 90, 13,160,238,163,150,208,204,181,167,165, 1, 1,101,218,205, 71,125, -181,205,105,163,171,238,146, 11,209,203,203,171, 58,183, 73, 93,140, 60,196,255,156,244,145,172,239,100, 34, 70,203,179, 64,229, - 94,170, 49, 90, 94,249,170,204, 68,140, 86,239, 69,151, 6,192,146, 21,123, 82,211,171,143,113, 92,165,254,122, 39,212, 5,209, - 90,115,132, 95, 60,156,240,130, 67,172,206,114,222, 3,155, 52,174, 26, 71,245,125, 39,211,210, 50,155, 37, 91,137,199,228, 47, - 85,247,235,140, 85, 71,104, 33, 15,151,110,197, 29, 78, 35,182,146,117,153,115,133,106, 15,218, 77,142, 57,171,133,179, 14, 76, -213, 50,210, 82,111, 57,163,235,212,242,245,235,215, 45,225, 46, 60,114,228,136,100,201,194,255,208,123, 13, 68, 43,150, 76, 75, -167, 92,199,254,235, 62,145, 78,243, 20, 15,152,190, 36,107,213,145,210, 92, 77,175,131,194,200, 57, 71, 5,229,232,194,116,157, -234,184,253,119,123, 93,133,157, 23, 87, 86,191, 81,161,156,223, 44, 53,146,160,169,156, 9,152, 72,251,178, 37,185, 49,207,229, - 6, 43,102,140,117, 11,191,187,118,237, 90,147, 71, 63, 55, 73,150, 44,153,182,208,134,239,100, 50,201, 10, 68,217, 46,243, 42, - 18,152,100, 20,113, 84,215,185,131, 91,180,238, 0, 21, 44, 83, 87,154, 20, 82,207,176,249,239,100,130, 56,193,234,162, 78,170, - 22,114, 44,154,250, 49,116,188, 26,136, 86,140, 76, 4,180, 3,203, 57,219,239, 81,211,158, 83,201, 57,115,190,200, 26,173, 71, -208,160,133,254, 84,190,249, 24, 74,106,158,106, 52,227, 22,231,117, 72,217,219,112,106,252,234, 43, 28,231,117, 0, 31, 66,104, - 3, 5,246,173, 71,239,162, 46,211, 57, 84, 36,125, 78,201,178,163,101,211,169, 75,133,124,253,122,151,173,222,228,178,119,158, -210,129,206,222,190,193,108,245,120,149, 41, 71,209, 75,142, 78,206,189, 13,145,105,106,157,161, 84,174, 34,213,194, 78, 94,126, - 44,185, 38, 65, 78, 59,207,190, 36,185,199,107,240,234, 15,205,216,114, 4,189, 79,227,225, 23,150, 34,181,180, 76,152,250, 22, - 83,206,232,181, 11,163,204,237, 60,163, 82,123,148,190,174,109,249, 29,229,113,228, 65, 94,110, 35, 78,186,215, 58, 76,197,147, -144,110, 59,253,130,167,148,121, 41,141,216,195,115,142,129, 30,203, 56, 38,107, 41,147,108,140, 52,199, 64, 21,184,215, 28, 50, - 21,212, 57, 97, 41, 98,173, 6,206,216, 69,255, 13, 88, 73,117,123, 46,161,170,157, 22, 80,249,182,115,169, 98,135, 5,212,104, -208, 70,234, 62,253, 56, 13, 95,113,149,218,143,223, 77, 57,202,180, 33,246, 14, 28,211, 50,207,155,198, 54,226, 80,158, 3,235, -246, 95,149,230,179,195, 92,116,101, 26, 15,253,106,227,146,167,151, 76,206,242,253,123,158, 39, 25,119,201,230,247,226,200,133, - 71,210, 76, 4, 43,121,222, 53,124, 72,194,163,132,132,233, 60,234, 13,222,197, 68, 56,223,115, 45, 19,146,203,188,245, 95,146, - 45,169,137,217,157,117, 59, 79, 71, 96,126,154,145, 11,143,133,165, 48,183, 64, 64,173, 33, 36, 11, 72,200,125,153, 27,130,218, -119, 68,235, 59,119, 33, 91,178, 48,164, 84,213, 93,104,239,215, 83, 34, 89,227,120,242, 52, 93, 68, 75,117,237,194, 34,249, 29, -247,240,215,115,227,228,201,147,119, 98,171, 77, 67, 36, 76,206, 9,247, 26, 38,207,227, 23,189,148,216,154, 18, 43,238, 40,186, - 50, 49,229, 68,140, 22, 79,210,247, 25,238, 67, 94,230,128,120, 90, 2,226, 24, 47,218,184,113, 35,241, 60, 80, 97, 28,123, 50, - 18,238, 61, 94,159,239, 73,129,154,253,168,205,164,147,108,221,226,151, 30,127, 1,201, 37, 90,248,226, 44, 90,167,119, 20, 72, - 86,209,218,189,163,152,216,180,146, 9,170,166, 54, 74,202,117,206,199,117,172, 63, 97,194, 4,137,112, 33,193,130,133, 52,100, -200,144, 22,209,245,198, 34,211,154, 92, 10, 26,100,230, 76,194, 38,121,158,223,106, 60,245,157,115, 76,138, 53,152,206,163,143, -134,178,185,186,241,240,125, 84,176,238,112,178,116,200,186, 93,193,163, 38, 13,125,153,179,123, 40,125,206,156, 57,139,114, 92, - 78,123, 94,130, 99, 1,239,219,242,177, 34, 28,163,229, 18, 77,182, 12,234, 32, 64,182, 16,171, 5,119, 33,246,248, 31, 2, 16, -155, 5,183,161,210,162, 85, 2, 22, 45,118, 31,170,197,106,233,213,121,203,116,217,239, 32,232, 29, 9, 49, 89,112, 23,194,146, - 5,146,101,231,150,251,186,174, 14, 66,253, 92,114,123,239,116,236, 34, 89, 92,176, 66,243,200,190, 51,247, 83,207,217,103,200, -167,116, 91,158, 84, 51,211,106, 29,171, 1, 24,242,108,182,228,229, 77,190, 35, 89,114,136, 22,136, 9, 91,165,155, 91,184, 20, -124,221,164,203, 56, 58,126,225, 62, 53,235,191,140, 58,142, 92, 71,233,179,149,163,218,197,156,106, 94, 95, 89,102, 89,200,193, -170,135, 22,245,207, 53,216,212, 52, 41, 8,187,186,245, 73, 43,158,236, 70,244,224, 4,235,101, 51,190,174, 37, 63, 71,205, 56, - 46,171,126,138, 20,210,226,238,186,172,140, 26,137, 22, 72,214,166,147,175,216, 82,217,129,154,117, 28,128,213, 25,130,208,169, -170,187,186,229,234, 39,136, 19, 70,195,169,199, 99, 33,174, 78,253, 24,226,236,116, 17, 45,232,113, 18, 83,235, 69,117,218,141, -164, 49, 43,175,208,208, 37, 23,168,255,252,115, 84,165,245, 88,142,217,178,195,170, 20,114, 55,141,120,250,248,214,122,135,119, - 99,225,234, 93, 56, 6, 45,147, 15,132, 97,159,187,124,123,234,192, 67,243,221,242,212,128, 75, 95,219,128, 18,157, 58,207,131, - 17,218,179,190, 12,226,119,159, 52, 59, 60,191, 83, 6,245,237,219,119, 16, 15,106,104,175,163,208, 26,101,154,241, 34,215,246, - 30,133, 62,118, 26, 50, 55,114,234,234, 51, 60,237, 12, 19,132, 21,215,168,254,160,109, 84,160,206,176, 72,238,192, 63, 50, 33, -211, 86, 30,233, 56,214, 41,100,172,121,116,221,183,181, 11,121,134,252,168, 89, 27, 46,236,213,182, 4, 15,206, 33,143,220,181, - 14,173,210,231,186,155,214,195,247,173, 99,230, 34,111, 29,189,124,223,166,243, 42,242, 45,121,127,219,243,178,104,156,124,223, -166,231,189,125,198,188,154,166, 94,137, 41, 63,136,214, 67, 30,109,136,201,132, 47,222,125, 75,135, 47, 62,167,205, 60,101, 11, - 62, 78, 91,244,157, 77,185, 74, 53, 38,158,212,251, 30, 44, 88,188, 18,132,159,161,120,242, 7,244,163, 67, 23, 49,245,196,109, -142,245,188,203,171, 64, 84, 12, 50,192, 93,168, 17,103, 46,115,150,180,238,249,159, 53,232, 56,250,227,212, 53,231,249, 35, 16, - 19,151,222,162,214,227, 14, 80,174,202,221, 67, 44,157,114, 63, 67, 30,185, 10, 27,143,243,201, 49,116, 40, 60,146, 36, 53,185, -110,146,220,236, 94,210,100, 38,152,132,212, 80,146,101,200,203,220, 16, 44, 99, 53,110, 42,151, 60,231,148, 35, 12,149,163, 11, -121,164, 97, 48, 70, 23, 34, 22, 75,153,224, 46, 4,193, 66,210, 16,216, 23, 35, 83,117,237,194,244,105, 77,134,113,193, 12,158, -241, 61,186, 50,170,229,148, 70, 29,114,220,208,231, 51,103,206, 16, 47,176, 74, 75,151, 46,165, 86,173, 90,133,241,241, 11,156, - 63,122,137,144,156, 73,148,132,171, 96,205,254,212,118,178, 52,122,228,146, 10, 56, 90, 95,104,152, 68,113,248,170,187, 4,178, - 5,119,156, 1,128,234,122, 73,166, 96,203,128, 31,199,196,212,225,185,170,154, 78,154, 52,169,165,155,155, 91, 67, 11, 11, 11, -140,184,208, 21, 8,174, 85, 38, 38, 59,100, 18, 48,218,209,187,248, 69,239, 98, 77, 62, 58,120,151,184,204,110,155,177,112,221, -232, 41,179,198,243,108,189,114, 99,146,213,159,211, 90,254,125,137,247,183,120,127,138,247,115, 57,181,245,246,246,214,213,126, - 90,239, 9, 55,162, 52,143, 22,239,213,203,149,166,104,175,202,176,108, 97,175,161,204,250,234, 97, 64,211,196,100,213, 43, 19, - 47, 46,158,143,108,189,185, 93,230, 45,152, 62, 69,198, 77,244,202,132,140,232, 41, 28, 84, 3, 60, 99,126,179,110,168, 79,239, -160, 69,230,255, 9, 87,165,150,227,169,221,176, 53, 84,180,116,121,250,124,168,218,177,109,227, 11,141,119,115, 72,142, 9,103, -177,164,146,166, 77, 95, 57, 49,216, 1, 22, 54,196, 96, 97,202,137,108,188,215, 55,194,244,123,162,245,205,117, 24,200, 24,190, - 51,181,241,232, 29,189,116,145, 62, 57,170,229,253, 78, 38,136, 19,220, 92,253,103,236,145,172, 23,176,100,129,100, 97, 77,198, -174, 19,119, 72, 22, 25,124,112,128,100,193, 42,175,135,104,225, 94, 9,146,152, 88, 54,201,152,163,196,157, 2, 21, 90,132,103, -200, 90,244, 82,162,228, 22,186, 22,102,150,141, 39, 91,175, 6,100,202, 91, 37,200,220, 33,203, 4,213,139, 48, 81,166,115,142, -202, 31,204, 28,188,226,178, 46,161, 36, 42, 79,158, 60, 85, 57,228, 98, 0,135, 75, 12,226, 9, 60, 7, 45, 88,176, 96, 80,249, -242,229, 7,112,236, 92, 21, 29,122,170,163,221,221,146, 89,218,251, 76,225,145,178,247,248, 93,255,153,201,213,103,155,140,133, -238,167,180,207, 50, 93,225,152, 95,155, 30,225, 86,146, 76,172, 83,200,207,203,255,215, 58,228,185,157,120, 4,228, 28,109, 75, -240,224, 28,230,127,146,187,214,161,140,103, 79, 95,150,152,186, 35,196,130, 63, 80,159,242,253,239, 32, 46,147,211,105, 78,135, -248, 67,122, 29, 98,113,245,124, 76,233,212, 79,156,228,149, 83,222,195, 0, 1, 55, 44,166,107,178,207, 84,224,131,190,194,169, -156,215,209, 70,126,137,173,211,103,255, 47,173, 71,225, 61,220, 23,223,181,113,147,210, 30,158,218,134, 23, 78,151, 63,161,170, - 1,101,249, 19,179, 98, 9, 65, 89,100,235, 71, 11,175,239, 37, 25, 23,249, 63, 85,166,167,107,138, 42,165,138,184,108,114,115, - 50,133, 89, 91,117,237, 66, 67,203,170, 94, 78,144,173,193,108, 37,186,207,196, 37, 16,238, 68,252,207, 66, 53, 44,254, 27, 67, -184, 48,219,239, 10, 57,138,141,145, 80,169, 93,114, 29,228,120,156, 38, 6, 22, 84, 14,158,150,220,169, 22,143,142,123,178,148, - 33, 95,142, 76, 25, 98, 98,101,209, 42, 83,105,209,226,125, 93, 78,109, 56, 85,231,228, 27, 87,139, 22,238,138, 81,136,202,153, -225,213, 11,234, 88,115, 98,242, 62,139,181,142, 58,252,165,117, 55, 20, 68, 57,186,244,243,100, 70, 19,174, 12, 5, 3,170,151, -203,113,223, 55,171,109, 41,190,151,166,133,185,245,118, 16,170, 25,146, 38, 77,138,121,162, 90, 70,239,229, 20,255,151,180, 17, -166, 83, 1,121,146,155, 52, 76,191,242, 75,202, 41, 7, 48, 61,121,244,149, 51, 81,214,172, 89,139,242,243,216,132, 63,130,218, -177,139,191, 9,175,169,234,171,249,221, 23,115, 39,125, 50,227, 82,236,255, 19, 24, 94,175,144,215, 45,140, 66, 82, 91,187, 80, -163, 92,228,209,146,255,167,150, 51, 46,149,212,114,141,198,114,218,184,228,190,157,150,167,152,192,232, 71, 38, 89,239,237, 92, -243,220, 54,224,158, 63,163,238, 6,220, 94,100, 85, 34,240, 51, 26, 66,200, 52,174,126, 9, 60, 5,158,198, 66,192, 16, 93,146, - 27,172,109,136, 76,185,245, 16, 50,229, 34, 37, 47, 95,188,196, 19, 86, 75, 29,139,174,127, 87,115, 45,249,227,101,221,229, 53, -171,222, 92, 63,163,238,122,111,250, 7,103,208,100,249,255, 37,197,253, 25, 13, 33,100, 26,183,233, 4,158, 2, 79, 99, 33, 32, -116,201, 88, 72,126,147, 35,240, 20,120, 26, 11,129,248,162, 75,198,170,239, 31, 39, 7, 13,160, 41, 25, 82, 80,109, 50,116, 29, -215, 39, 95,200,212,220, 46,113,109, 47,129,167,192, 83,174, 14,136,103, 83, 59, 2,114, 49, 84,205, 39,240, 20,120,106, 66,224, - 95,214, 37, 37, 30,113,237,207,244, 61, 83,191,227,188,186, 69, 11, 49, 90,191,100,139, 47, 44, 90,148,211,184,234, 32,240, 20, -120, 26, 11, 1,161, 75,198, 66, 82, 88,201,132, 46,253,249,186,100,220, 18,254, 94,105,191, 36, 16, 94,152,190,141,223,200,226, - 69, 97, 92, 76, 5,158, 2, 79, 99, 33, 32,116,201, 88, 72, 10, 66,248, 47,235,146,113,181,232,247, 74, 19, 68, 75, 13,255,127, - 89,177, 69,221,141,251, 48, 10, 60, 5,158,198, 66, 64,232,146,177,144, 20,228, 45,190,232,146,113, 91,252,215, 74, 19,174, 67, - 61,120,199, 23, 37, 20,229, 52,238,131, 35,240, 20,120, 26, 11, 1,161, 75,198, 66, 82,144,162,127, 89,151,140,171, 69,255,136, -180,127, 89, 97, 68,221,141,171,228, 2, 79,129,167,177, 16, 16,186,100, 44, 36, 5, 41, 18,186,100, 92, 93,138,207,210,148,174, - 66,229, 68,165,194,117, 40, 92,135, 49, 8,136, 23,133,113, 31,109,129,167,192,211, 88, 8, 8, 93, 50, 22,146,130, 16,198, 23, - 93, 50,110,139,255, 90,105,234,196, 42,246,255,188,254,148,114,129, 87,133,234,239, 95, 91, 70,113, 55,129,128, 64, 64, 32, 32, - 16, 16, 8, 8, 4,254, 85, 4,226, 57, 23, 81,181,100,129,100,197,158,222, 1,149, 83, 86, 80, 16,173,127, 85,197, 69,189, 5, - 2, 2, 1,129,128, 64, 64, 32,240,251, 16,248,171,185,136, 42,201, 18, 68,235,247, 41,153,184,179, 64, 64, 32, 32, 16, 16, 8, - 8, 4,254, 85, 4,254,106, 46, 18,207,205,117,255,170, 78,138,122, 11, 4, 4, 2, 2, 1,129,128, 64,224,175, 65,224,175,230, - 34,127,117,229,254, 26, 21, 20, 21, 17, 8, 8, 4, 4, 2, 2, 1,129,192,223,139, 64, 60,231, 34,186, 99,180,254,222,102, 19, - 53, 19, 8, 8, 4, 4, 2, 2, 1,129,128, 64, 64, 32,240,211, 17,208, 61,234,240,167,223, 94,220, 64, 32, 32, 16, 16, 8, 8, - 4, 4, 2, 2, 1,129,192,223,139,128,250,204,240,191,108, 30,173,191, 23, 82, 81, 51,129,128, 64, 64, 32, 32, 16, 16, 8, 8, - 4, 4, 2,191, 25,129,248, 50, 73,154, 40,167,113, 21, 69,224, 41,240, 52, 22, 2, 66,151,140,133,228, 55, 57, 2, 79,129,167, -177, 16,248, 25,186,100,172,178,253, 14, 57,202, 24, 45,220,251,251,121,180,126, 98,137,126, 70, 67, 8,153,198,109, 48,129,167, -192,211, 88, 8, 8, 93, 50, 22,146,130, 20, 9, 93,250, 55,117,201,184,181,254,181,210,148,174, 66,245,253, 79, 47,133,120, 88, -140, 11,177,192, 83,224,105, 44, 4,132, 46, 25, 11, 73, 65,138,132, 46, 9, 93, 50, 46, 2,241, 83,218,111, 11,134, 23, 15,160, -113, 21, 70,224, 41,240, 52, 22, 2, 66,151,140,133,164, 32, 90, 66,151,132, 46, 25, 23, 1, 33,205, 32, 4,196, 3,104, 16, 92, -122, 51, 11, 60,245, 66,100, 80, 6,129,167, 65,112,233,205, 44,240,212, 11,145, 65, 25, 4,158, 6,193,165, 55,179,192, 83, 47, - 68, 6,101,248, 25,120, 26, 84, 0,145, 89,124,229,253, 12, 37, 20, 50,141,251,100, 9, 60, 5,158,198, 66, 64,232,146,177,144, - 20,125,199,191,172, 75,198,213,162, 63, 72, 26, 26, 85, 83, 50,164,136,218,100,232, 58,174, 79,190,144,169,185, 93,226,218, 94, - 2, 79,129,167, 92, 29, 16,207,166,118, 4,228, 98,168,154, 79,224, 41,240,212,132,192,191,172, 75, 74, 60,226,218,159,233,123, -166,126,199,121,229,168, 67,213, 25,226,127, 73, 57,254,101,102, 46,234,110, 92, 21, 19,120, 10, 60,141,133,128,208, 37, 99, 33, - 41,172, 79, 66,151,140,171, 75,241, 89,218, 47, 31,109,168,202, 86,141, 13,156, 80,108,227, 34, 42,240, 20,120, 26, 11, 1,161, - 75,198, 66, 82, 16, 24,161, 75,255,166, 46, 25,183,214,191, 86,218,111,155, 25, 94, 60, 44,198,109,104,129,167,192,211, 88, 8, - 8, 93, 50, 22,146,130, 20, 9, 93, 18,186,100, 92, 4,132, 52,131, 16, 16, 15,160, 65,112,233,205, 44,240,212, 11,145, 65, 25, - 4,158, 6,193,165, 55,179,192, 83, 47, 68, 6,101, 16,120, 26, 4,151,222,204, 2, 79,189, 16, 25,148,225,103,224,105, 80, 1, -254,176,204, 98, 30, 45, 61, 13,242, 51, 20, 70,200, 52,238, 83, 32,240, 20,120, 26, 11, 1,161, 75,198, 66, 82, 88,243,132, 46, - 25, 87,151,226,179, 52, 49, 51,188, 32, 90, 90, 17, 16, 47, 10,227, 62,218, 2, 79,129,167,177, 16, 16,186,100, 44, 36, 5, 33, -140, 47,186,100,220, 22,255,181,210,244,199,104,109,219,182,141,126,109,153,196,221, 4, 2, 2, 1,129,128, 64, 64, 32, 32, 16, - 16, 8,252, 31,129,191,150,139, 40, 43,246,215, 86, 80,104,177, 64, 64, 32, 32, 16, 16, 8, 8, 4, 4, 2,127, 52, 2,241,156, -139,168,206,159, 5,235, 22,254,255,158, 65, 10,162,245, 71,235,160, 40,156, 64, 64, 32, 32, 16, 16, 8, 8, 4,254, 90, 4,226, - 57,209,210, 29, 12, 31,207, 43,247,215, 42,157,168,152, 64, 64, 32, 32, 16, 16, 8, 8, 4,254, 21, 4,226, 57, 23, 17, 49, 90, -255,138,162,138,122, 10, 4, 4, 2, 2, 1,129,128, 64, 32,190, 34, 32, 60,107,241,181,229, 68,185, 5, 2, 2, 1,129,128, 64, - 64, 32, 32, 16, 16, 8,252, 60, 4,244, 91,180,126,222,189,133,100,129,128, 64, 64, 32, 32, 16, 16, 8, 8, 4, 4, 2,255, 4, - 2,234,177, 90,255, 68,165, 69, 37, 5, 2, 2, 1,129,128, 64, 64, 32, 32, 16, 16, 8,252,108, 4,126, 11,201,138, 47,147,164, -137,114, 26, 87,253, 4,158, 2, 79, 99, 33, 32,116,201, 88, 72,126,147, 35,240, 20,120, 26, 11,129,159,161, 75,198, 42,219,239, -144,243,219, 92,135, 63,163, 33,132, 76,227,170,144,192, 83,224,105, 44, 4,132, 46, 25, 11, 73, 65,138,132, 46,253,155,186,100, -220, 90,255, 35,210,196,195, 98,220,134, 22,120, 10, 60,141,133,128,208, 37, 99, 33, 41, 72,145,208, 37,161, 75,198, 69, 32,126, - 74, 19,139, 74,235,105, 55,241,162, 48,174, 98, 11, 60, 5,158,198, 66, 64,232,146,177,144, 20,132, 80,232,210,159,175, 75,198, - 45,225,175,149, 38, 22,149, 22, 68, 75, 43, 2,226,229, 99,220,135, 81,224, 41,240, 52, 22, 2, 66,151,140,133,164, 32,153,241, - 69,151,140,219,226,191, 86,154,136,209, 18, 68, 75, 16, 45, 13, 8,196,151,151,143, 40,167,113, 95,152, 2, 79,129,167,177, 16, - 16,186,100, 44, 36,255,114, 57, 80, 20, 77,201,144,106,107,147,161,235,184, 62,249, 66,166,230,118,137,107,123, 9, 60, 5,158, -114,117, 64, 60,155,218, 17,144,139,161,106, 62,129,167,192, 83, 19, 2,255,178, 46, 41,241,136,107,127,166,239,153,250, 19,206, -255,178,169, 30, 4,219, 55,110,115, 11, 60, 5,158,198, 66, 64,232,146,177,144, 20,110, 41,161, 75, 66,151,140,139,192,223, 33, - 77, 16, 45,181,118, 20, 47, 10,227, 42,182,192, 83,224,105, 44, 4,132, 46, 25, 11, 73, 65, 8,133, 46,253,249,186,100,220, 18, -254, 90,105, 34, 70, 75, 15,222,226, 1, 52,174, 66, 10, 60, 5,158,198, 66, 64,232,146,177,144, 20, 68, 75,232,210,159,175, 75, -198, 45,225, 63, 34, 77, 40,182,113, 27, 90,224, 41,240, 52, 22, 2, 66,151,140,133,164, 32, 48, 66,151,132, 46, 25, 23,129,248, - 41,205,158,139, 13,171,150,114,159,243, 87, 85, 67, 60,128,198, 69, 90,224, 41,240, 52, 22, 2, 66,151,140,133,164, 32, 90, 66, -151,132, 46, 25, 23,129,248, 41, 77,204,163, 37, 92,135, 90, 17, 16, 47, 73,227, 62,212, 2, 79,129,167,177, 16, 16,186,100, 44, - 36, 5, 25,142, 47,186,100,220, 22,255,181,210,116,199,104,109,219,182,141,162,147,223,175, 45,151,184,155, 64, 64, 32, 32, 16, - 16, 8, 8, 4, 4, 2, 2, 1,133,226,175,230, 34,168, 28, 26, 89,185, 23, 13, 46, 16, 16, 8, 8, 4, 4, 2, 2, 1,129,128, - 64,224, 87, 34,240, 87,115,145,191,154, 69,254, 74, 45, 17,247, 18, 8, 8, 4, 4, 2, 2, 1,129,128, 64, 32, 78, 8,252,213, - 92, 68, 88,178,226,164, 19,226, 34,129,128, 64, 64, 32, 32, 16, 16, 8, 8, 4,140,132, 64, 60,231, 34,234,163, 14, 99, 79, 88, - 26,207, 43,103,164, 38, 22, 98, 4, 2, 2, 1,129,128, 64, 64, 32, 32, 16,248, 93, 8,196,115, 46,162, 62,234,240,119,193, 40, -238, 43, 16, 16, 8, 8, 4, 4, 2, 2, 1,129,128, 64,224,175, 67,224,183,205, 12,255,215, 33, 41, 42, 36, 16, 16, 8, 8, 4, - 4, 2, 2, 1,129,128, 64, 64, 32, 32, 16, 16, 8, 8, 4, 4, 2, 2, 1,129,128, 64, 64, 32,240,235, 16, 80,181,106,253,178, -187,198,151, 73,210, 68, 57,141,171, 18, 2, 79,129,167,177, 16, 16,186,100, 44, 36,191,201, 17,120, 10, 60,141,133,192,207,208, - 37, 99,149,237,119,200,137, 29,252,254,109, 57,158, 95,178,253,140,134, 16, 50,141,219,116, 2, 79,129,167,177, 16, 16,186,100, - 44, 36, 5, 41, 18,186,244,111,234,146,113,107,253,107,165, 9,162,165, 7,111,241, 80, 27, 87, 33, 5,158, 2, 79, 99, 33, 32, -116,201, 88, 72, 10,242, 38,116,233,207,215, 37,227,150,240,215, 75, 19,174, 67, 29,152,139, 7,208,184, 10, 41,240, 20,120, 26, - 11, 1,161, 75,198, 66, 82, 16, 45,161, 75,127,190, 46, 25,183,132,255,136, 52,161,216,198,109,104,129,167,192,211, 88, 8, 8, - 93, 50, 22,146,130,192, 8, 93, 18,186,100, 92, 4,226,167,180, 95, 22,147,165, 14,143,120, 0,141,171, 48, 2, 79,129,167,177, - 16, 16,186,100, 44, 36, 5,209, 18,186, 36,116,201,184, 8,196, 79,105, 58, 39, 44,197, 67,162, 41, 25, 82, 85,109, 50,116, 29, -215, 39, 95,200,212,220, 46,113,109, 47,129,167,192, 83,174, 14,136,103, 83, 59, 2,114, 49, 84,205, 39,240, 20,120,106, 66,224, - 95,214, 37, 37, 30,113,237,207,244, 61, 83,191,227,252,111,155,176, 84,124,233, 24,183,185, 5,158, 2, 79, 99, 33, 32,116,201, - 88, 72, 10,139,150,208, 37,161, 75,198, 69, 64, 72, 51, 8, 1,241, 0, 26, 4,151,222,204, 2, 79,189, 16, 25,148, 65,224,105, - 16, 92,122, 51, 11, 60,245, 66,100, 80, 6,129,167, 65,112,233,205, 44,240,212, 11,145, 65, 25,126, 6,158, 6, 21,224,111,204, -108,155, 56,113,226,190, 41, 82,164,152,201,105, 14,255, 30,207,149,180,214, 83,209,239, 26,194,204,204,172, 99,218,180,105,111, -112,122,154, 62,125,250, 29, 41, 83,154,118,118, 51, 81, 20, 97, 57, 73,100,130,166,171,113, 19,178, 12, 79, 78,157,185,140,215, -147, 39, 79,254,144,127, 47,195,255,156,108,116,200,215,171, 48,195, 28, 20, 53,174,116,170,178, 9,123, 53, 57, 21,236,236,236, -142,242,177,210,106,199,245,202,212, 86,158,186,166,138,146, 53,205, 20,143,145,240, 91, 37,159, 65, 50, 83,166, 76,217,208,222, -222,254,100,234,212,169,159,241,254, 56,227, 81, 83,195, 61,117,201, 76,195,117, 27,231,228,228,116,203,193,193, 97, 50, 95,139, -213,201,229,108, 6,149, 83,142, 64,206,163, 87,166,175,137,194, 55,191,137, 34,176, 64, 50, 69,112,161,100,138,153,188, 47, 85, - 74,161, 48,141, 99,187, 23,230,235,214, 89, 88, 88, 92, 96, 93,223,198,191,171,115,130,126, 85,199,255, 56,142,243,156,144, 79, -117,211, 91,206,104, 57,227,120,255,140,211,200,232,255, 59, 48,206,193,217,178,101,123,200,105,145,187,187,123, 35,185,237,110, -106,106, 90,138,175, 93,207,207,211,195, 2, 5, 10,188,117,116,116,188,153, 46, 93,186,197, 38, 38, 38, 69,227, 88,119,153, 77, -242, 93, 54, 57,117, 55, 84,182,144,105, 40, 98,186,243, 11, 60, 5,158,198, 66,224,103,232,146,177,202, 22,239,228, 84,226, 18, -143,226, 52,237,210,165, 75,254, 68, 36, 37,252,230, 99, 51, 57,141,214,209, 9,198,106, 8,238,240,135, 12, 31, 62,252,243,139, - 23, 47, 40, 48, 48,144,110,221,186, 69,147,250,247,138, 42,147, 42, 49,185,217, 90,135, 50, 25,184,235,156, 46,221,170, 44,230, - 9,123,177,204,140, 90,144,210,214,184,214, 76,174, 78,247,239,223, 63,228,232,209,163, 33, 95,191,126, 13,137,138,138, 10,121, -254,252,121,200,190,125,251, 66, 10, 21, 42, 20,194,242,186,112, 74,164, 65,174, 94,133, 25,234,160, 56, 76, 11, 6, 16,246,170, -215,103,206,156,249, 26,223,135,106,212,168,241,133,143, 59,202,237, 28, 53,213,141, 47, 78,158,197, 66, 97, 85,211, 92, 17, 16, -177,120, 24,209,140,238, 4,178, 21, 23,153,105,210,164,217,220,177, 99,199,160,103,207,158,209,151, 47, 95,232,241,227,199,212, -170, 85,171, 15,124,124,185,218,189,181,213, 61,117,214,172, 89, 3, 78,158, 60, 25,245,254,253,123, 58,116,232, 80,148,143,143, - 79, 0, 95, 43,135,108,197,146,201,247,156,203, 68,109,135, 33,137,175,153, 47,179,156, 49,217,242,153, 40, 30,135,249, 31, 36, - 58,187,135,182,212, 40, 64,147,114,167,163,234,169,146,189, 47,156, 76,209,193, 79,161, 72,108, 64,187,215,242,243,243,251,120, -249,242,229,200, 55,111,222,208,181,107,215,162, 90,180,104,241,153,175,191,138, 61,254,199,113,156, 71, 62, 62,222,220,128, 54, - 2, 89, 91, 56,120,240, 96,126,140,136,248,121, 32, 38, 86, 84,188,120,113, 10, 9, 9,193,161,135,156, 22, 69, 68, 68, 52,145, - 35,211,210,210,178, 33,183,115, 72,104,104,168, 36, 15, 27,244, 17,109, 54,109,218,180,143,252, 65,179,131,229,104,250,200,208, -171,243,113,120, 83, 9,153,113, 0, 77,199, 37, 2, 79,129,167,177, 16,136, 47,186,100,172,250,254, 14, 57,232, 27, 85,227,180, -228,244,149, 82, 57,235,245,234,213, 75, 73,170,118, 22, 46, 92,248, 76,147, 38, 77,252,145,248,247, 33, 62,191,251,220,185,115, -254, 61,123,246, 4,233,170,167,167, 35,179, 46, 88,176,224,251,151, 47, 95, 82,166, 76,153, 40, 67,134, 12,132,223,216,206,214, -202, 69,251,189, 20,244,228,200, 78,218,179,113, 29,181,176, 79, 76,190,246,150,225,246,105,211,190,177,177,177, 25,193,114, 19, -232,233,116,170,121,121,121, 5, 95,189,122, 53,228,246,237,219, 33, 67,134, 12, 9,225,142, 43,132,137, 66, 72,245,234,213, 67, -166, 78,157, 26, 18, 22, 22, 22, 50,127,254,252, 16,182, 68, 92,101, 89,234,100, 75,175, 18,106, 35, 90,108,221,152,194,164,147, -238,222,189, 75, 44, 23, 86, 10,229,166, 46,211,210,202,202,170,172,181,181,117, 23,236, 57,147, 37, 50,102, 82, 40,204,179, 91, - 42,210,119,200,238,150,121, 91,189,146, 25,167,149,204,147,171,102,202,132,239,195,167,119, 39,170,145, 62, 78, 68, 11,157,111, -231,206,157,131, 65,176,208, 1,163, 3,199, 62, 56, 56,152,234,213,171, 23,196,150,173,106,250, 58,113,198,125,216,145, 35, 71, - 34,208, 70,188,167, 29, 59,118,208,140, 25, 51,162,152, 0, 77,148,161,193,177,234,206,157,253,222, 61,123,246,248,159, 63,127, -222,255,244,233,211,254,225,225,225,254,220, 30, 82,218,182,109,155,255,134, 13, 27,252, 87,175, 94,237,207,228, 88, 74, 92,110, -127, 87, 87,215, 93,106,247,209,219, 70,121, 77, 20, 79,190, 30,221, 66, 52,177, 29,125, 24,211,134,222,119, 45, 79,175, 90, 21, -161,153,121,210, 81,145, 20,138,173,106,122, 4,241, 26,101, 38, 73,146,228,240,195,135, 15,163,250,244,233,243,213,219,219,251, - 67,179,102,205, 62, 3, 75,108,216,227,127, 28,199,249, 7, 15, 30, 68,177, 14,236,211,135,167,202,249,209, 74,146,117,248,240, -225, 24,114,132, 31,104, 39,214, 91,201,162,229,226,226, 82, 95,159, 76,115,115,243, 42,189,123,247,150,216,153,250,198, 24, 75, -237,141,242,241,179,246,156,101,165, 54, 20, 79, 25,237,172,158, 69,111, 27, 9,153, 6, 33, 32,240, 52, 8, 46,189,153, 5,158, -122, 33, 50, 40,195,207,192,211,160, 2,252, 97,153,227, 52, 51,124, 73, 16, 40, 88,175,250,245,235, 7, 34, 5,203, 86, 82, 78, -230,209, 9, 22,130,186,252,162,151,242,128,144, 69,231, 81,173,187,106, 67, 84, 90,187,118,109,216,228,201,147,137,221, 81,196, -157, 47, 77,153, 50, 69,250,250,126,185,109,185, 68,180,174,247,109, 44,245, 23,183, 70,180,151,254,191, 55,107, 40, 53,104,208, - 32,148, 93, 35,170, 36, 78,189,113, 83,229,202,149, 43,248,211,167, 79, 33,139, 23, 47, 14,225,188,103,185, 0,222,156,146, 68, -119,172, 40,111, 35,238, 24,131,174, 92,185, 18,178,114,229, 74, 88,182,134,200,236,116, 96, 85, 43,198,238,206,234,189, 29,147, -220,134, 69,171,183,157,226, 50, 31,243,225,100, 27, 45,195,129,235, 46,149,155,221, 55, 71,180,116,142,150, 76,250,122, 49, 9, - 28,196, 29,224, 32, 38, 28,131, 60, 60, 60,250, 84,118,181, 47,176,169, 94,169,156, 31,134,182,201, 73, 19,186,102, 29, 95, 46, -111,201, 85,117,138,214,107,234, 98,115,180, 89,154,228,161,181, 45, 19, 5,199,197,117,200,174,163,211,176, 96, 41,201, 21, 58, - 92, 88,182,238,223,191, 79,108,237, 35,182, 28,238,215,215,137,115,251, 92,131,140, 89,147, 38, 81, 13,159,204, 84,196, 42, 37, -249, 89,167,164,220,230,201, 63,122, 41, 20,185,245, 40,248,119, 68,235,194,133, 11,208, 15, 41,177, 53, 72, 74,239,222,189,139, - 57,134,227, 31, 62,124,144, 18,200,150,155,155,155,193, 68,171, 80,114, 69,161,124,201, 21,111, 11,152, 40, 62, 85,114,180,121, -222,198,213, 38,242, 84,189, 2,244,174, 93,113,154,156,211,145, 96,217,146,217,238,149,146, 37, 75,134, 15,137,238,156, 64,202, - 27,151, 45, 91, 86, 50, 25, 97,143,255,163,143,119,142, 38, 89, 32,206,202, 77,215,203, 39, 33,187, 4, 63, 66, 14, 44, 89,124, -193, 9,252, 15,139, 22, 18, 92,135,209,178,213,225,213, 40, 51, 99,198,140,183, 88,239, 99, 8, 32,172, 88,108,193,165,123,247, -238, 17,127,116,208,217,179,103,137, 9, 35,173, 89,179, 38,146,201,253,118,153,117,215,211,180, 58, 79,255,140, 23,175,144,249, - 35, 45,242,253,181, 2, 79,129,167,177, 16,248, 25,186,100,172,178,253, 14, 57,250, 71, 29,178,101, 1, 47,126,213,109, 12,172, - 85, 32, 82,124, 80,215, 68, 92, 45, 65,196,162, 93,137,112, 49,106,220,184,243,159, 15, 87, 97,227,198,141,201,211,211, 83, 74, -108, 25, 35,238, 88, 41,228,206, 21,137, 88,157,173,157, 91,234, 52,130,175,159,151,254,247,111, 80,144, 46, 94,188, 72, 28,111, -178, 71, 7,106, 91,143, 31, 63, 30,184,124,249,242,151,156, 7,241, 88, 32, 88,249, 57, 77, 97, 87,226, 66,222,195, 93,152,129, -147, 53, 91,210,222, 50,249, 8, 97, 55, 31,200, 86,122, 29, 50,253,184,124,119,217, 2, 70,175, 94,189,162,183,111,223,210,216, - 66, 30, 4,162, 53, 60,119,134,168, 89,179,102,125,233,222,189,251,199, 84,169, 82, 33,118,199,129,229, 69,160,220, 69,138, 20, -129,107,237,187, 13, 22, 44,144,172,207,159, 63, 15,226,206,112, 16,203, 27,180,101,211,166, 65,101,124, 60, 26,131,100,129,108, -149,115,180,174, 62,177,116,158,214,207,250, 52,175,209,175,160,247,245,207,163, 59, 29,172,229,106,167,106, 33,147,173, 56,182, -182,182, 47, 96,121,225, 11,190, 75,176,188,177, 11, 87,213, 29,169, 81, 46,215,173, 95,231,186,117, 34,171,101,112,164,187,147, -251, 83,248,222,149, 20,190, 99, 49,221, 25,211,149, 42,167,181, 9,202,159, 52, 97,111,185, 5,130, 69, 11,150, 44,206, 31, 67, -180, 64,178, 52, 17,173,160,160, 32,137,104, 49, 1, 81, 39, 90,114,111, 23,147, 47,127, 50,133,155, 95,138, 68,103,207, 55,246, -165,192, 54,197,169,172,101, 18,196,236,197,117,171,203, 23,130,124, 53, 48, 80, 0, 92,133,163,149,132,106,204,152, 49,146,142, -227,127, 62,142,115,113,221, 44,217,109,125,191,121,243,230, 17,108,205,125,197,174,241,247,103,206,156, 33, 88,201, 96,125, 92, -183,110, 29,241,135,133, 68,176,241,220, 85,168, 80,225, 61,223,200, 47,174, 55, 19,215, 9, 4, 4, 2, 2,129, 95,129,128, 6, - 46,242, 43,110,251,243,239,161,172,152, 74, 5, 45,249,174, 83, 57,237,228,132, 14, 6, 91,130,172,137, 20,181,138,167, 72,124, - 17, 9,191,113, 44,250, 92,101,222,195, 53, 51,133, 83, 90, 77, 37,230,248,156, 59,136,107,225,152, 22,202,159, 63,191,148,138, - 22, 45, 42,197,146,188,191,125,133,118,101, 86,208,209,170, 89, 37, 43,204,171,171,254,180,213, 83, 65, 7, 42,251, 80, 64, 64, - 0,177,187,234,190, 22, 20,178,215,174, 93,251, 6,187, 92,174,177,149, 6,157,120, 50, 78,203,254,251,239,191,144, 19, 39, 78, - 28,142,140,140, 28,199, 95,246,173, 57,182,168, 45, 31,103, 67,140,162,220,232,209,163, 67,184,158, 32, 90,176, 74,104,218,124, -184, 83, 10,133,235, 5,100,133, 93, 90, 4,139, 85,143, 76,169,162, 64,180,250,103, 73, 27, 57,125,250,244,224, 77,155, 54,189, - 91,182,108, 89, 32,147,171,167, 74,139, 22,147, 73, 4,197,127,183,193, 93,200,228, 65, 34, 89, 32, 92, 28,239, 36, 37,187, 84, -169,122,193,109,232,153, 92,145,111, 89,245,162, 45,217,170,213,164,109, 14,215,126,171,106,149,120,251, 97,104,219,155, 62,201, -165, 32,126,131, 55, 46,199,169,167, 79,159, 18,223,147, 96,241, 96,242, 66,192,254,245,235,215, 82, 71,172,102,209,210, 40,223, - 69,161, 40, 84, 49,157, 93, 84,248,158, 21, 68,227,219, 16,181,204, 75,212, 34, 15,209,208, 6, 20, 48,163, 63,229,176,183,251, - 98,145, 50,229, 59, 38,145,115, 89,128,187,174, 66,130,104,193, 93,168,180,100,113,222, 24,210,197,152, 72, 86, 44, 16, 44,110, -103,127,118,153,249,207,155, 55,207, 40, 68, 11,101, 42,148, 66,145,115, 84, 30, 87,250,208,163, 50,181,119,177,166, 60,230,138, - 84, 58,202, 90,156,221,134,107,153,100,130,216,183,227,100,134, 61,254,199,113,254, 93,220,224,198, 96,146,165,116, 21, 42,221, -123,248,159,229, 32,182, 81,185,181,101,242,187, 45, 97,194,132,243,248, 64,121, 78,101,185,141, 74,232,185, 87,211,133, 11, 23, - 94,155, 61,123,246, 53,206, 87,128,147, 27, 92,243,108,213,165, 9, 19, 38, 16,235,191,244, 17,115,243,230, 77,226, 56, 59, 90, -176, 96, 1,177,219, 28,109, 37, 54,129,128, 64, 64, 32,240, 71, 34,160,129,139,252,145,229,212, 82, 40,221,174, 67,245,202,177, -251,109,178, 63,111,236,206,216,203, 2,165,175,110, 16,171,193,190, 57, 62, 6, 47,159, 64, 31,230, 14,166, 94, 57, 51,125,140, - 38, 91, 56,157, 48,119,238,220,199,113, 13,143,116,194, 40,170,239, 54, 38, 90,183,209,217, 87,171, 86, 13,238, 23, 42, 87,174, - 28,113,252,148,100, 45,122,114,225, 12,173,203,164,160,237,101, 60, 36,215,199,221,211,199,104,165,187,130, 54,151,246,144,220, - 32,220, 1,223,211, 82,177,174, 28,232,126,120,228,200,145, 7,248,124, 77, 78,185,217, 98,134,192,224,144,161, 67,135,238, 42, -227,238,178,168,142, 85,146,215,245, 82,155,188,242, 76,162,152,204,231, 77,249,222, 33,108, 73, 9, 73,144, 32,129, 70,139, 9, - 91,193,142, 35, 86,134, 93, 93,176,164, 93,137,150,235, 58,196, 94,113, 68,114, 29,166, 85, 92,226, 99,157,216, 93,121,139, 59, -180,103,188, 15, 67, 71,246,232,209, 35,116,158, 26, 45,122,176,104,113,158,129,236,198, 25,196,214,134, 65,227,199,143, 31,195, - 22,136,157, 28, 7,117, 42,181,101,202,193,163, 75,230,238, 68,227,187,181, 4,217,242, 78,174, 24,127,175, 87, 19, 58,216,188, -202, 87,207, 20, 82,167,107,240,198,163, 13,235,180,108,217, 50, 24,120, 51,177,147,220,133,136,179,130, 43,137,113, 15,102,183, - 24,220,192, 58,183,194,201, 19,111,186, 53,169, 31,209,132,182, 68,245, 61, 99,210,231, 58, 30, 52,170,221,127,116,138,235, 12, -146,204,177, 87, 81, 60,218, 13, 46, 47, 14, 55,211,188,129,104, 33, 30, 75,155,187,144, 93,155, 7,153,104,109,227,184,172,141, -172,115, 27,153, 20,108, 99,183, 24, 70,244,253,240,230,155, 84,145,101, 84,126,119,250,208,191, 46,117,204,100,171,139,104,213, -170, 83,167, 78, 32,199,164, 5,115,189, 16,215,247,142, 99,217,238, 97,143,255,113, 28,231,185, 64,170,163, 1,245,150, 79,233, - 42,132, 37, 11,238,193,104, 75, 22,116, 17,174,247, 14,252,255,177,246,237,219,251,243, 71,129, 63,235,190, 63,147,248,173,236, - 82, 31,196,164,172,162, 30,225, 11, 57,255,181, 74,149, 42,129,104, 57, 35, 47, 91,108, 95,143, 24, 49,130,118,237,218, 69, 28, - 76, 79, 32,219,104,115, 88,184, 14, 28, 56, 64, 28,211,133,188, 98, 19, 8, 8, 4, 4, 2,127, 36, 2,127, 9,209,210, 60, 67, -188,122,229,248,235,122, 41,226,174,152, 8,193,242,128,184, 44, 5,172, 88, 65, 75,199, 17,117, 46, 65, 65,173, 10,209,197, 46, - 53, 8,199,162, 91, 43,105,205,154, 53,165, 88, 45, 92,171,169, 5,153,104,205, 70,220, 8, 58, 2, 14,200,150, 18, 19, 36, 41, - 32,254,202,225,125,180,200, 77, 65,107,138,187,211,245,235,215,233,244,214,117, 52,207, 85, 65,235,107, 22, 34, 38, 82,176,192, -104,115, 29,142,103,130,179,182, 86,173, 90,171,248,158,136,153, 90,192,255,135,116,232,208, 1, 22,171, 70,213,205, 20, 47,232, -212, 14,162,233, 93,169,138, 89,130, 87,124, 44, 9,187, 89, 16, 60, 28,194,157,206, 3, 77,229,100, 34, 38, 69, 61,243, 72,174, - 40, 62,159, 82,153, 71, 67, 48,188, 37,147,178,125, 28, 16, 45, 25, 42,216,133, 3,162, 5,203,130,166,205,146, 99,142,122, 49, -129, 24, 52,142, 55,182, 60, 60, 96,203,210, 83, 38,132, 23, 79,158, 56,113,214, 43,147,251,113,144, 45, 15, 83, 69,150,162,118, -102,187,163,198,119,163,113, 37,114,145,187,249,119, 1,204,223,201,206,151, 36, 81,243,162,201, 19,159,247, 53, 73,248,130,247, -254,121,146, 36,250, 15,153,152,156,174,109,212,168, 81, 48, 72, 22,130,245, 57,224,156,170, 84,169, 18,204,199,225, 78,213,187, - 21, 72,150,232,233,167,205,115,137, 90, 23,136, 33, 89, 95,235,122,208,225,170, 62,116,237,234, 21,201, 90, 2,107, 35,218,143, -173, 40, 81, 28,128,175, 62, 74, 48,230, 30, 74,162,165,193, 93,120, 26, 4,139,211, 82,118,113,205,204,146, 37,203,196, 60,121, -242, 76, 28, 59,118,236, 76,198,107,154,222, 66,234,207,144,176,176,137, 98,241,209, 86, 21,232,195,240,255,168, 82,170,228,152, - 78, 65,227,198,228,116, 15,147,254, 16,142,157,122, 91,191,126,253,215, 24,181, 10, 61,193, 30,255,227, 56,206,179,222,108,209, -127,219,255,231, 80,139,201, 82,181, 98,117, 99,203, 86,204, 40, 94, 12, 6,224,248, 69,127,198, 97, 43,223,119,208,192,129, 3, -117, 17, 45, 83, 38,109,151,185,108,215, 80,238,232,187, 49,231,207,245, 21,207, 15, 54,124, 44, 32, 38, 15, 4,139,221,234,146, - 37,147, 99,192, 52,186,182, 13,169,143,200, 43, 16, 16, 8, 8, 4,126, 22, 2,127, 1,209, 82,143,211,138, 13,149,170, 95, 84, - 73,180, 64,158, 56, 87, 12,209,122, 55,185, 59,189,107,158,159,206,215,240,161,141, 53, 11,196, 34, 90, 32,101,186,136, 22,203, - 41, 55,103,206,156,240,221,187,119, 83,219,182,109,165,196,214, 16,201, 98,181,107,210, 48,154,230,162,160,117,173,107, 18,226, - 76,118,142,234, 67,171,171, 23,160,195, 75,102, 19,127,177,127, 78,154, 52,105, 85, 77, 13,203,150,153, 41,108, 9,152,158, 51, -103,206,201,124, 62, 17,119,246,207,208,199,112,224, 59,136, 86,194,106,102,138, 87, 52,189,155, 52,122,175,178,169, 2,157,140, -117,249,242,229, 67,152, 32,224,252, 2, 77, 50,217,189,114,153,173, 47, 82, 7,197,191, 97,245, 66,224,119,210,190,105, 21,199, - 46, 12,106, 65, 61,237, 20,103,248,255, 82,236, 14,220,137, 96,126,190, 63,109,222,188, 25,214,175,175,124, 92,117,164,152,186, -120,105,212, 33,187,161,182,112, 48,252,157,143, 31, 63, 94,132,219, 12,228, 99,205,234,213,103, 97,217,226, 11, 18,116,206,233, - 30, 66, 19,186, 81, 99,143,116,122,227,137,138, 36, 75,180,109,114,241,156,193, 33,243,134, 16, 29,222, 64, 33, 83,123,208,248, - 66,153,131,252,146, 39,218,140,155,115,249,107,114,185, 14,115,204,214, 83,238,100, 15, 50, 73,208,107,201,194,117,137, 18, 37, -170,144, 35,131,115,232,243, 5,163,136, 90,229,151,136,214,135, 90,153,232,110, 37, 87,154,217,184,114, 12,201, 66, 12, 16,218, - 16,137,101,195,218,163,113, 3,209,194,232, 66, 62, 41, 37, 21,119,225, 54, 38,209,243,216, 93, 56,138, 7, 7,244,230, 60,157, -120,192, 68,167,141, 27, 55,246,230,145,114,253,126,228, 97,206,107,170, 72, 83, 36, 69,130, 13, 43,235, 22, 15, 14,153,214, 51, -106,123,195,146, 84,200, 68, 49, 76,135,204,138,220, 54,176,140,118,226, 84,146,201,123, 32,116, 9,123,252,207,169, 13,183,223, - 65,222, 27,106,101, 28,141,192,119,149,184, 44,169, 8,176,100,225,121, 97, 82,233,207,250,122,150,221,134,131,248,112, 93,222, -143, 97, 76,224,234,214,106, 33,228,115,126, 76,240,207,236,223,191,255, 18,255, 6, 78,157,219,180,105,115,109,201,146, 37,129, - 76, 86, 63,243,245, 47,216, 34,248, 22, 86, 76, 36,118, 47, 74,123,126, 62,244,198,230,253, 8,230,226, 90,129,128, 64, 64, 32, -240,163, 8,252,181, 49, 90, 74, 96,148, 21,100,151,201, 88,182, 12,249,115, 28,213,105, 62, 23,227, 58,236,230,157, 33,228,100, -139,210,180,190,114, 46,170,159,214, 60,150,235, 48,111,222,188, 7,217, 53,230,207, 86,158, 25, 90,128,182,224,145,119, 65,112, - 21,178,123, 68, 26,113,136,223,136, 37, 89,209,162, 58, 45,170,144,139,118,173, 94, 74,243,103, 76,163, 54,126,185,168,116,206, - 44,225, 78,233,210,189,230,206, 13,157,142,198,141, 71, 3, 14,100,162, 51, 32, 71,142, 28,125, 57, 67, 34,118, 7,238, 96, 55, - 84, 72,137, 18, 37, 64,164, 82,150, 74,174,168, 93,195, 60,193, 43, 88,182,106,126,155,248,115, 24,199, 85, 41, 99,180, 90,107, - 17, 91,152,221,143,225,232, 24, 17,211,196, 49, 93, 8,224,143,234, 87,193, 47,124, 74,247,182, 52,183, 87, 71,226, 96,120, 41, -200, 24, 35, 38,231,206,157, 75, 28,148, 28, 54,106,212,168, 43,108, 45, 66,140,154,206,141, 73,236,118,184,209, 64,176,238,220, -185,227,207,177, 90,254,220, 97,250,115, 39,184,207,214,202,106,165,139,189, 29,117, 47, 81,128, 50,153, 38, 90,173, 75, 80,254, - 36,137, 26, 77, 45,149, 59,152,142,108,228, 33,108, 13,165,160,119, 90, 48,140,194,231, 15,162, 97,185,220, 62,228, 74,148,168, -161,190,178,104, 57, 95,214,215,215, 55,228,216,177, 99,212,184, 98, 25,122,211,171, 38, 5, 84,207, 72, 87,202,187,208,129,226, - 78, 52,170, 80, 70, 58,126,252,152, 20, 96, 13,130,185,106,213, 42,226,185,203,244, 90,180,152, 60,197, 16, 45,196,100,193, 93, -200,105, 41, 72, 22,187,188, 58, 49,217,104, 48,105,210,164, 42,108,229,172,194,152, 55, 96, 98, 40,103, 37,244,116,236,126,157, -196,233, 9,167,105, 28,160,231, 86, 32,137, 34,119,129,228,138,158,245,156, 83, 31,190, 49,170,203,245,208,165,163, 31, 95,238, -247,223,219, 10, 54,201,111,229, 84, 40, 82, 24,128, 9, 98, 19, 65,188,116,145,103, 57,226, 18,195,101,136, 13,123,229, 5,252, - 91,250, 48,193, 94,249,140,201, 17, 22,157,167, 57, 91,192, 86, 48,185, 90,207,255,207,228,253, 37,142,129,187,198,150, 55,184, - 6, 93,163,243,184,241,128,142,183, 60,160,133,102,206,156, 73, 28, 83, 72,252, 92,131, 40,138, 77, 32, 32, 16, 16, 8,252,209, - 8,196, 83,178,197, 93,140,180, 41,231,211,210, 59,143,150, 19,103, 70,224,236,110, 78, 8,116,199,166, 43, 24, 30,157, 18,172, - 63, 8,230,181,211,214,130, 76, 50,122,128,196, 32,118, 4, 46, 39,140,140,234,242, 95,227,200, 82, 25, 29,162, 50, 58,216,125, -100,203,203, 45,123,155, 84,139,114,152, 74, 35, 5,211,201,208,132,198, 28,236,219,146,101,194, 93,134,251,254,199, 29,127,200, -222,189,123, 67,216, 42,131, 17,129,152,218, 1, 27,226, 97, 26,177,117, 44,132, 3,220, 67,208, 1,241,255,186, 58,221,154, 28, -168,255,110,231,206,157,146,197, 74,125,195,100,171,176,226, 96,164, 23,203,105,200,196,238, 16,143,124, 60,196,115,139,161,227, -211,185, 49, 33,232,195, 35, 41,207,129,148,110,223,190,221,127,197,138, 21,254,173, 91,183,190,204, 29,238, 39,142,167,138, 66, -108,205, 69,142, 15,243,244,240,192,168, 52,103,109,194,216,109,123, 38,104,254, 48,250, 60,188, 9,125,174,234, 36, 17,173,224, -137, 61, 40,160,125, 73,186,213,174, 28, 21, 75,158,232,164,190,178,104, 58,207, 86, 29,204,141, 38,205,193, 4,139, 85, 35, 38, - 91, 39,155,151, 36, 14,120,163,165,126, 46, 52,177,116, 54, 42,227,231, 43,117,222,112, 71,178,101, 37,138,235,164, 55, 70,139, -167, 24,144,136, 22,183,139, 20,248,206,242,183, 62,121,242,100, 6,183, 69, 47,182,194,212,103,178, 90,188,152,139,115,175, 18, - 41, 77,110,149,180, 72,126,215,195,220, 20,243,117,169,206,159, 22,171,184,150,140, 77, 70, 55,183, 96,118,137, 69, 97,208, 2, -187, 72,163,188, 60, 50,125,158, 80,187,236,250, 7,243, 71,175,255,188,115,201,238,208,205,115,143,175,109, 90,241, 82, 81,211, -132, 75, 10,152,197, 76,199, 17, 23, 88,112, 13,116,124, 19, 39,229,168, 67, 12,166,216,172,242,191, 38,185,210,228,164, 26, 44, - 90, 9,213,136,150, 65,101,226, 24,202,174, 91,182,108, 25,204,177,113, 99, 57,110,108, 62, 91, 8,183, 51,201,186,196, 66, 48, -113, 42, 48,195,234, 8,149,216,154, 25,200,214, 83, 76, 54,139, 9,117,131,217, 50,108,232,136, 73,131,202, 37, 50, 11, 4, 4, - 2, 2,129,127, 24, 1,245,216, 44, 57,198, 2,197, 8, 76,217, 16, 61,135, 86, 27, 29,224,181,196, 20, 16,152, 10,130,243,168, -198,160,104,188,132,231, 29,218, 8,183, 33,207,165, 21,194, 22,160,141, 73, 18, 37,106,238,196, 35,195, 56,115, 92,134,186,251, -178,133,170, 10, 91,200, 42,240,245,249, 56, 37,225, 17,119,207,153,196,133, 48,241,145,102,131,103, 18,240, 10, 19,151,114,224, -122, 8,127,245,135,116,237,218, 21,214, 46, 57, 46,180,228,156,175, 29,187, 39, 55,114, 92,215,165,254,149,139,135,143,237,216, -156, 26,187,219,226,250,233,156, 96,105,179,194, 61,217,197,186,159, 99, 99,118,243,125,230,200, 80, 50, 7, 38, 22, 7,152, 16, -158,195, 68,157, 61,122,244, 56,199, 4,244, 41, 72, 22, 79,255, 64,108,233,146,130,204,153,132, 69, 50,233,209, 26,167,228,107, -146,232, 5,237, 89,174,113, 10,135, 39,253, 26, 80,161,100, 9,181,198, 35,233, 42, 35, 91, 9,223, 34,136, 30, 68, 24,110,221, -245,235,215, 83,217,130,121,105,117,235,234,180,252,191, 42, 52,174,108, 94,202,151, 50,249,199,180, 41,205,207,113,124,208, 43, -185,163, 14, 49, 9,169,114,116, 33, 19, 0,127, 38, 88, 27, 24,175,137, 76, 24, 58,193,146, 5,146, 53,178, 76,193, 79,161,251, -214, 82,240,154,233,212, 59, 87,166,207, 42,131, 45,190, 43,178, 99,234, 84,203, 14,243,108,245, 74, 18, 12,130,186,105,227, 70, -170, 93,174,212,165, 15,187, 86,206, 59, 58,168,253,170,174,185, 50,109,226,185,181, 64,144,180, 18, 54,165,224,156, 28, 15, 87, -196, 34,225,140,242,233, 83,189,240,181, 76, 56, 61,127,202, 88,203, 75,213,102,171,219, 61,190,215, 11, 38,132, 24,152,177, 28, -123,149,255,155,106,193, 52,102,196,161,202, 72, 67,232,249, 64,142, 85,148, 44, 90,112, 33,226,218,236,102, 10, 27, 63,203,132, -243, 42,187,217,189,193, 30,255,107,146,233,156, 84,225,225,107,107,122,180,138,187,125,112, 81, 71,203, 35,203, 23, 45, 24,203, -238,112,196,199, 65, 87,134,177, 46, 29,173, 91,183,238,181,165, 75,151, 94, 99,157, 15,195, 96, 8,158, 96,245, 35, 15, 82,209, -229, 54,149,161,182, 34,139, 64, 64, 32, 32, 16, 16, 8,232, 64, 64,221,146, 37,139,104, 85,194, 36,164,232, 12,162,231,210,210, -228,138,170, 12, 34,134, 60,209,179,195,171, 79, 96,166,105, 66,179,193, 60,195, 56,241,139, 31,214,175,184,108,170, 50,211, 86, -173, 90, 53, 63, 91, 72,242, 48,113,203,195,194, 96,185,114, 98,114,117,143, 45, 69, 33,152,196, 20,113, 54,220, 9,135, 48, 17, - 12, 97, 43, 21, 72,146,242,171, 95,245,222,122, 39, 94, 67,140,214,217,254,255, 17,246,106,133,110,192,195,236,119,114,224,241, - 86,142,137,234,169,114, 78,151, 76, 39,182,222, 13,132,245,136,203,218,151,247, 47, 16, 23, 6,146, 5,151, 28, 44, 16, 24,201, -200,199,159,170,221, 43, 70,102,137, 20,137, 79,189, 27,219,142,162, 22,142,160,175, 83,251, 72,132,235,253,164,222,244,122,230, - 16, 58,219,162, 12, 21, 77,158,232,132, 76,112, 99,149, 19,196,137,221,124, 81,236,214, 36,152,111,153,240, 97, 96, 0,121, 56, -216,127,201,159, 44, 97,128,175, 73,226,221,113,153,176, 20, 68, 11,150, 44, 14,210,246,103,226,234,207,174,230, 13,236,154,158, -136,152, 44,184, 11, 97,201, 2,201,162, 30,229,136,218, 21,166,187,205,139,170,198, 0,162, 42,177, 39, 65,181,179,123,170,156, -173,157,227,221,164, 24, 36,196,213,165,181,177, 9, 42,146, 34, 81, 75,142,199,242, 43,196,203, 25,233,193, 32, 70,102, 49,203, -132,139, 78,205, 28, 21,249,105,231, 82, 90,217,184, 92, 68, 81,171,132,170, 46,240,213, 32, 85,108, 21,122,128, 61,147,207, 39, -216,115, 92,162,244, 63,223, 3,131, 49,148, 91,140, 76,181, 64,120, 12, 66, 0,201,106,167, 12,130,199,158,255,151, 38, 81,101, -114,181,248,244,156,113, 81, 95,182, 47,166,181,205, 42, 68,226,127, 77, 50,139, 89, 37,222,122,126,225, 36,250,186,123, 57,109, -236, 88, 63,178,112, 90,139,195, 76, 2,199,117,234,212,105, 3,235,204,101,182,192, 94, 99,130,124,141,151,223,185,198,235, 30, - 30, 99,226,117,137, 63, 22, 52,185,223,245,234,188, 76,253, 49,232, 57, 18, 50, 13, 66, 64,180,145, 65,112,233,205, 44,240,212, - 11,145, 65, 25,126, 6,158, 6, 21,224,111,201, 92, 15, 4, 42,218, 90,181,157, 45, 49, 59,121, 84,158, 63, 18,207, 77,133, 89, -208,183,194,234, 53, 96,192, 0,116, 24,250,150,224, 81, 98, 98, 76,162, 5,153,121,184,131, 77,207,100, 7,174, 70,204,216,142, - 13,132,171, 19, 91,207,142,243,232,181, 16,142, 27,195, 60, 92,152, 13, 94,155,207, 84,175,194,104, 89,130,167, 28,143, 14,219, -206, 4, 98, 51,119,154,112, 27,170, 6, 48,235,149,169, 4, 4,150, 43, 30, 4, 16,137, 41, 34, 64,108, 96, 69, 98,242,161,201, -162, 21, 35, 51,111,210, 68,117, 70,228,201,248,225,243,212,174,244,166,181, 31, 37, 77,148,136, 2,167, 15,162,203, 13,243, 83, -107, 39,139, 15,185, 19, 37,170, 45, 83, 9,213,203,233,206, 86,193, 80,158,214, 32,106,235,214,173,196, 36, 27,211,107, 96,157, - 63, 63,153,242,144, 45, 54, 41,226, 96,120, 38,189,210,210, 58, 72,108,133,132,203,116,235,196,137, 19,103,176,251,184, 23,199, -183,213,135,187,240,195,236,129, 20,217, 50, 31, 61,175,145,137, 14, 20,178,213, 73,180,152,168,142,103,183, 97, 36, 92,156, 28, -227, 70, 60,227, 63,113, 27, 68,217,166, 78, 61, 59, 46,229,172,232,106,251,225,203,234, 73, 68, 53,157,233,121, 37, 23,242,181, - 72,136, 81,170,202,141,215,166, 86,108,228, 52, 87,205,146,133,185,230,112, 92,117, 65,241,152,186, 99,129,104, 38, 98, 88, 82, - 7, 3, 27,148,203, 62, 45,226, 99, 91,185,236,152,119, 14,238,121,201,146, 91,209,197,246,253,231, 53, 83,164,251, 63,171,232, - 76,133, 82, 38,120,167,114,255, 24,153,149, 61, 28, 67,195,214, 34, 95, 6,122,214,177, 28,149,176, 73,254,142,227,181,134,240, -220, 99, 43,152, 16,159,101,210,117,158,175,195, 26,164,117,162,159, 3,109,112,200,214,207,184,224,105,192, 53,250,178,138,114, -234, 67,200,176,243, 2, 79,195,240,210,151, 91,224,169, 15,161,127,231,188,250,136, 67,189, 49, 90,170,208, 64,145,224, 18,156, -197,241, 80, 49,195,209,241,155,143,161, 83,195,220, 81,218, 92,113,154,148,176,127,180, 69, 75,142,155, 77, 83, 19,169,203, 76, -206,163, 14, 83,176,235, 14,163, 35, 53, 85, 76,175,219,136,175,211,251,176,104, 34, 90,220,169, 77,102,119,228, 6, 30,213,181, -150, 99,143,212,131,166,245,202, 84,169,156, 51, 91, 63,222, 49,249,136,130, 21,137,131,203, 35,121,228, 24, 58, 90,103, 53, 0, - 98,201,228, 81,135,235,186,103,118, 12, 58,215,144, 45, 64,157, 42,211,209, 6, 69,169,165,163,121, 80,145,228,137,214, 24,160, -219,154,202,233,206,193,249, 11,153,160, 6,177,149, 14,115,169, 21, 52, 64, 30,178,198,146,137, 81,172, 24,121,168,154,216, 2, -185,129,201,210,116,182,232,245,103, 43, 90, 43,183,228,201, 38,117,242,112,248,124,169,170, 23,237, 99,146,213,192, 38,153,186, -235, 80,189,156,246, 76,162,223, 48,105,147, 8, 33, 98,197,120,164, 98,144, 6,204,116, 21,253,255, 22, 45,171, 68,107,214, 85, -207, 31, 21, 80,193,145, 70,103, 78, 25, 85,204, 58,209, 34, 45, 23, 34,206,105, 51, 39,109, 19,222,198,200,228,145,127,179,153, - 84, 45,226, 24, 45,200, 82,126,136,148,226,181, 56, 7,241,241, 65,216,243,241, 50,184, 79, 17,203,132,203,150, 87,201, 29,249, -188,188, 3,141,202,108, 30,137,255, 85,238, 31, 35,179, 68,170,196,155, 54, 55,175, 16,245,162,121, 33, 26,232,110, 22,153, 63, -149,201,126,182, 88, 97,164, 36, 44,206,121, 57, 97,210, 94, 57,155, 33,250, 41, 71,222,119,237, 46,247, 34, 61,249, 68, 57,141, - 4,100,180, 24,129,167,192,211, 88, 8,252, 12, 93, 50, 86,217,254, 4, 57,178, 92,135,234, 5, 77,203,150,151,133, 60,169,228, - 90,103,103,231,181, 60,156, 31,193,202, 8,154,151,213,145,169,100,114,227,248,148, 32,238,200,179,199, 17, 9, 77,141,155,134, -101, 57,114, 82, 95, 56, 87,238, 45,244, 42,204, 80,123, 69,251,219, 61,107, 95,196, 94, 69,104, 94,182,112,128,104,106, 26,242, -175, 87,166, 90,225,156, 97,217,130,187, 48, 58, 54,203, 89, 67,225,191,147,201,150,171,250, 28,248,126,162, 96,178,132, 47,139, - 37, 79,124, 60, 79,162, 68,154, 44,139,134,182,145, 92,220,180,229, 51,180,238,144,163,107,176,133,182, 78, 92, 26,117,200,120, - 61,199,168, 67,206,164, 9, 51, 89,117,207,158, 66, 97, 95,220, 42,209,166,130, 41, 19,124, 44,110,153,104,125,110, 83,237,131, - 58, 12,208,249,156,108,101,107,194,164,170, 9,207, 35, 87, 51,250, 58, 16,255,172,152, 39,139,143, 87, 84,206, 0,143,233, 40, -138, 90, 37, 90, 81,200, 34,193,123,236,241,191,202,125, 98,240, 68, 57,139, 49, 41, 68, 62,142, 41, 91,145,222, 68, 90, 94, 42, - 46, 91, 92,218, 72,223,125,132, 76,125, 8, 25,118, 94,224,105, 24, 94,250,114, 11, 60,245, 33,100,216,249,159,129,167, 97, 37, -248,179,115,199,137,104,197,165, 74, 63,163, 33,132,204,184,180,132,246,107, 4,158, 2, 79, 99, 33, 32,116,201, 88, 72,126,147, - 35,240, 20,120, 26, 11,129,248,162, 75,198,170,239,239,144,243, 67,174,195, 31, 41,112,124,105, 92, 81,206, 31,105,229,239,175, - 21,120, 10, 60,141,133,128,208, 37, 99, 33, 41,200,155,208,165, 63, 95,151,140, 91,194, 63, 72, 26,148, 79, 83, 50,164,136,218, -100,232, 58,174, 79,190,144,169,185, 93,226,218, 94, 2, 79,129,167, 92, 29, 16,207,166,110, 11,176, 92, 28,149,249, 4,158, 2, - 79, 77, 8, 24,170, 71,114,136, 98,124,145,169,196, 35,174,253,153,190,103,234,159, 58, 47, 71, 49, 12, 5, 68,200, 52, 20, 49, -221,249, 5,158, 2, 79, 99, 33, 32,116,201, 88, 72, 10,235,147,208,165,127, 83,151,140, 91,235,127, 68,154,120, 88,140,219,208, - 2, 79,129,167,177, 16, 16,186,100, 44, 36, 5, 41, 18,186, 36,116,201,184, 8,196, 79,105,134, 45,193,147, 56,239,240, 0, 69, -206,193,132,132,223, 60, 27,102, 66, 93,137, 39,173,194, 60, 67, 88,176,246,113,244,111, 85,179,160,244,155,229,236,101,121,254, - 72,248,173, 87,166, 90,126, 21,220, 99, 30,106,150,145, 72, 67, 89, 19,225,184,156,164, 73,230,207, 40,103,124,145,105, 68,221, -142,119, 47,222, 36,249,254,175,243,248,173, 79,127,212,243,107,210, 37,213, 60,166,133, 71,191,206, 86,119, 97, 31, 93,201,204, -119,204,107,229,115, 39, 93,251,255, 45, 6, 79, 67,159,205,116,246,246,165,120,100,227, 99, 36,252,254, 85, 58,111,128, 46,229, -230,188, 91, 56, 29, 86, 73,147, 53,149,211, 0,153,250,178,198, 59,253,212, 87, 33, 3,206,139,186, 27, 0,150,140,172, 2, 79, - 25, 32,253, 35, 89, 12, 92,130,135, 9,150,255, 99,162,195,183,137,137,214, 48,114,173, 58,103,149,122, 74, 95,102,212,198,148, - 14, 89,239, 91,217, 58,191,231,151,120,204, 82, 40,209,132,235, 59,162, 5,130,197, 50,253,143,220, 33,137,108,241,188, 16, 86, - 38, 73,147, 14,183,182,182, 62,201,179,196,135, 32, 73,191,249, 24,206,169,231,215, 70,180,208, 49, 41,203,154, 40,207, 48,242, -172, 58,167,139,123,229, 89,189, 83,164,205,186, 43, 65, 98,147,125, 60,185, 86,149,193, 10, 69, 82, 77, 29,167,198,151,185,106, - 57,179,245,190,192,196,177,164,105,242,228, 61, 29, 29, 28,182,115, 61, 31,242,252, 79,143,108,120, 97,232,164,137, 19,247,196, - 57, 5,231, 81,173,151, 94,153, 44,191, 38,151,135,103,175,172,111, 97,110,190,128,235,124, 11, 9,191,113, 12,231,228,212, 93, - 61,143, 62,226, 42, 75,166,241,158,134,248,247,242, 97, 61,186,255,154,232,250, 11, 34,147, 2, 35, 41,107,253, 37,171,145, 60, - 74,116, 62,236,144, 46,195, 23,164, 76,197, 58, 30, 86, 30, 79, 94,112, 84, 76,126,137, 28,105, 32, 69, 56,174,148,153,167,249, -106, 90,127, 54,124, 8, 82,139,158,147,214,184,184,186,135, 32,225,183,242, 56,242, 40,243,235,146,169,255,217, 28,179,193, 34, - 67,161,171, 38,214, 46,207,120,126,182,152,197, 58, 65,182,228,232, 39,207,147, 98,205,179,168, 14, 72,156, 40,209, 62, 94, 42, -233, 29,214, 6, 77,146, 56,241, 94, 28,195, 57, 35,235,210, 50,245,181, 68,163, 9,215,247,239,144,127, 89, 63, 69,221,141,129, - 64,252,123, 47, 25,163,214,223,100,196,151,186, 27,175,198,191, 94,146,129, 75,240,112, 7, 1,146, 53,120, 27, 81,137,206,219, -104,237,185,168,237,170,169,102,243, 65, 87,125,124,178, 70, 98, 70,110,172,139,199,179,154,199,188, 43,117, 17, 45,144, 44,150, -233,175,112,169,121,135,215,212,123, 51,107,214,172,112, 94,186,134,176,148,202,215,175, 95, 9, 51,163,243, 12,215,225, 56,135, - 60, 49,249, 97, 9,211,208,145,129, 60,161, 67, 82,150, 53, 91,163,229, 49,157,153,187,135,247, 27, 94, 91,143,176, 64,114,177, - 98,197, 94,115, 39, 49,148, 39, 38,202,160, 74,184,180,117, 58,184,239,127,227, 79, 93,183,180,117,250,218,190,125,251, 32,229, - 44,233, 60,155, 55, 29, 59,118,140,120,125, 62, 26, 54,108, 88, 84,133, 10, 21,130,147,153,165,250, 58,107,237,169,235, 82,189, -180,148, 19,199, 99,234,226,217,226, 58,175, 17,120,187, 73,147, 38,159,118,237,218, 37,173, 39,136,132,223,188, 38,221, 39,156, - 83,112, 30,125,117,143, 37,147,229,155, 40, 20,133,211,166, 73, 51,135,103,117, 63,201,100,240, 9, 18,126,227, 24,206,169,231, -215, 88,119,227, 41,102,124,121,168,255, 95, 78,214, 35,144,172,181, 60, 37,111,197,222,123, 98,116, 62,131,171,251, 87,158,148, -150,176,204,143, 99,186,244, 17,107,207, 68, 72,207, 2,242, 40,243,235, 34, 69,202, 60, 73,243,143, 32,175,138, 99,135, 88, 58, -229,222,107,158,210, 34, 66,249,192,164,180,176,136,192, 49,156, 99, 43,150, 44,153,186,158,205,166,221,166, 92, 40, 81,178,116, - 24,150, 80,194, 51,117,246,236,217,152,103, 83, 23,209,138,209, 55,215,218,119, 56,223, 11, 94,127,146, 46,240,226,230,119,239, -222, 37, 94, 0, 93,218,243,234, 11,196,235, 84,190, 80,112, 30,189,250, 41, 95,151,178,113,214,231, 77, 91,118,164,245, 59,143, - 73,101, 21, 68, 43, 6,188,248,247, 28,201,111,119,125, 57, 69,221,245, 33,100,216,249,248,130,167, 97,181,250,115,114, 27, 62, -103, 22,220, 19, 73,243,141,144, 72, 86,202, 34,227,222,171, 90,179, 44,221, 74, 92,100,146, 32, 45,124,140,133,135, 65, 58,176, - 96, 46, 47,146, 76, 76, 18, 62,235,117, 29,186,214,189,157,201,211, 59,226,201,147, 39,132, 5,111,241,242, 30, 63,126, 60,241, -218,108,180,121,243,102,194,113, 36,119, 15,175, 8, 5,231, 85,186, 26,181, 17, 45,148, 21, 86, 55,144, 44,211,194, 99,222,123, - 84,157,221, 29, 22,173,132, 73,205, 94, 64,222,211,167, 79, 9, 11, 14,191,122,245,138,120,146,200,168,196,201, 82, 79, 82,146, - 45, 77, 50,149,110,190,212,142,153, 67,207,159, 63, 79,139, 23, 47,166,124,249,242, 17,207, 66, 78,188, 70, 31,241, 66,213,196, -139, 72, 19, 47, 59, 36,173, 71, 56,103,206, 28, 74,106,225, 24,170,171,156, 49,174, 67,247, 38, 55,109,210,164,141, 56,122,244, -104,140, 5, 80,253,107,254,224,193,131, 81,200,163,224,188,178,100,102,106,118, 35,181,163, 71, 16, 47, 36,252, 14,157, 43,175, - 37, 24, 35, 18,109,132,206,146, 9,225, 91,228, 81,112, 94, 93, 50,141,168,179,241,229,161,142, 41,167,170,155, 47,101,145,177, -111,149,150, 43,123,199,244, 95, 65,178,240, 65,193,203, 34,145, 69,186,156,119,112,206,188,200,152, 55,250,220,124,170, 50, 19, -123, 52,122,167, 36, 48,120, 86,148, 27,158, 31, 37,129, 65, 30,125, 50,117, 61,155,214,158, 21,207, 96,213, 5,172,155,137, 5, -202,177,102, 38,158,205, 58,117,234, 68,241,179,249, 78,175,235,144, 9, 84,225,194,190, 81,208,107,232, 13, 63, 47,196,235, 59, - 82,173, 90,181,164,186,227, 89, 66, 42, 91,182, 92, 20,200,150, 17,116, 9,203, 15, 45,236, 51,104, 12,221,124,250,145, 64,182, - 4,209,138,245, 20,198,187,231,232, 95,126,135,136,186, 27, 17,129,248, 39, 74,105,205,210, 94,114, 44,251, 18,157,252,144, 11, -110, 40,144, 43,124,185, 99,175,116, 75, 89,176, 69, 40, 71,142, 28,225,232,192, 97,197,106,219,182,237,199, 41, 83,166, 28,228, -245,249,214, 69,132,133,205,119,176,183, 31,143,188,154,238,132,227,206, 10,133,165,169,169,105,224,227,199,143,105,199,142, 29, - 82, 39,176,124,249,114,218,185,115, 39,237,219,183, 79,218,163, 19,226,245, 19,165,197,149,217,178, 21,136,107,116,200,148, 98, -177, 64,174,224,126,129,219, 16,255, 91, 43, 20,153,185,156,145,188,142, 30,241, 18, 45,180,100,201, 18, 73,230,235,215,175, 41, -177,137, 89,160, 6,162, 21, 83,100,101, 93,217, 26, 20,136,122, 58, 57, 57, 17, 47,113, 66,108, 33, 34, 15, 15, 15,226,133,144, -169, 92,185,114, 84,191,126,125,137,108, 33, 79,242,228,201, 99,226,216,180,213,157,163,228, 82,112,125, 30,251,251, 99, 21, 35, -205, 27,175, 7, 40,149,113,247,238,221,168,251, 99, 92,163, 11,207, 20, 10, 69,174,172, 89,179, 6,226, 26,116,174,192,245,202, -149, 43,116,227,198, 13,233, 55,228, 41, 55,224,201,100, 49, 16,215,104,147, 25,255,116,219,120, 37,214, 22,147,149,222,206,174, - 28, 47, 29,244, 9,235, 79, 62,123,246, 76, 34,222,172,224, 35,212,243,107,105,119, 73, 63,121, 77,156,210,133, 11, 23,142, 84, - 18, 24,172, 31, 89,166, 76, 25, 38, 44,101,105,208,160, 65, 49, 4,134,245, 42, 18,121,245,233,167,166,103,211, 82,161, 72, 95, -177, 98,197, 79,208, 3, 88, 72,121, 93,210,167,236,138,110, 96,166, 80,120,243, 67,109,162,212,107,109,250, 9,151, 32,136, 32, -202,184, 97,195, 6,226,213, 31, 2,249,250,166,252,204,187, 34,225, 55,175, 10, 17,136,243, 32,157,233,211,167,127,129,107,126, - 64,151, 98,145, 44,144, 45, 46, 27, 7, 44, 72, 22, 45, 44,251, 36, 54,129,128, 64,224, 31, 67, 64,157,139,252, 85,213, 71,229, - 80, 33,229, 94, 27,209, 74,146, 40,209, 42,184, 11, 95,188,120, 65, 45, 91,182, 12, 58,124,240,224,194,203, 23, 47,206,189,113, -237,218,220,200,136,136,185,250,136, 86, 10, 19,147, 65,252,197, 29, 14,203, 11, 72, 22,200, 22, 47, 8, 45,185,227, 78,159, 62, - 77,176, 32,129, 16,237,217,179, 71,186,199,208,161, 67,195,112,141, 62,162, 5, 11, 22,136, 22,246, 73, 20,138, 54,121,242,228, - 9,133, 53, 11, 95,244, 32,111, 27, 55,110,148, 22, 29, 70, 71,105, 97,157,230,157,190,142, 12,247, 99,130,245, 6,150, 48,184, - 76,122,244,232, 65,213,171, 87,151, 72, 86,233,210,165,169, 87,175, 94,180,116,233, 82,201,242, 6,215, 36,175, 9,248, 74, 95, - 71,150, 44,113,226, 30, 93,186,116,249,162,139,100, 61,127,254,156,120,205, 70, 41, 53,109,218,244, 11,174,209, 86,247, 84, 10, -133, 3,175,181,248, 28,110, 87, 88, 47, 22, 44, 88, 64,147, 39, 79,166, 49, 99,198,208,184,113,227,104,250,244,233, 82,157, 97, -201, 83,110,192,151, 23,136,126,137,107,255, 42, 5, 54, 66,101,180, 17, 45, 28,231, 8,114, 83,147,100,201,142,240,250,158,146, -117,116,244,232,209,196,150,219,238,170,215,104, 35, 90, 30, 10, 69, 42,117, 2,195, 58,218,204, 70,161,112, 67,194,111,117, 2, -131,107, 32, 91, 27, 41,210, 68,180,152,181, 76,128, 27,158, 23, 56, 39, 23, 23,151,187, 94, 10,133,153, 82, 39, 85,247,218,100, - 34,254, 10,250, 3, 75, 22, 72, 22,151,205, 78,253,122, 28, 3, 89,135,133, 15,207, 20,174, 49,144,104,169, 6,190,191, 84,186, - 11,163, 73,214, 66, 46, 27,214,106,196, 26,143,202,197,225,141,208,178, 66,132, 64, 64, 32, 16, 95, 16, 80,231, 34,241,165,220, -209,229,212,237, 62,148,107,209,226, 78,250, 94, 96, 96, 32,193, 82,196,132,105, 47, 72, 22,119, 62,115,249, 11,122, 46, 91,180, -244, 18, 45, 94, 92,248, 24, 72, 22, 44, 76,176,100,129, 8, 29, 63,126, 92,178,142,225, 5,127,245,234, 85,201,157,136, 61, 58, - 53,124, 61,227, 26, 57, 68,107,252,178,243, 19, 45,109,157,239, 45, 94,188,136, 99, 74, 30,208,197,139, 23, 37,226,134, 24, 21, - 16,185, 83,167, 78, 17, 58,162,100,230,182, 15,229, 16, 45, 94,155, 46,134,161, 32, 70, 39, 56, 56, 88,138, 37, 67, 2,121,129, -133,136, 45,121,146,203, 83,142, 69,139, 3,232, 15,131, 76,106,218, 64,148, 64, 44, 65,176,128, 7,172,123, 28,171, 70,184, 70, - 91,221, 57, 64,191, 19,227, 38,197,250,132,134,134, 18, 98,106,152,200, 81,213,170, 85, 63, 21, 40, 80, 32,152, 45, 38, 31, 91, -183,110,253,137, 59, 68,201, 77,137,120, 53, 96,220,188,121,243,240,228,201,146,117,141,103, 10,252,211,139,171,139,104,225, 28, - 91, 23, 45, 44, 82,166,244, 71,187,163,189,216, 29, 23, 25,109, 29,148,172, 86,218,136, 22, 19,178,129,170, 4, 38,189, 66,145, - 86,253, 94, 56,166, 74, 96,112,141,161, 68,139,215, 14, 61,134,114,193, 26,197,133,169,166,137,100,233,120,142, 18,114,224,251, - 94, 60, 51,176,176,193,122,165,237,122,156,131,206, 67,231, 16, 32,111, 32,209,250, 46,240, 29,100,139,177, 3,201,210,104, 9, -255,233, 13, 47,110, 32, 16, 16, 8,252, 49, 8,196,115,139,150,250, 18, 60,177,137,151, 92,139,150,143,143,207, 23,188,204,209, -113, 28, 62,116,104,217,109, 38, 89, 15,152,100, 61,127,250, 84, 22,209, 98, 66, 18,140, 23, 52,187, 27, 37,171,213,137, 19, 39, - 36, 34,132, 23, 60, 72, 6, 72, 22, 2,111,225,246,194,111, 88,120,112,141, 62,162,229,144,183,205,164, 92,185,243,124,129,203, - 12,132, 8, 95,245,111,223,190,145, 44, 88,215,174, 93,147,228,177,187, 35,138, 93,157,100,237, 86,106,181, 28,162,197, 86,136, - 0, 85, 82, 4, 23, 33,130,245, 81, 86,148, 29,113, 53,108,113, 35, 94, 32,155,120,196,164, 94,215, 33, 91,189,130, 52,185, 13, - 85, 73, 22,240, 64, 91,172, 88,177,130,250,246,237, 11,185, 90,235,206, 65,201, 71,113,173,114, 59,114,228, 8, 44,107,225,220, - 17, 86,226,214, 77,130,132,223,137, 18, 37, 10, 7, 97, 5, 6,112,163, 66, 46,119,202,103,254,152, 39,235, 15, 41,136, 62,162, -133,243,110, 10,133, 13, 47, 96,125, 15,177,137,136, 85, 98,226,117, 97,112,244,136, 86,173, 68, 75,133,192,192,122,165,237, 62, - 56,167, 70, 96, 12,178,104,177, 27, 50, 8,207, 22,226,170,120,101,117,123, 67,137, 22, 70, 22,194,229,136,248, 67, 11,118, 21, -106,187, 30,231, 16,163,137, 45, 91,182,108,176, 14, 27, 66,144,178, 49, 78,234,129,239, 47, 5,201,250, 67, 30, 2, 81, 12,129, -192,111, 70,224,175,183,104, 1, 95,125,174, 67,142,251,144,136, 22, 2,110,217, 66,180,236,209,131, 7, 18,201,226, 24, 33,217, - 68, 11,113, 67,115,231,206, 37,140,224,131,219,237,242,229,203, 18,201,130,139, 14, 68, 6,228, 10, 29, 25, 72, 18,146, 28,162, -149,220,202,249,252,236,217,179,233,193,131, 7, 28,227, 20, 40, 89,111,208,233, 32,193, 2,133,184,165, 76, 30,222,159, 42,212, -237,188, 21,238,197,184, 16, 45,196, 65,129,180,193,213, 9,151, 28, 44, 72,136,181, 65,144,176, 28,162,197,121, 62,194,221, 2, - 18, 5, 89,216, 80, 54,212, 21,245, 7,201,130,133, 12, 36, 22,241, 59,108, 49,129,220,143,218, 58, 50,117,162, 5,121, 92,182, -168, 18, 37, 74, 4,194,245,131,132,223, 44, 51, 10, 46, 78,224,221,177, 99, 71, 98, 43, 23, 89, 88, 88,156,253,205,207,211, 31, -119,123, 57, 68, 11,121,120, 4,167, 47,187,117,163,160, 99,208, 99, 38, 72, 77,116, 89,180, 84, 9, 12, 92,133,218,238,131,115, -106, 4,198, 32,162,197, 58, 19,132,129, 16,253,250,245,139, 19,209,202,156, 57,243, 59,144,113, 4,190, 27, 64,180,222, 27, 64, -180,228, 4,190,255,113,122, 33, 10, 36, 16, 16, 8,252, 58, 4,226, 57,209, 50, 12, 40,188, 60, 53,197,129,216,216,216,220, 3, - 73, 64,108,213,218,181,107,247,178,187,107,238, 91, 38, 89, 33,193,193,178, 98,180,224, 6, 4,161, 66,220, 20, 98,189, 64,178, -224, 34,196,151, 52, 94,242,112,159, 33,208, 22, 9, 86, 41,184, 22,229,184, 14,147,166, 72,249, 14,214, 34,184, 10,145, 64,184, -222,191,127, 39,185,120,186,117,235, 22,201,111,248,169, 25,138, 15, 25,170,140,227, 50, 38,209, 26, 53,106,148, 44,162,197,150, -144, 19, 40, 35,234, 10, 82,136, 56,175, 22, 45, 90, 80,189,122,245,168, 90,181,106, 82,236,151,159,159,159, 20, 32,221,189,123, -119, 76, 31, 65,184, 70, 91, 71, 6,215, 33,187, 34, 99,166, 9,208,228,146, 68, 44, 13, 44,132,112,245,114, 76, 29,181,106,213, - 10,247,136, 72,150, 36, 73, 23,195, 52,226,239,207, 45,151,104, 33, 31,235,211,124,184,187, 97, 65,229,223,107,117, 17, 45, 85, - 2, 99, 0,209, 2,129, 49,136,104,241,168,194, 99, 32,127,176, 90,198,197,117,200,110,192,125,112,173, 67,159, 13,112, 29,238, -147, 73,180, 68,224,251,223,255, 8,137, 26, 10, 4,254,117, 4,116,187, 14,213,209,209, 70,180, 56, 24,126, 53, 70,196, 33, 70, -137, 93,102, 65,207,159, 61, 91, 8,146, 21,246,229,203, 92,138,140,212, 27,163,133,192,118,204,157, 21, 16, 16, 64,155, 54,109, -146, 44, 57,120,185,195,226,130, 99,111,223,190,149, 8, 22, 58, 12, 4, 29,119,232,208,225,171,156, 96,248,196,201,204, 94, 35, -254, 8, 73, 73,182, 96, 13,195,168, 64,158,176,180, 14, 58, 45,213,128,249,223, 65,180,184, 30, 67,135, 12, 25, 18, 6, 66,132, -249,141, 80, 95,116,212, 60,213,131,228, 46, 68,204, 26,207,215, 69,156,135,198,142, 29, 11, 2,134,129, 0, 67,181,117,100,202, - 96,120,144, 41, 88,198, 96,205, 0,118,112,113,162,125, 16,151, 54,115,230, 76,226,121,192,136,167,126,160, 70,141, 26, 33,192, - 30, 83,112, 4,138, 96,248,239,223, 7,134, 16, 45, 30, 25, 88, 22, 83,146, 0,103,182, 44, 74,163, 88,181,185, 14, 85, 9,140, - 1,174, 67, 16, 24,131,136, 22,130,225,161,251,208,123, 46, 83,156,130,225, 49,162, 18, 22,101, 4,231,107, 11,134,207,152, 49, -163,220, 96,120,213,192,247,199, 34,240,253, 95,239,131, 68,253, 5, 2, 2,129, 88, 8,104, 35, 90,236, 82,200,224,237,237, 29, - 6,171, 22,130,130,217,133, 24,194,177, 65, 7,159, 62,126,108,240,244, 14,184, 30, 36, 3,193,241, 74, 75,214,187,119,239, 36, -194, 16, 25, 25, 41, 5,200, 99, 42, 8,103, 25,211, 59, 36, 72,156,124, 63, 2,193,217, 66, 22, 5,242, 2,194, 5, 34,195, 83, - 36, 4,204,225, 88, 37,116, 90,152,250, 1, 22, 45, 76, 5, 33,147,104,189, 84,181, 18,105,114, 29, 34,112, 56, 58, 70,235,165, - 50,166, 69, 75,135,155, 16, 67,225,185, 62,111,224,126, 4,161,132, 37, 15,238, 66, 88, 7, 65,178, 16,159, 3,146,133,184, 47, -196,217, 32,175,174,225,243,184, 31,130,177,121,110,175,215, 32,172,136, 25, 2,158,108,105,148, 8, 91,255,254,253,169,115,231, -206,146,171, 16,163, 38, 27, 54,108,136,216,172,247, 98,122, 7,205, 15,187, 42,209,114, 78,155,182, 52, 15,252,120,198, 22,220, - 23,248,173, 78,194, 48,241, 45, 15, 42,144, 72, 73,209,162, 69, 35, 7, 99, 54,127, 13, 27,174, 67, 96,187, 42,129, 73,175, 37, - 24, 94,149,192,196, 41, 24,158,167,119,224,137,121, 67, 49, 88, 5,122,197, 51,194, 63, 49,116,122, 7, 76, 70,138,103, 17, 3, - 71, 80, 30,245,233, 29,112, 12,100, 14, 31, 66, 50,166,119, 16,129,239,162, 95, 17, 8, 8, 4, 4, 2,218, 16, 80, 78, 2,250, -109,194,210,177,223, 77, 88,138,169, 14,240, 53, 15, 98,132,233, 24, 64, 20, 96,149,145, 59, 97,105,198, 76,158, 17,112,161,193, - 69,168, 12,126, 71, 7,129,152, 42,108, 8,144,183,181,179,151, 53, 97, 41, 58, 51, 30, 19,158,146, 59,167, 33, 60, 82, 48,148, - 45,102,146, 76,116,130,152,180, 20,150, 44,144, 43, 76,102,138, 73, 77, 49,185,105,244,250,141,170, 22,131,152,137, 1,149,147, -139,166,247,246,251,128, 78, 69,185,161,174, 32,113,112,103, 34,214, 10,211, 59, 32, 33,120, 56,133,173,215, 7, 89,147,139,242, - 36,143, 14, 60,187, 56,226,165, 32,139, 39, 39,165,213,171, 87, 19,202, 60, 97,194, 4,201,146, 5,151, 98,106, 91, 59,174,187, -238, 9, 33, 99, 38, 65,229, 73, 72, 83,217,187, 7,151, 42, 85, 42,104,205,154, 53,210, 28, 92,112,205,162, 77, 64, 2,121,182, -121, 88, 40, 66,204,172, 29, 67,196,132,165,223,105,124, 76,187,171,146, 41, 12,132, 80, 78,250,201,238,219,112,182, 22, 13, 75, -174, 80, 20, 98,130,229, 2,146,197,255, 47, 0,153,133, 37,150,231, 87,123,172,102,125,138, 37, 19, 83, 53,168, 19, 24,245,233, - 29,212, 9,140,134,233, 29, 84,245, 83,154,160, 87,211,179,137, 9, 75, 17,163, 5,221,135, 43, 30,250,137, 1, 32,152,247, 77, -238,132,165,229,202,149,143,130,174,195, 82, 10,242,143,184, 49, 36,252,198, 49,144,172, 10, 21, 42,202,153,176, 20, 83, 52, 96, - 62,172,195,156,164, 9,221,120,255,140,147, 33,193,243,104, 48, 49,105,167,113,187, 42,129,167,192,211, 88, 8,252, 12, 93, 50, - 86,217,226,129, 28,149,245, 3,181, 45,193,227,158,201, 35, 18,147,139, 34, 30, 10,150, 20,144, 36,184,173,184,118,250,215, 83, -227, 25,223, 49, 25,233,240,225,195,195, 16, 16, 15,210,134, 4, 57,157, 58,117,250, 10, 75, 22,102,133,215,183,134,160,186,165, -129, 45, 64, 14,252, 22,159,155, 43, 87,174, 72, 4,150, 91, 88,217,190, 86,174, 35, 7,146,133, 37,133,176,124, 9,102,223,214, -214, 57, 42,215,113,219,112,252,249, 37,187,244,158,159,120, 78,170, 16,116,168,112,203,161,163,129,165, 12, 83, 48,240,200,201, -168,226,197,139, 7, 37,183,114,248,180,251,236,243, 75,202, 53, 28, 85, 90, 87,117,121,151,255,175,243,200, 75, 11,193, 90,197, - 29, 96,216,162, 69,139,164, 9, 90,177,135,117,140, 93,124,168,187,180,252,144,190,186,171,175, 55, 23,189, 4,207, 92,182,196, -156,179,178,178,122,201, 29,107, 0, 91,176, 46,240,126,145,114, 9, 30,189, 50,141,167,154, 63,227, 1,252,169, 50, 85,117,137, - 49,124,167, 28, 13, 10,178, 13, 50, 12, 2,220,160, 65, 3,170, 93,187,182, 20,243, 6,189,143,158,188,116,154, 46,162,133,115, -152,132,180,124,249,242,145,250, 8, 12, 79, 56,170,109,194, 82, 85, 93,138, 89,219, 83,211,179,137, 37,120,242,228, 43, 16, 6, -178, 13,183, 60,150,118, 82, 62,155,178,214, 58,100,130, 15,107, 21, 62, 38,148, 31, 62,202, 41, 68,112, 12,231,240, 17, 96,160, - 46, 29,142, 38, 90, 32, 93,134,110, 63,181,221, 13, 45,140,142,252,162,156, 70, 4, 83, 16,108,227,130, 25,143,240, 52,122,197, -127,161, 64,158, 5, 72,218,212,215, 60,212, 82, 4,149,245, 3,177, 20,143,198, 69,165, 75,253,127, 81,105,219, 52,105,162, 64, -178, 16,236,173,139,104,169,174,143,230,204, 46, 65,196, 95, 33,216, 29, 35, 11,145,240, 27,199,112, 78,206,218,124,218,226,106, -172,120, 54,108, 94, 80,122,103,138, 52,222,251, 96,209,130,219, 16, 11, 78,131,100, 97, 65, 94,125, 68,235,255,229, 28,120,158, - 73,138, 31, 47,248,220,203,209,222,126,151,173,173,237, 3, 46,227,131,212,214,214,187,146, 39, 77,218, 11,231, 20, 57, 7,158, -215,187,238,155,234, 90,135,209, 11,106,107,171,187,114, 65,109, 67,101, 42, 93,151,218,246,114,240, 52,162, 66,198,187, 78, 71, - 85,151, 28,108,108,106,176, 62,126, 98,226, 35,185, 97, 65,170,224,154,133,149, 8, 35, 99, 49,138, 21, 65,227, 76,104,111, 97, -202, 7,125, 68, 75, 73,182,244, 17, 24,213, 89,225,117,124, 8,196,172,237,169,245,217, 44,243,255, 69,165, 29,211, 57, 69, 42, -159, 77, 89,107, 29,178,126, 42, 23,149, 70,124, 25, 79,225,240, 30,211, 56,168, 47, 42,173, 87, 63, 99, 43,211,150,104,162, 21, -151, 25,223,227,157, 46,253,203,207,145,168,187, 81, 16,248,151,117,222, 40, 0,254, 38, 33,202,121,179,212,247,154,139, 3,215, -154,114,205,181,104, 55, 91, 66, 93, 29,121,244,250,134,176,100, 61,214,187,214, 33,191,200,225,246,210, 71, 12, 98, 92, 99,209, -249, 85, 74,170,209,221,163,141,116, 41,143,107,168,147, 78,215,161,210, 21,104,140,114,170,215,229, 79,149,105, 68,229,140,119, - 47, 10, 77,250, 3, 11, 41,235,115, 87, 38, 25, 39,153, 36,189,134,165,148,227,160, 48,229,200, 61,118,255,117,132,203, 90,121, -157, 28,253,132, 75, 16,241, 87,234, 4, 6,199,148,238, 66,213,114,104,146,105,232,179,137,245, 13, 65,176,144,244,174,117,104, -196,103, 83, 77,151, 16, 24, 31,215, 25,223,227,157, 46,253,203,207,145,168,187, 81, 16,248,151,117,222, 40, 0,254, 38, 33,234, -150, 44,195, 23,154,142, 99,193,255,101,133, 17,117,143,163,210,104,185,236, 79,192, 19,228,220, 66, 79,181,254,132,114,202, 65, - 94,148, 83, 14, 74,242,243, 8, 60,229, 99, 37, 39,167,192, 83, 14, 74,242,243,196, 23, 60,229,215, 72,228,140, 65, 32,190, 52, -174, 40,167,113,149, 86,224, 41,240, 52, 22, 2, 66,151,140,133,228, 55, 57, 2, 79,129,167,177, 16,248, 25,186,100,172,178,253, - 14, 57, 74,139,150,234,124, 90,177,200, 16, 0, 83, 79,134, 20, 84,211,245,250,142,233,147,175,239,250,184,148, 89,200,252,190, -157,117, 97, 34,218, 72, 59, 2, 66,151,132, 46,201,213,129, 63,241, 57,170, 18,135,119,190,220,250, 34, 31,175,197,174,232,165, -175,226, 26,202, 32,231, 30,250,196,202,145, 97,104,127, 39,100, 26,247,121, 87,182,161, 54, 92,245,181,241,159,120, 94, 94,108, -214, 79, 40,249,207, 96,188, 66,166,113, 27, 74,224, 41,240, 52, 22, 2, 66,151,140,133,164,176, 62, 9, 93,250, 55,117,201,184, -181,254,181,210,116, 90,180,126,102, 81,196,195, 98, 92,116, 5,158, 2, 79, 99, 33, 32,116, 73, 13,201,193,131, 21, 9,121, 76, -114, 2,162,193,188, 95,155,136,168, 38, 39, 69, 2,153,128,107,196,179,102, 77,205, 51,252,119,168,111,157, 82,134, 92,209, 70, - 50, 64, 50, 32,139,192,211, 0,176,100,100,253, 25,120,202,184,173,200,162,142,192,207,104,136,191, 73,102,250,180,105,211,238, -230,180,135,129,227, 73,195,245,110,127, 83,221,245, 86, 86, 45,195,111,171, 59, 79, 90, 90,130, 23,226, 46, 33,179,192,191,173, -156, 50,203,167,204, 22, 83, 78,239,140,138,106, 94,153, 20, 3, 98,146,187,162,145, 54, 89, 94,124, 78, 53, 47,174, 85,201, 43, -167,238, 9,203,149,116,154,133,196,215,201,153,188, 84,142, 76,245,226,122,240, 84, 44,143,120,164,229, 51,158, 19,173,162,134, -186,196,200,228, 9,135, 19, 33,213,171,145,170,127,167, 86,153, 63,118,106,229,245,181,121, 99,167,128, 6, 53,173,111, 53,174, -103,179,179, 85,227,180,125, 90, 53,115,200,170,204,167,190,215, 85,247, 44,238,138,114,181,171,121,207,206,233,147,188,251,161, - 67,126,137,233,105,205,228,247, 78,184,218,182,104,152,106, 83,247,142, 57, 35, 27,213, 78,181,185, 89,179,212,230, 58,218, 45, - 46,117,215,167, 6,191, 84,230, 72,110,227, 33, 73,146,120, 13, 77,148,168,242,208,196,137,235, 13,227, 52, 52, 97,194, 58,188, -207, 61, 94,161,136, 83,221, 89,102,170,193, 10, 69,177, 17, 38, 38, 77, 88,102,111,150,213,107,164,137, 73,227, 33, 10, 69,209, - 81, 10, 5,207,238,163,117,211, 90,247,248, 38, 19,245, 69,189,255,212,186,235, 83, 66,113, 62, 26, 1,115,115,243,115,220,185, - 96,210,203,152,100,109,109, 29,128,196, 29,143,148,120, 78,169,152,196,203,149,224,220, 57, 3, 59, 71,140,224,130, 95,243, 72, -116,194,239, 31, 25,213,101,145, 52,105,210, 97, 92,142,147, 38, 38, 38, 33, 72,248,141, 99,122,228,234,122,249,240,232,123, 69, - 61,198, 99, 62,227,241,128, 39, 0,125,200,191, 23,224, 24, 39,156,211,182,233,146,153,130, 59,128, 73,188,224,240, 43, 94, 4, -248, 58, 79, 42, 25,229,225,225,241,138, 49,156,196,194,120,149,156, 56,201,140,171,238,234, 42,103, 70, 38,129,103,157,156,156, -206, 71,227,103,129,223, 92,246,179,252,127,198, 56,148,211,140,175, 41,201,248,245,229, 78,112, 79,244, 50, 55,207, 88,151,246, -112, 27,245,197, 57, 78,200,163,105,251,165, 29,132, 74, 1, 82,114, 57, 95,178,174,191,228, 99,127,165, 21, 2,196,137,194,110, -172, 84, 38,252,175,173,109,245,228,213,219, 70,197,253,236,171,204,153,222,124, 14, 18,126,203, 80, 90,189, 50,213,100,120,240, -202, 21,111, 63,125,250, 36,173, 92, 81,163, 70,141, 96,126,110,185,255,141,181,125, 71,180,218, 52,205,248, 54,236,211, 83, 10, -255,252, 92, 74, 95, 67,159,208,253,219, 7,104,203,186,161, 52,124, 96, 25,106, 88,195,250,100,253,154,105,178,200, 37, 90, 94, -110,138,138,253,250, 86,155, 19, 25,113,101, 78,237, 26,222, 51,166, 78,205,155,242,238,133,236, 54,167,247,101, 45,212,167, 91, -129, 40,220,227,224,158,233,212,180,142,205, 89, 29,100,203,208,186,203,128,243,151, 5,195, 39, 24,148, 44,153,243,144,196,137, -219, 12, 75,146,164,242, 40, 43, 43,175, 81,105,210, 56, 35,141, 73,157,218,117,104,146, 36,101,164,115,137, 19,231, 48,224,121, - 79, 48, 60,113,226, 2, 51, 51,103,238,243,238,246,237, 62,225,159, 63, 15,224,249,217, 6, 33,225, 55,142,205,244,240,232, 51, - 88,161,200, 39,100,126,135,128, 38, 93,250, 25,120,202,209, 65,145, 71,137, 0, 72, 22,214, 29, 84,110, 81, 81, 81, 20, 30, 30, - 46, 45, 96,140,151, 24,102, 73, 87, 46,100,140,101, 57,176,156, 14,127, 69, 6,104,123,161,169, 28,199, 87, 44, 26,125, 5,175, - 19, 23,134,153,183,177,128, 52,228,238,217,179,135,114,230,204, 25,198,231, 86,114, 66, 48,165,166, 47, 94,109, 47,159, 50, 60, -219,252, 27, 44, 90,141, 25,177, 33, 15,139, 55, 99,130,201,121,243,230,133,227, 28,203, 43, 99,192, 3,136,172, 62, 76,172,110, -243, 18, 36,159, 48, 11, 56, 38,100,197, 26,140, 88, 50,135,151,182,249,132,115,200, 99,128,204, 4, 76, 50,154, 56, 58, 58, 62, -159, 59,119,238, 23,224,120,250,244,233,155,192, 14,107, 41, 78,159, 62,253, 11,206, 33, 15,203,212,228,178,248,174,238, 92,134, -115, 74, 50,172,143, 8, 27, 72,134,115,184,184,184,220,229, 69,138, 35,121,129,234, 48, 38, 26, 91,144,238,222,189, 27,193,203, - 7, 69, 98,225, 98, 46,163, 33, 47,201,108, 76,168, 30,241, 66,225, 33, 60, 9,104, 20,102,238,199, 82, 68, 88,252, 26,203, 55, -241,114, 65, 81, 60, 65,232, 71, 38,199,152,143, 45,155, 6, 76,117,117, 58, 5,153, 12,205,102,236, 78,242,146, 56, 79,144,240, - 27,199, 88, 78, 65, 29, 79,181,222,142,140,101, 45, 89,176, 96, 65,196,200,145, 35,195, 25,235, 37, 50,222, 16,122,101,202,144, -161,158,229,167,202, 84,146,167,229,139, 7,175,236,212,182,204, 74,254, 31, 31, 38,154,244, 47, 1,206, 33, 15,242,130,152,169, -145,178,239,202, 89,190, 68,186,113, 85,202,187, 46, 42, 93,204,190,121,222,188,214, 41, 43,151,119, 93, 21,242,118,203, 96, 36, -252,198, 49,156, 67, 30,228, 53,176,221, 61,184,157, 31,249,248,248,188,230,229,183,174, 36, 73,146,164, 13, 72, 22,222, 75, 87, -175, 94,149,214, 17,133,126,229,205,155, 55, 56, 89,178,100,170,150,173,239,136, 86,253,234,214, 3,217,202, 20, 1, 82, 53,121, - 76,109, 90, 56,167, 45, 29, 61, 56,143, 2, 95, 92,146,136,215,245, 75, 91,169, 71,167, 92, 97,117,171, 91, 14,105,217, 50,103, - 18, 37,225, 82, 41,239,255, 45,132, 30, 10, 63, 37,201,194, 62,107,230,132,163,242,228, 72,220,175, 84, 81,147,145,147, 71,228, -152,216,163,125,134,251, 32, 89,170,100, 75,139, 43,241,167,182,123, 28,244, 80,219, 37,234,229, 76,192, 68, 42, 43, 91,177,106, -207, 76,151,206,106,130,131,131,229,104, 83, 83,159,145, 73,147, 22, 64, 26, 97,106,154,115,162,181,117,218, 53,249,242, 37,103, -178, 85,134,201,150,175,140,118,135,204, 38,254,211,167,247,226,197,112, 7, 5,223,189,219,231,230,164, 73, 93, 15, 85,169,210, -233, 88,157, 58, 29, 31, 47, 89,210,233,243,211,167,189,249,220,192, 99, 35, 70,244, 26,145, 52,105, 3, 33, 51, 22, 2,154,218, -200,216,120, 26, 81,165,226,165, 40,101, 48,188,106,172,150,238,138,160,243, 6,201,194, 18, 49,235,215,175,167,205,155, 55, 75, - 47,174,189,123,247, 74,107,244,225, 5,198, 36, 65, 34, 31,188,152,179,180, 6,154, 12,162, 85,157, 45, 36, 47,177,148, 7, 72, -134,166, 13,132, 14,179,112,243,210, 55,152,121, 27, 86,132,234,106, 37,213,244,242, 41,230,233,233, 25,138,165,114,110,223,190, - 77, 11, 23, 46,164,241,227,199, 75,235,179,161,220, 56,142,196, 86,163, 80,150, 85, 76,198, 3,136, 44,185,185,163, 14,229, 69, -179,163,130,131,131,165,122, 42, 55, 16, 66, 44,197,195, 56, 68, 33, 15,242,202,144,153,139,235,126,189, 93,187,118, 31,176,156, - 15, 54,158,113,252, 57,207, 54, 30, 5,162,133,132,197,166, 81,206,246,237,219, 7,177,220,235, 44, 51,151,190,186,163,157, 64, -122,177,189,124,249, 82,170, 55,150,143,193, 90,125,192, 17,255,131,112,130,204,202, 37,195,188, 12, 80,201,236,217,179, 63,129, - 69, 64,185,241,146, 67, 15,185,253, 95, 65, 14,202,136,245, 40, 51,101,202,244,132,137,145, 38,151,218,119,109,196,132,229, 2, - 48,196,114, 67,220,241,145,155,155, 27,241,130,216, 84,168, 80, 33,105,189, 72, 44,130,141,197,144,153, 20, 19,119,138, 23,100, -224,137, 44,217, 97, 93,227,165,139,222, 97,113,114,213, 15, 3,204,134,142,197,197, 43, 84,168,240, 54,218, 2,151, 93,166, 76, -213,108, 57, 74,148, 40,193, 48,188, 35, 44, 6,206, 58,246,142, 79,106, 35,151,202,235,226, 93,231,168, 36, 90, 32, 80,215,175, -237,154, 51,118,116,203, 49,197,253, 18,213,120,247,206,203,137,190,120,185, 33,225, 55,142,225, 28,242, 32,175, 28,162, 5, 2, - 21,250,126,203,224, 93, 91,251, 79,237,210,161,196,134,227,251,167,173,255, 26,114,116, 57, 18,126,227, 24,206, 33, 15,242, 26, -208, 70,252, 56,123,188,196, 50, 65, 88,132, 30,107,165,242,146, 94,159,249,121,253,122,241,226, 69, 90,177, 98, 5, 13, 27, 54, -140,186,117,235, 70, 3, 6, 12,160, 68,137, 18, 97,157,197,239,218, 72,213, 66, 53,105, 82, 21,203,101,115, 26,228, 88, 48,179, - 98,217, 5,211, 11,247,232,223,213,109, 69,155,166,246,183,134,244, 43, 65,143,239, 29,163,207, 33,143,104,193,236, 54, 4,178, -165,147,104,101, 82,244, 11, 13, 61, 55,231,221,187,179,115,110, 50, 86,183,174,237,154,119,243,218,230, 37, 55, 46,175,218,112, -241,212,140,131,247,207,183,157,220,181,141,203, 19, 25,100, 43,222,233, 18, 0, 30,154, 52,169, 43,187,244,170,175,169, 81, 35, - 41,147, 42,207,225, 73,146,248,142, 50, 51,203, 48, 61,109, 90,219,201, 86, 86, 54,227, 76, 77, 29,134,155,152,228, 6,225, 58, -216,191,127, 98, 38, 91, 37,134, 37, 74,148, 71,215,187,142,229,229,191, 56,103, 78, 79,110,235, 65, 23, 6, 14,236,182,167, 72, -145, 54, 15,199,142,173, 29,188,123,119,101,164,103, 51,103,214,188,216,172, 89,147,231, 75,150,180,141,252,250,181,255,225,129, - 3,123, 12, 85, 40,120, 78, 97,237,100, 67,155,204, 7,171, 86,213,104, 80,170,212,216,116,169, 82,157,115, 74,153,242, 66,171, - 50,101,230,191,127,253,122,240,143,200, 52,102, 57,183,249,250,182, 91,220,172, 89,187,171, 75,150, 72,245, 55,102,221,127,164, -156,241,146, 26, 25,183,208,234, 19,148,198,254,159, 45, 10,126,176, 42,112, 26,172,188,175,146,104,201, 33, 89, 88, 32, 25, 68, -139, 59, 52,117,139,150,122, 53,158,128, 72,225,197,168,111, 3, 89,192,130,213, 44,224,137, 30, 44, 82, 98,109, 68, 44,143, 2, - 34, 56,120,240, 96,105, 65,101,172,245,182,111,223, 62,105, 15,178, 8, 89,183,110,221, 34,172,177,200,242,244,185,128, 76, 56, -223, 99, 37,185, 2,161,124,241,226, 69, 76,145, 97, 49,131,133, 11, 86, 40, 44,226,140,188, 44,147, 87,228,209,190,177, 53,231, - 5,151,225, 12, 11, 57,204,132,224, 40, 91,134, 78,205,159, 63,255,216,196,137, 19, 47, 13, 28, 56,240, 58, 91,122,238, 52,106, -212,232, 65,181,106,213,158,178,187,227, 21, 47, 4,252,142,221,105, 65,250,244, 64,217, 78, 32,148, 88, 76, 27,196, 10, 27,136, - 48, 48, 1, 97,197,134, 54, 66,121,101,180,145,130, 23, 57,190, 3, 34, 12, 82, 5,204,128, 35,200, 26,136, 12,234,142, 58,115, -217,165,181, 41,217,162,112, 71, 95, 25,113,158,243, 5,130,252,240, 12,235, 32, 82, 88,140, 25,196,151,242,231,207, 47, 45,122, - 92,175, 94, 61, 98, 28, 36, 61,226,153,215,245,233, 17, 68,230,200,154, 53,107, 32,234, 4, 82,137,186, 98,105, 28,212, 19,191, - 85,137, 60,234,192,196, 14,237,174,143, 36,169, 86, 37, 33,151,241, 22, 8, 53, 8, 44,116, 0, 36,145,203,118,139, 51,201,137, - 45,146, 3,203, 31,145, 71, 37,238,106, 24,136,212,189, 91, 75,134,110, 89, 87, 99,216,158, 53, 94,195, 94,223, 44,208, 13, 9, -191,113, 12,231,144,199,203, 67, 49,145,175, 83,183,104,125, 87, 31, 88,171, 64,164,190,188,223, 63, 61,240,233,230,117, 67,250, - 22,121,216,176, 86,234, 79, 72,248,141, 99, 56,135, 60,200, 43, 19, 16, 55, 38,249,129,104, 87,232, 20, 54,232, 38, 62, 84,152, -104,125,106,211,166, 77, 80,239,222,189,169,113,227,198, 84,169, 82, 37,170, 92,185, 50,222, 35,143, 52,201, 86, 37, 90,135, 22, - 13, 54,121,253,100,149,125, 80,224, 50,183,240,247,253,124,195, 63,244, 46, 21,241,126, 68,163,173,171,170, 79,108,221,212,241, -213,222,237,147,232,203,199,199,212,179,115,158, 48,165, 27, 81,147,204,204,238,138,226, 74,139,214,128,190,213,231,100,243, 74, - 56,166,112,222,196, 67, 42,148, 73, 62,101,220,144,146,163, 35,223,204,104,251,225, 97,223,209,154,200,150,158,152, 45,153,240, -252,190,108,131, 20,138,164,112, 9,206,119,119, 55, 7,201,154,108,103,231,195,230,197,146, 17,151, 46, 89, 84, 43, 81, 34,150, -149,116, 64,194,132, 14,131,147, 36,201,179,170,106, 85,233,154, 49, 10,133,173,166,146,115,167,100, 61,197,205,173, 15, 44, 89, - 23, 6, 12,232,202,190,214, 38, 44,179,188,166,244,100,194,132,218,175, 86,175,110,201,174,196, 62,227,211,164,233,173, 45,102, - 75,147,204, 17,157, 58,117,241,206,152,113,135, 87,230,204,161, 75,150, 44,145, 92,207,120,167,226, 29,234,230,234,250,217,183, -112,225,211,117, 45, 44,102, 24, 34, 19,101,228,186, 87,224,186, 79,205,232,226,114,221,204,212,244, 19,146,187,147,211,173,250, -197,138, 45,251, 26, 26,218,215,144,114,182,201,149,107,108,234, 84,169,222,101,114,119,255,194, 94,167,136, 52,236, 69,170, 82, -172,216,212, 23, 7, 14, 84, 69,221, 95,175, 93, 27,167,186,163,156,111, 78,156,168, 92,175,108,217,113, 5,178,103, 95,159,197, -211,243,138,163,131,195,235,180,182,182,111, 61, 50,100,184, 93,190, 92,185,163, 69, 77, 77, 87,243, 3,154,230,103,106,151, 38, - 46,242, 51,239,103,100,217,234,163, 14,241,255,255, 55,144, 44,245, 27,162, 3, 7, 41,218,178,101, 75,140, 37,235,208,161, 67, - 49,150, 44,184,252, 96,201, 66,199,198,164, 65, 90,116, 89, 70, 39, 46, 89,201, 96, 13,193,250,113, 32, 83,234, 27, 22,151,222, -176, 97, 3, 13, 29, 58, 84,114, 41,113,185,116,118,186,108, 81, 25, 56, 99,198,140,112, 88, 52, 64,178, 64,182, 14, 28, 56, 16, -171,156, 32, 89,176, 66,129, 44,177,220, 48, 92,163, 11,224,196,137, 19,119,239,210,165,203, 23,101,217,214,174, 93, 43,145, 14, -229,134,151,122,199,142, 29,233,250,245,235, 82,106,218,180,233, 23, 92,163, 75, 38,199, 36, 73,117, 87,110, 76, 88,110,242,226, -196,111,217,133,246, 21,164, 72, 61,177,107,242, 29,151, 19,238, 78,157, 27,220,133,168, 23,240,196,151, 60,136, 22,202, 7, 28, -129, 9, 94, 18,192, 25,237, 3,194,160,171,141,120, 77,187,193, 76,120, 78,181,108,217,242, 9,220,196, 88,240, 27, 58, 0, 92, - 33,235,249,243,231, 18,113,197, 30, 29,217,214,173, 91,169,108,217,178, 79,216,221,123,212,217,217,153,223, 93,218, 55,142,237, -122, 3, 12,241,226,130,133,161,126,253,250,228,231,231, 39,117,132,144, 15, 66,143,242,193, 53,155, 34, 69,138, 87,122,170,157, -150, 59,218,231,112, 15,163,110,236,218,163,201,147, 39,211,152, 49, 99,164,250,178, 11,150, 86,174, 92, 41, 97,160,220,160,175, -136,181, 98,185,105,245, 97,138,243,140,107, 23,118, 17, 75,102, 87, 96, 11,114,137, 5,154,153, 20,126,100, 23, 85, 23, 57, 50, -226, 97,158, 4,176, 90,129, 80, 61,185,214,120,201,164, 81,197, 15, 53,109,224,253, 63,246,174, 2, 62,138,227, 11, 31,238, 46, -193, 53, 4,119,119,138,211,226, 20,215,162, 69,139, 91, 91,220,139, 91,139,187, 59, 65,130,187, 7,119,119, 8, 22, 36, 4,146, - 3,242,254,223,183,205,230,127,185,220,221,238, 37,129, 66,187,251,251,205,239,246,118,103,223,206,188,153,157,249,230,189, 55, -239, 61,103,226, 57,175,241, 30,243,160,110,186,118,227, 81, 53, 72,169, 21, 1, 85,207, 78,174,239,111, 95, 26, 37,239,188, 23, -202,173,211,181,100,198,216,212, 1,205,234, 37,241,229, 61,230, 97, 94, 61, 60,203,146, 37,237,214,163,187, 91,202,241, 3, 67, -101,227,218, 49,178,115,167,135, 98, 34,192,241,136, 99, 11,190, 37, 31, 72, 74,223, 34,144, 55, 37,154,236, 79, 28, 67, 16,229, - 40,228, 97, 9,180,182,108,153, 28,205,235,198,194,164,175,158, 44,201, 96,126, 53,186,192,135, 23,189, 43,156,218,215,178,153, -255,243,105,189, 95,222, 30,252, 11,193,214,221, 27,251, 5, 18, 42,105,242, 99,194, 67,124,214, 94,121,131,108,180, 62,157,155, -209,176, 94,142, 89,123,182,164, 76,117, 96,119,166,194, 47,110, 13,174, 48,109, 76,157,241, 59,214,247, 90,247,224, 98,159,233, -214, 96,171, 89,131, 68,187,244,242, 86, 15,175,190,116, 30, 0,166,220,176,201,250,129,234, 66, 74,178, 48,129, 23,240,152, 57, - 51,194, 40,216,222, 66,210,149,149,105, 56,226,131,170,229, 26, 24, 53,106,182, 97, 17, 34,164,135, 97,123,161, 65, 17, 35,218, -148,224, 97, 96, 41,235,125,249,114,191, 55,183,110,245,223, 1, 73, 22, 65, 65,234,148, 41,175, 37, 77,146,228, 37,128,134,146, -146,187,184,188, 76,145, 60,185,146, 82,186,184,188, 74,155, 38,205,155, 52, 41, 83,190, 73,158, 48, 33, 23, 70, 33, 14,107,154, -185, 50,101,114,231,248,113,227,198, 13,101,204,179, 62, 56,118,177,111,245,234,213, 75, 18,153, 76,107,244,208,100, 57, 81,247, -166,233, 82,165,186, 82,171, 86,173,247, 71,142, 28, 81,180, 10, 76, 60,175, 89,163,134, 95,102, 87,215, 59,107, 70,142,196,134, - 87,147, 45,245,169,201,178,156,155, 33,201, 34,200, 98, 63, 87, 15,206,191,237,218,181,123,159, 40, 97, 66,239,105,191,254,218, -225,222,176, 97, 13,205,119,239,118,185,186,114,101,119, 61, 52, 85,126,178,172, 57, 51,103,222,211,177,125,251,103,152,127, 3, - 40,100,160,118,136, 42,120,142,125, 24, 87, 3, 74,149, 40,241, 50, 97,164, 72,161,137, 87,170,187, 27,218,194, 34,186, 31,254, -218, 51, 90,160,200, 50,106, 89, 57,129,115,178, 85,213,133,142, 64, 22, 39, 79,170,215, 32, 1,208,146, 68, 40, 96,131,147,169, -154, 84,149, 15, 59,248,140, 25, 51,164,123,247,238,210,167, 79, 31,101, 50, 38,224, 66,121, 28,210,100, 32,106,210,224, 10,132, -146, 44,150,243,224,193,131, 10,125,170,142,216, 81,212, 14,115,249,242,101, 57,124,248,176,240, 25, 71,109,130,251,123, 40,193, - 80, 15, 78,228,234,193,137,157,192,134, 64,129,239,161,180,135,234, 46, 62,227,136,166, 37,208,130,170,239, 13,202,225, 69, 32, -128,143,251,146, 53,200, 2, 24,124, 7,117,152, 79,224, 4,225,176,251,176,157,198,140, 25,163, 0, 12,166, 95,126,249, 37,232, -156,255, 91,183,110,173, 0,144, 81,163, 70, 41,129,144, 29,181, 17, 64,214,113, 74, 27, 33,185,121,193,193,102,225,194,133,210, -181,107, 87,133, 38, 37, 77, 4, 88, 84,203,246,236,217, 83,185, 78, 94,183,105,211,230, 25,251, 72,161, 66,133,142, 56, 42, 40, -108,104,130, 80, 15,251, 21,251, 11,129, 18, 19,249, 64,233, 4,237,182,168,238,213,146,104,225,126, 23,180,175,130,124,169, 58, -154, 48, 97,130, 0, 24, 11, 6,179,119,197,138, 21,123, 83,185,114,229,183, 63,255,252,243, 59,168,168,149, 17,147,101, 39,208, - 2, 47, 62, 64,154,166, 7, 36, 37,133, 90,243,153, 10,174, 9,180, 8,178, 88,119,246, 5,172, 36, 41, 29,179,185,250,254,218, -191,117,173,242, 81, 69, 72,233, 21,129,213, 47, 29,202,124,184,120,118,155, 48,241,156,215,120,143,121,180,232,224,126, 68, 26, -187,211, 14,139, 42, 66, 74,175, 8,178, 36, 0,205,134,100,246,217, 38, 55, 79,148,144,241, 67, 92, 2,120,143,121,152, 55,208, - 64,222,161,196,176,116,137, 44,231,207, 31,174, 39, 47,159,174, 19, 31,239, 29,178,111,215,100, 25, 59,102,128,210, 70,235,214, -173, 19, 44, 96, 4,223,196,219,124,249,242,189,115, 4,178, 88, 7, 75,160, 53, 99, 70,219, 40,183, 79,207,139,239,253,104,101, -154,231,119, 38,100,109,221, 36,253,152,191,166,254,188,231,206,245, 13, 7,223, 61,158,210,155,146,173,129,125,203, 40,182, 85, -147,255,104, 40,220,141,232,136, 15,216,117, 88,133,134,240,133,243,199,234,251,248,148,107,146,253,187, 92,243, 53,169,151,234, -143,153,211,187,237,190,115,125,211,161,109,235,122,174,183,150,108,245,239, 81,236, 83,139, 22,142,165,227, 58,120,255,143,101, -129, 93, 86,157, 81, 9, 19,102,134, 77, 86,158, 81,113,226,164,133, 52,167,202,224, 8, 17, 18, 18, 96, 65,218, 21, 87, 73,209, -162,185, 78,203,158, 61, 53, 62,205,196, 19, 51,102,140, 59, 52,122,244, 50,131, 35, 70,140, 15,144,246,179,173,130,115,135, 29, -141,221,175,254,249,103,143,219,144,218, 16, 20, 16,100,169, 38, 19, 28,171, 40,113,167, 20,219,218,110, 56, 69,146, 36,175,244, -208,140, 29, 51,230,125,142, 21, 28,219, 41, 33,183, 62,184, 80,165,201, 12, 23,214, 80, 93, 60,210, 67,147,146, 44,130, 44, 44, -216, 62,217, 2,111, 28, 7,177, 64,252,148, 57, 99,198, 59, 67,162, 71,183,101, 83,102,178,172,251,252,214,173, 59, 82,146, 21, -162,112,184, 0, 16, 24,128,177,253,125,171, 42, 85, 70,189,217,183,175,229,139,115,231,186,141,140, 30,189,177,158,114,170,146, - 65,128,211, 23,172, 59, 53, 21, 28,139, 3,181, 92,202, 57, 36,197,138,185, 76, 44, 29, 90,150,176,116, 62, 91, 88, 36, 44,244, -190,240,179,150, 30,225,213,243,144, 69,176, 68,147,156,192, 57, 9,210, 38, 75, 5, 47, 4, 31,156,176, 84, 21, 13, 37, 89, 92, - 73,194, 96, 90,233,224,161, 1, 90, 42,224,194,132, 45,176, 95, 82, 38, 76, 21,104, 81, 42,161, 5,180, 48,233,190,225,100, 11, - 27, 34, 69,106, 69, 59, 31,174, 60, 40,221,225, 71, 65,144, 69, 32, 72,117, 18,207, 9, 22,248,140,163, 6,192,224,252,154,117, -227,193, 15, 4, 18, 51,229, 92, 5, 89,164, 11,245,158, 34,209,161, 45,200,184,113,227, 4,210, 39,135, 52, 85,160, 69, 32, 3, -144,117,146, 42, 15,130,141,233,211,167,223,227, 4,161,130, 45,170, 0, 51,102,204,248,116,240,224,193,234, 74,220, 97, 95,225, -238, 79, 85, 50,200,129,135,224,138,131, 14, 15, 14, 14, 4, 89,252,160,121,176, 61, 29,181, 17,140,138,151, 3, 60,126, 34, 56, -133,132,233, 9, 63, 44,218,190,144, 46,127,217,214, 4,171,236, 7,148,116, 98,117,247,148, 18, 52,128, 98, 26,199, 47,211, 11, - 52, 89, 22,214,159,244,216, 78,108, 55,130, 24,214, 25, 70,241,228,165, 67,112,141,119,237,183,148,134,114, 16, 64,155,125,192, -251,105,240, 76, 41, 3, 83, 53,216,229,124, 32,176,102,219, 99,119,167,244,239,223, 95, 32,169, 61,166,245,241,193,150,110, 51, - 36,142, 65,203, 90, 85,162, 69, 16,200, 4,105,227, 39, 72, 48, 55,107,209,249, 22,239,211, 30,139,170, 66, 74,177, 8,176,212, -131,231,188,198,123,204,163, 85, 55,186,111,224,206, 66, 26,189,211, 30,139,170, 66, 74,178,130,128,150,239, 81,121,125,231, 7, -217,184, 48,141,240, 30,243, 48, 47,159, 9,116,253, 96,247, 21,144, 76, 14, 59,186,187,121,192,157, 75, 3, 21,160,197,116,229, -252, 10,233,209,189,185,242,173,242,123,228,162, 13,170,101,127,108, 44,129, 23, 1,251,135,245, 46,194,195,135,199,199,184,119, -101, 78,138,106, 21, 83,254, 58,101, 98,135, 45,215, 47,175,219, 53, 99, 90,135,221, 23,143,182,110, 66, 53, 34,109,182, 40,213, -218,179,125,186,180,109,230,210, 87,203,207,150,171,171, 41,154,167,103,219, 40, 55, 61,243,199,171, 88, 54,242,111,147,199,183, -218,118,245,194,250,157, 4, 91, 11,166, 55, 25, 46,207,255,108,127,243,100,167,137,253,187,101,186,220,235,151,252,159,218,180, - 72,180, 94,139,183, 95,243,125,170, 0,167,167, 73,147, 0,246, 79,101, 47, 13, 31,158,158,234, 66, 24,177,231, 4,192, 82,118, - 83,163, 63, 69,248,244,225,195,200, 83,243,231,143,193, 53, 5, 80, 15,143, 20,169, 2,102,165, 40,120,166, 7,174,133,216,201, - 77, 23, 6,120,110,224,129,186,117,127,161, 13, 17,129, 1,165, 88,236,155, 4,214,148,178, 83,139,193,133, 47,199,126, 74,124, -184,112,227, 2, 43,101,210,164, 54,199,101,107,154, 42,208,162, 36,135,115, 28, 77, 36, 56,167,113, 17, 79,147, 1,206, 73,170, - 29, 41, 42,194,133, 86,136,195,154, 38,213,133,144,170,190,183, 5,178, 56, 70, 19,212,113, 12,172, 88,177,162,127,209,200,145, - 87,105,209,164, 77, 22,213,133,182,128, 22,223, 65, 97, 69, 38, 87, 87,255, 54, 21, 43,142,247,243,242,234,138, 29,154, 54,181, - 44,182,248, 73,158,166, 79,151,238, 37,231, 10,150,137, 60,224,102, 37, 38,158,115, 14,165,205,111,140, 40, 81,222,125,137,254, -247,141, 75,182,108, 7,147, 86,145, 43,209,164,202, 68, 78,224, 92, 33,232, 1, 89,148, 72, 16,236,132, 5,104, 81,242, 98, 13, -180,216,193,245, 0, 45,150, 19,187,248,148, 78, 65,117, 23, 63, 52,130, 33, 21, 8, 18, 92, 81, 45, 69, 64,200,164, 5,180, 48, -209,191,101,231,226,202,152, 54, 64,148, 6, 17,164,144, 6,233, 18,204, 81, 45, 65,117, 21, 85, 19,148,194,241, 25, 61, 64, 3, - 96,239, 56, 1, 12, 65, 22, 19, 7, 4,168,225, 30, 16,104,113, 37,145, 35, 71,142,167, 77,154, 52,161, 97,175,110,160,197, 85, - 8, 7, 25,130, 33, 74,183,120, 80,164, 76,155, 21, 74,177,120,176,141, 8, 78, 52,218, 40,134,155,155,219, 56, 72,167,118, 97, -199,225, 34,184,159,184,203,250,211, 86,129, 3, 3, 19, 55, 50,176, 79,164, 79,159,254, 14, 38,188, 37, 0,133,187, 0, 76,198, -161,238, 49,244,212, 95, 29, 36, 72,151, 6,230, 28, 32, 9,168, 41,149,162, 58, 18,187,251,156, 6, 90,164, 9, 58, 1, 48, 92, -127, 10, 21,166,146,120,142,149, 88, 0, 13,247,217, 47,168,234,133,148,139,210, 40,186,166,176,123, 0, 64,149,197,160,250,134, -210, 44,214,151, 60, 35, 47, 9,170, 9,230,217,214,156,200, 97,243,245, 18, 68,108,109,172,248, 18,227,208,103,123,199,231, 4, - 90, 84, 23, 82,146,101, 6,200,242,127,214, 71,145,104,133, 6,104,177,175,149, 42,158,241,241,217, 67, 13,229,192,206,129,242, -252,233, 25,165, 91, 93, 56,189, 68, 26, 55,170,165, 0,106,216, 60, 42,139, 54, 72,154,185,129,193,238, 97, 13,180, 6, 13,170, - 27,181,104,193, 88,191, 76, 24,215, 97,253,149,139,155, 55, 78,153,208, 97, 75,155,230, 25, 70, 83,141,248,225, 69,223,138, 52, -144,247,216, 56, 86,188, 30,156,148,230,141, 18,111,161,115, 83,173,198,128,106, 60, 98,129,220, 81, 58,141,255,163,245,154, 75, -231, 86,109,154, 52,190,229,182, 38, 63,166,250,227, 9,212,136, 35,126, 47, 51,210,243,240,212, 93, 19, 71,231, 29,187,123, 67, -246,226,244,179,165, 69,239,107,190, 15,160,213,121,118,230,204,113, 0,154,202, 63, 94,178, 68, 81,135, 65,133,152,103,146,201, - 20, 13, 77,148, 21,169, 20,193,214,192,200,145, 11,172,252,123, 65,100, 26, 28, 41, 82, 57,222,199,179,157,176,237, 52,150,117, -253, 84, 96,112,164, 89,179,206,111,118,236, 80,128, 22, 85,133, 4, 23,150, 32, 75, 29,251, 57,166,170, 90,150, 84, 46, 46, 14, -129,150, 74,211, 18,104, 17,108,169,137, 2, 0,246, 37, 74,241, 9,180,168,193,208, 2, 90, 42, 77,218,100,113,161,103,125,112, - 92,225,156,196,121,138,227, 54,231,185,116,241,227,223,118, 4,180, 84,154, 41,147, 39,127,192,133,176,229, 65, 62,112,225, 74, -224, 70,193, 5,164,125,126, 43,230,204, 25,174, 5,180, 44,249,169, 2, 45,142,123, 28,243, 56, 55, 17,104,146,174, 58,254,177, -254,177,163, 70,117, 40, 80, 8,107,223,180,133, 69,194, 74,243, 11, 63,111, 27,100,217, 43, 4,129, 22, 37, 25,170, 26, 78,149, -100, 81,162, 97, 9, 96, 56,129,115, 34, 38, 16,193,132,235,180,234, 80,149,104,217, 2, 90, 92,149,106, 1, 45,170, 1, 89, 30, -126,112, 59,119,238, 84, 58, 47,203, 72,116, 79, 73, 6, 59,159,170, 23,167,132,135, 32, 65, 75,117,136,186, 31,226,135,198, 73, -250,175,191,254,226,138,131, 42, 50,197, 96, 27,198,234, 2,213,148, 64, 21, 70,251, 36,101,165,195,221, 77,124, 70, 11,104,160, -227, 62,132,116,196, 71, 5, 89,234, 47,234,126,143, 98,105, 24,239,190,170, 80,161,194, 59,216, 72, 41,128, 67,143,234,144,190, -204,184,210, 96, 93,185,250, 34,208, 98, 61, 9,178, 8, 12, 73,135, 31, 14, 19, 1,169,142, 54,178,172, 70, 33,184,224,184,193, - 54,166,248,152, 31, 26, 92, 51, 72,129, 2, 5,110, 32,147,245, 46, 33,135,253,217,218, 70,205, 30,208, 34, 48,212,146,104, 81, -117, 8,169,154,205,149,157, 58, 0,177,239, 82, 18, 69,176, 76,126,194,142,129, 54, 97, 31, 97, 95,213,213, 65, 65,163, 2,164, -221, 83,213,154, 28,116, 56,136,113,133,199, 1,150,110, 61,104,163,129, 93,161,202,192, 27,232,138, 34,234, 23,254,144, 63,235, -235, 62,167,234,144, 54, 89, 4, 87,148,100,241,119,231,106,215, 80,169, 14, 3, 25, 80,164, 89,253,236,126,187,182, 77,144,119, -111,159, 41, 96,139,146,173, 85,203, 6,227,187,172, 40, 80,189, 43, 64, 11, 59,161,233, 46, 70, 23,208, 66,255,136,156, 35,115, -196,246, 99, 70,182, 91,126,249,194,150,213, 4, 91,148,108, 61,191, 51, 45,171, 98,179, 5, 3,121,238, 70,156, 50,182,145,162, - 62,108,223, 34,195, 13,122,144,183, 69, 60,104,131, 1, 28,188,230,204, 98,106,247,199,168,182,203, 46,157,223,188,130, 96,171, - 98,153,200,191, 30,218,147, 41,207,225,253,110,133,170, 86,138, 49,241,242,185, 21,171,202,149,142, 58,252,193,229, 44,137,232, -212,244,179, 54,240,103, 38, 14,251,172,102,240,153,149,106,100,140, 24,197,232, 4,148,175, 27, 24, 35, 70, 42,168, 7, 83,171, -175,166,141, 22,213,135,252,223, 51,109,218,168,195,163, 68,169, 72, 73, 22, 37, 90,182,138,167,170,207, 30, 44, 93,218,245,241, -172, 89, 63,170, 64,139,128, 69,149,100, 17,100, 81,211,162,130, 44,142,251, 28, 3, 0,180, 94,233,161,169, 23,104, 81,227,160, -165, 58, 84,203, 73,163,119,206, 61,150, 7, 23,197, 42,200, 98,217,105,155,202, 49, 42,102,244,232,239,245,148,179,101,173, 90, -195,127,172, 83,231,111,149, 5, 14, 21,100,169, 54,138, 52,151, 1,112, 11,112,193, 2, 99,112,244,232, 77,245,208, 84, 85,135, -148,104,169,116, 41,217,226,188,202, 57,149, 27,159, 56,246,115, 46,129,234,208, 38, 63, 63,115,183,250, 86,200,235, 83, 29, 90, -214,134, 19, 56, 17, 45,129,144, 22,200, 98, 62,118, 32, 29,147,184, 23, 39, 47, 75, 27, 45, 71, 64,139,106, 26, 45,160, 69,195, -118,250,206,162,148,136, 98,100, 74,156, 40,246, 37, 72,226, 53, 2, 14, 2, 15,138,145,249,110,172, 78,252,181,140,225,113, 31, - 90,172,193,138,162,158, 31, 51, 39, 86,174, 34, 40,113, 34,226,230, 10,164,100,201,146,138,170,139,192, 6, 0,140, 6,246,112, - 76,108,255,160, 91, 11,128,191, 43,214, 32,139,255,161, 58, 51, 67, 21,249, 22, 18,164,103, 4, 5, 76, 4, 28,122,129, 22,203, - 64, 21, 33, 19, 12,243,149,103,249, 81, 80, 13, 7,187, 37, 5, 8,178,172, 3, 7, 14,212,211, 70,193, 42, 1, 9,219, 21, 74, - 1, 9,226,184,169,128, 70,156,144,118,217, 52, 48,117, 84,255,240, 4, 90,120,143, 98, 12,207,129,148, 0, 95,181,203,224,234, -139,160,144,210, 65,168,100,149,118,227,132,139,221,156, 10, 95,224, 7,139, 34,127,187,198,240,152,148,135, 0,240,126,176,222, - 21,203,190, 68, 32, 76, 91,188, 95,127,253, 85,217,205, 70, 27, 66, 72, 51,253,208,238,216, 69,254,175, 57, 62,171, 49, 60, 13, -223,105,147, 69, 41, 22, 19,207,157, 49,134,183, 6, 47, 67, 6,119,188,249,224,174,167, 16,108, 29, 63, 56, 60, 72,141,216,190, -109, 13,169, 89,179,166,212,175, 95,159,109,238,112, 67, 73,246, 76,145, 90,100,115,139, 56,144,191, 4, 89,163, 71, 16, 16,109, - 89, 70,176, 69,201, 22,213,136,222,143, 22,166,161,129,252,235,167,179, 93,233,250, 97,196,160,239, 21,160,213,229,231, 44, 79, -237, 2,173, 64, 39,176,112,157, 49, 29,180,150, 94, 58,183,117, 41,193, 86,129, 60, 81, 58, 82,141,120, 29, 54, 91,251,214,167, - 72, 93,162, 72,228, 65,151,206,175, 95, 80, 40, 79,228,254,158,238,213, 98,218,163,247,173,244, 48,216,104,149, 26, 17, 51,102, -169, 17,113,227,166, 3,128,202,161,150,123,104,180,104,233, 41,197, 26, 24, 37, 74, 62, 24,192,187,169,106, 67,236,224, 75, 55, - 40, 94,188,156,138,161,124,164, 72,213,109,213,115, 16,141,225,225,140,244,253,163, 71,125,207,182,109,219,156,192,128, 70,239, - 92, 56, 82, 16,160,130, 44,213, 76,132, 32,139,227, 62, 23,151,169,146, 39,183, 41,209,180,166,169, 23,104, 81,250,142,149, 21, -119,153,135, 56, 66,208,180, 2, 90, 4, 47, 44, 27,133, 1, 4, 89, 43, 86,172, 80, 22,242, 76, 0, 90,116, 19,164, 73,147,118, - 95, 41,147, 37,123, 68,215, 66,156,159, 56,175,113,145, 77,154,234,252, 68,115,159,114,101,203,250, 99,247,135,205, 57,201, 22, - 63, 85,137,150, 35,160, 69,205, 78,204,168, 81, 29, 74,136,191,149,126,250,213,148,147, 64,139, 0,133, 8,153, 43, 5, 85, 74, - 68,228, 76, 68, 78, 53, 21, 37, 89,156,228, 56,217,113,114,226,100,170, 81,129,251,236,252,164,193,143,195, 18,112, 89, 74,180, -250,245,235, 23, 4, 22, 64,239,190, 6,205, 32,247, 14, 92,205,176,179, 17, 20,168,146, 44,181,140, 44, 31,223, 71, 87, 16,160, -167,181,187, 41, 62,242, 61,167,106,139, 31, 44,221, 14,208,198,135, 70,223, 52,184,239,221,187,183,162, 58,228,206, 72,130, 23, -230, 5,205,248,142,202,137, 1,255, 17, 12,169,207, 97,245,114, 26,118, 36,231,240,236, 37, 24,148, 95, 3, 0,184, 13, 48,244, - 0, 19,182, 63,212,122, 79,160,138,123, 82,182,108,217,231,229,202,149,123, 9,233,139, 77, 91, 0,203,247,208, 9,169,106,147, - 69,222, 18,100, 89,218,100,177,140,170,141, 0,127,117,180, 81,176,106,192, 40,252, 10, 37, 67, 4,176,108, 51,218, 67,125, 78, -160, 69,176,168, 37,209, 10, 44, 96, 62, 26,172,179, 92,148,232,177,221,185, 59,148, 18, 55,174,190,104,192, 79, 85, 33, 37, 80, - 77,155, 54,165,109, 22, 85,125, 14,221, 59, 0, 12,223,181,220, 93,170, 14, 58,236,239,172, 55, 93,122, 16,176, 82, 58, 6, 59, - 45,129,107, 14,182,189,205, 65,247,171,249,144,117, 20, 36, 84,238, 29,224,184, 84, 9,197,227, 32, 92, 15, 95, 29,158,238, 29, - 84,127, 95, 42,120,185,124, 97,219,202, 33,131, 59,220,108,240, 99,102,191,211, 7,234,203,157, 75,131,228,233,253,185, 50,247, -175,118, 82,164, 72, 17,186, 17,161,209,178,205,221,134, 42, 91, 8,178, 62,153, 47, 44,203,145,217,244,151, 10,178,248, 75,208, - 69, 53, 34,109,182,110,222,156, 17,207,235,198,159, 73,233,250, 97,209,220,250,249, 6,246,251, 78, 1, 90, 61, 58,231,133,100, -193,246,238, 75,181,172, 83,198, 53, 81, 64, 22,193, 22, 37, 91, 43,177, 83, 17,234,198,200, 52,144,111, 88, 47,231, 95,116,253, - 64, 63, 91, 57, 51, 71, 28, 5,195,121, 37, 92, 15,202,166,107, 71,167,142,166,253,226, 89,224,162, 33, 14,237,180,230,149, 46, - 29,125, 88,140, 24,133, 85,169, 22, 11, 66, 85,225, 12,216, 98,169,133,130,189, 65, 12,168, 5,139,193,183, 86,116,128,172,218, - 0, 91,153,236,128,141,191,221, 59,136, 12,120,188,104, 81,251, 7,147, 38,213, 75,153, 34,197, 75,206, 61,150, 32,139,243,138, - 10,178,184, 8,227, 56,136,124, 54,199, 80,128,141, 96, 52,227, 68,143,254,144,223, 59,231, 58,123,170, 67,142,165, 92,108,161, -113,232,172,217, 22, 40, 10, 70,147, 46, 28,184, 48,229,193,178, 80,195, 64,250, 92,180, 17,100,209,158,144, 54,174, 28, 83, 18, - 39, 76,120, 84, 15, 77,214,125,209,200,145,173,147,185,184,188,227,226,159, 52, 45, 65, 22,231, 39,110,216,225, 66, 59, 62, 34, -153,232,165,249, 49,208, 70,203, 17,208,162,253,111,244,104,209, 52,231,164, 47,222,233,190,174, 23, 90, 74,181,180, 75,198, 9, -156, 64, 75, 15,200, 82, 39, 39, 27,147,184,245,118,221,102,144,144,188,227,118, 81, 2, 53,130, 55, 26, 47, 18, 0, 17,104, 81, - 2,193,173,254,148,208,192,195, 51, 39, 49,162,124,235,184,107, 54, 29,150, 66,194,225, 75,117, 33, 69,181,170,241, 59,223, 65, -219, 49, 30,124, 15,108,138,104, 71,165,215, 97,105, 37,168, 7,223,114,130,165,248,148,182, 57,203,151, 47, 87,212, 71, 52,132, -167,202,144, 9,124, 98, 25, 43,217,224,168,117, 57, 11,192, 1,235, 69,128,170,215, 52, 36, 39, 15,212,157, 29, 16,205, 6,192, -112,247, 21, 60,208, 43,246, 0,112,232,249, 26,147,132, 46,135,165,108, 39,126,196,228, 37,219,139, 31, 24, 15,214,157,192,139, -252,228,225, 68, 27, 5,171, 10,156,116, 94,225, 74,145, 70,235,180, 77, 35, 47, 96,159,165, 37,209, 10,209, 70,232, 27,143, 45, - 69,232,182, 84,135, 4,173,129, 54, 90,116,195, 96,125,216,106,247,188,168,255, 73,168,118, 95,115,224, 34, 79,169, 66,230, 96, - 67, 27, 55,130, 33, 0, 87, 31,248, 57, 59, 3, 98,154, 14, 75,209,222,123,108, 57,210,165,100,148,117,231,198, 7, 2, 89,238, -184, 36,248,230, 32, 9,218,214,187, 77,191, 57, 39,147,223,138,195, 82,123,224, 5,109, 91, 36,127,238,100,143, 61,214,214, 8, -224,110,196, 69, 51, 43, 9,140,224, 9,172,237,129,172,160, 54, 82,129,214,148,177, 77, 20, 73,150, 10,178,168, 70,164,253,214, -160, 65,101, 34,115, 55,226,202,149,131,162,210,253,195,168, 81,229,227,117,237,144,211,143, 33,122,186,118,200,245,145,129,168, - 3, 59,106,176,118, 87,203,122,250,216,156,165, 4, 91, 4,135, 42, 40,101,160,105,130,170, 79,112,253, 64, 63, 91,116,106,170, -250,221,170,135, 93,138, 52,160,183, 69, 83,123,212,214,149,227,179,247, 79,168, 0, 75,193, 93, 67,169, 73,149, 42, 69,131, 33, -124,113, 2, 40,218, 96,169,165,163, 52, 11, 41, 21, 65, 22,193, 22,239, 19,104, 97, 97,105,105,239, 22,172,156,116, 46,122, 98, -202,148,222, 64, 44,191, 61, 91,177,162, 13, 93, 56,168,243, 19,199, 39,130, 44,130, 14, 46,140, 85,144,197,241,198,106, 78,178, - 75, 51,107,234,212,199,168, 22,164,102,134,223, 59,199, 59, 2, 46,154,140,112,236,167,118,133, 82,242, 74,149, 42, 81,203,194, -200, 37,234, 97,151,102,195, 50,101, 22,211,133, 3, 23,249,148,180, 19, 24, 17,100,113, 65, 72,144, 69, 77, 3,231,186, 66, 5, - 11,250, 49,170,129, 30,154,172,251, 67, 56,106,237, 94,175,222,239,240, 73,232,207, 5, 38,203,202,185,132,227, 19,233,114, 12, -101,121, 49,135,124, 4, 77,213,230,205, 33, 63, 73, 51,125,218,180, 14, 85,135,180, 77, 5, 77, 75, 97,202,231,232, 75,186, 58, -241, 87,154,201,177,195, 82, 91,133,230, 4,206, 78, 75,209, 36, 59, 52, 19,213, 92,236,196,156,140, 40,197, 98,167,180,220, 81, -161, 3,104,241, 85, 52,246,156, 10, 71,149, 31,185,219,142, 31, 8, 85, 82,148, 18,177, 33, 9,184,240,110,118,144,169,129,121, -245, 76,184,204, 83,150,206, 72, 49,193,154,185,202, 97,199,102, 98, 71,132,116,195, 63, 80,146,101,207,120,217, 94,135,169, 76, -105, 85,135, 14, 29,204,148, 98,176, 3,115,130,165, 3,196, 6, 13, 26,144,166,179, 97,125, 34,224,153, 22,168,223, 67, 24,126, -251, 19,180, 16, 28, 64, 21,229, 69, 80, 0, 41,153, 63,234,240, 16,187,229, 90,160, 62,186, 66,240,208, 27,191,106,131,198,250, - 18, 96,168,254,165,216, 78, 84,113,133,162,141,130,120, 14,231,165,215, 57, 64,208,185, 40, 12,229, 21, 32, 19, 24,126,199, 81, - 95, 15,193, 79,168, 69, 55, 82, 5,173, 30,148, 52,210,200,146, 54,115, 52,176, 39, 56,162,212,176, 94,189,122,156, 36, 55,218, - 32,238,232,163,102, 8,158, 25, 72, 39, 24, 77, 0,210, 67,198,231, 60, 5,195,247,185,160,163, 59, 4, 15, 12,225,203,227,253, -111, 84,137,160, 90, 86,242,151,101,103,123, 81,170,201, 65,141,174, 71, 0, 66, 95,129,190,181,103,252,207, 49,248,124, 86,154, -223, 74, 8, 30, 71,224, 5,237, 16, 3, 14,126,135,229,200,154,228,124,146, 36,177,182,226,191,163,157,145, 33,128,214,153,163, -179,151, 17,108, 81,178, 69, 53,162,189, 32,210,129, 1,168,251,119,108,233,246,188,113,157, 68,191,218,155, 28,173, 99, 66, 90, -123,209,103,192,105, 21, 92,209,131, 60, 99, 34,242, 63, 93, 66,216,163, 25, 78,147,203,103,237, 75,129,101,140, 64, 55, 15,176, -173, 42,180,171,127,255,200, 84, 21,210,224, 29,233, 59,134,219,129, 23,248,202, 80, 43,230, 34,248,162, 74, 17,118, 93, 13, 3, -129,152,229,152,103, 93, 78, 37, 4,207,222, 65,131,122,127,122,255,190, 63,253,100,113,110,178, 4, 89, 28, 83, 44, 65,150, 22, -208,226, 24,171,210,244,121,241,226,247, 70,181,106,173,201,157, 43,151, 47,165, 80, 28, 59,105,130,194, 77, 58,180,161, 34,224, - 74, 16, 55,174, 15,158,233,130, 20, 36,149,195,185,221,114,126,240,245,253,213, 53, 67,134,251, 0,104,202,166, 28,210,229, 88, -199,141, 91,156,235, 40,189,135,153, 72, 0,198, 43,198,146,213, 93,119,250,201,122,187,127,127,139,190, 63,254, 56, 4,134,239, -239,160,122, 12,160, 13,169, 42,201,162, 0,128, 11,108,104,165,184, 67, 48,109, 96,155, 56,228, 39,105,102,117,115,123,166,250, - 30,228,194,156,130, 11, 2, 67, 2, 56, 74,239, 73, 19,223,152,165, 52,239,115,244,165,112,234,230,255, 8, 25,231,129, 22, 3, - 68,115, 18,103,162,147, 75, 38,238, 88, 83, 19,237,177,152, 8,174,212, 4, 0,225, 76, 80,105, 14,132, 43,161, 34, 11,224,228, - 77, 21, 15,118,114, 5,224,218, 10,189,131,164, 13, 86,198,165,253, 21,141,221,185,179,144,137,231,129, 54, 89,142,212,133,142, - 58, 76,188, 64,154, 7,209,201,222, 49,129,230,193, 64,154,142, 2, 96, 59,162, 25, 19, 64, 96, 2, 64,204, 83,124,116, 1,240, -201,245, 0,124,125,138,213,130,211, 65,165, 97,132,175,180,211,103,106, 35, 19,156,152,186, 19, 92, 82, 29, 75, 53, 29,165,142, - 0, 92,238, 26,221,216, 86,221,147, 0,160, 93,128,221,216, 91,170, 34, 57, 72,114, 80,228,234,145, 96, 24, 3, 90, 64,233,210, -165, 95, 3,136, 94, 0,237, 36, 78, 2,173,208,126, 85, 33,202, 9,176, 85, 6,170,209,199,240,203,230,203, 21, 50, 65,151,234, -167,135,146, 82, 74, 35,225,121,220, 39, 48,200,116,153,127,170,156,161,173,176,173, 73,252, 91, 9, 42,173, 5, 94,156,224, 73, - 8,160, 69,245,161,154, 40,229,114, 4,180, 44,239,217, 5, 90, 80,169, 42,170, 85,203,100,165,102, 85,157,154, 50, 92, 15, 65, - 22,255, 91,213,225,115, 76,100, 95,138,102, 4, 0,171,242, 0, 81, 45,135,197,142,157,157,198,238,148, 94,225, 87, 9, 26,175, - 74,177,134, 68,140, 88,175,103,164, 72,220, 0,144, 82, 71,221,149, 32,200, 19,210,164,233,151, 54, 85,170, 55, 4, 86, 20, 0, - 80,133, 72,205, 5, 23,152,214,170,127, 71, 18, 45, 21, 20,170, 52,111,108,216,208,227,236,174, 93,191,126, 95,177,226, 14,216, -224,126,224, 34,144, 96, 40,109,234,212, 31, 32, 29,152,135,252,182,230, 16, 91,252, 12, 42,231,186,113,227,134,100,202,152,241, - 62, 54, 78,153,213,112,118, 52, 65,160, 26,178,120,177, 98,244,238,238,233,108,221, 89,206, 23, 23, 47,246,240,123,246,172,251, -166, 21, 43,134, 96, 39,226,211, 18,197,139,155,185,200,166, 36,139,170, 72,218,145, 98,193, 74,233,147,186, 89,195, 97, 57, 73, -115, 80,175, 94,139, 10, 66,186, 70,119, 59, 28,251,168, 17, 33,240, 34,136,131,109,234,123,204, 53,143, 33, 4,168, 97,175,207, - 59,241,253,253,155,179, 58,167, 58, 12, 39, 78,232,249,168, 11,226, 93,148, 96, 48,241, 92,235,208, 67, 83,139,134,245,253,127, -138,102, 90,116,222,109, 48,122,247, 64,129,212,149,135,163,178,255, 19,229,140,140,143,111, 38, 60,187, 95, 4, 80,186,152, 51, -103,206,153, 40, 96, 8, 95, 55, 58, 6, 73,102,225, 71, 95, 10, 3, 64,111,168,233,182,160,238,119, 33,129,186, 11, 80,191, 5, - 0,182, 55,239, 89, 12, 12,255,100, 27,177,156, 85, 80,198, 53, 88, 76,156,199, 96,253, 0, 64,246, 1,202,121, 30, 0,153, 94, -161, 41,117,176,231, 21,252,159,104, 35,103,251, 59,243, 7,149, 51, 71, 38, 83,109, 71,128,192,146,184,133, 61,151, 2, 34,248, -172,147, 3,111, 68,250,201, 10,244,149,165,233, 26,193,178,156,214,239,214, 99, 35,102,135, 49, 65,117, 87,141,225, 9,174,212, -164, 37,209,210, 3,180,244, 54, 72, 14, 4,160,134, 20,237, 87,134,237,177,241,204, 55,215,151,172,235, 0, 96,149, 12,206, 72, -107, 64,245,215,147, 14, 73, 33, 65,106,141,243, 62, 86, 54, 89,186,164,247, 42,109,218,125,165,128,199,247, 84, 73,147,190, 70, -242, 73,237,226,226,147, 38, 89,178,215, 52,124,167, 77,150,131,197,191, 93,126,146,230, 32,104, 69,160,242,108,129,242,245,109, - 31, 57,242,240, 52, 17, 34,108,195,138,111, 53, 12, 59,179, 58,104, 79, 77,154,216,113,249, 83,145,104,209, 54,100,192,120, 23, - 43, 70,140,247, 72,239,146, 65, 40, 1, 65, 64, 39,208,117,186,238, 44, 39,119, 98,210,237, 5, 19,203,156,211,100, 26, 0,155, -172, 27, 84, 23, 98, 17,248,158, 32,139, 18,122, 61,223,166,101,221,155, 71,142, 60, 54, 99,212,168,199, 83, 39, 76,120,203, 37, - 81,162,167,160,249, 0,229, 60, 12, 58,127, 34,101,210, 57,206,235,237,254, 70,190,112,226,192, 55, 63, 80,132,129, 15, 70,221, -195,192,188,127,227,164, 19, 6,118, 24,125, 41, 12,204, 51,250, 82, 48, 14,252, 99,125,137, 97,120, 44,141,227, 53,154,244, 31, - 43,167,147, 93,237,107, 43, 39,109,178,184,104,183, 94, 8,126,109,229,116,146,205,223,100,118,231,124,106,133,161,138,223, 74, -227, 26,229, 12, 67, 35, 27, 19,217,215, 49,145, 57,217,132, 70,159,119,146, 97, 6, 48,176,203, 1,163, 47, 25,125, 41,124, 57, -240,239,160, 22, 12,104,241, 35,177,149,156,169,170, 61, 26,142,174,107,209, 55,104,218,110,151,208,182,151,193, 79,131,159,122, -251,128,241,109,218,231,128, 94, 30, 90,230, 51,248,105,240,211, 22, 7,254,203,125, 73,229, 71,104,231, 51,173,111,234,159,184, -239,188,195,210,112, 42,165,177,210, 9, 39, 70, 6,146, 49,248,105,240, 51,188, 56, 96,244,165,240,226,228,223,116, 12,126, 26, -252, 12, 47, 14,252,151,251, 82,120,241,240, 63, 69,231, 91,238, 48,201,208, 82, 76,122, 14, 91,121,191,229,186,235,169,179,163, - 60,255,182,186, 59,211, 23,190, 68,221, 83,129,249, 76,122, 15,230, 77, 97,149,249, 75,148, 83,111,249,254, 75,125,201, 25,158, - 24,109,228, 12,183,180,243, 26,252,212,230,145, 51, 57, 62, 7, 63,157,121,191,145, 55,144, 3,182, 26, 66,239,164,101, 47,159, -158,198,213,251, 14,181,161,172,105,142,140, 16,193,244,137, 9, 25, 16, 37,194,225, 97, 47,175,158,114, 90, 19, 78, 9, 23, 25, - 93,224,212,117, 49,220, 61,112, 71,138,139,147,147, 99,102,184, 71,152, 68, 39,154, 76, 60,199,243,153, 53,202,175,183,156,220, - 29,211, 14,110, 45,118,115, 23, 30,118,183,236,198,255,159,145,156,218, 53, 99, 81, 22,238,228, 97,248,154,161, 72,121,116,124, - 49, 65,229,116,201, 89,115, 69,210,156, 53,207, 32,157, 75,156,171,122,102,254,242, 63,175,235,160, 99,153, 69, 79,221,157,233, - 11,164,173,135,166,147,197, 12, 70,211,217,242,140, 71, 3, 5,216,232,203,159,187,156,206,214,209, 94,126,163,156,225,197,201, -191,233, 24,252, 52,248, 25, 94, 28,248, 28,125, 41,188,202,246,237,210,193,118,247, 31, 49,201,238, 64,218,206,115, 29, 53, 9, - 45,128,113, 52,153,104, 53,174,229,179, 99,117,148,209,122,240, 73,198, 73, 73,117, 86,137,243, 0,108,237,159,140, 58,143,180, - 78,188,206,251, 22,121, 9,204, 84, 41,152, 86, 57,173,139,150, 12,161, 98, 86,194, 55,140, 59, 66,234,184,195, 17,159, 59, 2, - 58, 47, 71, 38, 75, 73,132, 93,154,216,130,219,168,112,145,226,158,123, 15, 28,189,122,229,218,237,135, 23, 46,223,188,189,113, -235,206,227,185,114,231, 57,198,123, 14,248, 96, 77, 83, 1, 84,216, 26,188, 27, 91,132,239,243, 23,255,219,195,127,202, 6,196, -186,186, 13,231,165, 94,136, 47,246,114,239,222,189, 15, 90,181,106,117, 45, 66,132, 8,116,203, 97,189, 77,223,154,166, 45, 9, -204, 0, 56,171,221,138,144, 25, 30,112,111, 49,220,170,124,182,242, 7,209, 36,168,122,242,202, 44, 76, 56, 87,126, 3,207,207, -232,108,111, 53,155, 86, 27,133,232, 11, 0,154,150,110, 56,190,180, 36, 51, 68,121, 80, 17, 53,118, 99, 65,156, 79, 9, 76, 60, -231,145, 60, 70,244,232,225,213, 63,245,176, 86,139,159,122,104, 88,231, 49,104,134,134,107,246,159, 49,248,105,240, 51,188, 56, -240, 57,250, 82,120,149,237,159,160,147, 63,240,165,156,179,105,175,101,173, 69,208, 87, 38,134, 40,129,115, 56, 79, 38,156,115, - 2,214, 58, 44, 27, 34,196, 36, 1,103,165,219,171, 85,171,230,110,153,120,205, 1,120,225,251, 28, 53,174,242, 14,179,217, 79, -193, 62,164,131,208, 54,107, 0,144,186,164, 74,149, 42,161,131,194,218, 45,103,196,136, 17, 2, 54,110,220,184, 29,225, 24,220, -173, 19,175,243,190, 51, 64,171,133,201, 20,189, 65,244,232,101,154, 1,252, 52,142, 18,165, 35, 83,243, 24, 49, 26,102,141, 31, -127,252,253,187,119, 55, 35, 48,178, 59, 98,235,185, 35,172,130, 59,232,111,132,132,171,163, 69,185,237,213, 61, 75,209, 98, 37, - 78,188,126,227,243,254,222,237,187,222,191,119,233,191,189, 71,247, 65,235,166,205, 93,185,249,224,177,179, 71,178,101,203,121, - 4, 52, 52,195,145, 32, 15, 1,211,122,132,152,185,137,160,167, 15, 16,164,251, 5,188, 2,223,134,179,189,135,112, 90,250, 6, -193, 74,253,251,247,239,111,166,167,124, 56,237, 52,195,187,177, 63, 60,228,159,197, 51,244,150,108,121, 88,150, 51, 8,248, 70, -140, 24,113, 28,226, 19,198,102, 2,128, 27,166, 2, 45, 72,222,198,168,215,153,199,142, 52, 49,164, 68, 43, 87,205,119, 10,192, -194,175,165, 68, 11,125,115, 8,125, 96,217, 73,150, 65,160,181, 6,138, 96,125, 22,253, 84,170, 87,175,126, 28,253,169, 55,128, -231, 95, 90,229,180,211,223,178,192,193,236, 29,248, 16, 11, 22,198, 40,105,158,218,197,179,149,106, 54, 48,113,142,154,101,108, - 60,167,150, 51, 88,121,208,247, 24, 69,161, 95, 96,254, 25,112, 40,235,201,132,255, 8, 41,135,189,244,241,226,213, 5,208, 10, -242,198, 31, 40,213, 10,237, 66, 64,235, 91,215,250, 54,245, 60,111, 43,143, 86, 27,133,134,174, 65, 51, 52, 92,179,255,140,193, - 79,131,159,225,203,129,111,147,154,186,203,208,250,215,185,218, 96,226, 58, 76,144,133, 16, 36, 4, 90,116, 98,166,117, 88, 3, -152, 32, 80, 98, 15,192,104,128, 23,173,193,156, 19, 81,128, 10,180,212,119,192,203,183,123,169, 82,165, 56,241, 22,181, 83, 96, - 91,146,183, 0, 62, 15,105,203, 37, 11, 73,214,114,130, 45,252, 95,174, 94,227,125,230,227,123, 65,219, 82,205, 24, 98,240,169, -139,176, 32, 77,162, 69,107,183,103,214,172, 86, 62, 79,158,180,195, 12,216,137,233,214,197,139,157,127,110,209,226, 56,188, 18, -159,189,122,246,236, 46,196,213,115, 71, 56, 5,119,128, 28,119,168, 16,233,145, 88, 61,108, 14,104, 80, 19, 78,223,181,247,208, -229,123,183,239,189,184,122,230,252,163, 65, 29,122,109, 28,220,119,248,234,223,135, 79, 89,176,112,249,150,149, 11,150,173,217, -192, 60, 58,234,222, 5,113,189,174, 35,110,160, 63, 66, 67,152, 17,142,198,220,168, 81, 35, 51,188, 2,155,221,221,221,223, 35, -180,131,121,198,140, 25,102,196,124, 52,119,236,216,209, 92,187,118,109, 51, 60,189,223, 64,156, 46,123, 17, 1,172,129, 65, 0, -156, 61,238, 65, 32,109, 15,196,178,244,168, 80,161,130, 71,249,242,229, 61,106,214,172,233, 1,105,158, 7,226, 64,238,113, 6, -184,170,146, 45,254, 90,214,141, 0, 11,225,162, 30, 1,200, 61,130, 55,247, 71,240, 68,255, 8,225, 36,148,196,123, 90,252,180, -226,211,200,106,213,170, 6, 16,100, 33, 96,181, 55,188,196,123, 34,216,248, 89, 55,183, 76,161, 1, 48, 89, 16, 43,237, 25,189, - 87, 35, 10,194, 19,203,247,228, 46,223,106,232,203,215, 62,175,123, 14,249,115, 69,210,236,181,114, 91,149,193, 26,184,178,111, - 50,150,227, 99,132,151,242, 68, 95,172,137,252,115,174, 95,191,238,201,132,243,217,144,182, 38,133,167,253,221,104, 35,175,136, - 17, 34, 40,139, 14,173,254,169,245, 49,235,184,111, 76,184, 58,152,228, 68, 22,131,159, 78, 48, 75, 71, 86,131,159, 58,152,228, - 68,150,207,193, 79, 39, 94,255,213,101,181,150,100, 5,247,163,133, 73, 84,212,228,168,232, 24,208,215, 34, 92,138, 39, 38, 98, - 14,238,107,157,173, 38,164, 21, 83, 57,224,115, 50, 69,104,151,235,101,203,150,117,183,149,120, 79, 5, 47,124,198,201,247,140, -226, 59,152, 80,198,107, 63,255,252,179, 59,164, 51,238, 8, 92, 77, 85,220, 26, 4,226, 84, 85, 45, 14,201, 82, 45, 72,208, 71, - 64,165,102,228,121, 32,208, 10,118,141,249,152,223, 17,193, 58,240,170,219, 35, 91,182,159,125,159, 61,107,247,254,254,253,214, -247, 86,173,106,112,115,202,148, 58, 30,191,255,222,172, 65,229,202,171, 46, 64,132,133,152, 18,103, 55,204,155,119,110,246,212, -169, 59, 17,176,216,189,103,207,158, 27,225,229,183,181, 86,253, 1,162, 14, 92,184,116,227,222,175,157,251,109, 29,221,253,183, -205,127,142,156,228, 62,123,230,226,245,115,151,184, 47, 95,178,218, 99,225,209,147, 23, 8,180, 14,104,209,129,119,246, 19, 8, -191,240, 8, 64,200,140,144, 56,102,132,138, 48, 99, 50, 55, 51,124, 4, 36, 88,254,136, 67,105, 70,140, 63,115,161, 66,133,204, - 0, 76,102,240,211, 12, 64,246, 26,180,223,216,161,173, 0, 95, 21,145,176, 77, 17,135,114, 15, 36,118, 30,119,239,222,245, 56, -117,234,148, 7,130,125,123, 32, 32,182,146, 32, 49,115, 4,180, 66,188,194, 17,208, 66,104,142, 71,104,175, 43, 54,164, 90,150, - 18, 45, 45,150,152, 32, 9,205,133, 32,223,103, 33,201, 59,139, 88, 95,158,144,236,121, 34, 94,217,217,234,213,171,217, 3, 90, - 65, 52,241,238,118,232, 23, 15,153,224, 1,127, 56, 3,107, 51,216, 55, 15, 21,104,169,146, 44,151,156, 53,186,109,218,113,248, -232,163, 39,207,159, 22,172,210,254,143,248,121,106,198,183, 87, 56,216,199,185, 34,136,250,198,179,103,207,122, 62,120,240,192, - 19,113, 56, 61, 33,105,243, 4,104, 85, 18, 98,102,122, 2,188,122,226,155, 86, 36, 92, 0, 92,199, 32, 53,204,165, 89, 89, 35, -131,193, 1,131, 3, 6, 7,254, 65, 14,232,197, 34,255, 96, 17,195,246,106, 86, 80,139, 2, 38,138,153,144, 16, 0,107,120, 18, -104, 49, 20,139,211, 7,128,195,239, 80, 57,109, 71,112, 94,247,244,233,211, 91,219,230,152,120,141,247,152,135,121,157,126,193, -223, 15,168,182, 51,145, 16, 66, 37, 63,130,255,206, 65,240,102,247,213,171, 87, 83, 26,213, 75, 15, 77,123,160,202, 22,208,178, -190,102, 77, 31, 1,204, 98, 82,146, 69,144,229,125,252,120,147,177,245,235,119,200,148, 46,221,229,116,136,150, 94,184, 80,161, -151,189,186,119,191,119,243,220,185,147,215, 47, 94, 60,121,244,224,193, 51, 19, 48,169, 15, 25, 60,120, 11, 38,121, 70,137, 79, -164, 85, 94,216, 82,109, 58,119,241,250,245, 81, 99,254,218,120,235,250,173, 59,203, 23,173,222,178,101,251,190,205, 79,158,191, -188,179,231,224,169,213, 71, 79,156, 91,197, 60, 90,116,160,210,242,129, 20,205,135,146, 42,252,154, 17,122,199,140, 9,220, 12, -105,160,185, 68,137, 18,126, 13, 27, 54, 52,119,233,210,197, 12,105,148, 25,147,183,185, 72,145, 34,102,168, 14,175, 65, 13,120, -198, 30,109,168,216,230,168,224, 26,177, 29,111,181,104,209,194,163, 89,179,102, 30,136, 33,230, 1,233,139, 7,236,190, 60, 16, -235,209, 3,146, 51, 15,208,247, 64,156,193, 91,129, 64, 89,115, 35,130, 35,160, 5, 21,172,181,244, 74,171,250,214,247, 35, 2, - 40, 53,195, 66,224,232,236,217,179, 61, 17,240,218,243,207, 63,255,244, 4, 0,246, 68, 44, 49, 79, 4,114,245,166,164,203,209, -134, 9, 6, 15,135,189,157,160, 44, 2, 94,249,192,182, 77,137,205,198, 3,253, 92,145,104,169,146,172, 30,131,166,173,112, 45, -218,120,196,141, 59, 15,238,111,219,119,194, 51, 73,206,154,150,193,133, 67,148,157, 18, 43,170,217, 41,193, 66,192, 90, 79, 72, -239, 60,249,109,242,255,149, 43, 87, 60, 1, 92, 21,144, 53,116,232, 80,126,171,213,157,173,188,145,223,224,128,193, 1,131, 3, -255, 4, 7,244, 96,145,127,162, 92, 58,222,169, 74,180,236,199, 59,212, 83,185,240, 0, 90,156, 32, 42, 86,172,184,142,224, 4, - 17,209,221, 41, 49, 80, 43,192,115, 94,227, 61,230, 97, 94, 29,149,211,204, 2,176,149, 85,165,155, 63,127,254, 5,154, 15, 32, - 67,120, 2,173, 38,209,163,151,220,243,215, 95,173,204,143, 30,181, 25, 85,175, 94,199, 36,137, 19,251, 34, 42,186, 63,130,160, -154, 17,184,211,124,244,200, 17,255,182,173, 91,191,216,179,121,179,231,244, 73,147, 60, 75,231,203,119, 36,115,210,164,139, 80, -140,244,122,202, 10, 3,237,254,171,214,110, 58,125,248,248,185, 83,115, 23,175, 95,235,243,246,253,107, 63, 63,255, 55,231, 46, -223,216,117,245,230,253,157,127,205,154,187,145,121,180,104, 65, 13,122, 22,106,214, 7, 80,225,153, 41,189,130,100,132, 0,203, - 12,137,142, 25, 82,198,215, 4, 93, 80,247, 41,215, 10, 20, 40, 96,198, 68,111, 6,136,221, 15,186, 8,105,102,255,192,187,211, - 1,232,101, 86,237,176,208,206, 57,161,242, 82,164, 88,157, 59,119,246,224,127,245, 30,127,153, 31,212, 52,221, 23, 56, 2, 90, -216, 84, 16,106,160,133,254,146, 54, 99,198,140, 11,102,206,156,225, 9, 9,156, 39,128,191, 34, 29,130,205,154,231,226,197,139, -149,115,208, 39,128,225, 70, 0,187, 46, 64, 0,180,188, 8,180, 40,197,154, 55,111,158, 96, 35,129,146, 62,125,250, 36,136, 29, -169, 0,173, 36,185,106,252,232,190,227,208,145,135, 94,207,158, 36,203, 91,103,192,212,121,235, 60,120,158, 52, 87,141, 14, 90, -237, 5, 32,232, 6, 32,184, 2, 54,115,158,144, 56,122, 78,156, 56, 81, 1, 88, 88,164,120,162,191,123, 2,184, 30, 75,151, 46, -221, 47, 90,116,140,251, 6, 7, 12, 14, 24, 28,248, 90, 56,160, 7,139,124, 45,101,181, 42,135,182,109,150,158,202,133, 7,208, - 98,193, 48,177,182,133, 68,192,125,231,206,157,238, 80,161,140, 87, 11,203,115, 94,227, 61,230, 9, 47,102, 98,178, 73, 7, 41, -138, 2,224, 0, 18, 86,234,161,107, 1,180,130,236,177,104,155,101,109,163,101,113,205,174, 27,136,102,177, 99,215,247,190,123, -183,157,215,166, 77, 13, 50,166, 73,115,125,155,135,135,255,135, 15, 31,204,239,124,125,205,176,121, 51, 63,127,246,204,188, 18, -118, 81,205, 26, 54,188,221,184, 90,181,249, 7, 86,172,104,217, 52,118,108,152,116,233, 62, 98, 39,113, 73,182,231,252,165,107, -215,143,159,186,184,111,229,154,205,187,119,239, 59,116,236,209,227,103,199,206, 93,188,114, 24,134,215,123, 65, 41,142, 14,106, - 3,155, 52,105,114, 6, 32, 72, 81, 11, 22, 43, 86, 76, 1, 89,180,209,130,234,140,134,240,126, 80,157,249,253,248,227,143,126, - 0, 93,119,161,190, 58,140, 93,135,199, 65, 55,154, 14,218, 65, 89, 16,156,186, 7, 34,194,123, 0,116,120,108,217,178,197,131, -255,157,121, 94,205,235, 8,104,189,120,241,194, 90,117,168, 75,101, 72,176, 95,166, 76,153,195, 71,143, 30,245,132,138, 83, 81, -205,221,188,121,195,243,220,185,179,158, 80, 65, 43, 18, 35,128, 39, 69,170,133,182,111,224,168,220,224,187, 23,164, 76,130,231, - 4, 60, 84,126, 1,176, 21, 9, 23,158, 85,128, 86,186,116,101,162, 87,106,212,103,250,235, 55,190,111,107,182,232, 63,167, 73, -167,161, 11,120, 94,178,102, 23,168,162, 7,233, 9,186,108, 2, 56,141, 10,122,197, 33, 45, 84,164, 88,144, 14,122,162, 30,153, -240, 61,197,197,245,152, 0,142,109, 41,201,133,132, 56,116,187, 96, 66,211, 56,198, 51, 6, 7, 12, 14, 24, 28, 8, 5, 7,244, - 96,145, 80,144,253, 18,143,132, 93,162, 69, 73, 3, 36, 30,126, 40, 45, 85,140,194,115, 14,228,161, 41, 61,236, 85,226, 1,240, -172,129,125,142, 59, 38,117,130,170,194, 76, 60,231, 53,222, 99,158,208,208,182,245, 12, 86,254,205,167, 78,157,234, 14,251, 35, -119,156,255,166,135,174, 10,180,108,237, 54,180,117,205,210,150,203,154,126,163, 40, 81,218, 67,140,209,241,254,188,121,181, 17, - 13,221,151,146, 44,130, 44, 63, 72,179,238,221,189,107, 62,176,127,191, 25,246, 73,230, 2,249,242, 61, 63,179,124,121,237,215, -215,174, 53,228, 51,122,202,105,145, 39, 93,153,178, 21, 78, 61,124,252,236,242,182, 61,135, 55, 30, 61,113,118,139,247,203,215, -167,191, 43, 91,129,198,209,153,116,210,138, 6,224,116,244,251,239,191, 63,142, 73,251, 46,126,205, 69,139, 22,125, 15, 59, 55, -179,101, 74,152, 48,161, 25, 42,193,155,160, 73,112, 25, 67, 39,109, 37, 27, 48,111,124,216,119,109,130,125,145,199,129, 3, 7, - 20, 27,173, 26, 53,106,108,226,117,103,232, 48,175, 22,208,130,209,250, 35,128,185, 71,231,206,157,211, 45,221, 2, 40,153, 72, -245, 32,108,250, 0,170,174, 41, 64,235,201,147, 39,158,207,158, 61,243, 52,155,205,138,122, 14, 32,244, 16,250,107, 99, 20,193, -150, 15,177,160,106,196,143, 31,159,174, 48,100,217,178,101, 2, 0, 43,216, 68,160,164,107,215,174, 9, 54, 57,132, 27,208, 66, -159,174, 7,158,162,200,199, 60,105,183,181,114,229, 74, 79,124, 67, 27,209, 39, 27, 65,253,187,133, 42,207, 85,171, 86,121, 66, -138,230, 80,242,232, 44,255,141,252, 6, 7, 12, 14, 24, 28, 8,111, 14,124,195, 64, 43,108,172,192,228, 83, 10, 78, 52,183, 19, - 96,169, 7,207, 33,241,160,243,202, 80,237, 60, 0,205,166, 80,117,184,195,184,222, 29,234,167,233, 76, 60,231, 53,222, 11, 91, -137,255,255, 52, 38,196,239, 49,201,109, 36,128,251,253,247,223,185,139,239, 59, 61,180,195, 83,162, 21, 4,180, 22, 46,172,157, - 32,126,124,223,183,111,223,154,153, 96, 16,110,134,116,203,188,116,233, 82,243,220, 57,115,204, 89, 50,103,126,226,119,252,120, -101,175,243,231,235,195,237, 3,157,129, 58,117,192, 40,125,221,181,235,183, 15,159, 60,123,117,249,149, 27,119,151,223,188,115, -119, 39,175, 57, 69, 4,238, 39,144,127, 4,129, 20,128, 2, 37, 89,102, 72,159,204,251,246,237, 51, 3,168, 42, 59, 14, 65,243, -129, 5,205, 56, 48,180, 94, 16, 55,110,220, 97,122,222,131,182,109,188,112,225, 66, 5, 96, 97, 7,158,199,225,195,135, 61, 32, -193,244,224,117, 61,207, 91,230,113, 4,180, 0,140, 66, 37,209, 2, 24,217,141,205, 13,138,122,144,137,224,133, 96, 11,234, 62, -207, 49, 99,198,156,160,235, 8,168, 4,117, 69, 12, 0, 79,188,176,161, 64,176, 83, 83,160,198, 83,212,135, 83,166, 76, 17, 72, -109,233,150, 65, 1, 90, 73,115,212,168, 21, 90,213, 33,159,167,228, 23,210, 50, 5, 96, 1,212,121, 98, 19,131,162,238, 4, 95, - 61, 71,142, 28,169, 72,225,184,129, 37, 80, 2,247,147,179, 60, 54,242, 27, 28, 48, 56, 96,112,192,224,192,103,228, 0, 38,157, - 4,152, 88, 70,112, 87, 19,140,201, 41, 25, 9, 6,180,184,186,255,227,143, 63, 60,161,250, 25,239,172, 61, 21,242,199,194,106, -123, 57, 1, 16, 92, 5,108,103,226, 57,175,241, 94, 40,170, 21,204,121, 36,202,157, 7, 59, 12,135,194,118, 69,145,146,209, 93, - 2, 12,144,199, 65, 45, 20, 89, 15,237,240,180,209,162, 26,208,251,193,131,182,175,246,237,171, 79,213, 33, 36, 28,254,207,159, - 63, 55, 67,162, 99, 94, 6,144,133,178,153,193, 99,191, 28,153, 51, 31,251,120,227, 70,149,163, 11, 23, 54,128,186, 81,143, 67, -216, 96, 85,201,230,150,230, 82,253, 58,149,222, 87,255,161,148, 79,169,226,185, 94,150, 45,147,255,109,214, 76,169, 47,233,169, -175,101, 30, 0,167, 29, 72,119, 1, 20, 94,194,222,199,140,221,143,138,250,240,183,223,126, 51, 67, 50, 98, 6, 72,120,202,251, - 76, 0, 72, 94, 0, 38,126,200, 75, 32,238,240,128,125, 92,148,226,197,139,175, 36,200, 2,160, 38,184,250, 11,210, 35,143, 61, -123,246,120,192, 88,124, 37,239,107,209,208, 11,180, 96, 23,165, 91,138,101, 73, 19,253,102, 39, 1,150,106,151,197,115,180,149, - 39, 92, 59, 80, 85, 88,195,153,242,129, 63, 15, 39, 77,154, 36,104, 95,129, 68,248, 61, 54, 24,200,180,105,211,100,250,244,233, - 2,169,160, 2,180,114,126,215,242,119,186,117,112,214, 24,158,207, 82,101, 8, 21,238, 33,130, 44,236, 6,245,132,221,220, 86, -170, 8, 1, 96,143,173, 95,191,222, 19,253, 75,177, 43, 67,158,163, 84, 31,226,145, 72,206,148,223,200,107,112,192,224,128,193, - 1,131, 3,159,145, 3, 0, 89,245,160, 26, 60,134,201,213, 19, 19,132, 39, 86,230,158,112,128,104, 38,216, 98,130,106,207, 76, -149, 10,253,106, 97,133,238,153, 47, 95,190,227, 84,209, 57, 83, 36, 12,254,117, 48, 57, 40,174, 28,152,120,206,107,206,208, 8, -204,171, 58,197, 12,128, 23,244,195, 48,220, 94, 76,227,119,216,255, 40,118, 89,180,249, 2,200, 26, 75,123, 21,189,180,195, 19, -104, 53,140, 28,185,196,182, 41, 83, 90,153,189,189,219, 78,238,208,161, 93,194, 4, 9,124, 39,140, 31,239,239,177,117,171,121, -246,172, 89,230,214,173, 90,249, 67,165,232,179,110,242,228,134, 31,189,188,170,143,175, 94,189,121,253, 40, 81,138,232, 45, 43, -243, 65,178, 81,166, 93,155, 38,226,227,227, 45, 79,159,220,149,141,107,167,201,252,217, 3,165,104,161, 28,194,123,206,208,130, -196,234, 62, 36, 34,102,248,243, 50,131,127,202,206, 67, 58, 40,237,219,183,175, 2, 10, 33, 41, 81,140,248,153, 0,154,204, 48, -192, 54,235, 1, 90,144, 38,150,129,139, 4, 69,138, 5, 48,176, 1, 60, 78,204, 95,218,107,245,238,221,219, 67,175,180, 81,173, -139, 35,137, 22,250,102,168,128, 22,202, 52,189, 83,167, 78, 4, 41, 39,104,167,181,117,235, 86, 69,154, 5,123,180,189,206, 2, - 21,168,215,219,161, 63, 62,100,130,129,255,112,238, 52,132,107, 20, 1,200, 20,240, 75,149,104, 21,203, 86,178, 69,255,164, 57, -106,246,208,235,222, 65,173, 63,202, 20, 7,146, 50,207, 51,103,206,120, 98,247,167, 39,108,176, 20,215, 37, 88,168,100,192, 14, -207,233,104, 55, 15,252,254,197,255,206,180,191,145,215,224,128,193, 1,131, 3, 6, 7,156,230,128,106, 87,174,223, 51, 60, 61, -191,195,193,163, 39,236, 73, 60, 33,209,160, 47,158, 19,152,132,122, 19,172, 0,128, 69,195,111, 23,122,201, 62,121,242,164, 98, -187, 2,187, 35, 91,222,226, 29,170, 21, 49, 1,165,182,242, 2, 79,160,148, 90,163,122,214, 52, 67, 56,197, 84, 61,185,207,157, - 59,215, 29,101,220, 0,240,246, 11,108,128,168, 18,179,119,132, 40,103, 56, 0,173, 32,154, 45,160,142,163,123,135, 23,247,239, -183,121,119,243,102,195,191,122,246,108,229,154, 46,221,213, 68, 9, 19,190,133,193,180, 79,230,140, 25,207,175,156, 52,169,145, -223,221,187, 85, 79, 47, 95, 94, 23,187, 20, 91,119,182,109, 96,238,144,159,110,174,105,100,202,248,223,100,220,168,158,210,163, -211,143, 74,114,205,144, 74,203,109, 71, 8,154, 0, 5,231,105,172,141,228, 67, 39,165, 52,136,239,209,163,135, 2,180,198,143, - 31,111,134, 84,202,188, 97,195, 6, 37, 13, 25, 50,196, 12,183, 25,214, 64,203,102, 57,209,111, 38, 0,148,123, 64, 85,234, 1, -218,168,162,178,187,179, 51,192,155, 7,104,120,240,190, 51,109,228, 8,104,121,121,121,233, 1, 90, 33,202, 73,187, 67,244,151, -174,121,243,230, 61,194, 5, 6, 23, 19, 4, 90,184,182, 89,231,103,231,168,141,178, 0,244, 62,129,148, 80,176, 11, 51,152,195, - 82, 85,178,165,195, 97,105, 80, 49, 8,180, 8,176,168, 42,132,115, 89,130, 65, 61, 27, 30,212,231, 67,165,242,119,242,219,212, -201, 50,135,217,140,114,134, 7, 23,255, 79,195,224,167,193,207,240,226,192,231,232, 75,225, 85,182,127,130,142,243,158,225, 49, - 1,110, 39,200,130,125,137, 39, 86,226,199, 0,188,172,189, 85,115,146,204,194,123, 4, 89,129,190,181,118, 88,213, 78,171, 33, -130, 57,180, 12,244, 94,173,101,255,162, 9,180,224, 7,106, 59,140,184,233, 9,254,103,157, 42, 77, 71, 64, 43,180,187, 14,131, -209, 68,176,193, 12,157,210,165,251,249,233,181,107, 63,125,244,246,110,236,119,241, 98,117,223, 83,167,170,248, 93,184, 80, 73, -238,220,169, 66, 73, 22, 65, 86,139, 4, 9,126,174,109, 50, 89,198,211,179,100,169, 93,126, 6, 73,180,222,188,144, 39, 94,119, -100,195,154,169, 50,111,214, 0, 61, 18, 45,187, 52, 1,122,239, 18,104, 65,221,101,134,109,145, 25,190,175,204,144, 72,153, 1, - 90,159, 66,245,245,152, 9,146,207,103,221,186,117,211, 5,180, 42, 87,174,188, 18,182, 94,138, 23,120,168,117, 21,215, 21,252, -173, 95,191,190, 7, 84, 93, 30, 80,235,186,227,146, 61, 3,243,160,114, 6, 5,149,214, 14,193,163,181,211,208,110,221,185, 67, - 15,253,103, 24,124,134,157,128, 49, 61,129,150,135,206, 47, 87,171,207,103,129, 99,216, 59,240,166, 31, 60, 4, 79,142, 26,197, -178,150,106,254, 91,178,156, 53,190,183,241, 30,155, 52, 85,160,117,228,200, 17, 79, 24,195, 27, 64, 75,103, 3, 33,155, 86, 27, -233,167,100, 0, 24,114,192,224,103,104,122,140,253,103,254,203,252, 12, 95, 78,126, 89,106,214,254,179,180, 61, 39, 4, 6,144, -222, 14, 48,181, 11,231,118, 93, 13,104, 4,154,214,211, 97, 28, 5,144,182,197, 38, 91, 52,131, 84,135, 48,226,158, 23,232,253, -221, 25,123, 20,187, 64, 43, 12,187, 14, 67,208,132, 47,128,116, 77,163, 71,111,179,180, 91,183,159, 46,109,223,222, 20,187, 11, - 27, 61,187,112,161,193,177, 69,139, 26, 82, 93, 72, 73,150, 3,144,165, 57,160,185,102, 76,229, 81,185, 66, 17,233,212,174,142, -146,120,206,107, 97,144, 66,228,133, 26,241, 30, 0,213, 35,168,138, 31,193, 56,254, 17, 84, 94,143, 40,241,178,160,153, 18,182, - 72,251, 33,161,177,116, 96,107,179,221, 1, 6, 27, 65, 50,186, 6,224, 44, 88, 7, 68, 31,107, 88,178,100,201,213,176,245,115, -228, 46, 33,136,230, 23, 12, 42,109,162, 15, 54,164,241, 72,221,117,126,179,122,250,188, 78, 82, 65,217,108,210,164,148,150,246, - 87, 52,130,199,206,205, 19, 26, 82, 91,235,119,126,177,114, 58, 91, 89, 39, 23,107,161, 33,255, 95,174,123,197,208, 48, 44, 12, - 99, 72,104, 95,247, 95,110,163,255,114,221, 29,246, 23, 24,137, 23, 66,170, 26,152,120,174,254,183, 60,175, 96,145,135,121,213, -255,133, 72,220,226,153,160,235, 54,174,169,239,176,164, 85, 24,249,156,114,101, 20,218,206,239,236,115,122, 59, 76, 48, 67,246, - 80,126,212,206,208,208,156,116, 0, 10,218, 80,125,168, 55, 49,191,158, 9,130, 42, 65,216,108, 21,109, 26, 35, 70, 93,238, 70, -228,238, 66, 26,190,211, 38,203,142,186,208,146,172, 46,126,186,185,185, 41,118,116, 58, 27, 75, 23, 77,157,180,212,108,159,149, -102,144, 68, 43,103,205,115,137,115, 85,207, 12,224,117,206, 50,168,180, 19,101,253,172,229,116,162, 28, 90, 89,237,150, 19, 18, -229,142,136,195,120, 20, 11,158,174, 90, 68,244,244, 79, 39,105,104,126, 71, 97,164,199,199,191,249, 54, 10, 3, 15, 62, 71,221, - 13,160, 21,134, 6,177,241,232,231,104,163,255, 50, 77,187,173,163,130,161,192,185,141, 27,243, 20, 48,244, 55,118, 10,126,174, -230, 81,239, 89,252, 50,115,208, 51,122,159,101, 62,152,206,244,195,179,101,157,232, 62,218, 18, 45, 39,136, 57,202,250, 95,238, - 48, 70,221,195,169, 19, 5,146, 49,248,105,135,159,122,119,210, 26, 64, 43,136, 3, 70, 95, 50,190,205,240,226,128,209,151,194, -139,147, 26,116, 28,129, 42, 71,160,203, 10, 88,133, 0, 90, 54,192, 88, 16,112,179, 5,202,190, 80,117,157,122,141,209, 9,157, - 98,151,102,102,131,159,154, 44,114, 42,131,193, 79,167,216,165,153,217,224,167, 38,139,156,202, 96,240,211, 41,118,105,102, 54, -248,169,201, 34,167, 50,124, 14,126,218, 45,192,231, 2, 90, 42, 93, 75,192,101, 45,233,178,144,104, 57,170,179,245,110,195, 96, - 18, 45, 62,104, 43, 57,195,113,123, 52, 28, 93,215,162,111,208,180,221, 46,161,109, 47,131,159, 6, 63,245,246, 1,227,219,180, -207, 1,189, 60,180,204,103,240,211,224,167, 45, 14,252,151,251,146,202, 15,221,243, 89,120, 0, 45, 91, 42, 70, 71,215,156,148, -104, 57,191,235, 80,107,100,208,121,255,115, 32, 94,131,166, 78,230,235,204,102,240, 83, 39,163,116,102, 51,248,169,147, 81, 58, -179, 25,252,212,201, 40,157,217, 12,126,234,100,148,206,108, 6, 63,117, 50, 42,172,217,236,216,104, 85,161,237, 20, 37, 78, 22, - 82,167,242,182, 64,153,154, 39, 52, 54, 90,214,234, 71, 59,117,177,148, 96,169, 59, 16,195, 90,109, 93,207, 27,157, 80, 23,155, -116,103, 50,248,169,155, 85,186, 50, 26,252,212,197, 38,221,153, 12,126,234,102,149,174,140, 6, 63,117,177, 73,119, 38,131,159, -186, 89,165, 43,227,231,224,167,195, 23,219,216,117, 24, 13,215,184, 27,208,114, 39, 98, 20, 59,187, 17,173,119, 18, 58,179,235, - 48,216,206, 69, 93,220,249,130,153, 62, 71, 67,124, 17,154,121,147, 71, 28, 90,179, 80,114, 15,166, 26, 5,147,121, 84,207,159, - 84, 73, 85,243, 37, 81,210, 15,121, 19,111, 85, 82,238,132, 91,191,207,149, 96,107,110, 23,211, 80, 43,190, 58, 85,206, 44, 41, - 77,137, 74,187,198, 88, 84, 50, 99,244, 59,129,105,126,206,120,166, 4,206,208,204,150,204,148, 61,127, 10,211,252,188,201, 77, -103,152,120,206,107, 26,237,173,183,156, 17,114, 38, 53,181, 43,144, 46,214,158,242,121, 83, 63,204,151, 54,250,238, 28, 73, 77, -140,199,104,203,239,149, 38, 77,215,132,166,162, 25, 18,152,220,145, 54,103, 78,100,210,179,147, 67,147,102, 40,250,181, 65, 51, - 20, 76,115,240,136,193, 79,131,159,225,197,129,207,218,151, 48, 17, 71, 10, 75,178,168,100, 80, 57, 65, 47, 66, 88,146, 45,154, -225,197, 76,208,249,172,252, 12,199,114, 26,164, 48,177,182,207,225, 98,122,130,228,197,115, 29, 28, 9,214,184, 57, 82,152, 42, - 20, 76, 29,233, 46,210, 3,208,168,159, 61,137, 41,153,173,196,123,204,131,116,143,207, 56, 3, 54,114,166, 50, 85,201,155, 34, -226,243,220,201, 35,188, 6,157,201, 40,103,133,162,169, 76, 49,156, 5, 27, 4, 88,220,122,176,107,122, 23,241, 61, 60, 69,222, - 30,152, 32,111,247,141,225, 37,217, 49,190,169,248,108,251, 77,222,108,237, 35,111, 54,247, 80,174, 85,201, 25,111,139, 51,229, -180,204, 75,144, 85, 57,143,203,195,251, 39,220, 3, 2, 94,222,150,143,207,174,202,249, 77,147, 63,150,203, 22,255,190, 21,216, -178,251,177,228, 73, 97,106, 93,163,120,214,171,123,119,108,189,113,237,210, 69,175, 43,103, 79, 62,216,179,110,225,249, 90, 69, -211, 93,230, 61, 39, 38,199, 8, 4, 80,121,210, 68,219, 93, 44,115,162, 7,185, 83, 69, 81, 0, 85,174,148,145, 55,108, 91, 54, -245,190,249,197,237, 87,239,111, 31,126,243,230,230,225,167,179,134,119,190,149, 43, 69, 36, 58, 25,141,232,108,221, 1,176,214, -153,221,219, 6,200,214,246,146, 45,121,100, 45, 95, 95, 36,111,179,238,217, 93, 76,141, 80,190,191,180, 18,243,217,224,129,174, -193, 39,155,139,105, 78,246,164,166, 67,160,209, 21,239,113,113,182, 47,233,248, 78,180,178,232, 42,167, 22, 17,103,219,200, 73, -122,118,219, 40, 20,116, 44, 31, 49,234, 30, 70, 6, 26,237, 30,196, 1, 75, 80, 20, 2,104, 69,136, 16, 97,159, 94,240,165, 23, -104, 33, 95, 49,189,224,203, 0, 90,225,219,209,191, 89,106, 0, 46, 47,228,205, 61,145,151, 55, 4,231,207,117, 84, 36,216, 32, - 9,224,244, 72,222, 61, 19,121,243, 80,102,246,169, 33, 83,186,215,144, 9,157,171,200,216,246,229,101,116,155,210, 50,252,167, -162, 50,164, 73, 1, 25, 92, 63,135,136,239, 83, 17,239, 27, 82, 32, 85,164, 71,206, 12, 20,249, 82, 70,124, 30,112,115,135,200, -165, 85,178,164,115, 62, 25, 89, 63,147,148,205, 28,243, 41,202,219,202, 6, 32, 80, 73,135, 24,204, 9,180,118,253,217, 69,126, - 42,159,225,158, 42,201,106,254, 93,218,187, 4, 89, 77, 75,165,188, 75, 73, 22, 83,227,226,201,239,108, 31, 94, 53, 76, 64,139, -146,172,187,135, 87, 6,124,186,189, 75,204,155,218,201,187, 13,173,229,245,217,245,178,115,122,167, 79,101, 50, 69,159,175,245, - 1,102,117, 49,229,168, 85, 34,251,229, 55,175, 94,249, 61,186,123,245,245,188, 17,117, 60,231, 13,168,115,196, 99,230, 0,207, - 11,123,215, 94,170, 81, 56,245, 37,230,177,211, 94,150,117,143, 8, 48,177,209,125,222,216,123,239,158, 92,125,249,246,198,129, - 55,207,206,108,121, 52,162, 75,109,175,245,115, 71,251,188,191,184,193,255,254,159,149,204, 87, 71, 23, 48,159,255,163,164,249, -214,198, 33,254,147,250, 52,185, 10,222,118,113,166,141,152, 55,109,124,147,187, 10,180,178,184, 68,182,142, 40, 96,171,168, 54, - 39, 92, 2, 44,243,205,221,242,126,255, 40,121,183,103,168,188,219,249,187,248,110,235, 43,190, 91,186,139,175,123,103,121,187, -161,157,188, 93,219, 82,152, 47,180, 64, 11,207, 62,120,124,245,120,192,233,189,235, 63, 52,171, 90,232, 9, 64,215,188,236,127, - 75,225,172, 1,166, 30,176,145, 37, 99,226, 72,119,210, 36,136, 20,204, 51,124,185, 44,209,139, 55, 45, 24, 99, 96,169, 76, 49, -203,132,182,156, 58,190, 71, 3,192,252,205, 1, 3,188, 57,217, 89, 52,178,127,115,252,180, 5,168, 8,180, 80, 79,174,155, 53, -165, 93,206, 0, 45,228,165,202, 74, 83,218,165, 49,206,247,194,253,171,129,137,231,206, 30,182,218,136,225,238,232,196,147, 73, - 43,244,157,238, 49,217,217,130,253,139,242, 91,251,205, 10,157, 31, 45, 76,168,239,228,245, 29,145,153, 57, 9,180,222,233, 96, - 80,176,198, 45,144, 58,210, 75,121,239, 45,242,226,170, 60,221, 55, 77,228,202, 90,145,243,139, 68, 78,254, 37,114,116,188,200, -129, 33, 34,187,251,202,211,197, 13, 0,230,110,137, 28,159, 44,121, 82, 70,244,182,122,143,195,143, 90, 1, 90, 23, 87,137,172, -169, 43, 79,230,215, 18, 89,223, 72,222, 45,171, 37, 19,155,101,101,153,151,219, 41,115, 8,154, 84, 23,250, 30,158, 42, 4, 89, -234, 51, 84, 21,250,108,255, 93, 8,176,212,107,148,100,189, 94,219, 86, 42,229,140, 27,106,137, 22, 84,133,119, 63, 62, 62, 35, -230,205,237,197,111,201,247,242,120,122, 25, 57, 62,161,182,156, 90, 53, 66,168, 70,212,248, 0, 77, 80, 17, 46,222,179,117,211, -141,199,119,175,188,126,112,125,191,247,230,209,223,157,222, 54,188,244,201,109, 3, 74, 29, 58,242, 87,231, 99,123,231,252,122, -136,121,180,234, 78,192,180,109,241,196,187,190, 87,183,251,223,156, 86,217,124,102,104, 30,179,231,136,226,230, 75,203,251,152, - 31,159,222,236,119,123,106, 89,243, 35,143,145,230,167,158,171,204,167, 38,213, 52,239,234,151,219,124,106,229,144,187,121, 82, - 71, 61, 97,175,141,220,146,152, 74,118,249,177,240,195,201, 61,106,203,164,238, 53,101, 66,215, 26, 50,190, 75, 85, 25,220,166, -146,244,104, 82, 86,186, 54, 44, 45,191, 53,255, 78, 70,181, 45, 43, 35, 90,151,145,225,173, 74, 73,187,239,179,189,133,106,209, - 58,168,182, 93,137, 22,128,207,197, 15,247,142,200,187,237,253,132,231,150,210, 45,254,247, 59, 53, 47, 44, 64, 43, 2,192,231, -221,195, 19,107, 7, 60, 60,237, 17,240, 30, 33,142, 30,223, 56, 27, 48,101, 64,187,183,144,116, 57, 11,222,178,116, 45, 29,237, -153,124,244,147,162,233, 34, 7,139,117,216,182, 88,204,161, 1, 47,111,189, 62,216, 45,233,138,210,153, 98, 88,135,187,250,230, - 38, 50, 29, 99,131,222, 44, 70,221,245,114, 74, 95, 62,131,159,127,163, 41,123, 18, 45,197,168, 90, 11,108, 57, 3,180,238,220, -185,147, 87, 15,216,178, 55,206,195, 25,118,233,192, 50, 41,218, 19,158,195, 81,177,143,154, 16, 9,197,199, 34,221, 15,204,111, -221, 27,130,181,123,213,170, 85, 83, 34, 67,105,144, 83, 18,207,237, 37, 68, 5, 41, 17,152,223, 33, 77,125,221,239, 95,157, 43, -124,118, 29, 98, 34,246,188, 51,171,134, 92, 25,148,142,160,197,211, 89,150,101, 79,102,234, 51,175, 79, 85,241,252,171,185,236, - 30,219, 64,250,212, 47, 44, 61,127,204, 39,221,106,230,146,206, 63,100,145, 14,149, 92,165, 93,185,180,178,174,103, 1,121, 58, -171,162,252, 86, 61,181,228, 72,102,114, 10,189, 67,213, 88, 49, 79,138,136, 47,115, 37,139,240,174, 16, 36,104,205,138,187,124, - 58, 59,161,178,200,218,122, 50,162, 65, 38,193,164,217, 70, 79,185, 21,160,117,112, 98, 8,160,245,198,163, 95, 8,160,245,106, - 85, 75, 91, 64, 75,207,107, 76,144, 52, 21, 25,210,186,226,171, 15,183,247,138,239,252, 10,242,120, 90, 25, 57, 48,184,184,172, -236,251,157,108,156,216,201, 26,104,217,164, 9,123,172, 11, 55,206,159,122,188,106,116,141,211,123,198,150, 57,239, 57,182,196, -197,243,127, 20,185,120,102,104,225, 51,167, 71,126,119,244,218,134,145,199,153, 71,171, 64,133, 50,196,245,244,123,118,227,245, -213,137,101,205,247, 61,198,152, 31, 31, 93,110, 62, 52,186,178,121,115,143,108,230,253,227,234,249,159, 29,150,215,252,196,115, -181,185, 64,150,200,230, 61,131,138,153,215,117, 72,111,222, 59,177,233,235,194, 25,226,190,177, 71, 59, 83, 66,211,140, 15, 55, -119,138,220,217, 45,114,107,187,200,141, 45, 34,215, 54,138, 92, 94, 35,190,167,151,136,175,231, 2, 9, 56, 51, 79,228,244, 44, - 0,238, 63, 69, 78, 76,150,143,135,199, 74,142,228,145, 22,106,149, 87,189, 79, 96,245,225,206,126,241,221,252, 75, 8, 64,165, -170, 22,237,168, 14, 53, 95,145, 43,177,169,122,171,162,113, 94,156, 27,156, 37,224,104,255, 76, 1,123,251,231, 10,184,178,101, -114,192,139, 59,231, 37,103,178, 8,148,182,218,139,205,104,202,150, 44, 82,187, 76, 73, 34, 61,100, 74, 25, 63,226,240,172, 46, -145, 30,127,122,116, 82, 25, 44, 85,160,165, 74,178,190,115,139,222,205,111, 77,163,163,159, 30, 28,123,218,165,116,204, 63,202, -184, 69,143,175, 89, 56, 35,131,193,129,175,156, 3,241,226,197,203,152, 39, 79,158, 5,217,179,103,191,131, 64,237,126,248,245, -203,154, 53,235,109, 94,227,189,127,170,248,142,128,214,153, 51,103, 52,193,150,173,114,219,146, 90, 33, 95,177,135, 15, 31,230, -189,124,249,178,155, 22,216,178,199, 11, 0,170,123, 7, 14, 28,144,229,203,151, 43,233,202,149, 43,202, 24, 98,235,184,121,243, -166, 32,196,217, 61, 45,190, 34,220, 89,169,141, 27, 55,150, 94,185,114,165,146, 80,190, 32,208,165,130, 47,245,119,255,254,253, -165,153, 95,139,166,113,223,100, 25,235, 48,228,174, 67,119,119,247,160,112, 45,150,231,214,140,163, 68, 72,214,212, 19,153, 12, - 0,100, 95, 58,228,144,223,121,146, 71,222,251,252,224, 12,241, 61, 62, 75, 74,102,142,123, 55,115, 98, 83, 10,213, 78,139,231, - 69,211, 71,187,227,189,176,166,220,152, 86, 73,114,186, 68,216, 27,214,198,203,153,200,148, 5,192,235,244,229,201, 63,200,251, -229,117,165, 80,234,200,151,244,208,164, 36,235,237,254,177, 66,195,119, 53, 63, 37, 89,111,182,244, 18, 26,191,171,215, 40,201, -122,181,162,153, 84,204, 30,199, 90,162,229,240, 53,101, 76,166,200,185, 92, 76,213, 75,100,136,118,239,201,137, 85,242,238,216, - 12,185, 55,227, 7, 57, 56,180,132,172,236, 83, 70,230,252,218, 64,198,183, 45,249,177,180,107,116,203, 24,130, 54,105,230, 75, - 97, 58,116,253,244,161,135,187, 38, 54, 57,251,226,210,182,151,183,198,229,191,249,112, 92,238, 59,111, 47,186,191,190, 61,233, -187, 51,215,151,116, 59,200, 60, 90,245,174,152, 47,173,207,203,203, 59,222, 29, 27,144,211,252,244,236, 86,115,126, 0,170, 77, - 61,243,152,151,182, 78, 99,158,215, 34,149,223,161,254,217,205,199,198,215, 52,175,235,158,219,188,234,231,116,230, 69,173,210, -153,215, 15,171,123, 43, 87,202, 40,103,237,209,118, 77,108,202,215,177, 86, 62,159, 63, 58, 86,150, 49, 29, 42,201,232,159, 43, - 40,210,171,109,147,218,138,156,153, 43,219, 38,180,148,161, 45,138,201,224,102, 69,100, 80,211,194, 50,176,113, 65,105, 89, 62, -227,227,140,250, 12,228,149,215, 42, 64, 11,234,195,183,235,219,218,147, 92,105, 85, 61,196,125,180, 77, 44,128,179, 81,173,139, -197,125,118, 99,100,174, 15, 94, 19,114, 7,220, 30,147, 35,224,210,208,172, 1,199,251,187, 5, 60,191,188, 79,138,164,143,249, - 56,191,201, 20,197,238, 0,153, 40,210,195, 0,255, 55, 18,240,252,170, 52,204, 23,213,199,188,173,155, 64,106,165,140,143, 5, - 82,255, 45,209, 82, 37, 89,251,127, 73,188,162, 78,158, 24, 35, 62, 94,115,191,239,191,233,103, 79, 0,175, 42, 78, 23,218,120, -192,224,192, 87,194, 1, 4, 57,143,129,248,165, 71, 27, 55,110,252,118,193,130, 5,114,251,246,109, 57,127,254,188,140, 29, 59, - 86, 16,152, 94,230,206,157, 43, 8, 38,255,182, 72,145, 34, 71,153,215,153, 98,227,243,137,140,196,221,102, 76,220, 97,198,197, - 14, 83,100, 36,126,143,154,113,110, 29, 1, 45,128, 14,129, 20,202, 33,216,178, 85, 94, 45,160,245,224,193, 3,135, 96,203, 30, - 15, 16,224,222,139,252,187,122,245,170, 92,186,116, 73, 16,127, 87,214,174, 93,171,240,112,246,236,217,178,116,233, 82,201,150, -255, 59,165,188, 71,143, 30, 21,196,163,245,210,193,207,210,247,239,223, 47,125,253,250,117, 5,100,157, 58,117,170,244,246,237, -219, 75, 19,124,129,182,242,155,165,224,119,138,148,139,247,248,171,131,102,152,179,232,197, 34, 97,126,209, 63, 65, 64,111,229, -194, 3,104, 97,231, 90,209, 17,109,202, 40,234,194, 21,131,234, 8, 64, 86,115,181,206, 60,159,222, 42,167,162,246,251,165, 82, - 74, 97,222,240,224, 7,164, 98,101,134, 55,202, 46,178,177,153, 52, 42,156,232,147,171,171, 73, 51, 48,164, 2,180,246,142,146, -102,165, 83,223, 85,119, 23, 54, 41,153,226,238, 27,247,110, 66,187, 44,170, 12,153, 26, 20, 73,124,231,213,178, 70,186,129, 86, -193, 52, 81,218,150,113,139,225, 89,181, 64,138,103,243,135,180,240,125,118,198, 93,252, 46,174,147, 7,115,106,203,249,185, 63, -203,158,233, 29,101,225,128, 6, 50,168,113,254,143, 37, 50, 68,191, 3,240, 25, 71,139, 7,121,146,155, 70,236, 89, 61,251,250, -157,189, 11,239, 95, 25, 93,224,202,135,167, 87,204,159,158, 94,250,248,114,124,150, 7,207,150, 52,191,182,105,112,245, 3,204, -163, 69,167,112,134,120,231,158, 94,216,241,124,207,175,121,205,135, 38,212, 51,175,234,158,223,188,240,167, 84,230, 25,141,147, -153, 71,215, 74,252,198,163, 91, 38,243,250,142, 25,204,203,218,164, 49,207,111,145,202,188,164, 91, 17,115,251,239,221,142, 1, -232, 12,212,162,109,121,223, 53,137, 41,239,172, 94, 48, 91, 56, 49, 85,102,116,175, 36, 4, 99,206, 60,111,157, 87,177,211,186, -190, 93,222,174,106, 18, 4,180,194, 34,201,130, 74,176,112,129,116, 81,143,239,158,244,211, 59,191,109, 61, 3,222,205, 46, 22, -240,126,102,129,128,183,127,230, 15,120, 58, 41, 79,192,163, 5, 63, 6, 60, 61,227, 30, 0,137, 22, 65,187, 93,137, 86,250, 68, -145,188, 8,180, 40,197,122, 48, 49,191,124, 56, 49, 77, 73,242,233,131,228, 78,249, 55,208, 2,160,250, 17,146,172, 35,159,238, - 31,126, 82, 33,107,244, 1,119,199,231,243,224, 57,174,119, 8, 11, 79,140,103, 13, 14,252, 83, 28,128,196, 42,121,209,162, 69, -159,175, 89,179, 70, 89, 84,240,151, 82,162,174, 93,187, 42, 96,128, 64,107,198,140, 25,242,250,245,107,153, 51,103,142,228,207, -159,255, 57, 84, 95,201,181,202, 27, 8,100, 98,224, 55, 46, 82, 66,164, 68, 72, 9, 54,109,218,148,224,135, 31,126,224, 14,237, -120, 72,241,145, 56,102, 70,119, 68,207, 17,208,186,117,235,150, 60,126,252, 88, 94,189,122,101, 23,108,217,162,109, 15,104, 61, -125,250, 52, 47, 65,214,179,103,207,220,222,188,121, 99, 23,108,217, 43,111,252,248,241,159, 65,170, 36, 0, 63,226, 7,254,141, - 28, 57, 82,142, 29, 59, 38,111,223,190, 21, 31, 31, 31, 5,116,253,242,203, 47, 50,100,200, 16,133,159, 49, 99,198,212, 99, 63, - 93,250,248,241,227, 10,160,250, 0, 16, 53,125,250,116, 5, 80,189,127,255,190, 52,104, 42,215,127,255,253,247,210, 35, 70,140, - 40, 13, 32,103, 0, 45,173,206,249,247,125,199, 54, 90, 95, 18,104,177, 52, 0, 84, 27,111,175,233, 35,239,119, 13,148,242, 89, -226, 61,200,158,221, 20,149,169,116,198,232,247,223, 46,169, 37,231,199,151, 35, 0,219,168,175,110,218,185,178, 37, 49,213,157, -209, 30,193,189, 55,183,145,154,121, 19,248, 59,146, 66,168,212, 40,201,226, 32,177, 99, 92, 19,236, 48,236, 47,111,182,244,150, - 55,155,186, 41, 3,199,246, 97, 63,200,171, 53,173,229,213,202,230, 66,144,197,163, 98,182, 88,154, 18, 45, 72,175,182,175,158, -212,219,247,221,189,147,242,233,197, 77, 49,223,218, 35,190,135, 38,202,131,185,181,228,202,242,190,178,125,212,143,210,170, 76, -170,151, 37, 96,151, 85, 42, 83,244, 25,176, 83,138,171, 93, 59,147,137, 96,172,100,230,120,231, 30,157,218,250,196,107, 77,183, - 7,151, 6,100,124,122,115, 72,218, 55, 62,139,235, 60,122,176,182,231,213, 98,233,163,157,211, 67,139,128,105,201,184,238,151, - 79,204,237, 98, 94,241,115, 6,243,188,230, 41,204,127, 54, 74, 97, 62, 56,169,161,121,223,248, 6,254,251, 39, 54,244, 59, 50, -165,137,255,250,129,223,251, 47,239, 95,233,110,135, 42,153,142,228, 72, 22,225,184, 30,224,106, 89,143, 44, 73, 35,205,123,178, -101,128,200,225, 49,226,181,161,183,240,191,158,122,218,203,163, 0,173,171, 91,196,103, 41,128,123,160,141, 22,127,223,131,183, -118,140,224,237,190, 46,103, 18,211,247, 13,138,165,124,242,120,247,228,143, 31,174,111,147,143, 87, 55,201,135,115,139,229,195, -129,145, 1,126, 75,171, 5,152,247, 15, 15,120,127,115, 95,192,164, 95,170,189,198, 59,126,119, 84,110, 24,188,123,125,132,154, -212,127,125, 11,217,219, 41,158,242,235,191,161,165, 34,225,130, 26, 81, 1, 90, 69,211, 69,139, 62,186, 90,236,233, 1,175,238, -190,157, 82, 39,246,156,101, 77,227, 44,224,121,255, 10,177, 38, 39,137, 29,219,150,177,125, 88, 88,101, 60,107,112,224,179,115, - 32, 93,186,116,135, 9, 10,212, 99,254,252,249,130,137, 92, 98,199,142,173, 36, 75,160,229,229,229,165, 72,101, 16, 20,253,176, -163,130, 21, 47, 94,188,250,201,147, 39,243,131,102, 60, 36, 23,164,212, 72,105,207,158, 61,155, 30,180, 51, 52,109,218, 52, 61, -104,164, 2, 13,134, 65,113,105,217,178,101, 10,188,171,140, 61,154,142,128, 22, 84,125,226,237,237, 45, 0, 29, 74, 21, 64,131, - 63,193,108,186,156, 1, 90, 47, 95,190,204,171,130, 44, 63, 63, 63, 55,208,178, 9,182,236,149, 53, 78,156, 56, 47,251,244,233, - 35,101,203,150,149,124,249,242,201,162, 69,139,228,198,141, 27,194,121,155,124,134, 36, 74,154, 52,105, 34, 73,147, 38,149,134, - 13, 27, 74,212,168, 81,237,154,114, 88,188,163,116,175, 94,189, 74,127,247,221,119,165, 11, 22, 44,168,128, 41, 74,183, 8,176, -152, 40,221, 2, 79, 75, 39, 75,150,172, 52,104, 26, 64, 75,223, 87, 19,118,160,133, 30, 27, 57,103, 50,211, 62,255,165, 85,197, -111,124, 42,218, 78, 29, 32, 56,210,247,254,224,185,114,186,152,114,118,171,158, 45,128,134,239, 43,251,150,165, 26,242, 23,166, -133, 29,243, 40,210,172,214,165, 92, 2,152, 39, 52,180,173,159, 97, 25, 65,123,247,237, 5,205,229,193,226,102,156,136, 53, 1, - 17,105, 16,104, 17,100,169, 59, 12,169, 46, 84,118, 24, 14,171, 42, 13,139,186,220,161,202,144,234,194,250,133, 18,222,241,248, -173,184, 38,208,162, 36,107,237,180,254,239, 2,222,121,139,217,243, 47, 24,232,215,148,183, 11, 42,202,195, 89, 85, 33,201,106, - 35, 91, 70, 55, 20, 0,177,187,161,149,226, 1,152,186,118,170,145,247,150,207,249,245,207,110,141,206,115,235,238,152, 28,119, -222, 29,154,242,224,231, 10,233,175,229, 72,110,202,170,135,151, 4, 76,185, 82, 68, 62, 49,165,119,253, 51, 59, 38,180,124,176, -180,103,105,191,233,109,242,220,109, 95, 57,147,217, 50,149,207,158,192, 12,117,225, 77, 72,141, 70,234,112,157, 17,236,213, 25, - 93, 76, 73,123,253,152,199, 44, 7,135, 97,119, 32,130,161,239,249, 85,186, 86,207, 98,230,117, 61,101,180,149, 71, 1, 90,151, - 55,200,155, 5, 85,228,205,220,114,242,122, 86, 41,121,253, 87, 81,121, 61, 45,191,211, 64, 11,180,118, 28,236,151,197,207,127, -107,215,128, 15,167,231, 2,104,185,203,199,187, 7,229,227,189,195,242,201,251,150,220, 59,190,225, 67,141, 34,169, 31,163, 79, - 13, 43,147,206,241,170, 57,121,188,136, 94, 84, 23, 62,255,171,184, 76,174, 21, 67, 94,204, 40,161,164,143, 23,150,138, 91, 82, - 3,104,133,182,189,141,231,190,122, 14,184,194, 22,235, 49, 36, 57, 10, 80, 57,125,250,180, 2,174, 44,211,137, 19, 39, 20,137, -209,197,139, 23, 37, 83,166, 76,180,117,116,117, 84, 43,168,195, 92, 33,181,105,229,239,239, 15,149,135,164, 66,202, 4, 48,148, -107,247,238,221,185,199,141, 27,151, 27, 42,202,156,120,103, 54,208,200,212,160, 65,131,212,153, 51,103,230,174,224, 12,161, 1, - 90,207,159, 63, 23, 95, 95, 95, 73,146, 36,201, 89,238, 68, 84,147, 37,216,114, 22,104, 81,146, 69,144, 5,208, 84, 2,207, 22, - 83,147,165, 20, 76, 15,208,202,149, 43,151, 98,163, 53,117,206, 10,169,210,176,139, 20, 43, 85, 65, 1, 94,127,252,241,135, 64, -197, 24,106,160, 69,245,225,228,233,115, 75,215,253,169,115,233,130, 69, 75,150, 94,184,112, 97,233, 49, 99,198,148, 6, 77, 3, -104,233,255,220,212, 88,135,170,125, 22,255,255,255, 0, 50, 46, 67,116, 28,152,128,169,130, 31,144, 8,229,173,224, 22,237,194, -234,174, 57,176, 26, 63, 33,242,250,162, 92,218, 60, 86,106, 21, 79,119, 3,182, 44,214,187,195,116, 21, 11, 19,218,226, 83, 83, -126, 84, 86,249, 21,178,198,122,206,228,191,162,142, 28, 29, 81,154,147,163,189, 29,114,186,104,171,153, 20, 59,155,164,166, 13, -155,135,213, 84,118, 51,206,234, 84,156,160,142,110, 30, 52, 15,101,135, 33,124,101,133,216, 97,184,166, 77, 48,195,119, 74,178, -188, 23, 84, 67, 29, 98,110,118, 68, 20, 59,201, 78,250,121, 93, 22, 51,118,192,153, 87,213,145,247,139, 42,195,224,191,188,156, - 24, 81, 74,246, 78,239, 32,189,106,100,241, 5, 32,170,165, 89, 48, 7, 25, 96,240,190,231,209,145,165, 87,159,204,171,123,230, -249,130, 58,167,158,236,154,124,138,215,156,161, 73,224, 68, 0,149, 39,117,180, 91,249,211, 68,243,255, 62,119,162,247,247,118, - 77, 55,191, 58,177,200,236,125,112,186,217,219, 99,144,185, 76,198,168, 15, 84,154,148,166,149,202, 24,101, 65,217, 76, 81,135, -233,121, 15, 36,107, 3,206,206,110, 41,159,118,245,149, 86,101,211,201,199,109, 93,229,228,228, 58,194,235,122,158,183,149,135, - 64,203,255,194, 26,121, 61,187,116, 48,137,214,187, 61,195,156, 2, 90,148,116,230, 73, 17,225,209,219,191, 10, 40,170, 66, 38, -179, 7, 0,215,229,117,242,241,213,131,128,137,253, 91,191, 1,160, 93,229,192, 85, 70,176,226, 37,141, 19,209,235,225,164, 2, -114,107, 76, 78, 25, 87, 61,134,162, 62,188, 50, 44,179,248,175,107, 42, 80, 43, 42, 18,173,210,153,162,215, 50, 84,135,161,109, -121,227,185,175,149, 3, 80,119,229,129,164,228,249,139, 23, 47,228,211,167, 79, 10,216,154, 57,115,166,146,120, 78,105, 17,237, -142, 0, 28,158,198,138, 21,203,122,151,173,173,106, 69, 72,145, 34, 69,137, 86,173, 90, 53,199,115,216,221, 36, 69, 33,121, 42, - 6,181,100,145,209,163, 71, 23,233,220,185,179, 34,129,105,219,182,109,190, 28, 57,114, 84,140, 17, 35, 6,231, 37,187,106,125, - 71, 18,173, 18, 37, 74, 40,101, 38,208,178,149,143,215,108, 21,208, 18, 52,169,231,200, 87, 12,160, 45,111,198,140, 25,203, 82, -146, 69,160,101, 43, 31,175,217,107, 75, 74,180,122,247,238,173, 72,180, 8,180,150, 45, 91, 38, 63,118, 24, 35,213,106,183,150, -239,178,100,147, 14,181,170,139,135,135,135,128,231,161, 6, 90,148,104,125, 87,171, 77,233,106, 13,219,151,142, 29, 63,126,233, -106,213,170,149,222,178,101, 75,105,208,252,210, 64,203, 33, 22,249, 90,251,123,152,202, 69, 9, 7,128,201,136,238,223,167,250, -120,108,228,119,114,176,175,155,124,124,114, 76, 1, 90, 47, 96,204,254,246,214, 97,153, 57,162, 75, 64,158,148,145, 39, 18,212, - 56,243, 50, 76,142, 25,155, 20,119,249, 32,107, 27,200,218, 30, 5,149, 68,105, 86,195,194, 9, 63,240,158, 51,180,172,243, 18, - 44, 80, 66, 86, 33,123,252,231,187, 39, 52, 17, 74, 79,246,140,173,167, 24,215,235, 81, 27,146, 30,129, 22, 29,146, 90, 26,190, -211, 38,235,213,170,159, 66, 2,173,121,223,107, 2, 45,216, 91, 61, 10,120,251, 68,252,214, 52, 85, 92, 56,120,207, 42, 43,158, - 35, 75,203, 26,212,123,195,164,174, 82, 38,115,172,103,101,254, 54,230, 12,237, 17,161,164,107,140,107,173,171,230,127,223,184, -172,155, 79,213, 60, 9, 94,214, 46,156,226, 45,212,144,215,156, 37, 88, 58, 67,148, 29, 72,119, 43,102,143,236,125,112, 65, 15, -243,225, 73,213,205,207,167,228, 55,191,152,156,207,252,126,215, 0,115,245,156, 49,158,150, 76, 31,229, 46, 83,149,156,241,189, -206,173, 29,230, 87, 54, 83,148,237, 90,239,129,139,250,168,117, 10, 37,247,150,157, 61,101,239,232,234,226,154,200,116,110,215, -176, 74, 34,238, 45,165,106,238, 4, 47,120, 95,139,134, 93,160,117,126,133,188,254,179, 80,152,108,180,234,194,136, 22,146,212, - 71,190,179, 10, 7,188,159, 93, 52, 8,108,125, 56, 54, 53, 96,225,160,102, 62,232,151, 78,237,128, 77, 16, 51,226,195, 75, 67, - 50,201,189,241,121,165,188, 91,148,247, 79,167, 23,149,107, 35,178,202,245,145,217, 36, 85,252,191,129, 86,203, 34, 49,127,167, - 91, 7,195, 24, 62, 52, 45,111, 60,243, 53,115, 0,182, 66, 5,176, 91,237, 2,164, 45,247, 96,243,244, 73, 85, 37,242, 28,118, - 70,247, 0,156,206, 69,137, 18, 5, 67,178,238,131, 96,196, 13, 18,176, 58, 80,149,213,156, 56,113, 98,117, 72, 94,106, 79,154, - 52,169, 6, 0, 86, 69, 0,187,114,112, 69, 80,149,121, 28,129, 44,190,205, 30,208,226,173,136, 17, 35, 14,254, 59,139,109,181, -161,179, 64, 11,180,212, 50,209,159,150,211, 54, 90,150, 64,139,170,195,105,211,166, 73,149, 90, 77,165,118,129, 66,210,173, 64, - 14,153,211,170,177, 28, 57,114, 68, 81,203,134, 86,117, 72, 27,173,239, 42, 84, 41, 29, 63,113,178,210,160,163,128,214,195,135, - 15, 43,231, 95, 82,117,168,187, 39,124,157, 25, 29,239, 58,180, 51,121,181, 47,148,218,228, 63,167, 85, 38,217, 51,164,172,236, -235, 16, 71, 38, 86, 53, 73,233, 12,166,243,101,179,197, 61,190, 98, 84, 51,249,136,109,251,215,247, 45,150,157,243, 7, 72,249, - 92, 73, 62, 16,220, 56, 83,255,108, 73, 77,127,238, 26, 80, 92, 78, 12,200, 46,199,126,203, 38, 60,231, 53,103,104, 48, 47,189, -199, 99,103,225, 11,120,131,127, 87, 58, 83, 28,175,142,213,178,125, 90, 63,178,177,248, 31,153, 8, 95, 92, 19,101,255,148,230, -146, 39, 69,164,195,144, 70,196,214, 75, 91,217, 97,184,185,167,141, 29,134, 77,130, 25,190, 83,146,229, 61,167,162,148,207, 28, - 93, 83,162,229,115, 1,134,239,251,134,137,247,236,178,114,114,116, 25, 89,221, 53,175,204,233,249,189, 76,235,245,163,208, 64, - 94,111,217,108,229,195,234, 43, 89,139,154, 37,197,239,181,151,188,121,116, 69, 78, 47,233,139,122,115, 55,100, 60,129, 95,149, - 50,206,208,134,196,234,254,199, 75,171,205, 31, 47,174, 54,203,181, 77,102,247,174,169,204,151,135,185,153,159, 79,200, 97,246, -117,255,217,188,121, 78, 27,179,220,223,167,164,219,219, 39,152,229,208,112,179, 30,160,149, 41,177,169, 33, 85,197,178,181,131, -252, 84, 38,213, 59,183, 68,166,148,205, 75,166,120, 71,176,189,168, 83, 94,193,125, 91,222,219, 53,139, 78,137,150,223,153, 37, -242,106,114, 14,167, 36, 88,182, 8, 67,122,187,111, 78,139,116,111,222, 44,253,241,147,223,202,186, 1,239,231, 20, 13, 48,159, - 95, 17, 80, 52,125,244, 71,249, 19, 40,198,182,186,143,120, 49, 35,182,139, 27, 35,226, 67,166, 56,209, 35, 14,231, 78, 67,239, -153, 37,229,226, 96, 87,129,180, 75,149,104, 21,107, 82, 48,102,127, 72,182,122, 24,238, 29,116,179,214,200,248,237,112,128,210, -159,166, 0, 84,179, 1,130,246, 48,241,156,215,144, 52,119, 7,218,169, 38,159,163, 31, 40, 58, 97, 46, 24,152,120,206,107,186, -104, 58,144,104, 41,182, 88,160, 19,110, 64,203, 66,186, 21, 42,160, 5, 55, 24,207,105,163, 85,174, 92, 57, 41, 86,172, 24,119, -107,202, 60, 24,189,247,172, 85, 85, 22,182,108, 40, 87, 15,238,151,193,131, 7, 11,242, 73,163, 70,141, 4,210, 60,107,223,147, -182,216, 24,100,163,133,141, 11, 10,152,194, 46,198,210, 85,170, 84, 81,206,207,157, 59, 87, 26,198,245, 95, 92,162,245,237,116, -107,135, 37,213,239,168, 20,160,233,217,171, 93, 35,228,213,246,193,178,176, 81, 28,169,155,195,228,135, 9,173, 7, 87,253,120, - 5,195,180,180,111,245, 67,158,183,135, 22,253, 46,114,239,128,200,221,189,182,188,197, 59,116,142, 71,119, 14,245, 11, 38, 8, - 16, 72,122,196,251,186,240,156,215, 52,152, 29,130,102, 9,215, 56, 47,228,233,121,145, 7,135,229,214,198,161, 34, 23,151,139, -156, 91, 40, 87, 87,255, 42,157,170,101,253, 4,245,225,124, 13, 99,240, 16, 52, 21,160,229,222, 85, 26, 21, 75,166,236, 48,164, - 77, 22,119, 24,190, 92,214, 80,104,151, 69,149, 33, 65, 86,157,252,241,110,191,152,249,157, 45,160, 21,220, 43, 62,108,180,166, -118,175, 1,239,234, 27,229,234,226,142,178,177,127, 73,153,215,167,154,252, 53,164,163,116,173,153,195,151, 54, 92, 58, 58,153, - 35,126, 70,200,145, 44,162,204, 31,253,139,204, 26,210, 78,134,181, 41,175, 36,212, 93, 96,187,224, 72, 82, 20,130,102,177,180, -145,207,215,200,151,240, 73,195, 50, 9,125,182, 76,105,110, 30,223, 36,177,249,209, 31,217, 20,160,245,118,105,109,243,152, 6, - 73,204,239, 38,101, 82,210,142, 30,153,205,178,184,172, 53,208,178, 89,206,252,169,163, 30,121,187,186,153,220,248,171,166,192, -125,131, 2,168,249,123,109, 74, 37,241, 89, 82, 83,242,165,138,114,196, 1, 15, 28, 58, 44,245, 59,181, 64, 94,142,203,160,168, - 14,157,240,153, 21,130,102,174,148,166, 84, 0,251,127, 85,202, 22,203,107,215,240, 42,239,253,246, 14, 11, 48,159, 94, 24, 64, -167,165, 58,218,135, 89, 28,181, 81, 22,248, 7,123,114,110, 64,122, 73, 28,251,111,160,165, 30,170,100,235,111,135,165,209, 13, -135,165,255,103,141,225, 96, 83,103,199,211,153,205,224,231,223, 40, 74,143,247,119,187, 96,203,130,215, 65,252,180,167, 18,180, -178,195,178, 11,182,108,209,228, 53, 72,180,206,174, 94,189, 90, 14, 29, 58, 36,220,125, 56,107,214, 44, 25, 56,112,160,108,219, -182, 77,176,115, 80, 81,199,194, 46, 77, 96,171, 38,163, 70,141, 34,208,178,229,110, 39, 88,187, 71,142, 28,185, 40,158, 83,164, - 86,244,147, 69,144, 69, 96, 69, 35,120,238, 70,228,127, 2,174,241,227,199,151,238,215,175, 95,105,230,183,209,191, 62, 71, 95, -210,217,141,191,218,108,122,230,241,255, 23,158,241, 12, 9,178,238,244, 52, 73,254, 84, 38,127,168, 84, 66, 24, 22,230,134, 68, - 2,147,167, 31, 65,150, 28,159, 68,160, 21,108,242,208,152,116,148,151, 33, 44,207, 43,130, 44, 62,143,243,215, 58,216, 23,162, -113,139,103,136,233, 45, 15,142, 42, 52, 22,245, 40, 39,115,250,213,134,119,241, 44, 31,105,235, 5,135,147,153, 67, 67,147, 42, - 67,126,101,219,135,125, 47,175, 86,183, 20,250,202, 34,200,226,225,241,107, 49,241,158,247,131,120,207,169, 36, 47,160, 2,228, - 97, 67,162, 21, 18, 16, 98,215,225,136,159,138,251, 28, 95,208, 75,246, 47, 25, 41,115, 6, 54,151,110,181,114,249,114, 55,162, -142, 50, 58,156,196, 41,181,234,218,164,130,248,189,130, 68,235,225, 21, 57,181,184,183,236,155,212,148,210, 55, 45,137,150,221, -143,165, 4, 84,131, 7,167,212, 55, 63, 95,209,210,252,118,101, 67,243,155,133,223,155,125,103,149, 52,183, 41, 17,247,233,247, - 89,163, 61,102,170,155, 55,250,179, 35,221, 93,116, 1, 45, 72,175,188,101, 93, 67, 25, 80, 59,163,164, 79, 96,202,197, 10,241, -247,183,154, 25, 20,181, 49,156,203, 98,247,178, 93,187, 10,155,229,164, 52,235,221,238,193,242,114, 76, 26,121, 57, 42,153,120, - 15, 79,228,140, 84,203,110,221,179,165, 48,229, 5,237,181, 63,149, 78,253,236,194,162,206,102, 0,184,135, 97,109,163,192,231, -179,196,140, 26,225, 78,244, 40, 17,130,133,224, 1,184,130,100, 43,198,111,112,235,240,253, 23, 26,208, 62,199, 32,105,208,212, -217, 73,116,102, 51,248,169,147, 81, 58,179, 89,130,162,111, 6,104,161,110, 69, 8,182, 18, 38, 76,248, 24,201, 11,118, 83, 94, -216, 28,240, 28,170,217,215,209,162, 69,243, 1,176,122, 5, 21,223,115,228,121,140,107, 4, 89,182,236,166,173,251, 82,226, 64, -240,228,208, 43, 60,104,169, 32, 43,241, 23, 26,151,116, 54,229, 87,153, 45,116,170, 67, 37,120, 52,131, 72, 59, 8, 32,205,123, -129,249,108, 5,154,214, 28, 40, 2, 3, 77, 63, 7,200,122,206,128,208, 58,216, 23,130, 38,105, 32,144, 52, 85,135,175,225,125, -126, 28,119,238,233,113,103, 96,111, 5,193,235,185, 93, 76, 67, 85, 95, 89,234, 14, 67,238, 50,164, 36, 75,149,102, 17, 92,169, -137,249,173,202,110,179,238,148, 92,209, 48,158, 54, 91,252,213, 41,201, 82, 73, 59,228, 39,192,128, 71,153,244, 38, 74, 31,149, -196,115, 94,211,224,169,125,176,129, 77, 16,165, 50, 70,187, 87, 33, 75,204, 71, 21, 50,199,120, 84,222, 45,250,163,114,153,162, - 61,162,196, 75,165, 73,176, 93, 34,125,228,253,165, 93,163, 88, 58, 86,181, 73, 19,210,202,223,235, 23, 78,252, 58, 91,210,136, -227, 44,203,148, 41,145,233, 55, 92,127,149,213, 37,226,111, 14,202,106, 87,162,101, 29, 80, 58, 44, 18, 45,235,247,131,118, 69, -164,109,232,227,115,117,244, 77,135, 96, 88,231,243,182,178,105,126, 71,161,160,109,208, 12, 5,211,156,237,159, 97,124,133,209, - 70, 97,100,160,189, 49, 89,143, 68, 75, 85, 33,210,102,203, 58,191,173,185, 67,143, 68, 43,208,232, 93,177,217,178,206,239,104, - 62, 10, 7, 54,124, 43,125, 41, 28,170,250,223, 35,241,173, 52,238,191,170,156,110,110,110,138,239, 23,157,221,237, 95, 85,119, -157,117,214, 5, 92,157,164,101,208, 52,130, 53,135,178,203,216,125,204,248, 54,195,151,163, 78, 73,180, 28,129,177,176, 0, 45, - 29,187, 14,255,203,237, 30,190, 45,254,101,169, 57,246,163,245, 25,203,242, 95,238, 48, 70,221,195,183, 99, 25,252, 52,248, 25, - 94, 28, 48,250, 82,120,113,242,111, 58, 6, 63, 13,126,134, 47, 7,190, 77,106,225, 19, 84, 58, 20,117, 55, 62,192, 80, 48,205, -193, 35, 6, 63, 13,126,134, 23, 7,140,190, 20, 94,156, 52,192,134,209,151,140,190, 20,190, 28,248, 54,169, 57,180,209,226, 71, - 98, 43, 57, 83, 85,123, 52, 28, 93,215,162,111,208,180,221, 46,161,109, 47,131,159, 6, 63,245,246, 1,227,219,180,207, 1,189, - 60,180,204,103,240,211,224,167, 45, 14,252,151,251,146,202,143,208,206,103, 90,223,212,127,234,190,177,210, 9,223,230, 54,248, -105,240, 51,188, 56, 96,244,165,240,226,164, 33,209, 50,250,146,209,151,194,151, 3,223, 38, 53,195, 70, 75,163,221,140,129, 34, -124, 59,182,193, 79,131,159,225,197, 1,163, 47,133, 23, 39, 13, 64,104,244,165,175,191, 47,133,111, 9,191, 44, 53, 3,104, 25, - 64,203, 46, 7,140,193, 39,124, 63, 70,131,159, 6, 63,195,139, 3, 70, 95, 10, 47, 78, 26, 32,243, 91,233, 75,225,219,226, 95, -150,154,227,160,210,159,177, 44,223, 74,227, 26,229, 12,223, 78, 96,240,211,224,103,120,113,192,232, 75,225,197, 73, 3,108, 24, -125,233,235,239, 75,225, 91,194,255, 8, 53,163, 99,135,111, 67, 27,252, 52,248, 25, 94, 28, 48,250, 82,120,113,210, 0, 48, 70, - 95, 50,250, 82,248,114,224,219,164,230,188,103,248,112,170,167,241, 1,134, 19, 35, 3,201, 24,252, 52,248, 25, 94, 28, 48,250, - 82,120,113,210, 0, 90, 70, 95, 50,250, 82,248,114,192,160,102,112,192,224,128,193, 1,131, 3, 6, 7, 12, 14, 24, 28, 48, 56, - 96,112,192, 1, 7,130, 27,199,187,187,187, 43,225, 90,212, 95,131,117, 6, 7, 12, 14, 24, 28, 48, 56, 96,112,192,224,128,193, -129, 47,201,129,127, 25, 22, 49,128,214,151,236, 60,198,187, 12, 14, 24, 28, 48, 56, 96,112,192,224,128,193, 1,199, 28,248,198, -129,150, 99, 27,173,111,188,114, 70,223, 53, 56, 96,112,192,224,128,193, 1,131, 3, 6, 7,190,113, 14,252,171,177, 8, 42, 87, -134, 21,228,239, 55,222, 78, 70,241, 13, 14, 24, 28, 48, 56, 96,112,192,224,128,193,129,111,144, 3,255,122, 44, 98,216,103,125, -131,189,210, 40,178,193, 1,131, 3, 6, 7, 12, 14, 24, 28,248, 23,113,192,192, 34,255,162,198, 52,170, 98,112,192,224,128,193, - 1,131, 3, 6, 7, 12, 14, 24, 28, 8, 39, 14,252, 99, 33,120,194,169,252, 6, 25,131, 3, 6, 7, 12, 14, 24, 28, 48, 56, 96, -112,192,224,192, 87,203, 1, 21,104, 89,255,126,246, 2, 27,142,236,194,151,197, 6, 63, 13,126,134, 23, 7,140,190, 20, 94,156, -252,155,142,193, 79,131,159,225,197,129,255,114, 95, 10, 47, 30,254, 19,116, 12,207,240, 26, 92,255, 47,119,108,163,238,225,251, - 73, 26,252, 52,248, 25, 94, 28, 48,250, 82,120,113,210, 0,195,223, 74, 95, 10,223, 22,255,143, 80,251, 86, 26,215, 40,103,248, -118, 72,131,159, 6, 63,195,139, 3, 70, 95, 10, 47, 78, 26, 96,195,232, 75, 95,127, 95, 10,223, 18,126, 89,106,148,104, 85, 11, -124, 37,127,173,109,182, 62, 91,105,140,142, 29,190,172, 53,248,105,240, 51,188, 56, 96,244,165,240,226,164, 1, 96,140,190,100, -244,165,240,229,192,183, 75, 45, 69, 32,192,226,239, 23, 59,140, 15, 48,124, 89,109,240,211,224,103,120,113,192,232, 75,225,197, - 73, 3,104, 25,125,201,232, 75,225,203,129,111,147,154, 97,163,165,209,110,198, 64, 17,190, 29,219,224,167,193,207,240,226,128, -209,151,194,139,147, 6, 32, 52,250,210,215,223,151,194,183,132, 95, 17, 53,118, 62, 91,201,153, 34,218,163,225,232,186, 22,125, -131,166,237,118, 9,109,123, 25,252, 52,248,169,183, 15, 24,223,166,125, 14,232,229,161,101, 62,131,159, 6, 63,109,113,224,191, -220,151, 84,126,132,118, 62,211,250,166,254,137,251,134, 68,203,144,104,217,229,128,177,202, 11,223, 79,210,224,167,193,207,240, -226,128,209,151,194,139,147,134, 52,239, 91,233, 75,225,219,226,255, 86,106,249, 77,166,152, 22,117,251, 86, 26,215, 40,167,118, -135, 76,134, 44, 76,122, 14,131,159,122,184,164, 63,143,193, 79,253,188,210,147,211,224,167, 30, 46,233,207, 99,240, 83, 63,175, -244,228,252, 47,243, 83, 15,127,190,149, 60,159,103,215, 97,118,147,169,245,132, 92, 73, 63,230, 50,153, 98, 5,114,194,110,135, - 73,154, 52,233,140,244,233,211,251,226,247,137,139,139,203, 99, 53,225,255, 99,164, 71, 22,105,191, 21, 87,109,210,140, 22, 45, -218,196,180,105,211,190, 77,152, 48,225,147, 68,137, 18,121, 37, 78,156,216, 43, 73,146, 36, 74, 2, 45, 37,225, 29, 74,194,189, - 19,122,104,134,177, 53, 63,239,199, 34, 18, 41,137,139,139,103,138, 20, 41,188,156, 77, 46,201,146, 29,118, 18, 12,143,140, 16, -193,244,137, 9,207,141,212,193,151,207, 91,119, 29, 5,208,153, 37,168,156, 98, 50, 69,210,147,114,154, 76, 9,162,152, 76,237, - 35, 70,140,120, 41, 90,196,136, 29,213,103,156,228,103,176,226,249, 29, 53,101,242, 63, 98,170,103, 62,106,106,203, 95,254,255, - 7,251,103,157, 40, 81,162, 44,194, 55,178, 30,101,232,138,228,194, 95,254,231,117,156,215,113,192, 91,135,237, 94, 42,175,169, - 79,133,194, 81,174,150,200,107,106, 73, 26,101,242,155, 18,227,124,118,133,194,145,175,149,204, 99,106,109,135,174, 35,154, 17, -240, 76,196,192,196,115,189, 71, 16,205,149,104,119,189,169, 97,194,132,217,127,202,146,254,113,219,220,174,135,234,186,184,164, -231,115, 97,105,119, 29,133,253,226,223, 17,198,203, 22, 24, 35, 31, 98,188,124,136,113,180,133,142, 50, 50,139,158,114,254,138, -124, 99, 3, 19,207,181, 14, 45,154,119, 64, 0,159,159,146,120,174,231,208,162,169,135,134,117,158,127, 3,205, 63,215,174, 93, - 43,175, 94,189,146,129, 3, 7, 10,218,254, 22, 42, 73,144, 16, 77,131, 33,214,117, 15, 45,157,208,240,253, 91,120, 38,252,129, - 86, 14,147,233,135, 63, 42, 23,249,244, 97,222,208, 0,173,193, 7, 31,243,156,102,205,154,153, 5,199,229,203,151,197,223,223, - 95, 62,124,248, 32, 31, 63,126, 84, 18,207,213,148, 42, 85,170, 7, 86, 28, 13,209,177, 49,233, 77,250,241,199, 31,223,144,222, -137, 19, 39,228,221,187,119,226,231,231,167,208,125,255,254,189,242,223, 50, 37, 75,150,204,203, 17,205,120,241,226,157, 0, 96, -243, 98, 34,104, 83,129, 27,193,155, 37,128,179, 4,113,200,163, 23,188, 85,198,187,247,234, 72,204,103,255,163, 6,208, 34,192, - 98,157,157, 61, 82,167, 78,125, 79,171,141, 44,238, 39, 35,192, 82,223,129,243,128,232,209,163,167,181,188,143,115,107, 73,151, -230,224,147, 50,101,202, 31, 81,254, 29, 72,219,121,174,227,171, 9, 70, 51,110,220,184, 39,200,255,228,201,147, 63, 81, 19,104, - 61,177, 76,160,251, 68, 77,108,115,180,167,221, 54,114, 4,178,246,152, 76,145,163,155, 76,229, 34, 71,138,228, 14, 58,175,207, -158, 61,171,240, 3,253,238, 65, 88,129, 22, 65,149,239, 1,211,175,207,118, 71, 63,234,115,107,212, 43,254,242,191, 21,216,210, -228,167, 14,254,233,153, 32,154,227, 56,237,229,229,245,224,229,203,151,143,254,250,235,175, 43, 49, 98,196, 56,192, 95,254,231, -117,222, 7,161, 14,118,222,103,183,156,197,242,154,138,182,170,147,194,247,244,186,166,190,229, 10, 69, 62, 85, 34,151,169, 90, -197, 98, 81, 31, 76,237,155,221,119,223,172,146,190,101, 11, 68, 60,231, 36,205, 8,145, 35, 71, 46,142,197, 85, 75, 76, 12,205, - 2, 83, 83,252, 42, 9,125, 66, 73,104,243,122,142,190, 35,189, 32, 43, 77,140, 24,197,235,101, 76,235,123,103,200, 32, 57,219, -181,179,180,116, 77,243,154, 96,203,137,239, 40, 20, 77,164, 11,192, 56, 75,215, 97, 95, 34,200,226,216,107, 54,155, 5, 99,221, - 67,157,196,245,244,207,177,248,100,148, 4,154, 76, 90,135, 22,205,160, 97, 15,132, 8,182,244, 28,142,104,198,136, 28, 49, 98, -143, 88,209,162,109,143, 30, 57,242, 19, 38,158,227, 90, 79, 16,142,225,128,184, 86, 57,245,148, 75,207,183, 25, 26, 58,150,207, - 56, 42,103, 28,124, 51, 55, 39, 78,156, 40,190,190,190, 74,226, 57,175,129, 64, 28, 39,234, 30, 90, 58, 97,173,219,215,242,252, -231,181,209,130, 36,171,224, 47,121,221,222,155,151, 79,252,228, 95, 39,157,101,167, 15,209,184, 4, 89, 53,190,255, 62,232, 35, -201,159, 57,179,244,111,214, 76, 70,117,236, 32, 19,186,119, 81,210,196,110,191,200,244,222,189,228,241,227,199,162, 3,104,141, -169, 83,167,206,115,149, 96,203,150, 45,101,243,230,205,114,244,232, 81, 57,127,254,188, 92,189,122, 85,110,221,186, 37, 15, 30, - 60,144, 39, 79,158, 8, 38, 12,209, 2, 90, 4, 88, 4,102,234, 17, 16, 16,160, 0, 64, 14, 62, 4,112,188,199,206,248,246,237, - 91, 37,113, 37, 64, 73,153, 85,107,219,235,216,123,153,159,229,185,127,255,190,220,187,119, 79,238,222,189, 43,119,238,220,145, -219,183,111, 43,101,189,121,243, 38,121,184,215,209, 4, 97,178, 0, 90,195,134, 14,145, 33, 3,123,203,136,161,189,149,223,254, -253,250, 74,223,190, 33,211,148, 41, 83,228,211,167, 79,228,105,168,129, 86,181,106,213,164,122,245,234,199, 1,104,122, 71,138, - 20,233, 47, 59,146, 46,205,193, 7, 0,104,143,143,143,143, 39, 19,206,119,235,248, 82,130,209,100, 27, 61,124,248, 80, 94,188, -120, 33,222,222,222, 74, 98,219, 50,145,191, 76,175, 95,191, 86, 18,239, 1, 36, 8,222, 99, 23,180,219, 2, 90, 16,229,100,192, - 64, 59,178, 80,161, 66, 47, 70,142, 28,249,174,102,205,154, 82,187,118,109, 57,121,242,164,140, 25, 51,230, 67,132, 8, 17,124, -209,247, 19,242, 89, 7, 19,110,127,220,187,134,116, 21,169,151,117, 61, 41,193, 34,184, 58,178,161,161,210,221,248,203,255,188, -238,128,166, 14,118,105,102, 9,209, 70, 88, 96,172, 3,175, 30,162,110,151,126,250,233,167, 51, 88,168, 60, 66,145, 30,241,151, -255,121,157,247, 99,199,142,189,198, 14,117,187,237, 94, 42,159,105,231,206, 69, 63,249, 30, 94,217,202, 23,146,173, 7,245,202, -199,125,117,104, 81, 13,223,131, 11, 43,251,182,173,157,216, 23, 18,173,174, 78,208,164,244,170,120,195,134, 13,155,163,124,109, - 47, 94,188,216,150,191,232,219,109,241,141,182,197,183,169, 36,244,173,182, 4, 91,142,190, 35, 61, 64, 43,182,201,148, 61,125, -250, 84,190, 19,187,180, 23,243, 31,163,196,167, 89,125, 57,148, 45,131,180,201,144,244,208,151,110, 35,205, 86,213,206,224,240, -219,164, 36,139,253,144, 99, 82,246,236,217, 95,226, 59,123,132,164,181, 50,215,252,222, 81,172,175, 25,104, 21,142, 22, 57,242, -253, 21, 11,167,125,188,123,243,140,248,191,127, 44,103,207, 28,149,139,103, 15,201,146, 89,147, 62,240, 30,202, 95,216,137,254, -169,221, 10,142,115,232,225,167,179,239,176, 73, 51,121,241, 14,181, 83,148,236,252, 36,101,137,142, 79, 18,184,126,247,218, 37, - 69,186,143,148,106,113,252,164,148, 11, 47,249, 83, 15,208, 74, 94,164, 67,237,228,197, 59, 61, 73, 94,172,227,147,120, 25,191, -123,157,212, 57, 58,206,214,229,191,151, 31, 19,141,107,131, 52, 46,222,239,150, 77,248,232,223, 44,183,120,151,142, 97, 23,104, - 81, 93,136, 21,177,191,165, 4,166,115,221,186,226,185, 96,150,220,223,188, 74,188,247,109, 20,239,189, 72,187,221,101,215,180, - 73,242,232,209, 35, 77,160,149, 38, 77, 26, 69,146,165, 30,191,255,254,187,236,216,177, 67, 78,157, 58, 21, 2,100,113,194, 37, - 48,194,224,235, 16, 20,113, 18, 39,189,237,219,183,203,238,221,187,101,223,190,125,114,232,208, 33, 57,118,236,152, 50,201,158, - 57,115, 70, 46, 92,184, 32, 87,174, 92,145,235,215,175, 11, 6,116,103,128, 22, 37, 85,175,222,188,121,163, 12,102, 60, 71,218, -107,145, 94, 61,125,250,212, 41,160, 69,112,229,115,111,129,248, 93,255, 89, 94,223,153, 39,143, 31, 92,151,213,107,215, 75,243, -182, 93,165,220, 15,245,101,208,176,209, 10,128,131,100, 66, 1,139, 78, 2, 45,118,234,145,213,170, 85, 13, 32,200,154, 60,121, -178, 55,128,167, 39,234,127,214,205, 45, 83, 16,223, 3,213,138,170,100, 75,115,160, 0,232, 57, 76,144,181,105,211, 38, 2, 45, - 75, 85,166,189,143, 40, 4,208, 34,200,114,119,119, 23,208, 80,192,245,214,173, 91,101,219,182,109,178,115,231, 78,233, 50,253, -172,180,156,112, 94,234,247, 89, 34, 7, 15, 30, 84, 64, 59, 36,121,154, 64,171,140,201, 20, 59,138,201,212, 44,106,148, 40,167, -211,165, 75,247,186,124,249,242, 31,213, 74, 66,122, 18, 0,245,217, 11, 72,178,110, 71,141, 24,177, 55,196, 25, 46,142, 36, 90, -232,155, 37,144, 55,216,202, 27,234,114, 31, 53,129,158, 79,191, 54,137,252,188, 46, 12, 13,176,236,195,175,174,143,240,161, 26, -241, 31,152,196,235, 67,138,177, 17,239,237,131, 84,191, 73,147, 38,167, 9,180,248,203,255, 72,221, 33,185,117,199,175, 45, 41, - 17,139,107,179,221, 1,162,126,232,222, 50,151,239,245,125, 3,125,103,141,168,236, 91,190, 72, 20,223,189,139, 27,251,158,219, -208,220,183, 89,181, 68, 62,165,242,152,154,235, 25,204, 3,243, 16,100, 21,169, 91,183,110, 83,130, 43,166, 37, 75,150,180, 69, -155,183, 61,119,238, 92,219, 27, 55,110,180,197,119,213, 22, 11,153,182, 88, 88,133, 25,104, 17,100,165, 74,147,216,231,204, 25, - 79, 44,140,110,202,248,186, 85,229,121,169, 2,114,169, 72,110,105,145, 58,233,227,127,160,141,194, 58,201, 56,250, 54,179, 64, - 51,224,205, 69, 37,192,171,112, 28,226,120,153, 32, 65, 2, 45,201, 86, 48,154,144,130,114,124, 85,212,122,129,231, 44,243,239, - 48,239, 24,195,196,243,192, 74, 56, 82, 39, 90,210,188,163,210,195, 47,207,121,216,186,166,197, 27, 91,117, 47, 84,184, 80,158, - 55, 15,238, 94,148, 11,231,119,202,155,151,219,228,195,251,189,210,177, 67, 93,233,213,179,181,188,245,185, 37, 15,239, 92,144, -156,217,179,188, 1,113, 91, 96, 75,115,172,211, 42,148,141,251, 95,140, 38,128,209,243,230,127, 28,147,246,211, 47, 43,169,221, -228,115,146, 54,231,119, 50,120,240, 96,101, 72,202,153, 51, 39,205, 69, 18,217,169, 67, 80, 57,147, 21,237,240,188, 82,255, 3, - 82,125,232, 25, 37, 85, 29,116, 66, 92, 50,151,254,155,142,217, 75, 26, 86,207,248,233,212, 34, 83,245, 15, 71, 76,101,152,204, -135, 77,133,228,168, 98,150, 16,116, 96, 44, 47,227,232,127, 40,248,248,165, 31, 81,157,149, 90, 74,182,254, 46, 3, 39, 42,171, -202,233, 21,195,154,242,154, 76, 73,202,197,143,117,251,229,220, 17, 31,204, 93,202,201, 43,128,172,243,133,162,218,125,158, 54, - 89,150, 19, 10,207,199,118,238, 36,231,150,205, 23,175, 29,171,131,110, 17,112,237,158, 62,209, 30,208, 10,198, 60,218,100, 17, -252,180,111,223, 94, 6, 13, 26, 36,243,230,205,147,195,135, 15, 43, 42, 73,130, 11, 74,141, 40,201, 82, 65, 22,213,137, 84,185, - 57,106, 1,170, 10, 89, 24,130,172,189,123,247,202,175,191,254, 42,125,250,244, 17, 79, 79,207, 16, 32,139, 82, 40, 14, 70, 54, - 36, 90,142, 94,177,151,146, 22,150, 15,153,246, 90,101, 84, 85,139,182, 84,135,255,207,106, 33,209, 26, 62,164,151,188,187,218, -246,111, 73,219,149, 54,114, 7,171,178, 14,221,126, 11,226,103,250,172, 5,229,210,165, 75, 50,125,250,116, 69, 34,103, 5,180, - 52, 59, 35,242,231, 42, 92,184,240,217,254,253,251,159, 5,143, 61, 7, 12, 24,224,137,213,206,217,234,213,171,217, 3, 90,154, - 52,209, 6,107, 15, 28, 56,224,185,114,229, 74,218,153,173,213,124,192, 42, 3,193, 48,219,180, 94,189,122, 66, 0,104,157,154, -143, 59, 47,231,239,248, 72,129,106, 61, 41,129, 83, 36,136, 54, 36, 90, 65, 84,177,131, 35,127,132,248,110, 7,163, 39,202,240, -118,220,184,113, 31,159, 61,123, 38, 85,171, 86,229, 64, 35,144,146,190, 3, 15, 94, 70,138, 24,113, 30,243,217,146,126,217, 42, -191,155,155,219, 45,130,245,229,203,151, 43,137,192,220,250,248,244,124,133,188,244, 44,169, 72,178,120,240,247,224,252, 56,126, - 86, 18, 45,103,217, 19, 94,249,127, 2, 33, 2,175, 86, 97, 33, 88, 50,175,105,245,177,205, 3,125,111, 31, 25,231,219,173, 69, -118,223, 97,221,139,248, 94,217,209,221,119,249,196,106,148,110, 93, 47,157,215,180,167,114,241,104,143,113,174,231, 61, 17, 1, -152, 91,168, 32,139,191,224,109, 91, 44,134,218,226,155,111,139,239, 49, 8,100,161, 13,219,162,205,109, 73,180,130,170,227, 72, -162, 69,144,149, 34,117, 28,159,121,238, 53,229,175, 5, 93,101,207,190, 29, 50,127,254, 12, 25,221,176,182,180,204,225,246,142, - 54, 91, 97,225,203, 87,246,108, 22,104, 6, 94,112,124,228,184,196,177,194,195,195, 67,214,172, 89, 35,241,227,199,215, 2, 90, -214, 85, 9,182,184, 8,188, 73, 91,186,200,129,137,231, 60,244, 74,185,108,209, 11, 15,246, 69,139, 17, 53,234,157, 71,247, 47, -203,246,109,127,201,243,167,103,241,158, 79,242,233,227, 3,169, 95,191,178, 84, 40, 95, 76,250,246,249, 25,230, 39,247,229,214, -213,243, 18, 40,217,114,164, 70, 12,143, 50,125, 81, 26,214, 18,173,164,201,210,124,236,222,189,187, 34,164, 88,191,126, 61,231, -167,169,122, 10,100, 45,209, 74,146, 60,205,199,158, 61,123,202,237,107, 71,229,240,214,126, 50,127,144,233,244,147,237,166,249, -106,122,177,203, 52,214,247,176,169,166, 37,216, 82,177,136, 10,184,172,177,137,158,114,252,195,121,212,197,113, 72, 9,176, 69, -229, 20,128,164,183,114,153,161,187,205, 23, 45,234,205,251, 19,122,155,205, 3, 27,202,155, 50, 49,228, 98,225,104, 1, 29,147, - 68,252,104,181,243, 48,168,238, 52,124,191,118,237,154, 20,203,145, 67,122, 53,106, 36, 19,186,116,145,141, 99, 70,203,141,117, -203,228,229,190, 13, 65, 31,211, 75, 39,128, 22, 65, 17, 1, 6,165, 25,148,100, 28, 57,114, 68,145, 54, 89,131, 44, 74,157, 56, -136, 80, 13,168, 7,104, 49, 31, 37, 89, 84,183, 53,110,220, 88, 58,117,234,164,232,173, 45, 37, 89, 4, 89, 4,114, 4, 90, 54, -212,145,142,218, 92, 81, 31, 98,245,109, 79,114,165,221, 95, 44,128, 22, 37, 90, 79,174,252, 41,111, 46,182,148,199,151,166,201, -149,139,158,210,178,125, 79,153,189,223, 95,218,204,121, 33, 41, 51,230, 82, 36,124,211,166, 77, 83,192,152, 19, 64, 43, 34, 38, -170,102,101,203,150, 61, 58,123,246,108,207, 69,139, 22,121,254,249,231,159,158, 99,199,142,245,196, 74,197, 19, 18, 50,111, 74, -186,156, 48,146, 15,170, 23,218, 96, 38,248, 7,236,234, 73,160, 53, 83,187,194,193,115, 16,104, 81, 77,104,239, 32,208,186,124, -255,173, 2,180,168, 98,164,138, 22,239,177, 59, 97, 64, 13,248,114,240,116,119,137,233, 86, 75,230,204, 95, 34,171, 86,173,250, - 8,213,168,151,151,232,216, 0, 0,255,244, 73, 68, 65, 84, 55,236,178, 14, 71, 53,153,126,172, 11, 59, 13, 71,118, 92,182,202, - 79,123, 62,182, 49, 65, 63, 37, 4, 84,101,159, 62,125, 90,182,108,217, 34, 11, 23, 46, 84, 36,140,171, 22,143,148, 51, 30,141, -228,192,162,228,242,240,236, 32,185,187, 59,183, 12,105, 31,213,199,134, 65,188,179, 44,250,106,242, 67,162,117,244,206,169, 57, -190,247, 78,254,229, 91,175,138,139,239,254,213,221, 21,233,214, 8, 0,174, 95,154,186,250, 30, 95,221,194,247,228,154, 38,190, -229, 10, 70, 60,169,163,208, 17, 49,241, 55,165,186,144,146, 44, 38, 72, 52,219, 98,177,165, 72,179, 84, 73, 22, 65, 22,190,177, - 80, 3, 45, 21,100,205,223, 84, 75, 22,110,171, 32,163,231,102,151,198,173, 75,200,216,113,163, 5,106,196,119,180,217,178, 50, -134,215, 81,244,175, 43, 11, 36,251,237,176, 64,228,198,163,139, 42,200,162,217,194,138, 21, 43,104,159,245,132,146, 44,240,250, - 17, 84,202, 90,170, 67, 61, 64,203, 86,229,195, 3,104, 69,137, 21,195,212, 61, 93,178, 8,251, 93, 83,196,127,144, 46, 86,164, -253,177, 34, 71,236,142,151, 65, 48,237,248,128,180,185,227,166,181,115, 62,124,240,191, 40, 31,252,175, 67,195,112, 81,186,119, -107, 34,205,154, 86,151,183,111, 78, 35, 93,194, 2,253,170, 20, 42, 82, 88,170,213,168, 35,157,219,119,248, 24,104,179,165, 69, -250, 91,187, 79,219,170, 59,191,253,246,155,204,157, 59, 87,150, 45, 91,166, 8, 45,220, 18, 39,254, 56,209,100,122,250,151,201, - 84, 91,103,133, 20, 58, 88,136, 43,125,104,195,134, 13, 50,123, 82, 59,153,210, 55,230,235,219,238,166, 99,183, 54,152, 20, 19, - 31,254,222,223, 98, 58, 76,176, 69,201,150, 74, 59,180, 88, 68,103,217,190, 68, 54,109,137,150,117, 37,181, 74,229, 22, 37,218, -173,147,125, 90, 4,124,152,208, 69,222,150,141, 5, 81,122,180,143,205,226, 71, 16, 44,241,186,218,123, 22, 96,228, 49,193,206, -239, 63,253, 36,167, 33,121, 58,191,104,145,220, 88,185, 66,158,122,184, 43,234, 66,157,170,195, 96,228, 57,153, 17, 60,208, 8, - 30, 70,202,138,212,128,131, 5, 1, 16,237,114, 40,245,176, 4, 89,108,104, 45,160, 69,154, 20,159, 83, 93,216,170, 85, 43,101, - 66,228,228, 8,181,103,144,186, 80, 5, 89, 84, 73,209, 94,203, 89,160, 69,144,192, 85, 3, 42,179, 55,176, 66,250, 36, 89,106, -237, 45,128, 86,191,190,125,228,194, 89,216, 20,156, 59, 36,103, 79, 29,146, 83, 39, 61,165, 81,139,142, 50,107,159,191,180,158, -253, 66,146,166,206,172,212,101,234,212,169, 10, 47, 0,158, 44,109,180,108, 54, 23, 6,225,180, 25, 51,102, 92, 48,115,230, 12, - 79,240,214, 19,170, 57, 79,244, 17,207,117,235,214,121, 46, 94,188, 88, 57, 7,111, 9,146, 40,241,208,235,246, 33,220,128, 22, - 1, 54,121,200, 85, 55,213,133, 84, 23,239,218,181, 75,246,236,217,163, 0,228, 58, 61, 22, 75,145, 90,125,164,120,173,158,138, - 90,145,237,133, 54,114, 4,180, 94, 31,184,248, 82, 42,182,250,227, 67,132,164,133,124,160, 26,252, 53,149,201,148, 82,207, 78, - 68, 43, 27,173,160, 58,178,140, 4,254,224,153, 32,143, 0, 20,200,176, 97,195,148,149, 34, 37,108, 52, 58,230,194, 99,209,236, -129, 50,107, 76, 37, 89, 63,187,170,236, 88,217, 78,242,102,141,249, 76,235,251,251,204,247,107,130,254, 58, 76,176,231, 96,112, -238,129,115,238, 18, 4,246, 48,181,228,127, 94,231,125, 36,230,211, 60, 42, 21,141,113,195,235,242,106,223, 71,231, 23,251, 54, -170,150,210,247,206,241,169,138,116,171,103,171, 92,190,167, 55,119,247,157, 61,188,146,111,157,114,113, 95,107,168, 16,213,247, - 68, 0, 95,155,208, 30, 11, 18,231,182,144,138, 42, 32, 11,124,108, 11,117,162,162, 46, 84, 65, 22,237,180, 66, 35,209, 34,200, - 74,153, 54,206, 27, 75,144,213,109,112, 30,233,214,247, 71, 73,147, 62,185, 15,239,171,146, 48,205,202,127,197, 25, 40,133,103, - 31,228,193, 95,142,155,148,188, 98,252,163, 74, 52, 75,104,139,110, 75,117,104, 71,157,168,119, 39,226, 29,148, 69, 81, 69, 34, -241, 92, 61, 92, 51,164,142,123,107,215,234,129,159,124, 30,108,151, 0,175, 99, 47, 94,239, 95, 47,155,134,118,253,148, 46, 97, - 28, 26,114,187, 58,170, 67,204,104,209, 54,191,120,122, 85, 62,248,237, 3, 7, 2,160, 46,172, 39,117,235, 86,146,114,101,139, -138,217,143, 38, 33,183,228,217,243,219,210,173, 87, 47,137,159, 52,181,244,255,117,144,208, 64, 62,180,124,249,138,159,155, 74, - 96, 4,213,187, 80,154,149, 39,113, 98, 25, 31, 57,178, 60,138, 26, 85,238, 70,137, 34,211, 77,166,231, 58,203,174,208,161,246, -132,210, 44,244,175, 59, 61, 26,155,198, 62,216,106, 90, 68,112,181,114, 20, 44,139,113,240,151,255, 41,221,162, 26, 81,165, 77, - 12, 66,105,150,229,175,206,247,126,253,217,172, 43,102,173, 39,181, 85,131,152, 73, 51,255,188,166,233,247, 1, 31, 48, 65,188, -171, 16, 95, 46, 21,138,230, 87, 59,142, 99,144, 69, 58,152,148, 31, 17,192,252,209,177,163, 60,196,100,227, 5,198, 62,195, 36, -248,108,203,102,121,190,109,179,188,216,177, 73, 73, 60,223, 57,217,174,141, 86,176, 34, 17, 20, 81,162,196, 78, 98, 15,100, 81, - 93, 70, 9,149,122,232, 1, 90,180,101,162,148,236,187,239,190, 83,108,179, 40,201, 34,208,226, 68,174,130, 44, 78,162,156, 56, -185, 2,128, 61,207, 19, 39, 90,123, 47, 1, 32, 37, 29,120,230, 21,210, 94,254,210, 38, 45,240, 92,155,148, 5,208,234,221,187, -183, 82,198,253,251,247,203,172, 89,179,148,213, 72,145,146, 21,100,226,230,167,210, 10, 64, 43, 73, 42, 55, 5,132, 80, 58, 71, -149,165, 22,208,162,170,176, 76,153, 50,135,177,161,192, 19,210, 32, 79,128, 2,207,155, 55,111,120,158, 59,119,214, 19,116, 60, - 97,151,230, 9,192,172, 72,181,192,203, 6,218,133, 13,153, 35,172, 18, 45, 21,104, 81, 53,167,130, 44,213,158, 14,147,175,236, -219,127, 64,214,174,219, 32, 27, 54,186, 43, 32,153,147,136,134, 68,235, 61,129,214,200,149, 80,231,166, 40,195, 29,133,159, 32, -209,210, 76,200,231,231, 8,104,113,224,161, 81, 41, 84,164,180,111, 83, 64,223,243,231,207, 21,245, 54, 87,124, 4,192, 4,138, -253,250,245,147, 95,126,249, 69,217, 94, 13, 99,115,135,170,237,208,240,219,137,103,218, 84,168, 80,225, 62,164,111,102,150, 19, -131,230,135,142, 29, 59,178,111,159,229, 47,255,243, 58,239, 51, 31,174,247,208,162, 93,167,130,203,203,103, 55, 61,124,159, 92, - 89,239,219,177,105, 78,223, 7,103,231, 43,210,173,110, 63,229,242,189,117,104,148,239, 79,181, 83,251,186, 36, 54,177, 31,169, - 42, 37,135, 36, 9,180,168, 50,164, 77, 22,213,133,170, 93, 22,129, 22, 19, 37, 89, 4, 89,248,238,157, 6, 90, 42,200, 90, 96, - 33,201,234, 58, 40, 55, 64, 86, 29,201,232,150,194,219, 18,100,125,235, 18, 45,238,218,229, 56, 71,169, 43, 23,169, 28, 31, 40, -201, 2,243,131,129, 44, 76,152,109,160, 6,127,136,197,215, 47, 90,109,237,224,126,120,171,255,162,164, 73, 17,227,198,203,219, - 27, 3,228, 22,236,128, 14,166, 19,153,147, 96,175,180,201, 34, 50,171,167, 60, 94, 62, 49, 32, 77,188, 24, 55, 80, 30,187,146, - 45,236, 44,244,162,225,251, 7,191,253,114,226,248,174, 32,144,149, 59,119, 86,121,243,230,150, 60,125,118, 91,238, 62,188, 43, -155,182,239,150, 40,113,146, 73,179,214,157,133,187, 17,195,192,131,175,241,209, 68,185,114,229, 82,236, 80,105, 79, 5,247, 53, -126,211, 35, 68,120, 50, 51, 66, 4, 47, 38, 72,179,158,232,148,104, 5,163,131,138,114,195, 76, 84, 2, 41, 2, 42, 91,154, 7, -107,160, 69,230, 56, 43,240,249, 26, 25,106,183, 76,206, 84, 46,110,178,172, 63, 12,253, 99,202,235,251,231,207,202,221,138, 46, -114,170, 80,180, 15,149, 99,106,131, 44, 75,160,133,115,105, 80,174,156,146,168, 66, 84,192, 22,210,250, 81,163,148,107,252,221, - 57, 73, 31,208,226, 96, 65,195,114,130, 22, 78,166, 84, 17, 81,146, 69, 67,105, 74,111,172, 65,150, 94,137, 22,237,186,176,211, - 74,217,189,167,170, 11, 39, 76,152,160, 72,133, 40, 45,163, 68,130, 0,135,187, 27, 33,225,145, 70,141, 26,189,115,162,209,247, -178,124, 84, 39,145, 54, 85, 74, 4,138, 28,236, 66, 11,180, 40,197,129, 90, 79, 81,147,209,165,197,236,217,115,164,126,231,241, -210,114,214,115, 72,180,220,148, 9,158, 19, 61,165, 64, 90, 64, 11, 3,234, 68,170, 7, 1,222, 0,170,174, 41, 64, 11,252,240, -132,164,192, 19, 3,179, 39, 85,126, 0,160,135, 0,200, 26,163,188,206,248, 47, 82, 88,132,221, 76,177, 99,198,140,233,199,126, -192,196,115, 87, 87,215,184, 78,240,207, 68,160, 69,245, 43,213,197, 4,145,150, 32,139,224,133, 32,152,109,115,252,248,113,197, -182,142,155, 22, 32,209,122,100,239, 29, 0, 76, 94,203,246, 61, 86,128, 86,218,162,205, 21, 35,123, 30, 93,160,222,166,253,159, -122, 96,167,155, 64,205, 18,244,159, 96,204, 17,208,226,202, 14,160, 85,138, 23, 47,206, 93, 92,202, 6,136,213,176,123,169,211, -164,189,228, 43, 90, 14,246, 95,173, 20,176, 69,113, 59,212, 52,138,173,217, 63, 9,180, 96,236,191, 15, 59, 96, 63, 1,172, 63, -207,157, 59,247,157,159,127,254,217,139,223, 16, 15,254,242, 63,175,243, 62,250,193, 39, 72,184,182,217,225, 41, 37, 96,244,141, -181,239,187,194,241,125,174,157, 94,235,123,229,196, 50,223,202, 37, 98,249, 94, 56, 56,195,247,220,190,201,190,181,203, 39,242, - 61,187,115,184,111,181,210,241,124, 43, 85,170,244, 44,106,212,168,231,145,191,154, 86, 63, 32,208, 34,200,154, 49, 99, 70, 91, -124,159, 10,184,178, 78, 4, 89,148,122, 57, 35,209,178, 13,178,114, 41, 32,203, 53,115,202, 16, 32,235, 91, 7, 90, 0, 85,237, -144, 30, 97,162,125, 73,201, 60, 55,149,160, 15,134,144,118, 55,104,208,224,110,224,134,159,235, 90,109,243,165,128, 86,196,136, -166, 14,203, 55,116,123,253,233,209,148,251,178, 39,174, 40,137, 64,171, 81,114, 97,122, 54,125,250,141, 49, 45, 6,121, 71, 52, - 69,180,231,138,196, 68,160,117,225,252, 49, 69,146,117,227,218, 22,168, 10,207,202,155, 87,216, 4,240,236,138, 36, 72,236, 34, - 49,226, 38,145,152,241,147, 75,241,114,213,229,128,231, 53, 57,122,234,218,191, 17,104,177,201, 38, 91,249,209,186,141,107,122, -252,104, 89, 55,183, 53,157, 91,206, 72,180, 2,129,214, 94,203,223, 48,244,183,111,243,209,252,153, 51, 14, 45, 87,172,224,195, - 10,149,107,153,253,205, 31, 3, 46,222,245,145,193,237,186,191, 41, 21, 35,114, 64,166, 40, 49, 38,235,169,149, 42,209, 82, 39, - 88,173, 95, 59,187, 14,131,189,138, 64,139, 19,174, 53,200, 34,248,226,196, 64,119, 6,214,135,150, 68, 11,187,193,252, 49,153, - 72,143, 30, 61,148, 73, 90,221, 93, 72, 48,131,137, 70,217,193, 70,224, 66,155, 45,190,135, 9, 19,176, 83, 64,139, 82, 1,130, - 43, 84,230, 85, 32,184,122, 69, 0, 23, 90,160, 69,169,200,208,161, 67,149, 58,243, 32,128,139, 17, 51,182,164,113,205, 33,229, - 43,215, 80,116,230, 44, 47,223,171, 5,180,176, 91,110,247,198,141, 27, 21,245, 32, 19, 1, 23,193, 22,120,233,137, 45,254, 39, -240,252, 16,240,221,105,117, 33, 27, 14, 32,174, 84,142, 28, 57, 40,126, 15,182,194, 45, 86,172,216,110,180,139,238,221, 54, 4, - 90,148,206, 81, 90, 69,201, 99,199,169,231,132,118, 89, 53,187,206, 83,164,142,220,196, 64,201, 22, 65, 12,193, 22, 85,116,142, -128, 22,108,180,110, 80,146,149,166, 72, 83, 49, 37,202, 35,240,243,166, 72, 51,185,107,144,137,231,214,255,169, 86,198,189,143, -122,129, 86,214,172, 89, 21, 41, 86,237,166,157,165,211,111, 83,165, 64,193,210,146,219, 37,137, 12,237,219,155, 54, 97, 18, 43, - 86, 44,197, 0,255,159, 4, 90,104,151,166,216, 25,198,193,110, 16, 82, 98,164,158,216, 76,240,128,141,197, 95,254, 15,188,254, - 27, 64, 22,243, 53,178,245,237, 3,128,174,234,213,171,215,115,168,157, 95,156, 61,121,248,249,148,145,237, 94, 77, 24,218,242, -245,174, 45,203,188,213,243,165,115,134,191, 28,209,175,222,235, 77,107,102,122,227, 91,127, 6, 53,240,115, 0,189,179, 90, 99, - 9,236, 64, 20,160, 5,233,173, 77,160, 5, 96,208,150,137, 82, 47,189, 64, 11,206,130, 50,167, 76, 23,231,205,130,205,181,131, -108,178,186, 14,114, 12,178,190,117,160,165,242,153,246,142, 4, 82, 75,151, 46, 21,168,133,173,129, 86, 12,244,219,167,148,124, -225,155,240,198,247,123, 5, 60,109,239,168,141,190,132,234, 48,113, 50,211,214, 59, 47, 23,203, 5,113,147,155, 79,163,156, 12, -216, 31,247, 6,129,214,203,218,121,111,108,202, 55,250,228,230,114,115,101,207,240, 77,146, 32,114,220,173,246,202, 74,213,225, -193,125, 30,210,164, 73, 13,153, 55,119,148,248,189,187, 1,183, 6, 55,197,235,201,109,137, 28, 61,158, 68,142,149, 88,162,198, - 77, 46,211,230,174,145,253, 39,111,201,230, 45, 7,254,173,170,195, 88,248,166,110,216,240,163, 69,137,160,234,124, 92,235,179, -228,253, 16,116,150,205,238, 46, 83,251,197,124,121,103,147,233,168,150,141,150,158, 23,124,229,121,172,109, 25,157,179,109,116, -203,152,170, 74,219,134,181, 94,223, 61,239, 41, 91,254,250, 67,186,253, 62, 49,224,175,141,151, 94,167,200, 90,250,105,156, 36, -110, 37,244, 86,158,170, 27,170, 14,171,148,171, 35,253,126, 25, 19, 34,109,217,176, 71,152,120,239,167,134, 93,116,237, 58,164, -199,119, 2, 45, 74,178, 8,128, 40, 41,114, 4,178,244, 72,180, 8,222, 56,137,219, 50,124,167,116,131, 54, 55,148,102,209,176, -153,246, 97,180,111,176,225, 50,194, 17, 91,246,114, 87, 27,221, 68, 88, 0,171, 80,219,104, 97, 66, 83,202, 68, 96, 72,251, 31, -234,200, 33, 97, 19, 72,137,148, 93,152,115,230,204,145,153, 51,103, 10,118,211, 41, 91,182,181,128, 22,238,239, 36,192, 82,237, -178,120, 14,128,230, 9,137, 24, 85,133, 53,244,182,183,101, 62,128,183, 4,160, 59,162, 93,187,118,158,152, 80, 61,173,129, 22, -165,100,127,252,241,135, 39,118,148,141,135,170, 34,169,214, 59, 84,160,133,237,232,194,100,105,252, 78,176,162, 94,231,111,253, -250,245, 21,123, 56, 26,254,218,163, 75,176,132, 73,222,107, 18, 36,169, 0,100,108, 79,242,137, 27, 7, 4,101, 23,128,111, 24, - 65,167,151, 12, 25, 50, 40,124,205,148, 41,147, 64, 10,195,237,235,244,197, 97,233, 71, 43,232, 21, 44,163,181, 68,139, 54, 48, - 5, 74, 85,149,130, 69, 42,200,119,110,110, 82,223, 45,157,116,251,161,162, 34,113,131, 68,231,107, 0, 90,182, 88,212, 25, 23, -247, 33,233, 86, 29,149, 40, 81,226, 38,164,167,248,140, 94,191,134,106,255, 53,250,207, 11,130, 41, 91, 9,160,248, 25,250,238, - 51,244,141,231, 0,155,151,181,218,158, 64, 11,223, 78, 91, 24,238,182,197,142,224, 96,210, 44, 75,144,229, 12,208, 74,159, 46, -245,246, 39,207,111,190,244, 56,210,203,151,134,239,191, 12,204,233, 80,146,245,111,176,209, 82,249, 12,163,247,118, 52,122,135, - 19,224,135,113,226,196,105,110,193,255,232,232,247, 39, 48,182, 6,112,156,227, 56, 75,205, 1,248,127, 87,163,141,244,170, 9, -131,140,225, 1,238,199, 59,160, 25,130, 94,130, 36,166,219, 47, 63,109,150, 83, 18, 67, 60,197, 36,158, 1, 17,158,143, 88,222, -118,229,130,124, 51,158,175,201, 61, 85,214, 21,248, 83,206, 78, 60, 36,241, 34,197,161,116,198,230, 65, 99,248,201,227,134,127, -252,181,127, 47,169, 89,171,138,188,124,117, 75, 30,123,221,145, 91,247,239, 74, 20, 5,100,165,144,130,165,170,201,158, 19, 55, -101, 31,128,214,160,129,163, 62,252,219,140,225, 83,148,232,220, 48,101,201,206, 79, 29,248,209,210, 37, 68,113, 41,218,185, 97, -242,226,157,159, 90,251,209,122,253,252,154, 28,220,220, 71, 22, 12, 54,157,210,218,117,168,245,221,127, 3,247,173,119, 29,234, - 7, 90,156, 32, 11,102,207,252,248,236, 78,119,217,183,112,178,204,233, 84, 71, 10,230,204,254, 60,121,214,146, 87,157, 1, 89, -100, 18, 38,174,135, 92, 25, 53,109,210, 83,102,205,220, 23, 34,237,217,125, 89,152,120,239,183, 95,103, 58, 5,180, 44, 65, 22, - 85,103,182, 36, 89,122,109,180, 8,180,104,247,165, 74,178, 44, 13,223, 9,142, 96,171,162,216,101,113,240,209,187,147,209,170, -147,236,165,106,146,110, 41, 44,128,150,115,253,200,194, 70,139, 64,107,193,130, 5,138,141,197,247,112, 6, 75,128, 64,233, 9, -125,138, 17, 56,140, 31, 63, 94,160, 10, 20, 0, 25, 5,140, 2, 44, 57, 52,134,199,253,233,216,101,233, 9,137,208, 9,218,105, - 65, 98,164, 72,179, 50,103,206,188, 23,133,180, 9, 42, 28, 21, 30,125,168, 30,192,201, 49,236,106,241,132, 65,184,231,252,249, -243, 61,177,114, 54, 19,108, 49, 97,160, 55, 83, 53, 73,191, 90, 80, 5,122,230,203,151,239, 56,234, 96, 57,224,135, 32, 79,219, - 60, 2,106, 53,130, 64,179,177,103,229,204,141,151,202, 46, 67,130,110, 53,202,128,250,203, 9,130, 97,158,180,128, 22,119,221, -148, 46, 93, 90,202, 65,133, 93,177, 98, 69,133,159,116, 15, 65, 71,165, 92,241,113, 7,106,211,166, 77,131,212,202, 0, 6, 94, -122,128, 22, 36,118, 66, 41, 41, 92,100, 72,243, 22, 63, 73,158,148, 41,164,158, 91, 90, 25,245, 93, 17, 89, 50,122,132,162,170, - 4,208,251,167,128, 22,213,191, 84,177,208,192,189, 93, 96, 27, 91,254,215,101, 59,101,201,219, 34, 69,138,220, 0,198,122, 3, -181,248,115,236, 0,126, 97, 11,112,169, 0, 11, 46, 58,158, 97, 1,243, 2, 46, 84, 94,128, 7,150, 78, 64,109, 54, 23,129, 22, - 85,131,214,134,239,214, 32, 75, 47,208,130,203,142,188,232,151,215, 95,123,223,145,251, 55,118,203,180, 57,117,222, 57, 82, 23, - 90,186,132,112,238,163,253, 54,114, 99,252,251, 9,139,141, 27, 0, 95,138,122,152, 82,114,168,105,205,220, 53,142, 5,200,101, -124, 71, 90, 19,200,103, 7, 90,241, 19,155,220,175,189,152, 40,231,197,245,211,194,119, 25,247, 39,188, 50,235,185,105,205,190, -189, 17,154,191,124, 94,167,242,193,253,155,202,207,251,180,173,247,106,137, 27, 41, 22,253,190,217, 59,162, 65,170,117,231,222, -205, 11, 48,122,191, 41,245, 26, 52,144,152,241,146, 74,172, 4, 41,229,200,153, 27,178,247,248, 85, 89,181,245,152,184,100, 42, - 42, 5, 74, 87,151,232, 81,163,114, 51,205,191,204,189, 67,199, 23, 63,141,245,252,191, 31,173,169, 23, 36, 67,222, 74, 65,126, -180,104,191,133, 58,219,243,163, 21,196,215,100,197, 58,190,168,252,235,161, 32, 63, 90,213, 6,159,148,228,217, 43, 56,229, 71, -235,219,248, 58, 28,150,210,121,207,240, 48,238,142,158, 35, 83,186, 46,121,179,184, 62,152, 63,162,239,167,237,127,142, 80, 64, - 22, 83,158,204,233,237, 74, 6,172,138, 17, 76, 21, 68, 63, 70, 4, 65,246,128,214,150,205,231,132, 73, 3,104, 5,163,201,157, - 51,148, 62, 81, 37,198,137, 87, 11,100,217,145,104, 5,163, 73, 41, 25,129, 22,165, 12,150, 32,139,210, 32, 26,177,243, 61, 42, -200, 82, 1,157, 13,117,164, 61, 53,152,226,176,148, 64,139, 59, 37,121,142,228,216,103,214,255,153,250,127,154, 22, 64,139, 0, -138,210, 42, 38,158, 91,167,209,163, 71, 11,147,106,195,101, 5,180, 66,148,147,246, 82, 24, 80,187,230,205,155,247, 8,129, 17, - 65, 16,129, 22,174,109,214,249, 49, 88,183,251,110, 24,220,122, 66,125,231, 9, 9,143, 39,128,204, 9,122,150, 71,138,137,119, - 69,195,111, 23,122,155,135, 11, 10,197, 6, 12, 3,187, 45,111,241,193,104,170, 64, 75, 85, 15, 54,234,183, 84,138,253,216, 79, -202,212,239,171,236, 68,164,180,145,160,152,234, 89, 74, 38,237, 0,173, 32,154,170, 68, 11,110, 44, 4,238, 44, 20,144, 85,165, - 74, 21,197,102,138, 32,149,246,121,180,113, 35,152,165,143,161,214,173, 91, 11, 1,174, 13,160, 21, 68, 19, 18,173,199,163, 96, -111, 72,149, 35,129, 86,193,130, 5, 5, 0, 68, 49,222, 31,208,163,187,116,170, 92, 78, 22, 0,100, 81,186, 9,199,168,130,208, - 70,202,134, 11,168, 14,173, 1,161,110,149,170,206,246, 97, 54, 75,154,173, 96, 63,118, 12,223, 6,237,117,142,225,222, 10,254, - 90,252,215, 43,201, 10,162, 9,105,193,200,225,195,135,191,132,205,224, 27,168,196, 95,194,254,240, 57,210, 11,124, 67,175, 32, -117,125, 6,251,199,103,144, 52, 62, 67,127,120,129,157, 78,222, 80, 39, 63,135,250,118, 19,222,141, 80,169,193,142, 16,117, 39, -208,162,177, 59,190,197, 32,195,119,122,132,135, 20, 87, 81, 23, 90, 38, 59,170,195, 32,154, 4, 77,217,179,101,217,250,228,193, - 41,255, 27,231,215,202,254,173,163,101,242,184,246,175,236,217,100, 89,251,221,178, 40,233,231,110, 35, 39,154,214, 97, 86,205, -114, 2,104,221,231,152,202, 49,138, 82, 44, 44,212,252,113,141,174, 55,128, 73,109, 30,193,104,134,147,234,208,146,230, 29,188, -213,122,215, 97,187,209,115, 26, 61,153,254,114,239, 19,211,133,149,162, 36, 0, 45, 83,139, 87,194,212,236, 79,159,251, 45,170, -118, 39, 48,226,194, 65, 61,108,213,189, 80,129, 60,185,222, 92,191, 12, 91, 89, 44,198, 82,164,203, 42, 81,227,165,146, 67,167, -111,203,110, 72,178,220,242, 85,148, 60,197,170, 74, 38,215,204,111, 65,228, 95,231,176, 84,149,104,165, 46,213,217, 43,129, 91, -249, 87,137,147,165,253,208,173, 91, 55,101,188, 92,189,122, 53,121,238,200,143, 86, 16, 63, 85,137, 86,138,226,157,189,226,103, - 34,157,244, 31,168, 97,161,201, 6,125,177,105,208, 9,175,190,253,237,209,201,229,154,238, 90,199, 90,229,223,173, 24,214, 77, -214, 12,237,162, 0,172, 49, 45,190,151,242,249,179,121,231,115,203, 56, 92,103,141, 66, 0, 45, 2,152,150, 63,245, 87, 36, 86, -214,105,204,232, 69,194,164, 94,215,227, 25,158, 64,139,246, 5, 42,200,162, 4, 67,235,208, 2, 69, 4, 90, 28,104, 72, 87, 13, -179, 67, 23, 14,106, 12, 69, 74,229, 40, 73,209,216,201,104,111, 64,219, 75,131,104,218, 13,113,167, 32, 13,182,193,203,189, 78, -243,211, 2,104,177, 28, 44, 15,165,107, 44, 35,203,204,242,211,240,157,170, 84, 2, 68,110, 16,160,161, 60,237,192,180,128,150, - 90, 22,128,153, 20,152,168,134,193,248,251, 4, 0, 11,129, 22,183,250,235, 57,130,213, 29,239,219, 78,144,133, 85,177, 39,212, -111,199, 64, 51,183, 53, 17,228,201,194,123, 4, 89,129,190,181,118, 56,154,112, 9,180, 88, 39,214,141,253,132,245,226,230, 2, -110, 40,160,207, 48,130,100,170, 11, 41,149,100, 10, 84, 29,218, 5, 48, 4, 90, 80, 95,120,161,140,130,221,116, 10,200,162, 10, -146, 97,119, 84,245, 35, 55, 66,112,131, 4,109,179,160,230, 82,182, 48, 59, 2, 90, 80,195, 28,133,244, 78,177, 21,163,221, 24, - 13,247,105, 7,195,231, 56,248,176, 76, 52,226, 87,164, 92, 0, 88,148, 60,210, 57, 46, 0,215, 81, 71,117,215,211, 0, 58,242, - 88,182,209, 26,130, 42, 0,149,211,252,133,125,222, 53,254,194,238, 80,249, 15, 90,192, 23,186, 14,235, 62, 95, 10,252,217,130, - 29,149,222,168,235,107, 72,182, 94,162,109,158, 67,130,245, 28,210, 86,111,216, 20,190,196, 38,129, 23,176,245, 34,128, 47,101, -231, 13, 54,129, 22, 37, 90,234,238, 66,130, 44, 26,190, 91,131, 44, 7, 18,173, 32,154, 41, 92,162,183,204,146, 35,225,219,223, -251,215,253,176,116,118,119,255,202,101,179, 95,143, 25, 61,242, 86,218,108,233, 9,207,163, 49,137,235, 98,154,131, 76,154,160, - 40, 20, 47,208,164, 9,105,214, 88,168,204, 95, 96,145,240,158,139, 21,168, 20,185,211,206, 30,200, 98, 17, 52,105, 34,143, 94, - 41,151, 90, 37, 45,154,145, 35, 38,136,115,185,167,231,142, 15,173, 31,158,144,180, 87, 55, 73,156, 13, 7,247,167,234,246, 70, -106, 76,242,149,154, 67, 78,251, 71,140,158,144,106,104, 58, 73,213,162, 89, 24,210,170,251,147,198, 78, 48, 79,255,115,158,148, -253,190,174, 28, 60,113, 85, 70,252, 49, 67,242, 23, 41, 23, 16, 61,106, 52,126, 3,255,202, 16, 60,129,140,137,129, 69,225, 21, - 2, 35, 74,244,105,207, 59,100,200, 16,201,244,183, 31,173,103,216,117, 72,199,197,182, 14,235, 54, 34,157,203, 92,128,210, 68, -130, 82,122,238,202,215, 65, 39, 20,221,248,171,124, 68,245,163,101,233, 79,203,113, 65,115,185,165,247,204,151,205,245, 73,126, -166, 44, 25,189,242,102,206,112, 39,127,214, 12,251, 51,103, 76,165, 87,250, 18,226, 3,100,220, 66, 2, 34, 78,140,122,147, 86, -172, 67,250,175, 34, 8,162, 36, 75, 15,200,210, 35,209, 98,128,104, 2, 56, 53,241, 29,106,162, 45,150,154, 8,216,212,132, 21, - 95, 88,130, 74,235,229,233,255, 59,118, 32,208,114, 22,100, 49,166, 34,202,239, 76,172, 67, 26,176,103, 69, 26,143, 68, 71,128, -122, 14,107,128,205, 0,210,219,145,118, 1,100,213,181, 71, 0,247, 28, 5,154, 14, 70, 19, 6,188,135,208, 62,247,212,132,246, -185,103,153, 88, 71,203, 68,112,137, 54, 58,100,245,238, 32,154, 42,208,162, 4,138,142,251, 8,126,184,227,148, 17, 1,104,143, -199,193,131, 0,201, 50,113, 96,162,225,186,149,234,208,178,156,185, 9,182, 80,214,199, 52, 56,134, 42, 70, 73,184,246, 12,160, -238, 45, 0,198,123, 36, 63,216,102,189, 5, 32,121, 70, 73, 86, 32,200,178, 6,162, 90,147,142,158, 54,177,206, 99, 73,147,225, -117, 86, 35,205,183,146,100, 49,206, 25,183,105,235,117, 88,104,175,156,165,160, 42,222, 10, 62,122, 67,210,248, 10,146,213, 87, - 63,252,240,195, 11,236, 54,221, 2,218,246, 0,150,221,201, 17,109, 94,149, 82, 45, 38,180,177,195,132, 60,181,108, 48, 39,168, -156,185, 10,199,127, 55,102,126, 78,113,205, 18,247, 77,188, 56,209,182, 82,141,168, 7, 96,217,176,209,250,220,109, 20,154, 54, -214, 51, 57,218,163, 27, 3,124,246,230, 38, 27, 44,106,180,252,238,233,169,123,120, 3, 45,150, 59, 67,196,132,241,207,149, 29, -247,251,219, 54,167,183,203,208,115,215,111, 53, 24,123, 77,242,213, 31,239, 19, 33, 70, 34,250,122,203, 96,239,123,183, 81,105, -203,160,210, 79,255, 99, 65,165,199, 17, 96,113,225,207,241, 45, 23,108, 84, 71, 68,138, 36,247, 97, 51,250, 16, 9,131,192, 11, -157, 64,107, 28, 23,150, 92,232,114,220,204,173,159,142,174,190,141, 14, 84, 8,169,106, 96, 42,140, 95,108, 53,149,178,129,255, -203,227,151,215,212,251,252, 45, 98,117, 63,138,174, 23,133, 62,147,125,207,240,161,167,169,235, 73,235,201,241, 44, 6, 70,234, -249,117, 39,124,228,214,222,162,131,209,196,253, 19,182,128,143, 37, 8,178, 62,119, 2, 20,233,170,164,206, 78, 24, 22, 90, 33, - 39, 29, 0, 45,151,100,201,142,112, 39, 29, 19, 13,189,173, 19, 38, 25,122,125, 14,150, 80,247, 71,137,147, 36,217,107, 81, 24, - 61,131,164,179,101,255,230,104, 18, 44, 97, 85,235, 9,160,227,165, 38,170, 64,212, 4, 80,224,165, 38, 74,177,130, 82,204,152, -176,197,117, 24, 84,218, 89,222,133,101,114,116,230, 93,182,218,136,182, 88, 84,181,208, 86,139, 54, 90,206,218,102,105,181,123, - 41, 0,205,181, 0, 93, 12,185,164, 5,176,236, 2, 45,103, 42,169,245,109,166, 76, 27,195, 61, 79,145,248,239, 40,217,114, 6, - 96,253, 7,128,150, 9, 99,199, 56,164,195, 24, 99,181,108,178,180,218,221,100,199, 97,169,163,166,212,164, 25,248, 48,109, 70, -219,152, 18,196,221, 96,138,155,240,154, 41, 90,226, 13,202,127,219,182,164,122,105, 58,211,197,190,117,154,244,127,165,108,205, -231, 2, 51,135,201,228, 63,205,194,143,214,140,191, 61,195,235,145,104,133,133,142, 46,126, 19, 68, 33,163,162, 66,198, 34,184, - 31,254, 87,225,175,197,255,160,251,188,198,252, 86,247,131,188,208,235,122,161,243,153,156,183,209,114,254, 29, 54,159,248,214, - 59, 97, 88,216, 96,212, 61, 44,220, 11,249,172,193, 79,131,159,225,197, 1,163, 47,133, 23, 39,255,166, 99,240,211,224,103,248, -114,192, 6, 53, 21,104, 57,250,181,188,103, 39,223,103, 47,231, 63,241, 2,227, 3, 12, 95,174, 27,252, 52,248, 25, 94, 28, 48, -250, 82,120,113,210, 0, 27, 70, 95, 50,250, 82,248,114,192, 9,160,165, 74,185, 84,181,161, 42,205,178,148,128,169,215, 62,115, - 33,237,199, 58, 12, 92,141,240, 67,177, 78,206,148,201,214,243, 90,215,180,232,107, 61, 31,154, 50, 27, 52, 67,182,179, 35,158, - 24,109,100,159, 3, 70, 95, 50,250,146,222, 62, 96,124, 71,198,119,100,139, 3,122,251,143,101,190,127, 75, 95, 82,235, 97,143, - 7, 33,234,249, 13, 72,180,190, 14, 27, 45,173, 30,162,243,190,177,122,210,201, 40,157,217, 12,126,234,100,148,206,108, 6, 63, -117, 50, 74,103, 54,131,159, 58, 25,165, 51,155,193, 79,157,140,210,153,205,224,167, 78, 70,133, 53,155, 13, 27, 45,197, 38,203, -158,186,240, 31, 80, 29, 58,148,104,217,172, 63, 98,108, 71,186,127,127,101,194,167, 79, 55, 39, 99,226, 57,175, 57,201, 44,163, - 19, 58,201, 48,141,236,223, 42, 63, 25,174, 71,111,200, 30,123,121,191,213,186,135, 71, 15, 48,234, 30, 30, 92,252, 63, 13,131, -159, 6, 63,195,139, 3, 70, 95, 10, 47, 78,106,208,177,218,117,200, 29,136,234, 46,195, 10,129,106, 67, 94, 83,119, 38, 90,158, - 7,221,255, 66, 69,213,247, 26, 2, 42,130,171,199,143, 23,149,121,252,120, 65,135,191,211,162, 50,188,230, 36,216, 10,234,132, - 73, 92, 92, 24,190, 37,200, 29,130,195, 93,129,200, 11,156, 26, 41, 88,250,119, 12,146,122, 1, 71, 88,192,134,222,119, 88,138, -110,245,117,140,192, 92,140,115,152, 51,103,206,118, 8,179,178, 0,142, 46, 59,216,136,123,104, 57,248,140,140, 16,193,244,137, - 9,143,143,212,120,145,163,188, 90, 3, 90,102,236, 4,156, 4, 23, 9,123,152,120,142,119,101,254,151, 2, 87,173,246,162,207, -163,198,112, 29,177, 29, 59,114, 95,227,188,155,141, 7,180,248,169, 62, 66, 63, 68,125,224,189,255, 52,194, 15,249, 96,199,224, -105,252,239,139, 20, 69, 15,205, 65, 93, 82, 20,219,183,165,241, 22,254,218, 42,244,160, 30, 41, 18, 31,217, 86,111,210,136,142, - 41,237,121,159,118, 84, 78,238,138,100,249,152,120,174, 55,192,185,222,186,179,200,172,103, 29, 36, 58,110,228,175,173,122, 51, -159, 30,154, 69,145,143,158,202, 55, 35,149,213,106, 68,157, 52,117,144, 9,150, 69, 79, 57,213, 7, 98, 99, 71,243, 52,164,251, -112,179,195,152,129,169,237,188,204, 25,154,122,203,107,143, 38,219,154,125,233,231,192, 95, 75, 63, 89, 90,180, 29,150, 19,187, - 43,171,161,174, 91,177,211,114, 43,207,181,136, 5,222,255,146,117, 15, 42, 18,220,195, 76,132, 83,241,183,244,214, 79, 55, 68, -150,238,135,108,236,170,215,219, 63,117, 86, 57, 40,219,231,168,187,179,101,248,154,242, 59,183,235,144,210, 43, 2,171, 51,167, -122,254,181,121, 83,249,151, 76, 60,231, 53,222, 75,158,181,118,218, 52, 5,234,109, 78, 95,184,241,227,100,121,234,124, 76, 93, -160,193, 99,151, 60,117, 54,243,186, 85,173,131, 26,130,192,202,255,205, 21,241,125,126, 72,204,190,119,130,124,170,216, 58, 81, - 28,138,134, 2,104, 37, 76,232, 26, 55,118,138,156, 3, 18,164,205,115, 48, 94,154, 28,111,226,166,202,241, 38,126,234,188, 7, - 99,167,200, 49,136,247, 28,180,136,102,135,201,154,216,148, 60, 75, 98, 83,247, 44, 73, 76, 30,252,229,127,141, 22,182,166,169, - 23,112,132, 5,108, 88, 62, 59, 86,103, 15,212,172,187, 37, 29, 12,184, 9, 17, 46,101, 57, 60,241,111,132,131, 84,119, 56, 34, -221, 88,171, 86,173, 21,184,158,210, 34,159, 74, 51, 25, 1,150,218,198, 56, 15,192,160, 48, 25,237, 59,210, 58,241, 58,239, 91, -228, 37, 48,179,148,130,217, 45, 39,182,142, 55, 42, 92,164,184,231,222, 3, 71,175, 94,185,118,251,225,133,203, 55,111,111,220, -186,243,120,174,220,121,142,241, 94, 40,219, 61, 2, 2, 35, 55, 4, 96, 91,138,116, 54, 48, 45,229, 53,208,115, 52,161, 7, 43, - 39, 6,192,125,140, 45,233, 76,194, 51, 7,236,125, 71, 58,218,180, 30,226,211,189,165, 3, 84,122,176,103,156, 75,240,154,193, -160,173, 15,107,126, 42,128, 10,245, 60,141,182,240,129, 43,139, 83,248,223, 31, 3,250,158,191,254,250,235, 38,188,235, 63,131, -195,213,183,112,188,250, 24,190,118, 46, 5, 6,148,182,158,228, 66,180, 81,215, 42,201,183, 28,219, 57,226, 45,127,109,149,253, -183, 14, 25,123, 28,222,217,243, 22,127,157,156,196, 35, 34, 92,207, 20,132,119,122,139,137,229, 25,210,211,192, 73,135, 19,207, - 19,240, 80, 73, 0,136,182, 98, 39,234,233,243, 89, 81,158,177,120,254,197,136, 17, 35,148, 40, 3,244, 49, 4,160, 73,159, 66, -252,182,120,223,242,208, 67,115, 29, 66, 96, 5, 48,138, 5,248,171,199,249,175, 37,205, 44,120,217, 34, 36,198,157, 84, 53, 11, - 4,107,164,195, 20, 4,220,224,149,127, 58, 22, 64, 15,113,237, 55, 29,237,110,183, 75, 1,164, 47, 89,187,118,237, 71,250,234, -163,115, 96,252,223,239,100, 27,217,163,221, 18, 46, 84,206, 51, 74, 2,248,201,246,105,109,227,155,178,230, 39, 65, 94, 75,180, -199, 82, 68,106,112,135, 3, 92,119,248,177,115,135, 51,213,165,188,142,100, 15, 4,234,110, 35,130, 44, 56,126, 86,162, 83, 0, -104,217, 13, 70, 29,138,118,183,203,227,208,240, 19,237, 59, 9,206,133,223,112,172,132, 19, 96,161, 3,109, 70, 40, 81, 29,104, -219,112,200,205,215,232,233,159,225, 90, 78,103,137,253,139,242,107,185, 67,249,187,170,127, 75,179, 22,116, 32,192,122,251,246, - 50, 60,141, 95, 22,158,243, 26,239,165, 47,210,216,179,231,136,249, 1,199,206,223,145, 71, 47,222, 11,127,219,246,255, 43, 32, -121,190,122, 12, 22,108,179, 99,179,241, 9,178,228,209, 32,185,180, 46,161, 60,123,245, 94, 6, 46,185, 38, 21,122,122, 72,177, -214,139,164,241,239,107, 64,235,173, 50,207,134, 6,104,197,118,201, 92, 54,110,202,220, 79,219,245, 26,107,222,114,120,171, 92, -186,125, 70, 46,222,186, 34,107,182,157,144, 86,221, 71,155,227,165,202,253,148,121,156,233,216,249, 83,152, 98,102, 78,108,106, -156,221, 37,194,182,118, 85,115,126,218,247,103, 71,121,177,127,146,236,155,214, 86,186,213,206,245,137,215,121,159,249, 52, 6, -180, 16,128, 3,222,199, 15, 33,188,203, 30,203,196,107,161, 5, 27,120,191,242, 14,179,217, 79,225, 33,233, 32,182,222, 86,240, -178, 23, 38,121, 71,177,170,108,126,128, 24,205,163, 65, 36, 82,188,105,236,216,117, 27, 69,137,210,158,169,113,236,216,245,139, -166, 73, 51,226,193,253,251,155,225,117,222, 29,158,230,221,225,128,210,125,203,150, 45, 27, 17, 66,165,139, 5, 15,108, 2,173, -136, 17, 35, 4,192,235,248,118,120,126,119,183, 78,188,206,251,161, 0, 90, 89,138, 22, 43,113,226,245, 27,159,247,247,110,223, -245,254,189, 75,255,237,125,251, 12,223, 56,107,225,218,173, 7,143,157, 61,146, 45, 91,206, 35, 40, 23, 39, 41, 91,135,189,193, - 39, 45, 38, 66, 79, 0, 21, 51,189,202,211,195,190, 26,146, 2, 32,243, 61,239,129,152,245,162, 66,165,111, 13,180,188, 46,239, -218, 38,247,207,156,148, 59, 39,142, 42, 30,252, 57, 48, 50, 93,216,234, 46,103, 54,172,145, 83,171,151, 43, 94,253,153, 24, 87, - 46, 99,198,140,156, 36,117, 79, 16, 22, 25, 83, 66,210,232, 79,143,204,171, 86,173, 82,130,140, 35,140, 18, 1,107, 39,141,254, - 25, 25,225,111,118, 13, 26, 52,232,218,174, 93,187,188,224,213,217, 7,161,151,238,195, 35,254, 3,128, 12, 31,180,175, 25,206, - 70,205,168,187,185, 77,155, 54,102,132,115, 50, 55,107,214,140,146,173, 62,246,202, 73, 9, 86, 55,128,171,250,223,151,148, 55, -175, 30, 10,127,249,223, 82,178, 85, 5,161,158, 58, 87,207,253,244,252,137, 69,159,248,203,255, 26,229, 84,111, 99,174,137, 56, - 5,177, 13,189,217, 95, 24, 98,137, 7, 39, 27,203,232, 8,116,142, 76,159,125, 58,105, 90,102, 27,245,243,207, 63, 43,222,252, -217,246,164,163, 38,134, 75, 98,104, 18,198,190,196, 3,163,108,244,121, 59, 93, 77,185,236,110, 1,180,172, 35, 31,104,245,207, - 21, 55,111,222,148, 49, 99,198, 88,134, 51,217, 67,208,198,132,135,247, 4, 18,104, 73,231,186,140, 8, 1, 32,227,143,107,214, -139, 2,189, 19,110, 36,128,215, 87,156,188,201, 83, 70,155, 0,248,176, 23, 43, 84, 47, 77,150,101, 58,163, 42, 48, 68, 22, 35, -100, 32, 52,151, 32, 66, 0,203, 63,215,170,172,150, 52,155,163,239,185, 31, 62,124,216, 29,223,143, 59,154, 58, 40,193, 89,181, - 59,192,160, 59, 34, 56, 80, 82,232, 48, 62, 42,238, 59, 44, 39, 37, 89,160,237,137,114,121, 2,168,238,129,147, 97, 15, 56,175, -214,114,214,171,183,238,142,250,133,245, 61, 71, 52,199,160,223, 63, 87,199, 73,240, 69, 9,115,195,254,169, 30, 6,208,114,134, -213,225,154,215, 57,137,150, 22,208, 74,154,179,166,188,120, 27, 32, 47,223, 73, 80,226,127, 94,183, 55,240,178,241, 41,201, 34, -200,186,117,114,136,220,127,230, 35, 21,123,178, 95,255,125,100,174,210, 95,110, 61,126,173,156, 99,112,252, 16, 45, 70,140,113, -166,168, 81,107,153,210,166, 77,174, 72,183,254,127,132,232,132, 4, 80, 25,242,148,246,221,142,112, 54, 94, 47, 94,203,189, 39, -207,229,240,185, 51,114, 4, 0,240,248,197, 71,114,232,236,121, 89,180,113,177,184,230, 47,249, 46, 86,146,204,182,188,176,135, -160, 9,201,213,252,182,149, 51,191,223, 59,181,181,188, 4,184,242, 61, 62, 43, 68,122,178,107,156,108, 28,217, 80,154,150, 73, -247,158,249,237,213, 29,215, 9,130,130, 64, 4, 1,197,166, 77,155, 14, 1,108,236,177, 76,188,102, 5, 54, 2,248,172,206,193, - 92,121,135, 10,180,212,119, 44, 92,184,112, 79,169, 82,165, 60,192,211,146,118,186, 84,136,186, 55, 53,153,210, 55,141, 30,189, -205,206,105,211, 90,121, 63,120,208, 22, 51, 88, 71, 32,184, 78,247, 46, 93,234,216,237,231,159,143,156,221,181,235,236,149, 51, -103,118,115,224,131, 71, 97,119, 4,216,118,207,147, 39,207, 98, 59,229,164,148, 45,128,229, 1, 64,185,100, 33,201, 90, 78,176, -133,255,203,213,107,188,207,124,204, 15, 90,214,106, 70,155,131, 15,212,132,211,119,237, 61,116,249,222,237,123, 47,110,156,191, -232, 53,229,247,145, 59,166,142,153,182,121,236,228,249, 43,150,175,219,177,110,201,202,117, 27,153, 71,111,221,145, 47, 45,192, -137, 23, 87,138, 28,188, 56, 25, 48,156, 15, 61, 30,211,123, 50,195,232, 44, 94, 48, 95,210,164, 74, 69, 48,100, 11,108,133, 0, - 90,247,207,156,146, 46,113, 76, 74, 82, 39, 70, 78,132,234, 53,254, 50,166, 28, 19, 39,181, 76,153, 50,133, 22,104,213,101,156, - 50, 2, 45,172,244, 95,161,124, 4, 66,169,116,212,189, 15, 66,226, 92, 93,180,104,145,185,101,203,150,230,186,117,235, 42, 9, -222,157,205,152,196,222, 99,226, 54, 67, 50,102, 6,120, 51, 35,216,184,185, 70,141, 26,102,132,214,184, 9,143,246,148,122, 89, - 30, 65,117,167,186,144,146, 44,130, 44, 30,252,229,127, 94,167,154,144, 18,172,182, 63,228,125, 54,126,104, 55,241,247,123, 35, -227,134,116,149,214, 63,228,123,198,235, 84, 39, 58,232,243, 84, 17,142, 67,249,158,168, 99, 7, 64,161,210, 46,140,107,201,182, - 98,244,131, 7, 15, 30,168, 82,152,208, 0, 45, 47, 2, 12,130, 97, 70,156, 80, 67,124,241,151, 33,174, 8,182,216, 63, 80, 14, - 47, 59,229, 44, 9,144,115, 23, 19,162, 88, 38,134,116, 42, 83,166,140,146, 24,172,156,161,157, 8,216, 24,230,169, 80,161, 66, -111, 64,171,136, 61,126, 2, 88,206,219,183,111,159, 82,101,130, 64,228,235,137,116,148,101, 98,194,249, 97,164, 44, 0,218, 62, -140,186,193,208, 94,232,247,182, 36, 80,186,129, 1, 66, 98, 29,103,127,100,228, 13,134,186,106,219,182,237, 43, 70, 56, 0, 0, -219,141,119,209,240, 87, 61,244,208,100, 48,230,233, 44, 59,121, 55,115,230, 76,133, 7, 24, 59,148,242, 51, 96, 59,238, 83,178, -101,139,230, 34,130, 43, 68,254,112, 71,187, 4, 3, 90,252,143,246,160,100,157, 64,139, 18, 63, 71,135,163,114,166, 67,168,177, -221,140,233,138, 80, 94,158,168,175, 39,192,165, 39, 36,104, 90,146, 45, 61,117,215, 40, 86,136,219,118,105, 66, 93,248,127, 68, - 5,166, 48,196,205,189,123,247,148,113,195, 0, 90,206,178,249, 31,206,175,165, 58, 36,160,122,250,230,147,220,122, 98, 22,175, -215, 31,229,200, 21,111,153,185,233,170, 45,160, 21, 84, 19, 2, 45,118,132, 91,143, 94,203,205,135,175,228, 6, 82,169,214,115, -101,132,251, 91,105, 60,253,153,164, 43,249,179, 92,190,171, 44, 80, 5,158,106, 17,179,238,116, 0, 68,196,239,176,178,240,143, - 27, 47,158,181,119,248, 32,186, 84, 9,198, 79,147,235,217,182,163, 59,101,219,137,197,178,247,212, 78,121, 4, 16,119,253,190, -183,236, 63,117, 79,254, 88, 56, 75,126,250,181,186, 12,155,214, 69,166, 46, 24, 33,201, 50,103,127,149, 32, 65,134,120, 90, 44, - 6,112, 82,202,242,225,249,117,241,187,178,197, 38,208,122,119,126,181, 60, 58,182, 66,142, 46, 25, 32,204,239,136, 38, 6, 74, - 56,220,253, 27,112,228,203,151,239, 46, 2, 13,239,177,149,120, 79, 5, 27,120,198, 81, 64, 79, 91,175, 27,197,119, 48,129,223, -119, 48,168,237, 65, 44,189, 61,136,171,200,119,121, 88,169,247,108, 22, 23,203,183,180, 93, 50,101,250,217,231,201,147,118,126, - 0, 89, 15,215,172,169,127,115,202,148, 58, 7,135, 15,111,212,165,113,227, 37,231, 78,159, 62,245,234,197,139,179,238,243,231, -159,155, 51,117,234, 46,138,241, 17,159,143, 18, 45,170, 52,108, 30, 84, 11, 82, 98, 69, 64,165,102,224,121, 32,208, 10,118,141, -249,152, 95,171,125,212,251,152, 76, 14, 92,184,116,227,222,168,190,195,118,205, 26, 49,126,207,138,153, 11,119,173, 93,229,190, -109,229,198, 93,235,150,111,220,181,228,232,201, 11, 27,152, 71, 39,189, 8,148, 86,113,224,130,228, 65,145,102,112,162,101, 12, - 69, 6,149, 30, 60,120,176,252,218,179,135,204,153, 60, 73,230, 77,157,194, 56,135,148,108, 57,180, 11,162,237, 4, 37, 89,150, - 64,139, 32,139,193,201,173,129, 22,227, 83,114,192,116,115,115,179, 6, 90, 58,139,111,202,207,137,123,239,222,189, 2,251, 57, - 74,178,104, 19,164,121, 64,189,122, 10,161, 86, 30, 67, 74,101, 70,208,108,179, 10,184, 42, 87,174,108, 6,112,243, 71, 0,109, -243,202,149, 43,205,249,243,231, 55,131,190, 25,125,201,140,120,143,175, 81,127,130, 3,155, 7, 37, 87, 84, 23, 90, 74,180,248, -159,215,105,147, 69,117,225,185,227,139, 63, 17,100,241,224,239, 89,252,231,117,222,183, 67,150,188,142, 12,117,225,223, 43,178, -192,131,113,213, 8, 66, 40,117,100, 16,120, 21,100, 17,212,162,159,217, 2, 90, 90, 60, 81,198, 42, 85,154,201,208, 94,170,196, -145,225, 69,166, 77,155, 38, 12, 77, 3, 34,150, 64,203,146,230, 12,130, 7,235,131,224,141,129,154, 25,115,148,160,154,253,128, -253,140,253,141,113, 47,161, 10, 93,232,160, 96, 9,208,151,174, 19, 68, 18, 0, 50,230, 38,218, 71, 42, 85,170,164,196,230,100, - 80,242,114,229,202, 41,177, 51, 9,180,138, 22, 45,106, 6,173,108, 90, 21,117,112, 63, 7,192,172,247,230,205,155, 21, 32,196, - 50,114,225,193, 58, 96,209, 17, 0,233,143, 30,213, 39,219,107, 44, 22,121,190, 80,117, 41,227, 58,165, 89, 3, 7, 14, 36,239, -168,242, 75,143, 52, 31, 65,198, 21,137, 25, 64,205, 5, 59,229, 81,128, 22,213,133,148,164, 19, 92, 49, 65,250,171, 72,185, 32, -137,117, 71,255,212, 3,180,236, 85, 87, 1, 89,104, 99, 79,244, 31, 74,178, 61, 17,152,222, 19,241, 72, 61, 25, 58, 42, 12, 60, - 12,247, 71,169, 30,103, 31,160, 36,139,146, 64,124,171, 10,240, 87,165,228,236,167,118, 36, 90,154,101, 41, 83,198, 20, 57,187, -107,194, 31,139, 23,116,221, 83,172, 64,198, 3,217, 92, 19, 52,113,117, 53, 69,211,124,208,200,160,114, 32,127,224,137,101,204, -195,255,115,135, 43, 96,254, 83,127,181,140,225, 9,180, 30,120,127,148, 69,123,158, 72,143, 25,103,164,124,143,173, 82,243, 87, - 15, 93, 64,235,210,157, 23,114, 17,233,194,237,231, 82,176,254,152, 32,160,149, 34, 95, 61, 57,125,253,169, 50, 54,101,118,203, - 40,251,118, 44,146,123,183,206, 97, 53,229, 67, 61,254,125,123,109, 73,155,172,190, 19,250,125,244,188,186, 79, 6,206,105, 44, - 30, 71,214,200, 75, 31, 63, 57, 7, 90,251, 79,223,147,214, 3,234,202, 79,253,154, 72,189,206, 53,100,252,204,126,210,162, 75, -189, 79,113,147,231, 28,170,213, 55, 84,160,245,254,244, 98,249,244,206, 91, 62,249, 60, 17,191, 91,123,229,221,201,249,242,238, -234, 54,121,126,237,176, 92,217,187, 84,214, 14,169, 45,107, 7,215,214, 4, 90,124, 31, 86,130,195,176,114, 59, 4, 85,204, 30, -172, 76,198, 91,151,129,215,120,143,121,152, 87,171,140,118,238,171,198,240,145, 0, 88, 10,103,201,146,101, 25, 6,141, 61,144, - 76,236,129, 10,241,119, 71, 52,169, 46,108, 22, 61,122,107, 44,137,219,189,244,244,108, 62,189,121,243,182,217, 93, 93,207,101, -202,144,225, 69,177,162, 69,189,123,117,235,118,239,230,217,179, 39,111, 92,188,120,242,216,193,131,103, 38, 13, 24,112,246,143, - 81,163,182, 64, 2,180, 12,118, 65,118,109,214,236,129, 42, 91, 64,203,250,154, 22, 15, 16, 55,112,211,185,139,215,111,204,152, -181,108, 39, 84,135, 15,119,110,217,181,239,208,145, 83,123,159,191,120,117,111,207,129, 83,171,142, 28, 63,187,156,121,180,232, -240, 62,237,175,176,210,254,160, 6,228,102, 95,228,196,200,201, 21,131,185,244,235,222, 85,186,183,108, 33, 93,126,172, 37, 43, -167, 77,150,159,126,172,253, 62,208,102,203, 46,121, 2, 45,170, 11, 85, 73,150, 37,184, 34,144,227,132,203,247,245,119, 77, 38, -131,242,102,146,195,139,230,132, 5,104, 65, 8, 28,117, 19, 37, 60,156,188, 96,188,254, 10, 5, 67, 84, 13,199, 7, 6,111,159, -197,139, 23,251,192,214, 78, 1, 89, 4, 84,136, 69,104, 46, 89,178,164, 25, 65,159,253, 32,149, 81,212,134,144,188,152, 33, 29, - 53, 67, 90, 99, 70,192,233, 43,176,211,178,150,104,133,120, 17,213,133,148,100,245,248, 33,197,238,227,187, 26, 78, 92, 48, 62, -119, 74, 74,172, 40,185,234, 88, 45,247,211, 32,137, 22, 36, 91,144,104, 61,229,117, 7,134,241, 10,208,162, 84,133,224, 23,101, - 22,214,149, 96, 0,253, 70, 81, 67, 89,130, 44,242, 54, 20, 64,139, 18, 51, 5,104,145, 38, 19, 37,101, 4, 47, 12,180,203,126, -192,180,117,235, 86, 71, 64, 43, 31,128,206,107,107,137, 22,131,134, 83, 58,132,197,137,128,215, 2,201,160,192,116, 64, 9, 94, - 14,158, 19, 92,107, 25,200,187, 98, 33,246,138,160, 68, 85,147,146, 30,251, 15, 65,155, 10,226,184, 32, 0, 45,107,181,174, 86, - 55,176,188,159, 13,210,182, 23,156,180, 25,172,157, 18, 40, 6,107,191,116,233,146,156, 63,127, 94,137,137,135, 54,184,171, 65, - 48, 34,190,141, 13,180, 19,100,255,231, 65,181,248, 31,127,252, 33, 88, 64, 82, 5, 25, 53,240,249,148,148,232,241, 40, 91,182, -172,189,197,170, 2,180, 84,115, 3,148,197, 29, 18, 39,247, 46, 93,186,184, 3,184, 41, 9, 96, 91, 5, 90,212,126,204,198,184, -247, 20,191,189,237,149, 17,224,175, 54,190, 77, 15,140,179, 43, 85,144, 5,213,172, 39, 2, 42,123, 66, 93,184,157,146, 44,204, - 59, 30, 0,191, 83, 49,142,122, 98,124,187, 4,213, 41, 23,108, 85,156, 97,100,120,231, 69, 89,158, 18,168,179, 95,210,110,144, -106, 67,130, 96, 53,118, 48,239,161,207, 63,115,230,189,110,110,113, 18,103,115, 75,212,175,118,245,210, 79,166, 79, 25, 43,235, -215, 98,225,178,107,189, 76,159, 60, 76,234, 84, 47,245, 50,123,150, 36, 35,179,166,143,111,207, 84,194,153, 87,105,230,181,198, - 34,154, 15,124, 93, 25,172,253,104, 5,183,213,178, 85, 57, 71,238, 29, 8,180,238,120,189,151, 5,187, 30, 75,183, 63, 79, 75, -217,110, 91,164,122, 63,125, 64,235, 20, 0,208,242,141, 59,165, 67,199,206,242,125,213, 90,210,109,226, 78, 69,162,149, 40, 75, - 69, 57,124,225,129,242,193,101,114, 77, 39, 19, 71, 54,151,141,171, 38, 66, 13,112, 83,226, 37, 72,128,208, 98,182,143, 84,185, -114,157,112, 63,176, 66,150,110,159, 34,155, 15,173,151, 27, 15,188,229,244,213, 39,178,219,243,174,172,222,117, 69,166,175, 62, - 41,131,102, 30,144,110, 19,182, 75,203,158, 77,228,183,209,253, 37, 94,234,124,180,219,113,120,168, 64,235,229,162, 90,242,114, -201,143,226,123,104,162,124,244,190, 45, 18,240, 73,238,156,218, 33,235,134,213,149,201,245,147,201,164,186, 73,100,213,239, 85, -117, 1, 45, 76,104, 46, 88,129,238,160,186, 16,182, 46,123,240, 65,228, 85, 11,193,115, 94,227, 61,230, 97, 94,173, 50,234,185, -143, 15, 51,135, 74, 23,131, 52, 3, 7,219, 61,234, 71,137, 82,100,235,248,241,173,252,158, 60,105, 59,179, 69,139, 54, 46,152, -128, 1,252,252,253,253,252,204,126,239,223,155, 15, 31, 58,228,223,182, 77,155, 23,251, 54,111,246, 92, 48,119,174,103,173,114, -229, 14, 23,118,115,163,234,207,158, 13,148,242,174,207, 9,180, 96, 84,219,127,157,187,199,153, 83,231,175,158, 91,183,105,183, -199,251,247,126, 62,254,254,102,223, 51, 23,175,109,191,120,245,230,150, 9,147,255, 92,207, 60,122,120, 69,195,119,218,193, 80, - 42,194, 21, 34, 39,174,147, 39, 79, 42,106,152, 62, 93,187, 72,183, 22,205,164, 83,173,106,210,190, 66, 25, 25,217,188,177, 76, -233,219,139, 82, 45,174,204,237, 30, 4, 90,164, 69,160,101, 75, 93,200, 73,146,105,112, 62, 55, 25, 85, 58,191, 28, 89, 50,207, - 89,160, 85, 19,147, 2,251,179,106,248,156, 14,146,203,167, 0,214,138, 90, 6, 32,243, 18,238, 69,119, 84, 70, 74,180, 32,165, -184, 71,160, 5, 35,122, 51, 84, 58, 4, 88,102,168,179,204, 80, 69,189, 6, 24, 48, 67, 98, 98,134,148,204, 92,176, 96, 65,229, -220,213,213,245, 16,104,106, 78,230,234,174,195,145,189,221,102, 29,220,214,241,204,152, 95,115, 14, 80,203, 66,155,172, 54, 80, - 23, 82,178,213,177, 90, 30,123, 54, 90,214, 69,143,136,137,240, 49,129, 6,109,168,246,239,223,175,180, 17, 39, 28, 72, 96, 20, -117, 33,121, 77,144, 69, 64,162, 19,104,197,128,212,115, 2,212,173,143, 17,139,241, 19,120,246,137, 65,113, 15, 29, 58, 20, 4, -182, 8,236,104, 12,175, 2, 45,130, 59, 20,204,158, 68,203, 22,187,203,118,238,220, 89,233, 3,129,170,191, 50,122,250,164,141, - 60, 69,177,176,185,134,111, 90, 32,105, 20, 72, 32,149,250, 18,196, 53,109,218,148,192,237, 19, 54, 48,204,198,115,206,186,226, - 81, 37,179, 89, 85,144,197, 73,155,146, 54,242,151,252,224, 60,193,111, 1,234,227, 15,232,115, 83, 28,148,159, 54,116,115,103, -205,154,165,140,231, 83,167, 78, 21,244, 39,197,190,140,160,128, 54,100,120,182, 13, 18,223, 57, 19,224, 70,145,150,161, 13, 28, - 74,180, 44,237, 58, 41,221, 66,125,131,128, 22,205, 23, 64,139,230, 11, 75, 40,125,230, 1, 91, 71, 95,252,143, 98,171,156, 24, - 23,183,211,240,157,120,154,191, 4, 89, 0,107, 4, 89,219,144, 63, 93,224, 51,191, 66,114,171, 72,180,201, 7, 38, 44, 64, 62, -226,222,231, 80, 23, 58,236, 14, 89,178, 36,200,153, 59,123,242,217,169, 83,167, 10, 32,216,101,155, 16,252,242,156, 11, 1,158, -171, 41, 93,186,180, 82, 40, 95,218, 77, 57, 50, 39,200,229,136,104,246, 76,241,243, 20,202,155,110,126,247, 95, 90,125,220,230, -177, 73, 54,187,175,147,206, 29,127,146,252,121, 50, 72,175,206,223,203,140, 41,253,100,239,206, 53,226,177,121,133,116,255,165, - 69, 64,177, 66, 25, 54,107,209, 12,101,159, 14,122,236, 27, 7, 90,214,146,172,144, 70,241,106, 5,237, 48, 42, 9, 86, 48, 75, -129,240,189,152, 18,167,202, 34,155,220,247,200,248, 5, 7,165,253,184,125, 82,166,235,102,169,218,103,171, 46,137,214,225,243, -247,165,125,135, 78,138, 40,158, 31,114, 6, 87, 55, 73,146,165,188,228,171,216, 74,118, 29,191,170,124, 32,174, 25,211,201,152, - 65,141,228,232,129,245,178,102,205,106,179, 41, 74, 20, 6,184,181,121,100, 40,156,229,221,185,235,103, 97,139,117, 95,206,223, -120, 42,158,151, 30,203,246, 99,183,101,249,246, 75, 82,181, 77, 78, 41,223, 40,163,148,169,147, 90, 74, 84, 77, 38,181, 59,118, -146,177, 11,118, 73,156, 20, 57,222,106,117,136, 96, 64,139, 96, 43, 48,249,223,220,163,128, 43,203,180,242,183,239,117, 1, 45, -190, 19, 3,127,103, 72, 77,246,192,166,100, 15, 6, 2, 4, 70,255,251,224, 57,175,241, 30,243,104,149, 79,239,125,168, 89, 50, - 96, 64, 82, 0, 28, 36, 20,155, 29, 61,215, 44,118,236, 31, 95,220,189,219,198,107,203,150,250, 89, 93, 93, 47, 65,141,231,255, - 1, 40, 1,118, 41,230,183, 62, 62,102, 12,232,230, 53,171, 87,251,183,106,214,236, 78,219,134, 13,151, 29, 94,183,174, 21,141, -229,181,202, 98, 1,180,130,236,177,104,155,101,109,163,101,113, 77,203, 13,132,229, 43, 99,187, 36, 75,190,231,242,213, 27, 55, - 79,157,187,118,100,221, 6,143,253, 91,119,236, 57,120,253,230,131, 93,199, 78,158,221,141, 9, 97, 47, 50,199,209, 42, 35,239, -115,103, 33, 7,124, 14,168, 52,176,230,170,241,200,145, 35,114,104,231, 14,233,218,172,169,180,175,254,189,116, 0,200,234, 86, -182,164, 12,248,190,156, 44, 31, 58,128, 64,235,172, 35,218, 42,208,178,165, 46, 84, 65, 22,223, 57,230,187,130, 50,177, 90, 89, - 57,182,114,177,100,206,156, 89,175,234,176, 64,225,194,133,253, 41,117,160,250, 8,229,136, 31, 88,150, 92, 80,185,191, 39, 16, - 33, 56,192, 53, 6,138,118,116,244,193,228,122, 14,106, 66, 51,164, 10,102,170,157, 64,215, 12, 80, 17, 44,213,175, 95,255, 85, -245,234,213,175, 66,242,122, 28,196,104,124,173,107,107,125,183,186,169, 98,140,238, 82,228,204,201, 3, 99,223,240,151,255,213, -194,232,216,117,104, 93,238, 8,144, 44, 60,162, 10,139,147, 12,213,133,148,100,113, 2,175, 87,175,158,146, 84,144, 69, 9, 10, -164,184, 90,170,195, 24, 0, 88, 55, 48, 57,251,211,254,138, 7,219,106,210,164, 73, 2,169, 72, 16,216,178, 6, 90,129,227,165, -110,160, 5,233,206, 70,168,240, 21,201, 3,213,156,248,191, 94, 79,159,180,147,135, 0,133,109,221,156, 82, 51,170, 31,209, 46, -108,231, 50, 72,148,104,115, 83,193, 24,164, 5, 72, 14, 23, 65,184, 79, 23, 14, 11,177,176,123, 13,245,255, 94,244, 3,111,142, -205,228, 39,235,204,201,155, 27, 43, 32,249,121, 8, 16,114, 9, 64,244, 41,230, 2, 26,174,199,118, 80,182,185,228, 31, 15, 2, - 83,208, 13,160,170, 21,192,157,193,128, 21,105, 32,192, 44, 65,213,244,113,227,198, 41,249, 2,165,112,173,236,208, 92, 68, 85, -161, 35,160, 5, 91, 84, 74,173,111,171, 32,139,101, 70,127, 37, 79, 8, 58, 67, 28,168,207,118,238, 46, 68,223,241, 68, 29, 61, - 1, 6, 21, 73, 22, 50,166, 11,204,252, 11,213,115, 84, 31, 67,165,206,141, 69,143,169,170,227,156,133,111, 94,151,132, 60, 12, -237, 27,236,209,172,110,137, 70, 53,111, 82, 75,250,245,237, 35,169, 83,167, 86, 76, 3,152,248,125, 83, 85,204,132, 77, 44,178, -110,221, 58,101,167,113,158,220, 57,101,223,238, 13, 2, 53,224, 57,123,101,200,230,154,112,236,192,223,123,162,126, 23,101,197, -178, 5,210,184, 65, 53,201,153, 53,165,228,200,146, 66, 73,221,126, 46, 31,148, 70, 15,110, 45,219, 54, 45, 16,207, 99,219, 37, -171,107,194, 19,225, 85, 47,123,116, 52,176,200,231,126,253,231,163,175,129, 34, 9,178,188,182,111,223,254, 81, 53, 12, 93,137, - 78,156, 54, 85,106, 25,208,111,154,180,234,183, 76, 74,180, 95, 35,223,247,222,162, 11,104,237, 60,118, 69,126,238,128,221,123, - 24,204,160, 87,151,244, 25, 50,200,214,253,103,101,203,190,211,178,105,239,169, 64,160,149, 86,134,246,255, 81, 30,220,187,202, - 78,254,206, 20, 51,166,170,251, 12,193,132, 68, 25,179,251,156,188,124, 70,214,238, 62, 40, 19, 22, 79,151,121, 27, 55,203,162, -173, 23,100,194,210, 99, 82,179, 93, 69, 41, 93,235,111,144,197, 84,169,121, 13, 25, 50,107,119,152,128, 22, 85,135,214, 64,107, - 69,255,202,186,129, 22, 6,170,248, 0, 60, 30, 39, 78,156,216,243,203, 47,191, 16, 84, 21,103,226, 57,175,241, 30,243,132, 87, -107, 67, 68,222, 6,131,200, 30,180, 31, 85,135, 14,213,145,141,163, 68,249,217,236,231,215,241,254,188,121,181, 19, 37, 76,248, - 22,106, 9, 5,100, 81,154,133,201,220,124, 96,255,126,243,238, 93,187,204,133, 10, 22,124,113,108,225,194,186,175,111,222,108, -200,221,136, 90,101, 85,129,150,173,221,134,182,174, 89,218,114,105,209, 14,188,159,174, 92,133,202,167, 30,121, 61,191,188,101, -199,254,117,123,246, 31, 91,229,245,244,197,225, 34, 69,139, 19, 16,100,210, 73, 67, 1, 90,180,127,128, 20, 79, 25,200, 32,193, -147,131, 59,182,203,190,117,107,164,221, 15,149,130, 64,214,176,106, 21,100, 97,155,166,114,100,134, 98,167,165, 9,180,184,187, - 80, 85, 25, 90,170, 11,127,203,146, 74,134, 22,200, 42, 99,202, 22, 82,164, 47, 76,148,126,233, 4, 90, 73, 32,185,122, 72,144, -193,213, 45, 38, 9, 85,141,199, 73,150,234,194,141,156,236, 40, 85,192,185,150,171, 15,101,215, 33,212,130,167, 90,180,104,113, -173, 74,149, 42,126, 0, 90,239, 96,252,108,182, 76,232,150,126,144, 84,208, 94,210,158, 31,173, 16,172, 38,168, 42,148, 33, 85, -159,222, 29, 26,202,141, 43, 59,133,191, 69, 92,211,244, 81,193, 22,213,132,180,201,178, 50,128,119,216,100, 4, 90, 4, 89,112, - 59,161, 76,220,148,100,169, 32, 75,253, 37,200,162,109,149, 22,208,162, 36, 11,210,160,255, 91, 18, 99, 4, 34, 80,163,196,140, -147, 63,248,161, 0,110,107,160,133, 69,136, 51, 18,173,140, 21, 43, 86, 12,160, 90,147,210, 7, 74,223, 96, 16,207, 13, 31, 25, -244,246, 77,171,124, 4, 90,253, 97,163, 21,192, 69, 1, 65,209,134, 13, 27,216,111, 8, 42,251, 65,205,245,152,118,100,176, 49, - 18,168,119,215, 56,122, 7,250,205, 20, 60,139,234,126, 82,236, 17,177, 33, 71, 1, 23, 4, 88,236, 87,180,127, 3,191, 9,252, -245,126, 71,173, 96,179,169,140,227,163, 70,141, 82,118, 19,162,223,120,210,142,136,223, 21, 22, 0, 74,187,193,208, 62,128, 18, - 46, 30,236,167,204,135,100,207,222,209, 33,208,130,116,111, 83,182,108,217, 30, 90,130, 44,214, 93, 89,180,187,186, 82,133, 24, -114,222,192,110, 66,212,221, 3, 18,219, 61, 0,170,158,168, 55,237,177,212,133,232, 20,240, 48,128,118,111,120,158,101, 35, 96, - 53,149, 46, 93,154, 99, 34, 65,231,193, 80,182, 91,168, 30,203,145, 37,177,215,195, 91,135,101,221, 42,152, 21,100,202,168, 72, - 6, 1, 44,149,249,147,210,192, 5, 11, 22, 40, 42,217, 17,195,135,202,230,141, 75,229,236,137,205,178,125,211, 60,201,238,150, -200,238, 66,128,247,238, 92, 63, 44, 11,231,142,147,162, 5,221,130, 0,150, 53,208,234,251, 75, 53, 89,183, 98,130, 92, 60,237, - 33, 91, 55,206,150,108,110, 9,239,132,170, 18, 58, 31,250,198, 37, 90,106, 45,109,187,119,112, 84, 57, 72, 4,150, 96, 53,130, - 49,235,163, 50, 0,209,136,151,226,249,113, 99,199, 73,233,188,197,164,109,251, 41, 82,178,229,124,236, 32,220,164, 11,104,185, -239, 57, 41, 83,231, 44,149,114,229, 43,160, 19,103,146,246,191,244,150,181,219, 14,203,234,173, 7,101,213,150, 3,127,139,124, - 51,164,149,223,122, 84,135,212,235,189, 64,196,235,111,234,220,217,174, 65, 94,252,212,249, 14, 44,217,120, 68,166, 46,159, 36, - 63,118,201, 47,213,219,230,148,223,167,173,148, 62, 83,118, 75,187, 97,171,229,135,150,141,131,128, 86,189, 30,147,164,205,111, -243,156, 87, 29, 90, 72,180,222,238, 27, 19, 2,104, 45,239, 87, 73, 55,208, 98, 75, 0, 72,180,130, 29,214, 30,168, 61,246, 96, -213, 60,159,137,231,188,198,123, 58,251,164,102, 54,208,170,209,184,113,227,221, 52,134,199,174, 50,210,174,232,232, 33, 21,104, - 61, 90,188,184, 86,146,196,137, 33,196,242, 81, 36, 89, 24,200,205, 59,118,236, 48, 47, 91,186,212,188,112,193, 2,115,182, 44, - 89,158,189, 61,126,188,178,207,245,235,245,156, 1, 90,150, 59, 12,195, 81,162,165, 84, 9, 19,230,186, 43,215,111, 31, 58,234, -121, 97,193,233,243,215,231, 94,186,122, 99, 11,175,105, 50,201, 34, 3,213,128,156, 64,255,252,243, 79,101, 2,239,217,169,131, -244,105,221, 74,250, 53,105, 32,171, 70, 12,150,205, 35, 6,201,238, 17, 3,228,192,176,126,114,116,228, 0,217, 62,118,132, 46, -213,225,217,141,107,131,128,150,106,147, 69, 41,214,208, 66,217, 20,144, 53,169, 70,121, 5,100,113, 16, 39,208,210, 99, 12, 15, -117,232,118, 24, 2, 43,118, 47, 88,140, 8,118,125,250,193,216,216, 23, 96, 73, 1, 29,180, 39, 34, 64,224, 47,170,168, 37,209, - 34, 23, 20, 63, 90, 4, 82,144,240,248, 99,178, 52, 67,117,102,198,100,107, 70,223, 52,195,230,203, 12,126, 90,218, 74, 38, 6, -191,184,163,115,162, 45, 30,211, 22,139,106, 66, 74,176, 8,174,182,109,156,171,124,219,219, 54,206, 81,192, 22,175,243,254,172, -209,185, 82, 13,234, 26, 63,254,174,245,117,254,232,211, 54,129,230, 38, 21,190, 11, 19,221, 35, 2, 1,130,200,126,253,250,133, - 0, 89,148,100, 48,241,208, 2, 90, 84, 23,146,239,150, 7,129, 16, 37,154,180,205, 3, 32, 8, 6,180, 8, 96,168,150, 13, 4, - 7,246, 84, 93,214, 44,153, 68,192, 66,186,148,234,176,236, 51,102,204, 96,187,216,228,157, 86,159, 69, 27,141,101,255, 36,112, - 35, 45,170, 13, 9,142,232, 50,129,187,208,216, 47,104, 71,245,219,111,191,241, 29, 14, 23, 87, 88,136,221, 35,200,162,186,156, -210, 26,170,203,217,111, 40,117,163,253, 27, 65, 45,104,184,105,149, 73,189, 15, 27,193,243,164,177,116,233, 82,190,123, 30, 18, -109,222, 26, 80,218,194,131,187, 13,105,196,207, 93,188, 60,168, 86,196,125,130, 44,230,179,119, 76, 3, 24,114,135, 4, 88, 49, -136,231,226,108,228,200,145,199, 1,148,158, 67,210,244, 1,125,208, 79, 5, 89,252,165, 10,149, 7,164,179, 31, 64,176,159,163, -178, 67,136,176, 29,227,156, 39,202,235,137,190, 64,160,213,147,188, 85, 15,242, 24,128,139,160,120, 30,129, 55,237,205,240, 62, - 61, 27, 1,244,178, 76, 51, 95,182, 76, 9, 1,180, 14,202,217, 99, 43,229,214,229, 61,178,114,233, 44,233,221,171,167, 96, 76, -151, 1, 3, 6, 64,106,221, 67,150, 45,154, 33,183,175,236,151,131,187,151, 74,207,206,181,100,228,144,206,194,231,236, 17,231, -189, 71,183, 15,200,201,195, 75, 21,154,147,198,254, 42,249,115,167, 15, 2, 92,189, 58, 85,145,101,243, 6,203,141, 11,187,197, - 99,195, 12,233,214,177,198,223, 52, 13,160,165,217, 94,200,160,207,143,150, 37, 37,170, 10, 41, 82,231, 74,156, 98,111,174,114, -232, 71,134, 91,221, 83, 38,133, 1,111,207,113, 82,173,221, 36,201, 80,174,199, 71,151, 60,117, 41, 65,176,121,168,187, 14,131, -141,104,118,254,100,200,144, 70, 70, 13,105, 5,219,149,151,146, 48, 81,162,243, 86,238, 29,130,209,167, 49,124,211, 78,195,204, -123, 78,156,151,106,109,114, 72,229,102,217,164,199,196,237,210,110,228, 86,105, 60, 96,131, 84,235,190, 68, 74, 84, 75, 9,201, - 86, 70, 72,188,182, 74,201, 90,157,253,157, 49,134,247,217, 49, 48, 72,109, 72,245,225,155,205, 61,130, 1,173,153,173,178,200, -178,190, 21,156, 2, 90, 0,143,177, 10, 20, 40,176,137, 0,168, 67,135, 14,135,152,120,206,107,188,167,167, 37,173,242, 4,243, - 6,143,193, 51, 63, 86,100, 99, 33,250, 86,118, 28,162,173,104,124,255, 39, 86,209, 14, 85, 61,170,234,208,231,240,225,186,153, - 51,100,184,186, 98,249,114,127, 0,107,243,129, 3, 7,204,176,129, 48,207,197, 22,127,216,103,248,231,206,158,253,148,239,213, -171,223,159, 88,190,188,129,147,170, 67,205, 93,135,206, 26,195,171,124,200,230,150,230, 66,253, 58,149,222, 87,255,161,148, 79, -233, 18,185, 95,150,251,174,192,219,172,153, 82,235,157, 8, 21, 50, 52,108,135, 29,205,123,130,173, 95,218,181,145,142,245,235, - 74,235, 74,229, 20, 73,214,238, 9,163,101,223,232,193,178,111, 72, 63,185,189,166,175, 92,154, 61, 90, 70,181,110, 97,214, 99, - 12,127,106,205, 10, 5,104,117,141, 31, 73,177,199, 82,125, 50,141, 41, 87, 88, 38,215,170, 40, 51,155,213, 81, 64, 22,191,179, - 64,160,197,201,205,209, 17, 11,134,212,138,187, 16,170,208, 8,182, 72,147,182, 58,156, 44, 57,105,210, 80,182,123,247,238, 2, - 64, 70, 3, 94,213,240,216, 33, 81,236,184, 60, 2,240,244, 0,147,143, 55,128,132, 25,188, 80,252,103, 97,226, 81,118, 29,210, -222,137, 96,139, 9,170,110, 47, 72,253,252, 49, 57, 81,221, 18,226,160,225, 59,109,178,168, 46,164, 36,203,242,224,127, 94,231, -125,230,235, 82, 35, 97,235, 35, 59, 7, 63,239,136, 95, 61,125,159, 64,139,245,163, 51,214,254,253,251, 7, 3, 90,150, 32, 75, - 7,208,138, 72,155, 44,203,178, 81,242, 66,105, 38, 1, 21, 85, 50,168,159,178,176,164,155, 15, 74, 16, 8, 16, 32,117, 38, 56, - 32, 95,243,233, 40,111, 76, 72,154, 94,211,237, 68,160, 11,131,251,240, 67,166,128, 33,108, 86,160,215,126, 91, 62,248, 28,145, -141, 13,201,138, 63, 1, 0, 37, 68, 48, 13,160,225,243, 12, 72, 32, 63,241, 63, 65, 18,251, 47,202, 72, 91, 34,250,249,114,216, -246, 52, 8,103,127,161,161, 59,159,165, 13, 22,213, 80,244,193, 6, 62,211,104, 93, 43,186, 66,176,178,162, 28,202, 46, 56, 26, -249,227,134,234,196, 56, 42, 36,166,247, 9, 2, 9,234,120, 80, 61, 73,137, 23,174,211,182,202, 17,200, 34,253,140, 72,163, 97, -219,166,184,113, 64,223, 60,206,221,181,108, 19, 30,124, 31, 15,130, 44,228, 91,133, 52, 29,253,211, 27,191,189,180,218,135,126, -178,104,244,142,118,222,138,111,121, 42, 65, 22,203,216,181,107, 87,101, 23, 39, 54, 41, 8,118,217, 10,190, 3,229, 58, 36,156, - 4, 93,213,181,232,134,231,125,130,162, 7, 55,247,201,225,173,191,201,169,125,227,229,198,197,173, 0, 64, 59,101,234,164, 81, - 74,186,114,110, 7, 0,211, 26, 25,216,183,137, 52,172, 93, 80,154,214, 47, 38,195, 7,117,208, 4, 90, 42,205,147,123,199,202, -165, 83,235,229, 58,104,246,239,213, 90,122,119,109, 38,215,206,109,147,163,251,150,203,239,189, 26, 5,167,249,153,129, 86,120, -242,237, 31,164, 21, 58,160,165,238,106,161,141, 1, 7, 32,126,132, 68,210, 9, 18, 38,249,228,146,187,230,135,100,121,234,221, - 74,154,187,238,194, 36,217,235, 90,250,124, 10, 86, 79,171, 16, 60,126,208,219, 67,162,149, 65,210,165, 75, 45,233,131, 82, 26, -172, 32,211, 72,230, 76,105,100,225,156, 17,114,254,220,217,128, 24, 49, 99, 78,118, 4,180,232,222, 33, 78,138, 92, 79,255, 90, -190, 79,254, 92,177, 70, 42, 52,200, 38, 63, 13, 94, 37, 13,126, 93, 47, 85,187,175,148,239,218, 47,145,106, 45,202,201,208, 9, - 61,164,231,232, 69, 18, 39,101,206,231, 58,221, 59, 92,153,220,255, 39,121,251,240,146,248, 95,223, 33,175,215,183, 87, 0,215, -171, 21, 77, 21,160, 53,179,101,102, 89,131,221,134,179,123,125, 47,181, 10, 36, 37,208,186,226, 76,195, 98,210,106,128,213,173, -226,202,129,137,231,188,230, 12,141,192,188,170, 55,120,250,169, 58, 14,201,198, 58, 26,191,195, 14, 66,177,203,162,205, 23, 86, -229,211, 64, 91,115, 64,167, 49,252,182,137, 19, 91,153,189,189,219,206,238,218,181, 53,165, 90,127, 78,159,238, 79,117, 33, 37, - 89,191,116,233,226,159, 32,126,252,183,203, 70,143,110,250,241,225,195,234, 83, 27, 52,104,218, 48,114,228, 18, 90,101,254,156, -198,240,124, 55, 84,104,101,218,181,105,130,109,232,222,242,244,201, 93,217,184,118,154,204,159, 61, 80,138, 22,202, 33,188,167, - 85, 62,139,251, 17,232,178, 97, 9, 38,211, 41, 16,195, 19,100,117,164, 77,214,119, 37, 20,144,117, 96,120, 95,185,187,190,143, -220,219, 56, 92,118, 14,237, 47,113,116,186,119, 32, 16, 82, 37, 89, 3,178,167,149,225, 69,115,200, 31, 21,138, 6, 73,177, 8, -178,150,247,233,130, 13, 22,191,202,133,157, 30,148,104,105, 1, 45, 19,108, 92,142, 17,108, 16,104,117,236,216, 81,241, 73, 68, - 73, 1,218,255, 29,236,109,174,161, 78, 52,234,165, 36, 75,107, 18, 11,170, 62, 1, 20,250,140, 89, 77, 52,130,199,228,166, 0, - 45, 72,143,204, 88,209,155, 49,159, 41, 9, 99,129, 25, 82, 31,179, 61,160, 69, 73,149,109,137,214,220, 32,137,214,232,254,217, - 70,244,108,144,164, 79,173,114, 69, 63,210,207, 22,127, 59,215, 72,208,110,100,251,120, 9, 28,181, 25,129, 22,213, 92,170,225, - 59,199, 39,242,144,246, 74,170, 36, 75, 5, 79,122, 36, 90,170,109,150,106, 63, 53,123,246,108,101,210,230,238, 64,240,196,220, -164, 73, 19, 69, 66,196, 9, 23,229, 34,192, 42,239, 68,159,106,195,177,146, 18, 50,124,227,148,176,228,193,228,253,129,246, 53, -108, 55,252,167, 81,184, 51, 71, 50,218, 99,113, 39, 32, 12,179,249,124,246,192,135,243,162, 79, 28,129,209,249, 11,252,210,167, - 86, 30,157, 68, 83, 64,106,117, 16,224,250, 1,109,240, 8,212,233,147,140,160,144,170, 53,157, 52,130,178, 1,184, 94, 80,165, -108, 0, 46,244,107, 69, 15,250, 27,177,152, 84,140,247,209, 63, 21, 0,131, 49,129, 32,147, 11, 47,189, 97,147,248, 14,214,105, - 52, 37, 89, 4, 89,116,109, 0,137,150,162, 34, 37,216,130,164,143,106, 66, 93,118,131,182,234,133,133,174,226,244, 13, 6,240, - 4, 83, 19,184,171, 85, 61,184, 0,130,164,140,215,155, 57,203,147,176,230, 7,208,186,127,235,242,118,185,120,124,158, 28,221, - 54, 72, 1, 92,103, 15, 77, 3,216,218, 6,151, 40, 27,101,204,144,118,210,168, 78, 33,105, 82,183, 8, 36, 79,117,100,200,239, - 63, 75,211, 6,229, 8,180,118,218,123,247,223, 52,119,200,133, 99,115,228,200,182,129, 10,205, 51, 7,167,200,245,243, 91,228, -204,177,245, 50,114, 80, 27, 5, 96,145,102,247, 78,255,167,153, 61, 83,194, 47,106,159, 22, 86,222,125, 51,207,211, 8, 30, 98, -239, 15,180, 93, 97,199,131, 45,145,146,184,243,132,247, 52, 42,242,255,221, 25, 22, 33,117, 48, 16, 60,126,253,234,165,220,190, -121, 89,214,174,156, 9,233, 85, 71,105,219,172,140,180,104, 80, 88, 90, 53, 42, 42,109,154, 22,151, 3,123,221,105,216,247, 30, -251,213,235,235,113, 88,154, 42, 91,113,223,113,243,118,200,172, 53,251,164,227,176,105,242, 99,159,181,242, 67,183,149,210,232, -247, 13, 48,128,223, 38, 93, 71, 44, 18,151, 76, 69,222,234,117, 88, 90, 6, 31, 44, 66,237,180,203,153, 42,234,227,133,163, 59, -203,155, 27,135,228,221,177, 25,242,122,109, 27,217,244, 71,115,217, 60,165,171,116,168,154, 83,178,185, 68,120,204,124,204,111, -197, 11,135, 59, 83,176,211, 43,141,149, 23,248, 0, 94,211,205,207,191, 51, 6,243, 56,111,233, 8,149, 82, 44, 12,200,187, 48, -160,245, 6,216, 8, 50, 62,182, 65, 63,168,156,170,123,135, 87,247,239,183,121, 7,251,171,217,125,251,182,204,156, 49,227, 53, -168,143,125,227,199,139,231,235,150, 33,195,149,217,163, 71, 55,255,120,231,206, 15,167,151, 47,175,219, 48, 90,180,118, 45,108, -239,104, 11, 86,247,112, 2, 90, 14,249,233,230,154, 70,166,140,255, 77,198,141,234, 41, 61, 58,253,168, 36,215, 12,169,236,109, - 23, 87,217, 96,139,102,218,244,105,210, 60,154, 51, 97,188, 44,250, 99,148, 12,107, 84, 79, 6, 84, 42, 35,251,135,253, 46, 71, -135,255, 38, 23,103,140,148,221,131,251, 75,126,215,140, 20,203,219,218,242, 28,194, 97, 41,129,150, 42,201, 26, 81, 44,167,140, -173, 88, 76,166,212,169, 28, 36,197,226, 68,191, 97,196,239,226, 49,121,140, 92, 57,176,135,182, 54,214, 64,203, 86, 57, 83,195, -177,233, 11,170,242,169, 50, 10,244, 86,239, 40,204,148,117,211,135,160, 25, 40,209,122, 8,112,241,134, 0,139, 6,241, 48,166, - 87,128, 22,212, 83,202,127, 74,182,152,160,182, 80,126,173,128, 86, 8,154,180,197,162, 77, 86, 48, 27,173,204,127,219,104,237, -220, 80,123, 44, 37, 89,150, 78, 77,249,159,215, 45, 10, 27,130, 38,128,228, 35,242,140,118,158, 42,200,162,132, 4,106,242, 16, - 50,114, 59, 64, 43,136, 38,202, 63, 17, 18, 18, 60,238,175, 72,116,168, 54,166,189, 11, 85, 90,216,253, 75,181,212, 4,148,165, - 18,210, 68, 36, 71, 0,203,102,255,196,243,103, 41,189,162, 52, 12,207, 47, 11,172,215, 50,170, 14,105, 95, 3,158, 59,178,241, -179, 69, 51, 25,221, 65,208, 54,139,224,154, 99,128,147,147,137,221,239, 8, 0, 70, 81, 35,210, 78,139,170, 62,140,211,175,116, -210,182,164,217,146,128,138,117,102,232, 34, 2, 33, 74, 29,249,159,215, 65, 79,239, 70, 23,187,229,132,157,151, 18, 66,132,180, - 65,111, 4,127,121,224,186, 93,191,110,129,245,112, 56,134, 0, 0,190, 37,160,194,188, 70,160,202, 99, 41,192,151, 2,176,169, -150,199,255,154,142,198, 79,157,188,210,147, 45, 88, 57, 97, 12,223,172,108,137, 44,239,150,205, 31, 10,112,181, 81, 1, 89, 71, - 60,126, 87,192, 17,193, 80,163, 58,133,165,107,251,154,138,106,175, 93,203,234, 82, 48,111,106, 63, 26,208,231, 73, 23,204,214, -215, 62,205,243, 27,228,236,193,169,114,216, 46,205,106,164,249, 46,123,166, 4,195, 92, 93, 19, 90,142, 49, 95,124,247,165, 30, -230,253,131,121,156,243, 12,111, 85,208, 36, 84, 31,226,163,249, 72,123, 15, 38,120,143,254,128,143,144, 19, 77, 18,141, 74,217, - 4, 90, 9, 18, 38,220, 10,145,181, 63, 6,115,223,173, 91,183,124,120,248,224, 62,116,223,102,121,246,244, 17, 0,214, 38,153, - 57,117, 16, 36, 19, 15,168, 99,127,111,114,113, 73,175, 5,180, 88, 6, 53, 4,207,247,141,123,251,247, 24,181, 76, 70,204,222, - 45,131,254,220, 46,173,250,207,145, 18, 53, 59,249,199, 77,153,203,233, 16, 60,164,155,203,197, 20, 11, 64,106, 64,225, 12,113, -124,214, 78,236, 38,207, 79,174,146,225,237,191,151,188,169,162,249,240, 58,239,219,225,129, 86, 39, 12,230, 45, 62,208, 27,186, -214,160,105, 77, 51, 4,208,130, 72,253, 80,177, 98,197,232, 9,254, 23, 27,193,158,109, 21, 53, 24, 77, 58, 44,237,148, 46,221, -207, 94, 87,174,180,252,232,237,221,216,239,226,197,234,126, 39, 79, 86,246,187,112,161, 18, 0, 86,149,143, 94, 94,213, 79,175, - 90, 85,183, 69,130, 4, 63, 35,136,160, 61, 99, 94,123, 64, 43, 44,187, 14,237,242, 51, 72,162,245, 6,190,132,188,238,200,134, - 53, 83,101,222,172, 1,122, 36, 90,246,104,166,141, 5,199,165,173,106, 87,127, 63,169,251, 47,178,236,183, 62,114,122,206,116, -217, 49,114,144,252,209,170,153, 57, 80,146,101, 11,100,145,191, 33,128, 22, 65, 1, 37, 48, 76,199, 87, 44,150, 19,171,151,201, -137,181, 43, 20,160,197, 68,251,172,243,144,100, 93,216,187, 83, 46,238,223, 37, 80,251, 62,180,106, 40,123,229,252, 14,147,173, - 98,200,140,118,231,106,219,222, 78, 48,205,118,183,204, 0,192,127, 11,182, 79,102,128, 1, 51, 0,135, 18,114, 7, 82,153, 96, -170, 67,128,157,167,144,200, 88,171, 14,109,150,211,222,174, 67,218,102, 81, 93, 24, 36,209, 42, 91,244, 35,213,136, 86,182, 90, - 54,129, 22,121,105, 9,178, 84,149,148, 53,210,210, 2, 90,168,183,178,235, 16, 78, 52,253,169, 54,163,187, 8,170,246, 8,178, - 48,198,221,228,125,157, 3,183,205,186, 99,162,246,161, 38,128,126,179, 64,167,120, 32,173,226,116, 52,202,157,113, 0, 7,116, - 44,107,207,253,134, 77,160, 69, 73, 22, 37,100,148, 96,226, 89,173, 49,195,186,248,118,191, 35, 72,182,118, 3, 80, 7,208, 45, - 8,164, 55, 31, 32,157,114,228, 64,213,146,174, 53,205,153,140,181, 73,247, 24, 4, 88,228, 41,119,240,225, 1,189, 32, 43,196, -119,100,249, 50, 72,202,246, 90, 74,180, 40,217,226,127, 94,215, 61, 31,217,200,136,182,122, 74, 21, 47,128,236, 7,168,100,207, -113, 35,196,193,131, 7,249,159,223,214,247,161, 28,231,117,118,159, 96,217, 66,180, 81,174,140, 46, 73,179,186, 38,152, 90,189, -114,254,143, 27, 86,140,145,171,103, 86,202,201,189,227,164,115,187,106, 50,102,120, 87,233,217,165,177,148, 42,154,241, 35,118, - 5,206,116,115, 75,100, 25,119, 86, 37,236, 20,205,209,195,224, 51,176,115, 67, 41, 81, 56,195,199,236,153, 18, 77,207,158, 46, -137,173,126,166, 53,199,133,166,238,255,134,103,156, 87, 29, 6,214, 58,152,123,135, 64, 73,150, 22,200, 10,254,177, 88, 7,137, -174, 91, 55,134, 41, 70,140,162,166,200,145,187, 3,120,109,193, 71,253, 28, 43, 7,127,236, 72,121,127,241,226,121,236,208,185, - 39,184,246, 42, 40,184,244,255,217,111,183,113,213,160,210, 52,144,135, 11,135, 55, 76,225, 21, 84, 58,163,139, 41,105,230, 36, -166,105, 89,147, 70,120,199, 95,254, 15,203, 71, 29,248,172,222, 64,211,118, 63, 22, 14, 94,140,113, 72,160,134,129,102, 62,182, -255,210,151,135, 51, 62,116, 66,240, 83, 13,193,179,178,111,223, 22,183,246,236,105,130,221,133,141, 94,221,184, 81,255, 20,108, -178,168, 46,108, 20, 61,122,219,186, 38,147,171,131,250,219, 4, 90, 97,220,117,232,240,163,118,205,152,202,163,114,133, 34,210, -169, 93, 29, 37,241,156,215,194,208, 70, 65, 65,165, 99, 99,103, 33, 19,141,229,157, 13, 42,141,201,235, 4, 93, 60, 56,147, 0, -144,173, 35, 33, 56,170,123, 35,216,250,220,131,218,132,146, 23,103, 14, 71, 52, 51, 67,210,114, 67,181,199, 82,127, 41,241,178, -120,129, 45, 99,120,187, 52,169, 70,180,246,163,165,210,234, 92, 43, 97, 75, 74,178,248,107,163, 2, 33,104,194,142,113, 15,210, - 35, 38,240,213, 97, 2, 47,109,109, 71,183,166, 73,176, 53, 17,201, 11,117,165, 31, 45,254,146,159,122, 65,150, 93, 96,128,118, - 25, 5, 51, 9, 58,182,157, 99, 85,183,177,144, 72,190,199,174,192, 63,244,126, 71,129,249,226, 97,195,195, 39, 74, 49, 25,202, - 7,215, 18, 58,211,232,200,235,168,221,147, 99,108,223,130,133,245, 93,240,130,126,178,244, 2,119,107,154, 84, 7, 54,196, 2, -232, 20,164, 68,190,248, 61,132,255, 53,195,177,156, 85, 1, 92, 3, 84, 27, 45,254,242, 63,232, 87, 13,195,247,206, 71,127, 37, - 32, 36, 56,100, 34, 80, 12, 4, 89,142,212,133,159, 3,108,216,165,153, 61, 99, 18, 87, 24,164,175,104,252, 99,201,128,109,235, - 39,200,192,254, 63, 75,197, 50, 57, 37,107,166,132,107, 50,103, 78,236,200,158, 78, 55,205, 1,253,219, 73,133,210, 57, 2,224, - 30, 98, 57,223,231,100,255,116,178,153,255,117,217, 67, 13,178,194,194,137,255, 55,174, 53,208,178,245, 63, 69,138, 52, 80, 21, -214,131, 93,214, 20,128,175,139,137,146, 36,153,226, 12,208, 10, 67, 65,117,127, 44, 78,132, 36,208, 75, 51,152, 33,123, 40, 7, - 10,103,104, 88,191,194,102, 57,237, 5,149,166, 77, 22,239, 57, 83, 78, 12,180,109,168, 62,212,155,152, 95,207,132,107,171, 12, -176,111,226,228,163,165, 50, 84, 31,213,219, 70,206,116, 45,131,166, 13,110,113, 23, 34, 13,223,105,187,101,125,123, 80,231,132, -113,185,235,144,191,161,109,119,103, 26, 72, 3,108,232,182,105,179,122,167,163,118,183, 71, 83,203, 62,201, 38, 77,120, 43,255, -139, 33,150, 0,222,102, 58, 89,111,102,255,183,244,207,170,148, 96, 81, 93, 24, 40,201,210, 2, 89,122,235,222, 31, 11,151, 7, -216, 9,254, 28,210, 80,218, 58,214,119,102,172, 11, 69,123,216,122, 68,179,141,224,158,161, 96,182, 76,137, 54, 6,166,194, 58, -222,171,159,166,107,130,117, 89, 50, 38,182,235, 82,201,226, 93,154, 52,117,148,235,223,148, 37, 76,170,195,176, 48,226,115, 52, -132, 65, 51, 44, 45, 18,242, 89,131,159, 6, 63,195,139, 3, 70, 95, 10, 47, 78,254, 77,199, 17, 63, 53, 55,183,216, 41,138,209, - 70, 95,174,141, 66,251,166,255,114, 27,133,150,103,255,233,231,254,203, 29,198,168,123,248,118,125,131,159, 6, 63,195,139, 3, - 70, 95, 10, 47, 78,106, 3,194,208,190,201,104,163,208,114,206,246,115,223, 10, 63,195,183,214, 95,158,154,165, 84, 43,216,219, -217, 0,182,146, 51, 69,180, 71,195,209,117, 45,250, 6, 77,219,237, 18,218,246, 50,248,105,240, 83,111, 31, 48,190, 77,251, 28, -208,203, 67,203,124, 6, 63, 13,126,218,226,192,127,185, 47,105,125, 19,223,226,125,107,251,172, 47,102,175,245,173,160,104,163, -156,225,219,173, 13,126, 26,252, 12, 47, 14, 24,125, 41,188, 56,105, 72,159,140,190,244,245,247,165,240, 45,225,151,165,102, 0, - 45, 13,126, 27, 31, 96,248,118,200, 96,252,156, 92,219,148,138, 73,239, 43,236,228, 55,218, 72, 47, 3,245,229, 51,248,169,143, - 79,122,115, 25,252,212,203, 41,125,249, 12,126,234,227,147,222, 92,223, 10, 63,245,214,231,107,205,103, 87,117,248, 57, 11,172, -167,113,233,243,227, 71, 36,198,164,170,137,164,181, 93, 89,139,102, 18,208,232,132,208, 14,251,153,120,142,196,107,142,142, 32, -154,240, 33, 68,255, 96,202,206,181,192,115,238, 12, 82, 19,119, 15,209,117,130,101,226, 53, 91,187,135,130,104, 98, 23,139, 23, -118,220,209, 27,178, 86,122, 9,255, 87, 12,254, 60, 17,187, 94,170,217, 40,176,195,186,195,239, 88,139, 10, 21, 42, 60,100,226, -185,206,134,213,226,167, 61, 50, 69,210,164, 76,126, 57, 89, 82,132, 72, 10,185,117, 59,136,230,180,106,166,145,211,171,155, 62, - 50,241, 92,171, 76, 14,242, 59, 91,206,130,216,157,181, 0,238, 46, 24,162,100, 11, 18, 3, 45, 91, 31, 33,104,194,127, 78, 51, -180,215,118,248,178,186,197, 95,254,215, 42,179,213,125,103,203,169,135,188, 65, 83, 15,151,244,231, 49,248,169,159, 87,122,114, - 26,252,212,195, 37,253,121,254,203,252,212,207,165,127,107,206,172,137, 77,201,225,164,179, 59,194,205,120,240,151,255, 53,234, - 26,172,195,252,144,213,244,161, 98, 38,147, 48, 85,205,108,250, 8, 31, 51,211,225,167,196, 29, 65,171,221,225,180,209, 29,129, -139,221, 27, 54,108,184, 17,215,135,128,110, 25, 36, 91,110, 4,108,117, 66,250,123,105,130,180, 21, 14, 28, 63,210,199, 12,131, - 96, 51,254, 27,163,218, 99, 43, 52,227,126,109, 13,204, 99,203, 55,140, 37,205, 32,159,135,200, 47,117,235,214, 61,142,116, 66, - 77, 8, 83,113, 2,161, 62, 60,241, 59, 25,191,245,113, 93,241,230,142, 56, 19, 69, 38,102,136,106, 25,116, 55,136, 38, 1,214, -177,197,243,229,228,234,229,114,104,238,140, 96, 62, 21,183,253,222, 83,182,255,218, 85,118,253,250,203, 11,220,216,133, 52, 30, -113,204,154, 33,106,188, 26, 90,195,146,197, 14, 63, 64, 2, 44,214,155,129, 79,225,191,230,161,206,126, 24,154,143, 58,122,209, -130,121,223, 61,187,123, 89,110,157,130, 39,243, 52, 46,111,241, 46,130,101,245, 80,104, 78,251,222,148,140, 0, 75, 46, 44, 17, -166,105,213, 77,159, 38, 84, 10,234, 51,101,145,133,126,174,152,120,174,228, 7,208, 10, 80,243, 43,224, 12,215, 2,137, 58, 83, -206, 14,112, 54,136, 40, 65, 74, 68, 13,185,127,255,190,192, 55,208, 45,208,177,222,169, 21,140, 38, 66, 21, 45,111,222,250,151, - 19, 27,183, 31,189,116,244,244,181, 91,107, 54, 31, 58, 86,183,113,203, 67,188,174,147,151,204,230, 76, 57,245,146, 53,104,234, -229,148,190,124, 6, 63,245,241, 73,111, 46,131,159,122, 57,165, 47,223,127,153,159,250, 56,244,117,230, 10,189,123,135,252, 41, - 76, 49, 51, 39, 54, 53,206,238, 18, 97, 91,187,170, 57, 63,237,251,179,163,188,216, 63, 73,246, 77,107, 43,221,106,231,250,196, -235,188,207,124, 54,234, 30,172,195, 16, 96,169,147,104,251, 66, 38, 57,113,226, 4,163,205,186, 91, 39, 4,176,118, 71,216, 31, -119, 68, 77, 95, 3,154,214,254, 81,172, 59, 97, 39, 58,254, 67,108, 63,197,243,182,189,131, 65, 88, 17,210, 7,177, 21,211,249, -129, 38,165, 92,150,135, 93,160,117,238,220, 57,177,145,182,156, 63,127,190, 51, 0, 93, 38, 18,201,130,232,246, 19,127, 40,254, -198, 60,178, 37,157,230,169, 71, 48,160,117,114,213, 50,233, 18,219,164, 36,203,227,207, 98,217,100,113,149, 34,207,214,213,175, -184, 3,215,199, 34, 53, 1, 48,200, 73, 34,217, 76,166,188,173, 18, 70, 60, 99,139,166,173,126, 70,160, 69,218,116,224, 87,167, - 78,157,151,112,104,248, 8, 78, 96,181, 12,242, 66,243, 81,151,217,182,114,214,199,171,123,151,201,222,233,157,101, 70,207, 31, - 37, 70,180, 40,151,173,203,105, 13,180,166,215,136, 40,201, 99,155, 38, 5,230,219,195, 32,200, 76,248,191,135,215, 92, 19,154, - 90, 77,171, 30, 33,168,143,132, 2,104, 69,133, 79,157, 89, 11, 22, 44, 80, 88,204, 96,185,244, 74, 77,224,141, 48, 43, 2,231, -144,234,187, 67,180, 17, 37, 87, 4, 89,175, 94,189,121,127,239,230,189,151,191,118,255, 99,219,244,249,155,118,236, 62,114,241, - 88,141,186,141,246, 57, 33,217, 10, 13, 63,181,134, 13,131,166, 22,135,156,187,111,240,211, 57,126,105,229, 54,248,169,197, 33, -231,238,255,151,249,233, 28,167,254, 13,185, 33,185,154,223,182,114,230,247,123,167,182,150,151, 0, 87,190,199,103,133, 72, 79, -118,141,147,141, 35, 27, 74,211, 50,233,222, 51,191, 3, 0, 99,178, 6, 90, 23, 47, 94, 84,128,214,176, 26, 46,239,250,150, 50, - 9, 19,207, 17, 40,215, 29,192,200, 29,158,121, 25,217,125,157, 35,154,184,247,136, 82, 28, 61, 7, 3,143, 50,152, 43,159,177, - 71,211, 82,117,136,216, 95, 31, 17,218,228, 56,188, 14, 31,171, 89,179, 38,211,209, 26, 53,106,140,199,255,186,248, 77, 77, 26, -208, 71,185,244, 42,144,213,203,188,124,226, 39,255, 58,233, 44, 29,101, 6, 3, 90, 7,103,255,101, 19,104, 45,172, 84,232,201, -218,186,229,183,109,109, 89, 99, 12,234,208,136, 33,187, 2,233,166,110,149, 53,195, 83,255,153,191, 19, 24,134, 0, 6,214,253, - 11,129,106,179,244,234,213,203,155,188, 0, 95,229,233,211,167, 74,104, 23,120,145, 14, 38,217, 2,241,220, 3, 83, 70,154,166, -135,166,141, 62,156,160, 84,177,130,175,166,140, 26, 40,222,247,175,202,145, 5,191,201,154,161,205,101,116,171, 74, 18, 45, 74, -164,187,182,104, 82, 21, 72, 41, 21, 65,214,145, 5,125, 5, 97,151,200,163,214, 72, 7,125,124,124, 16, 8,218, 71, 13,212,155, - 18,241,196,188,119, 76,235, 36,204,203,103,172, 84,141, 90,131,143, 11,188, 89, 31,193, 33, 12,199, 66,207,206, 12,205, 1, 47, -223,126,136,213, 23,112,249,242,101,233,221,187, 55,129,176,101, 16,236, 32,154, 84, 19,174,219,122,228,220,253,219,247,189,175, - 95,188,241,120,252,200,217, 91,199, 79, 93,181,118,197,230,195, 27,151,173,223,179,138,247,109,125,211, 97,228,167,222, 97, 66, -171,238,122,233, 88,230, 51,104,134,134,107,246,159, 49,248,105,240, 51,188, 56,240, 95,238, 75,118,121,136,185,177, 16, 82, 85, -254, 50,147,229,127,139,115,229,190,213,255,194,248, 95, 36,240, 89,222,103,226, 53,149, 94, 21,156,107,153, 44,233,105, 91,199, - 66, 13,119,119,119, 5, 32,168,191, 42, 69, 0, 39, 5,191,124,120,126, 93,252,174,108,177, 9,180,222,157, 95, 45,143,142,173, -144,163, 75, 6, 8,243, 59, 42, 13, 85,135,141,243,152,132,210,172, 95,190, 75,240,254,216,177, 99, 59, 9,170, 8,176, 84, 73, - 87,183, 98, 38,198, 0,219, 58,114,228, 72,247,133, 11, 23, 18,104, 49, 57, 58,188,222, 28, 63, 36, 71, 93,130, 75,138, 44,129, - 23, 39, 89,132,246, 17,196,111,147, 57,115,230,176,140,180,195,178,123, 32,134,216, 30, 74,177, 16,175,235, 20, 50,217,117, 12, -136, 73, 54,118,147,244,201, 47,249, 45,159,104,246,111,150, 91,188, 75,199,176, 89,127,170, 14, 45,143, 81,153,147,203,212,194, -153,101,126,197, 2,143,113,125, 43,210, 40,164, 6, 72,140,116,111,130, 75,222,120, 53, 83, 36,190,246,126,197,164,119,254,109, -139,106,122, 57, 39,200, 66,240,223, 23, 12,140,123,235,214, 45, 97,192,218,237,219,183, 43,129, 97, 75,150, 44, 25, 4,180, 80, -222,100, 45,179,166,243,242,159, 61,216, 18,188,233,233, 64, 74,158, 40,145, 34, 77, 61,190,125,149, 92,219,191, 82,142, 45, 27, - 41,139,127,107, 36,157,107, 22, 49,199,139, 25,253, 61,110,151,179, 71,168, 99, 9,147, 91,214,244, 73,175, 48, 48, 57,131,182, -254,244,211, 79, 74,156, 54,198,123,131, 20, 78, 32,185,164,170, 83,118,237,218, 37, 84,247, 85, 40, 85,224,109,181,236,166,130, -186, 11,134,144,148,144, 84, 62,102,221, 73,127,231,206,157, 10,200,226, 47, 64, 22,249, 55, 31,161, 53,222, 49, 0, 51,222, 75, -245,110, 8,155, 58, 60,127,241,220,149,123,247, 38,140,152,181,107,193,212,165,187,214,172,218,190,107,189,199,177, 77,235, 60, -142,175, 56,122,250,198, 58,222,183, 46, 79, 88,249,233, 68,253,140,172, 6, 7, 12, 14, 24, 28,248,215,115,192, 30, 22, 97,197, - 9,144,254,254, 81,128, 82, 5,171,255,202, 61,139,251, 65,255, 49, 7,244, 83,243, 90,230,225,117,254, 71,108,224,165,184,239, - 22, 14,204,117,172, 58,212, 2, 90,239, 79, 47,150, 79,239,188,229,147,207, 19,241,187,181, 87,222,157,156, 47,239,174,110,147, -231,215, 14,203,149,189, 75,101,237,144,218,178,118,112,109, 77,160, 21, 88,145,157,148,100, 1, 76, 41, 9,193, 81, 67, 0,173, - 46, 93,186,108, 5, 19,220,161, 2,210, 5,180, 94, 31,216, 21, 12,104,157,206,159, 86,110,116,110, 46,148,110, 12, 29, 58, 84, - 58,117,234, 36,221,187,119, 87,128, 22, 65, 8,202,225, 16,104,193,206,107, 31,129, 86,179,102,205, 8,180,108,198, 59, 43, 99, - 50, 69,174,156, 40,206,238, 55,243, 71,249,153,187,148,147, 87, 0, 89,231, 11, 69,213, 5,180, 38, 23,200, 36,243,202,229,123, -184,178,102,233,205,104,224, 17, 72,245,144,148, 56, 85, 0, 89, 81, 74,199,137,177,239,229,220, 17, 62,230,222,213,228, 85, 25, -219,224, 13, 0,165, 29,210, 35,128,148,139, 42,200,186,121,243,166, 98,147, 6, 67,248, 39,148,100, 33, 61,130,125,154,130,178, -139,162, 30,223, 39, 77,112,230,221,178, 9,239,252,219, 20,214, 4,111,182, 58, 93,146, 92,181, 42,167, 73,158, 88,214,143,106, - 41,139,251, 55,144, 42,168, 7,242, 85, 65,210, 19, 19, 45, 21, 0,225, 83, 74,217, 40,113, 34, 40,100, 64,101, 6, 6,126,241, - 2,193,160,159, 60, 81, 64,214,224,193,131, 73,211, 86,204, 59,123,223, 65, 74, 72,155,158, 80,130, 71,122,155, 54,109, 10, 38, -201,186,114,229,138,180,107,215,206, 31, 15, 87, 3,200,186,138,120,125,135,112, 30,217,154, 88,198,140, 25,215,159,186,112,227, -218,138, 13,251,246,241, 75,126,243,236,180,130,141, 15,157,186,182, 97,235,174,163,203,120,223,242,153,240,224,103, 56,124,216, - 6, 9,131, 3, 6, 7, 12, 14,252,107, 56,160, 7,104,169, 96,202, 18, 52, 89, 3, 44, 75, 16,102,153,223, 82,170,101,249, 12, -174,219, 10,196,237, 44, 95, 53, 37, 90,101, 88, 65, 36,224,135,255, 31,170, 68,235,229,162, 90,242,114,201,143,226,123,104,162, -124,244,190, 45, 18,240, 73,238,156,218, 33,235,134,213,149,201,245,147,201,164,186, 73,100,213,239, 85,245, 2, 45,197, 38,203, - 50,192,240,128,239, 19,190,163, 36,139,233,151, 82, 49,222,171, 64,107,254,252,249,186,128,150, 42, 45,162, 84,203, 82,178,197, -232,235,109,219,182, 85,128, 86,143, 30, 61, 20,160, 53,109,218, 52, 77,160,245,195, 15, 63,236, 39,208,106,210,164, 9,131,251, - 70,183,193,237, 8, 5,163, 71, 89,241,120,114, 63, 95,243,192,134,242, 6, 96,232, 98,225,104, 1,195,211, 68,218,104,171,101, -172, 37, 90,115,202,228,185,191,162,122,201, 77,155,154,254, 48, 12,101,175,139,164,216,122,241,200, 23, 37,202,178,123,227,123, -189,254, 48,162,165, 66,247, 82,225,104, 4, 9, 33, 14,128, 44, 47, 26,189,243,160,186,144, 32,107,253,250,245, 2,155,172,199, -148,112, 89, 61, 16,177, 80,204,104, 27,159,255, 53,200,199,220,167,134, 66,215,217, 30, 68,144,213,250,151, 33, 31, 79,120,122, - 74, 42,151, 68,242,107,131,210, 1,153,147, 39,244, 5, 29,103, 2, 88,231, 65,217, 46,180,105,211, 70, 90,183,110, 45, 83,166, - 76, 81,108,180,198,143, 31, 47, 77,155, 54,149,234,213,171,251, 71,139, 22,109,180, 19,101,139,133, 32,184,231,104,139, 69,144, -181,118,237, 90, 89,188,120,177, 34, 25,179,150,100,129, 95, 84,109,114,135,104, 8,144,197,247, 33,190,226,247, 61,122,255,118, -227,214,189, 39, 55,119, 30, 62,191, 99,211,182,125, 39, 46, 92,189,187,243,250,157,199,123,234,214,111,124, 6,247, 45,227,137, - 89,240,179,122,168,248,233, 68, 29,141,172, 6, 7, 12, 14, 24, 28,248, 79,112,128, 24,196, 22, 22, 97,229, 29,129,167,191,111, - 43,146,174, 32,169,151,122,205,242,215, 34, 95, 89, 85,162, 21, 40,241, 82, 54,100,125,246,195, 90,109,200, 23, 6, 3, 90, 4, - 91,129,201,255,230, 30, 5, 92, 89,166,149,191,125, 31,106,160, 69,208,117,240,224,193,173,152,124,183, 18,100,169, 64, 11,106, -190,112, 7, 90, 52,138, 70,213, 28, 74,180,176, 19,242, 0,129, 86,227,198,141, 9,180,162, 88, 51, 63, 67,244, 56,251, 78,247, -107,101,254, 48,161,139,188, 45, 27, 75, 46, 21,137,246,225,167, 4, 17, 94, 65,149,100,105,255, 19,244, 24,129,214,218, 95,218, -202,196,188,233,101, 86,169, 92,119,209, 25, 54, 34, 13, 65,170,131,148, 81,205,152, 62,122,220,157,199,251, 52,247,255, 48,181, - 23,232,198,150,203, 69,162,189,239,146, 52,162,165, 61, 85, 16, 77, 72,178,188,168, 38,187,113,227,134,156, 61,123, 86, 49,244, -167, 36,203, 6,200, 50,177,188,231, 7,181,247,255, 48,166,157,188,253, 46,166, 66, 87, 79,135, 74,146,187, 86,137,148,121,107, -251,166,202, 95, 87, 90,116,250, 93, 32,125,148, 86,221,134,127, 32,232,138, 19, 61,234, 60,208,208,218,117,106,239, 53, 4,175, -223, 99,135,169, 60,126,252,152, 0,139,109, 66,209, 45, 37, 99, 76,220,117,202,128,185,142, 34,199, 71,140, 26, 53,234,198,147, - 39, 79, 42,234,194,205,155, 55, 43, 32,139, 54, 89, 0,212, 1,148,100,193, 30, 76, 83,146,101, 89, 64,184,116, 24,190,113,243, -142,203, 23,111, 60, 56,190,193,227,224,166,219, 15,158,238, 94,176,120,249, 33, 92,167, 77, 89,208, 17, 90,126,234,225,185,145, -199,224,128,193, 1,131, 3,255,101, 14,216,194, 34,228,135,181,170,208, 22,168,210, 2, 90, 22, 18,173, 74, 54,128, 89, 88,217, -110,173, 58, 76, 17,130,160, 51, 64,139,170, 67,107,160,181,162,127,101,221, 64,139,118, 89,150, 18, 45,158, 95,186,116,201, 29, - 0,203,157, 42, 67, 53,205,154, 53, 75, 23,208,122,190,102, 73, 48, 73,150, 42,217,178, 37,209, 26, 55,110,156, 38,208,170, 86, -173,218, 65, 2, 45, 0,129,201, 96, 84, 48,137, 77, 44,151, 44,141, 54,182,169,243,233,195,236,129,242,174, 66,124,185, 92, 56, -218,187,186,113, 35,188,176, 7,178,200,104, 2,173,117, 29,127,146, 25, 37,179,223, 94,242, 67,177,245,104,224, 65, 72,181,144, -210,171, 13, 17, 59, 89,230, 31,215,180,172,249,233,195,252, 97,242,190,114, 66,185, 82, 56,218,155, 26,177, 35, 60, 7, 93,155, - 72, 27, 54, 77,237, 32,189,122, 4,247, 18, 47, 9, 86,182,108,217, 66,195,247,123,214, 13,203,242,186,255, 92,239,211,135, 25, -191,202,187,242,113, 41, 33,123,219, 46,145,109,240,102,249, 44, 65, 86,182,210,205,222,238, 63,116, 84, 8,102, 0,132,165, 73, -135,129, 66,144, 21,214,222,136,231, 59,129,199, 31,174, 95,191, 46,247,238,221, 83,212,157, 89,179,102,189,141,235, 93, 1,106, - 30, 80,234, 72,233, 20,252, 96,205,119,240,174, 63,160,122, 22,244, 37,217,189,123,183, 2,178,248, 75,169, 37,158,153,223,161, - 67, 7,197, 38, 75, 75,146,101, 73, 31, 82,171, 24, 63,148,207,228, 63,248,247,150, 31, 26,215, 47,246,126,242,248,254,254, 53, -171,228,216, 14,240, 26, 4,182, 21,126,182,175,239, 52, 63,195,129,103, 6, 9,131, 3, 6, 7, 12, 14,252,235, 57,160, 7,104, -217, 2, 94,196, 98,127,227,177,255, 75,182,248,223,158,141,150,154, 63,240,126,249,207,192, 88,173, 29,255,127,191,210,158, 68, -235,237,190, 49, 33,128,214,242,126,149, 52,129, 22,141,225,219,193, 16,158,198,239, 84, 23, 90,130, 45,107,160, 53,108,216, 48, -119, 24,176,235, 2, 90, 79,151,204,118, 8,180, 58,119,238, 28,164, 58, 28, 61,122,180, 38,208,194,142,194,195, 0, 90, 91,232, - 39, 11,108, 8, 50,156,142,159, 44, 75,153,145,227,255,124,250,242,222, 29,185, 95, 41,133,156, 43, 18,253,125,229, 88,145,222, - 58, 2, 89, 65, 64,235,231, 38, 55,225,198, 97,237,218,250, 21, 6,160, 35,212, 64, 74,171, 54,108, 12,151, 76,133, 7,143,154, -252,244,213,189, 59, 1, 15,127, 72, 45,231, 11, 71,127, 95, 41,102, 36, 31,123, 32,203,178, 67,192,133,131, 23,119,238,173, 88, -177,130,134,239,193,128, 86,176,242, 86, 76, 38,103, 80,222,138, 49,181,203, 75,144,149,189, 76,243,183, 7, 14, 29, 19,184,217, - 80, 64, 15,124,156, 73,210,156, 53,157, 86, 57, 90,119, 94,248, 72, 27,212,191,127,127,197, 30,139,146, 56, 2, 95, 74,159,232, -130, 1,109,174,236, 22,196, 38, 9,249,237,183,223,248, 46, 26, 43,218, 58,106, 83, 37,204,227,232,209,163,193, 36, 89, 87,175, - 94,117, 90,146,165,190, 0, 64,171, 76,231,246, 13, 32, 33,123, 41,111, 94, 94,145, 27,231,231,237,169, 94, 57,215, 32, 24,194, -199,103,158,208,242,243, 51,124,192, 6, 73,131, 3, 6, 7, 12, 14,252,167, 56,128,225, 62,180,187, 14,249, 28,119, 25,170, 59, - 14,131,140,233, 3,175,241,126, 8,205, 85, 56, 48,215, 57,160,229,179, 99, 96,144,218,144,234,195, 55,155,123, 4, 3, 90, 51, - 91,101,145,101,125, 43,104, 2, 45,107,247, 14, 30, 30, 30, 59, 33, 45, 81,164, 91, 42,208,130,241,186,251,220,185,115,221,199, -142, 29,235,158, 47, 95, 62, 2,173, 1, 26, 21,126, 64,195,106, 30,199, 82, 69,181,105,163, 69,160, 5,131,113, 25, 56,112,160, - 12, 26, 52,136, 19,248, 3, 71, 52,233,194,129,126,178, 0,180, 20, 23, 14,249, 51,103, 28, 90, 34,127,238, 7, 21, 42, 87,243, -127,239,247, 33,224,226, 93, 31,153, 60,108,138,119,201, 56, 49, 63,164,141, 25, 95,211,112, 27, 18,173,235, 40,222,106,164,223, -144,170, 33, 41,116,243,101,206,248,107,241,124, 57,238,148,173, 80,205,223,223,252, 49,224,242,189,183, 50,117,200,148, 87,101, - 98,199,248,144, 58,102,130,142,122, 26, 26, 64,171, 29,141,222,185,187,176,120,241,226,205,173,203, 75,186, 44,239,164,161, 83, - 94,148,140,173, 93, 94,130,172,156,223,181,120,123,232,200, 9,238,254, 84,236,190, 40, 41,154,191,116,173,164,204, 91,135, 54, - 89, 97, 57,162,163,188,239,233,211,140, 18, 56, 72,175,184, 35,114,114,193,130, 5, 63,112, 21,131,126, 32, 27, 55,110, 36, 96, - 52,227,250, 32, 36,155,246, 84,240,135,181, 5,198,243, 1,164,179,100,201, 18,165,124, 4,111,200,175, 72,178,224,135,205, 41, - 73,150,101,133,220, 92,211,200,206,245, 3,197, 99, 85,159, 61,203,254,108, 48,200,213, 53, 85, 25,203,246,119,150,159, 97, 97, -150,241,172,193, 1,131, 3, 6, 7, 12, 14,124, 51, 28,208, 86, 29,218,170, 10, 36, 90, 87, 38,247,255, 73,222, 62,188, 36,254, -215,119,200,235,245,237, 21,192,245,106, 69, 83, 5,104,205,108,153, 89,214, 96,183,225,236, 94,223, 75,173, 2, 73, 9,180,174, - 56, 98,137, 53,208, 90,185,114,229, 78, 24, 67,187, 15,174,154, 56,200,143,214,175, 21,227,189,131, 90,201, 29,146, 15,122,227, -174, 97,111,178,181,120, 79,107, 55, 55, 55, 63, 78,212,183,122,255, 44,103, 75,102, 83, 64, 23, 15,170, 14,233,183,169, 79,159, - 62, 10,200, 2,128,146,216,177, 99,211,181, 65, 48,155, 27,235, 50,195, 95, 86, 61,213, 25,169, 91,198, 84, 85,218, 53,172,243, -250,238,185, 19,178,121,234, 48,233, 57, 96,194,167,153,238,151,189, 83,100, 43,123, 39,102,138,172,249,244,116, 1, 0,173,149, - 40, 78,127,164, 31,144,148,221, 13,217, 50,164, 41,215,186,110,205, 87,164,187,105,234,112,233, 51,108,106,192,220,205, 87, 95, -166,201, 85,238, 78, 12,151,108,150,134,215,122, 94, 17,148,199,186,188,221,126, 27,247,105,198,198, 75,207,147,103, 45,173, 89, -222,164,217,107, 23,207, 95,161,245,219,195,199, 60,101,205,154, 53,220, 28, 33,123,247,238,149, 5, 75,215, 73,218, 66,245,125, - 8,194,156, 42, 76,200,204,241,105,143, 69, 55, 12,216,112, 64, 96,164, 74,245,178,197,138, 21,107, 39,182,217, 62,130,141,213, - 30,178,199,209,123,146, 36, 73,242,138,237, 11, 63,107,138, 77, 22, 64, 86, 64, 88, 36, 89,234,187, 40,209,234,244,115,125,241, -123,231,181,231,245,139,203,131, 78, 31,232, 91, 38, 44,252, 12, 35,175,140,199, 13, 14, 24, 28, 48, 56, 96,112,224,223,206,129, - 50,144, 40, 32,212, 78,187,156,169,162, 62, 94, 56,186,179,188,185,113, 72,222, 29,155, 33,175,215,182,145, 77,127, 52,151,205, - 83,186, 74,251,170, 57, 37,155, 75,132,199,204,199,252, 86, 60, 9,230,120, 45, 88, 8,158, 44,166, 15,200,219, 31,246, 47,235, - 58, 21,254,191, 31, 45,158,227,250,207, 72,113,236,240,215,150, 51, 55, 26,157,205, 44, 80,160,192, 71, 74, 55, 46,215,171, 32, - 39,179, 37,145,142, 29, 59,202,128, 1, 3,104,212, 46, 73,147, 38,101, 24, 30, 26, 88,135, 52, 80,179, 10,155,162, 58, 35,133, - 55,240, 4, 5,179,187, 61, 62,179,115,163,236, 91, 56, 89,230,116,170, 35, 69,114,103,127,150, 60, 91,233,211, 58, 64, 86, 80, - 57, 17,191,144,126, 60,232, 20, 77,121,119,230,204,137,227,228,207,230,246,240,244,142,141,178,127,209, 84,133,110,209, 60, 57, -158,167,206, 94,246,146, 6,200,114,232,200,206,102,121,115,101,123,150,204,173,248, 41, 7,229, 13,162,153,177,112,253,245,247, - 31,122, 41,234, 56, 26,151,211,171,250,194,229,235, 1,178,234, 57, 11,178,236,149, 51, 62, 54, 26, 8, 65, 17, 92,104,176,157, -227, 59,241, 13, 89,210, 92, 71,176, 70, 59, 58, 75, 73,214,171, 87,175,156,149,100,133, 40,167,107,134, 84,163,106, 87, 47, 53, -168,211,207, 63,150, 9, 43, 63,157,168,155, 86,214,255,178, 3, 67,163,238, 90,189,195,185,251, 6, 63,157,227,151, 86,110,131, -159, 90, 28,250,239,220,231,252, 78,169,150,250, 11,111, 77, 78, 28,185, 92, 76,177, 0,164, 6, 20,206, 16,199,103,237,196,110, -242,252,228, 42, 25,222,254,123,201,155, 42,154, 15,175,243,190, 19,160,200, 58,107, 44, 75, 73, 23,207, 53,138,230,168, 99,211, - 23,213,234, 54, 37, 10,203,217, 54, 13, 20,215, 14,176,175, 33,189,213,196, 55, 14,232, 6,163,137,103,162,231,200,148,238,151, -188, 89, 92, 31,204, 31,209,247,211,246, 63, 71, 40, 96,136, 41, 79,230,244,214, 94,229,237,145,253, 63,128,201,152,241, 59, 72, - 97,146,101,207,158, 61,106,150,140,105,218,230,201,156,241,254,236,161,189, 63,238,152, 49, 42,136,110, 94,125,116,109,214, 61, -140,229, 13,162,153, 44,119,205, 66,173,123,142,121,239,245,228,153,208,201,235,162, 21, 27, 66, 3,178,200, 15,187, 64,139,146, - 44,238, 94,164,195,210, 48, 0, 45, 55,196, 46,188, 50,117,234, 84,185,118,237, 90,168,109,178,236,149, 19,234,205, 28,104,255, - 46,161,108,127, 99,224,117, 98,108,209,145,213,224,167, 14, 38, 57,145,197,224,167, 19,204,210,145,213,224,167, 14, 38,253, 71, -178,168, 54, 89,214,191,206, 85, 63,163,139, 41,105,230, 36,166,105, 89,147, 70,120,199, 95,254, 15, 3, 40, 10,122,212, 82,210, -197,243,112,160, 73, 23,253,244,105,197,164,184,235,119,134,102, 46,215,116,215, 58,214, 42,255,110,197,176,110,178,122,104, 23, - 5, 12,141,105,241,189,148,207,159,205, 59,159, 91,198,225, 90,196, 2,239,135,248, 0,115,102, 74,119,177,125,141,114,111,151, - 15,237, 42,107,134,253, 34,115, 59,255, 40,227, 90, 86,149,138, 5,115,188,204,155, 37,195, 56, 29,116,109,126,212, 97, 44,111, - 48,154, 84, 15,182,233,245,199,251,219,119, 31, 74,134,194, 13,156,149,100,169, 85,176, 55,248, 68,201,157, 59,247, 51, 26,187, -231,204,153,147, 42, 92,103, 12, 16,173,105, 70,131,173,214,104,134,215,161,211, 83,103,118, 23, 90,240,249,179,243, 83, 71,155, -234,201, 98, 12,230,122,184,164, 63,143,193, 79,253,188,210,147,211,224,167, 30, 46,233,207,243, 95,230,167,126, 46,125,125, 57, - 67, 31, 84,218, 86, 93, 92, 93, 77,209,116,214,241,155,236, 48,185,220,210,123,230,203,230,250, 36, 63, 83,150,140, 94,121, 51, -103,184,147, 63,107,134,253,153, 51,166,114,198,181, 65, 72,160,229,150,254, 92,254,172,174, 79, 11,100,203,244, 12,116,159,130, -238,253,124, 89, 50, 28,207,153, 49, 93,205,176,240, 51,140,229, 13, 81,206,100,217,107, 23,204, 90,178,233, 50,218,108,233, 44, -151,117, 54, 71,237, 94, 9,129,159, 87,224,129,239,156,164,109,143,102,161, 42, 85,170,220,182,231,241,221, 25,128,173,230, 13, -111,126, 58, 89, 79, 91,217,191,201,239, 40, 28,234, 77, 18, 70,221,195,137,145,246, 22,128,225, 64,222,104,163,112, 96,162,214, - 2, 48,140,175,248, 86,218, 40,140,213,252,111, 62,254,173, 52,174, 81,206,240,237,159, 95,154,159,116,193, 97,115,135, 98,104, -128, 86, 24, 89,241,165,235, 30,218,226, 26,229, 12, 45,231,108, 63,103,240,211,224,103,120,113,224,191,220,151,194,139,135,255, - 4,157,240,149,104, 57, 81,131,255,114,135, 49,234,238, 68, 71,209,145,213,224,167, 14, 38, 57,145,197,224,167, 19,204,210,145, -213,224,167, 14, 38, 57,145,197,224,167, 19,204,210,145,245, 91,225,167,142,170,124,155, 89,216, 0,182,146, 51,181,177, 71,195, -209,117, 45,250, 6, 77,219,237, 18,218,246, 50,248,105,240, 83,111, 31, 48,190, 77,251, 28,208,203, 67,203,124, 6, 63, 13,126, -218,226,192,127,185, 47,105,125, 19,223,226,125,235, 93,135,250, 28,150,134, 67, 77,191, 21, 20,109,148, 51, 28, 26,219,130,132, -193, 79,131,159,225,197, 1,163, 47,133, 23, 39,255,166, 99,240,211,224,103,120,113,224,115,244,165,240, 42,219, 63, 65, 39,108, -187, 13,195, 80,226,207,209, 16, 6,205, 48, 52,136,141, 71, 13,126, 26,252, 12, 47, 14, 24,125, 41,188, 56,249,239, 2, 69, 12, - 34,207,100,239,176,117,223,232, 75,255,205,190, 20,190,181,254,178,212,194,213, 70,203, 13,101,103,210,115,132,246, 99,233, 4, -111,234,231,224,212,242, 19,188,180, 75,217,178,101, 7, 89,188, 44,136,102,169, 28,145, 79,124,151, 43,178,215,255, 83, 20,175, -239,114, 71,247,250, 46,111, 76,175, 82,121, 98,158,208, 83,192,192, 60,161, 45,167,163, 87, 24, 52,181, 27, 32, 93,204,120, 73, -207,198, 74,144,252, 74,244, 56,137,174, 68,137, 30, 7, 41,118, 80,138, 20, 53,186,135,173,118, 87,175, 37,207, 91, 59,109,146, - 92, 53,151, 39,201, 85,163, 36,130, 93, 47,227,111,210, 92,117,150,254,253, 91,123, 73,210,188,181,114,243, 55, 69,254,186,105, -236, 20,229,155,107, 35, 68, 83,136, 20,150,100,143,159, 41, 83,166,116, 71,132,133, 43,246, 18,190,199,221,218,205,249,205, 75, - 75, 74,163,142,231,144,148,224,180, 22,233, 34,206,181,130,206,234,234, 75,101,176,105,163,129,201,212,177,153,201,116,151,137, -231,188,246, 53,245, 79, 56,119,222,135,246,246,138, 27, 55,238, 13,150,139,191,252,207,235,161, 40,103, 7, 60,227, 27,152,120, -110,125,216,187,175,139,159, 58,250,164,101, 22,131,166,147, 12,211,200,254, 57,248, 25,190, 37,252,134,168,101, 65, 89,233,169, -157, 33,113, 30, 23, 42, 84, 72,178,101,203,198, 65,232,113,224, 53,222, 99, 30, 91,135,211, 13,129,208, 59, 99, 39, 77,154, 36, - 1, 1, 1, 65,161,116, 16, 14,103,144, 5,241, 32,154, 4, 88,114,103,143, 28,219,240,167,200,187,231, 72, 47, 68,222,191, 20, -121,118, 81,190,203, 27,219,203, 9, 30, 91,150, 51,110,194,132, 9, 39, 36, 74,148,232, 33,156,140,122,105, 37,230, 99,126,142, - 71, 86,239,211,172,123,236, 88,209, 63, 68,143, 30, 37,192, 86,226, 61, 27,229, 15,162,137,247, 30, 98,217, 48,248, 5, 75, 46, - 46, 46, 94,106, 74,150, 44,153,151,101,130,135,122, 47, 38, 60,103, 9, 66, 29,149, 51, 70,196,200, 81,251, 70,138, 18,123,119, -164,104, 49, 31, 69,138, 22,235, 81,228,104,113,118,243, 26,202, 22,195, 1,127, 53,235,142,103,211,165, 72,227,122,239,143, 25, -171,165,105,151, 33,114,249,218, 77,105,209,249,119,185,122,227,182,116,232, 61, 92,249, 37,232,178,213,238,234, 53,151,188, 13, -150, 76,156,189,246,133, 75,222,250, 15, 39,206, 94,163,252, 78,154,179,238, 57,174, 63,224,111,178,188, 13,238, 77,154,189,246, -185, 75,190,134,139, 66,219, 63, 27,101, 78,249,182,113, 70,151,143,182, 18,239, 57,106, 35, 39,250,159, 86,214, 32,126,170, 32, - 11,238, 44,232,117, 88, 26, 87,204, 63,114, 92,151, 26, 29,109,165,126,117,243,143,172,155,195, 36,141,242,197,204,175, 62,103, -143,159, 25, 51,102,188,244,241,227, 71, 4,212, 54,203,251,247,239,133,129,202,233,105, 31, 33,178,148, 0,224,174,174,174,202, -164,171,113,232,105,247,234,160,113, 26,233, 12, 18,131,182,107, 29,142,104,198,129, 47,181, 1, 8,223,180, 59, 90,180,104, 79, -152, 16, 98,107, 55,175,129,168,189,200, 18,124,159, 61,154,167, 17, 63, 83,241,203,246,236,217, 51,121,252,248,177,146,158, 62, -125, 42, 49, 98,196,184, 26, 14,117, 55, 17, 88, 77, 41, 89,242,227, 27,196, 16,245,234,214, 77,250,197,139,247,129,215,244,244, - 79,212,207, 3,229,184,226, 76,226, 51,206,142, 75, 4, 85, 28,124,249,203,103,173,255, 59,209,231, 41,169,242, 85, 7,242, 8, - 17, 34,124, 64,152,173,197,136,201, 58, 31,105, 94,209,162, 69, 23,240,154,122,159,121,145, 84,201,151,158,190,164,213,119,172, -239, 27, 52,157,229,152,227,252,159,131,159,225, 91,194, 47, 75, 45, 84, 54, 89,155,217,241, 9,172, 38, 76,152, 32, 0, 59,242, -238,221,187, 32,240,195,129,104,219,182,109, 74, 8,148, 28, 57,114, 16,120,241, 35,177,251, 81,151,175, 86,178,115,181, 70, 21, -132,169,112,201,188, 15,241,241,246, 65,254,136, 86,124,112,109,222,188,185,130,176, 24, 92, 24, 65,157,197,145, 68, 75, 1, 90, - 23,151,203,214, 46,105, 69,118,245, 18,153, 91, 80,100, 5, 2,115,111,110, 29,106,160, 69,208, 52,120,240, 96, 37,214,223,234, -213,171,101,217,178,101,178,112,225, 66, 65,160,107,153, 49, 99,134,140, 28, 57, 82, 24,196,154,201,207,207, 79,225, 9,242,125, - 12, 4, 91,150,213, 9,234,132, 69, 11,164, 57, 81,188, 96, 58,175, 98,129,169,104,190,212, 10,208, 33,192, 10, 98,168,213, 9, -239, 57, 26,208, 0,160,238, 61,135,227, 79,239, 51,103,228,197,201,147,242,226,196, 9,225,255,231,199,142, 32, 29, 66, 58, 32, -207,143,238,147,103,135,247,200,211, 3,187,228,201,238,237,242,120,187,135,220,199, 0,175, 14,160,129,244,237,125, 44,197,163, - 68,139,121,247,167, 78,191,155,103, 44,217, 34,219, 15,156,149, 45,123, 79,203,164,185, 27,165,105,251,126,230,104, 49,227,222, -197,243,246,252,108,105,126,128,209, 98,197,187,186,118,243, 30,233, 59,116,146, 36,207, 81, 78,146,101, 47, 27, 44,117,234, 59, - 82, 11,104, 37,116,201,249,195, 5,176,205, 55, 89,158,186,111,248,155, 92,253,205, 29,252,127,178,156, 63,156, 71, 89, 19, 58, -226,167,189, 54, 34,192, 82,155,230,201,159,127,202, 3, 4, 37, 87, 15,222,211, 59,233, 16,220,146,239, 90,201, 10, 4,171,228, -131, 1, 45,128,172, 2,184, 33, 0, 70,236, 35,178,229,175,254,107,229,210,170,153,150,233,244,210,254,107, 9,178, 2,252,222, - 4,240,183,105,161,152, 5, 8,182, 44,202, 27,172,141,210,167, 79,127,229,237,219,183,130, 32,239, 74,112,111,235, 4,160,165, - 5, 52, 72,218, 86,187,243, 27,159,146, 56,113, 98,246,121, 70,103, 56, 74, 32,195,119, 1, 4,156,197,255,124,241,227,199, 63, -197, 60, 54,198, 3,123, 52,121,189, 52,162, 3,220,221,181,107,151, 15, 0,161,239,245,235,215,125, 63,125,250,228, 11, 80,228, -139, 96,232,111, 32,133, 97,255,164,132,202,214, 97,175,127,250, 33, 32,185, 34, 69, 71,188,213,160, 68,160, 85,171,112,148,128, -118,149, 99,249, 54,251, 46, 38,199,174,106,136,198, 16,223,138,176,102,159,103,126, 74,177, 8,178, 48,168,138,148, 41, 35, 16, -149, 9,175,233, 41, 39, 1,214,170,117,203,101,227,150,117,178,118,227, 42, 89,190,122,137, 44, 94,190, 64,230, 45,154, 45, 51, -231,254, 41,211,102, 76,150, 9, 83,198,202,152,241, 35,101,228, 31,195,100,200,240,129, 4,136,214,241,103, 53,203,169, 2,171, - 76,153, 50,249,240,156,191,150,192, 75,111,159, 71,190, 96, 64, 11,101, 17,180, 83,192,189,123,247,148,196,115, 94, 51,128, 86, - 8,142,106,182,145,157,254,226,232,242,183, 66, 51, 20, 85,251,106, 30, 9,149,234, 80, 56, 32,122,123,123,115, 64,183,135, 7, - 20,176,113,254,252,121, 5,144,160,186,214,224, 32,168,113,231,237, 29,211,121,215,227,133,194,228,113,111,190,252, 54,189,139, - 64,186, 98,237, 13,125,228,225,195,135,149,213,100,244,232,209,247,130, 94, 60, 71, 31,181,170, 58, 44,157, 51,202,155,138,133, -226,251,148,206, 25,245, 77, 88, 85,135,148, 80,205,158, 61, 91,126,252,241,199, 96,131,173, 58,240, 54,105,210, 36,216, 36, 68, - 0,202, 21, 63,159,179, 55,240, 18, 96, 89, 50,176,106,133, 28,222, 69, 11,164,245, 74,147, 42,209, 39, 94, 39, 88,101,234,215, -175,159,146, 40, 85,208, 2, 90,224,221, 61,239, 83,167,228,202,196,137, 65,233,218,212,201,114, 99,230, 20,185, 57,111,138,220, - 94, 52, 69,238, 44, 69, 90,130,243,133,184, 54,119,138, 92,159, 49, 69, 30,184,111,208, 3,180, 10,167, 74,155,217,123,225,154, - 93, 50,115,249, 78,249,174, 65, 95,132,226,169, 43,255,107,239, 42,192,164, 56,154,232, 5,119, 15,110, 9, 36,184,107,128,224, - 46,193, 9,110, 65,130,187, 6,185,224,238,238, 16,220,221,221,225, 14,119, 61,244, 56, 28,142, 91,252,174,254,247,134,157,253, -231,150,221,157,153,227, 32, 33,217,249,190,254,102,119,166,167,166,167,218, 94, 87, 85, 87,125,159,247, 87, 41, 89,175,143,140, -156,181, 73,198,206, 94, 39, 73, 82,252,248, 24,223,236, 40, 0,182,110,167,142, 24, 57,198,173, 51, 8,197, 83,182, 74, 61,201, - 82,176,146, 12, 28, 61, 93, 70, 79,249, 75, 1, 91, 51,230,175,148,125,135,143,187, 4, 90,152,156, 39, 20,173,214, 62, 96,226, -156,117,150, 98,181,251, 90, 38,206, 93,103, 41, 94, 87, 61,123, 42,255, 75,212,251, 83, 57,151,174,221, 57, 0,245, 51,193, 85, - 91,250,168,142, 74,126,168,163,134,105,146, 41,117,196,227, 48, 38, 69,166,144, 0, 45,117,242,114,218,145,172, 55,236, 64,176, - 90,100, 27, 63, 85, 73, 22,251, 36,219, 29,128,129, 2,182, 54, 77,237,185, 66, 5, 90,199, 23,244, 92, 65,112, 21,248, 10,128, -102,215, 32,121,115,109,119,160, 42,217,210,240, 32, 88, 29,161, 61,109,132,218,240, 2, 19, 98, 60,190,192,249,141, 54, 97,178, - 13,112,164, 86,180, 83, 41, 58,170,247,241,236,211,254,254,254,130,160,221,143,208,175,222, 1, 16,201,250,245,235, 37,123,246, -236, 65, 69,138, 20,121,203,254,222,184,113, 99,142, 31, 4, 91,246,135, 35,154, 37, 96, 78,240,200,130,227,221,187,119, 22,140, - 83,150,149, 43, 87, 90, 64, 71,249,205,107,144, 68, 89,210,166, 77,251, 16,196, 28, 62,239,100,104,126,237,235,235,251,254,232, -209,163,114,238,220, 57,185,113,227,134, 34,209,227, 24, 87,191,112,120,145, 77,233,165, 77,229, 68, 50,124,234,218,115,153,178, -100, 31,207, 88,152,206,248,233,108,232, 39,168,162, 36,139, 32, 11, 31,108, 26,104,109,219,182, 77, 16, 31,214,101,202,147, 39, -143,252,252,243,207,130,168, 9,186, 64, 11,253, 98, 5, 36,224, 7,180, 9, 82,242,231,221,186,117,123,207,122,226,193, 51,255, -243, 58,243, 97, 49,176,194, 4,200,108, 73,169, 21, 1, 21, 52, 33, 62, 88, 60, 47, 64, 90,200,244,235,175,191, 46,230, 53,222, - 99, 30,208,212,170, 22,117,199,144, 16, 76,175,110,154, 33, 96,154,139, 71, 62, 7, 63,157,190, 14, 77, 49, 39, 18, 36, 41,182, - 84, 66,243, 59, 47,126,231,177,254,215, 94,103,126, 94,215, 62,107,255,159,207, 70, 67,130,164, 70,161,205,184,196,113, 67,192, - 42,215, 18,173,117,235,214,137,154, 52,196,149, 78,198,112, 41, 28,120, 46, 94,188,168,136,209,169, 86,240,243,243,147,237,219, -183,203,184,113,227,164, 3, 6,141,142, 29, 59,202,164, 73,147, 84,155, 6,135,229, 83, 37, 90,191,212, 41, 33,127,206,234, 34, -203,207,205,144,138, 13,202,190,199, 64,173,198, 32, 12,151, 57,115,230, 7,124,231,200,145, 35, 73,139, 42, 6, 67, 7,104,116, -222,113,202,210,151,103, 67, 15,184,200, 68,192, 68,169, 85,149, 42, 85, 12, 1, 45, 74, 0, 8, 52, 29, 0, 45,219, 91, 56, 97, -107, 39,216, 43,231,119,203,177,131,139,165, 82,197,114, 10,168,122,252,248,177, 2, 46,239,223,191,175,240,152,103, 39, 64,203, - 70,147, 64,139, 82,172, 96, 64,107, 18,128,214,140,241,114,125, 46, 0,214,162,241,182, 87, 18,112,241,218,213,233, 0, 90,107, - 86,217, 3, 45,123,110, 68, 14, 27, 33,138,207,140,197, 91,164, 93,255, 57,146,162, 80, 27, 73,148,181,178,141, 86,170,124,181, - 36,119,245, 63,165,237,192,133, 50,124,218,106,129,100,203, 7, 4, 92,169, 17, 29,114, 59, 66,164,168,183,106,212,168, 33, 80, -213, 72,219,142, 93,165,107,223, 97, 50,108,194,108, 5,104, 77,153,179, 76,118, 31,240,178, 7, 90,193,232, 64,154,113, 13, 82, - 54,128,172, 62,150,158,131,166, 88,138,212,236,101,233, 51,108,134,242,191,223,168, 57,150, 18,117, 61, 45, 67, 38, 44,176,148, -109, 52,208,178,121,207,113, 11, 36,142,215, 92,181, 13,251, 58,186,138, 58, 58,126,104,177,252, 89,190,140,248, 33,166,162, 22, - 96,241,247,241,100,201,196,137, 68,203,225,107, 84,160,197, 56,143,142, 36, 70,188,206,195, 9,208,210,210, 84, 36, 89,228, 27, -233,176, 95,158, 57,115,154,146, 53, 81,129,214, 7, 73,214,115,121,177,163,191,220,239, 31, 95,158, 46,168, 33, 79, 87, 52,127, -195,235, 70,250, 7,213,136, 90,213, 61, 65, 29,193, 6,165, 80, 92,124,177,189,178,141,222,188,121, 83, 0,190,174,184,162, 9, -190,123,243,153, 93,187,118, 9,192,144,162,142,100, 28, 77, 6, 45,223,188,121,179, 82,255,231,207,159, 23, 72,219, 4,117, 74, -201,150,222, 17, 3,234,193,219, 40,139, 5, 99,145, 5,101, 81, 0, 22, 37, 89,252,189,111,223, 62, 75,193,130, 5,149,107,120, -143, 5,106,197,219, 32,104,175,214,119,246,142, 87,215,174, 93,123,199, 96,229, 56, 43,223, 8, 44,167,212, 11, 36, 90,210,180, -100,148, 87,191, 87, 76, 97,217,236,245,244,237,168,153,155, 47,160,174, 42,233, 21,214,254, 62,213,132, 61, 98,197, 10,164, 36, -139,169,195, 55,223, 4,186, 80, 29, 6,123,156,210, 41, 74,178,170,254, 90, 73, 41, 19,207,246,233,215, 58,213,164,110,195,218, -210,184,105, 3, 69,170,229, 64,162, 21,140, 38,198,145, 3, 0,235,151,192,207, 75, 80, 23, 95, 66,253, 92, 2, 47, 47, 33, 78, -236, 83, 68, 92, 80,144, 22,207,117,234,212,121,230,227,227,115, 9, 82,168, 75,124,198,204,119,103,203,150,109, 38,158, 21, 0, -171,165,104,179,105,181,137,215,120,143,121,204,208,116,231,253,119,114,192, 9, 22, 81, 62,150, 32,136, 39, 53,105,255, 99, 81, -209, 67,253,239, 40,159,246,154, 21, 76,217,104, 89,159, 45,199, 51,105, 67,189,189, 16,121,140,218,161,155,175, 8,126,164,230, - 41, 27,208, 34,216,210,166, 70,141, 26, 73,211,166, 77,165,101,203,150,210,182,109, 91, 5,104, 17,116, 89, 25,224,242,197, 88, -141,133, 79,241, 93,138,109, 19,183,141,148, 1,243,123, 11,140,112,123, 89, 31,248,133, 0,139, 7, 1, 23,174, 25,246,244, 29, -154, 64,139, 42,192,134, 13, 27, 74,235,214,173,165, 69,139, 22,202,119,242, 63, 6, 26, 14, 20,138, 58,147,171, 93,130,171,147, - 80,219, 29, 58,116,136,121,222, 57, 80, 29,218,248,144, 55, 71,114,191, 11,167,183,203,234, 5, 61,101,229, 95,221,101,217,220, -174,178,100, 86,103,169, 80,190,180, 50,113,181,105,211, 70,121, 95,171, 86,173,148,196, 73,215, 8,208,122,136,119,127, 4,180, - 0,166, 20,160, 5,112,165, 30, 10,208,154,243, 1,104,221, 94,185,220,229,100, 30, 38, 76,132,110, 53,155,116,125, 51,109,201, - 14, 73, 89,184,173,164, 46,222, 81,146,229,168,102,163,149,246,231,122, 82,160,206, 96, 41,210, 96,184, 12,157,185, 89,106, 52, -233,242, 58, 92,132,200, 84, 3,155, 58, 8,180, 60, 7,141,145,170,144, 28, 82,106,218,162, 77,123,233, 6,176, 69,160, 53, 97, -230, 98,217,190,247,176, 75,160, 21, 59,118,108, 31, 20,202,178,113,227, 70, 11, 84,216, 22,168,144, 44,187,119,239,182,236,223, -191,223,130, 58,177, 96,113, 96, 57,126,252,184,229,212,169, 83,202,132,140,213, 56, 1,161,211,227, 67, 29,109,179,213,209,114, -212,209,210,217, 93,196, 19, 64,235, 22,164,141,246, 64,235, 72,216,176, 82,251,123,135,170, 67,135,239, 32,128, 34,120,129,180, -225,137,106, 43,167, 61,243, 58,193, 12,175,185, 42,167, 42,209, 2,168, 8, 36, 96, 57,127,254, 92, 32,251,157, 35,137,214,235, -243,235,130,158,206,175, 42,207,150,214,127,231, 64,162,229,244, 53, 84, 35, 82, 37,238, 76,141,168, 5,138,144,116,233,217,110, -101,160, 36,107,213,170, 85,194, 68,147, 0, 21,100, 81, 58,131, 58,147,189,123,247, 50,248,251, 27, 20, 40,187, 94, 35,162,253, - 21, 0,218, 11, 74,173, 8,172, 32,113, 10, 6,178, 42, 86,172,104,153, 57,115,166, 5,101, 84,164, 90,125,250,244,121, 22, 33, - 66, 4,218,108, 25, 57, 14, 1,244,189, 39,200,130,100, 75,233,155,170, 84, 7,124,167,154,211, 3, 42,208, 68,125,134,207, 59, -186,229,216,243,119,153,179,230, 28,102,132,168, 54, 15, 12,235,194,231,142, 30,253,222,190,149, 43,131, 6,215,173,251, 62,111, -140, 24, 62,133, 13,142,117, 4, 77, 52,105, 80, 37, 90,236,148, 90,233, 22,108,158, 32, 40, 43, 44, 37, 75,150,148,242,229,203, - 83, 10,101, 4,104,237,199,119, 94, 2, 79, 47,161, 94, 46, 1, 12, 95,130,118,226, 18,198,243,171, 80, 23, 43,170, 12,212,241, -251,126,253,250,249,240, 58, 15, 87, 64, 11, 38, 13,123, 48,166,223,210,166,100,201,146, 5, 64,122,201, 58,182,164, 72,145,226, - 30, 19,218,152, 23, 1, 23,129, 22,121,141,239,152,102,150,151,238,252,255, 94, 14,216, 97, 17,229, 67,181, 64, 74, 11,150,236, - 1,150,253, 61,251,231, 62,144,250, 0,218,156, 61,139,235, 73, 67,192, 93,125, 27, 45, 7, 31,102, 10,104,141, 26, 53,202, 16, -208, 98,225,209, 9,107,180, 29,218, 90,198,111, 25, 35, 63,164, 73,181, 15,151, 98, 82, 85, 72,169, 14,213, 12,248, 63,216,204, - 71, 58, 2, 90, 0,107,155, 97, 95,118,209, 81,226, 61, 23,244, 67,203, 24,222,246,138, 60,217,146,249,157,246,222, 36,243,167, -181,151,121, 83,218,202,156, 73,173,101,214,248,150, 82,182, 76, 9, 69,253,115,224,192, 1,193, 74, 92,246,236,217,163,172,252, - 1, 26,116,129, 22,190,249, 22, 7,210,108,223,125, 39,189, 32,125, 75,151, 36,137,172,233,209, 21,234,193,113,138,154,144,234, - 66,170, 13,189, 39, 13,146, 14, 85,202, 74,253,226,133,100,107,191,222,114,115,233, 98,151, 64, 43,108,196,104, 59, 70,207, 92, - 45,213,219,142,149, 31, 74,116,148, 52, 37,218, 75,210,204,101, 36,113,250,194,146, 44, 99, 81,201, 84,188,137, 20,109, 56, 66, - 74, 53, 29, 35, 77,251,254, 37,127,142, 91, 38,145,163,199,217, 97,166,190,152,151, 64,107,214,194,181,210,187,255, 72, 69,114, - 72,105, 73,164,232,241,108,118, 90,191,181,247,116, 9,180, 0,108, 21,160,181,117,235, 86,203,206,157, 59, 45,224,157, 5,124, -180, 28, 62,124, 88,153,100,161,210,181, 64, 50, 97,193,196, 73, 13,147, 46,208, 98, 29,157,242,222, 24,188,142, 38,180, 18,207, -114,165,109, 32, 83, 85, 29,178,172,180,219, 49, 3,180, 8,160, 40, 13,118, 6,164,184,105,129, 19, 59,207,174,120, 73, 59, 43, -213, 70,235,228,137, 19,111, 57, 88,184,178,209,122, 56,191,214,123, 39, 54, 90, 78, 95,163, 85, 35,170,234, 68,103,103,157,221, -136,138,225, 59,192,207, 59,126, 27, 65, 22, 64,207, 43, 92, 59,201, 4, 48,240,154,215,217,254,209, 79,169, 2,229,117,151, 6, -242,144, 80,237, 2, 48,183, 64,250,162,128, 44, 74,174, 84, 73, 86,185,114,229, 44, 11, 22, 44,176, 0, 32, 90,188,188,188, 44, -151, 47, 95, 86,192, 55,212,204,187, 12,182, 79, 6,160,223,139,244, 20,233,153, 38, 81,130,147, 79,165, 81,190,106,253,153,219, - 79, 90,164, 98,141,198,243,245,232, 66,213,214, 3,252, 60,137,243, 25,140,113, 27,160, 34,187,130,128,234, 74,155,226,152,139, -250,166,125,150, 86, 5,233,148, 36,129, 22,109,178,180, 82, 44,210,169, 86,179,178,212,174,255,171,212,111, 92, 87,154, 52,111, -132, 69, 75,115,105,215,177,181, 12, 25, 49,200, 16,208, 2, 31, 21,160,181,102,205,154, 75, 75,150, 44,185, 52,119,238,220, 75, - 35, 70,140,184,138, 0,240, 10,208,202,154, 53,235,123, 0, 86, 31,216,170, 94,194,194,229, 18,234,124,191,179, 66,178,253,238, -159, 57, 69,142, 47, 95, 44, 94,139,254, 82, 36,161,108,247, 76,187,198,143,148, 93, 99,135,203,202, 14, 45,184,192,126,228, 6, - 90,122,173,231,191,121,223, 17,200, 34, 39, 84, 80,244,225,231, 7,245,161,250,219,254,236, 12, 92,217, 63,195,231,236, 37, 90, -214,255, 69, 67,192,125,215, 54, 90, 78, 62,204, 20,208, 26, 62,124,184, 75,160, 5,155,138, 54, 52, 50,117,148, 40, 37,226, 32, -204,131,198,240,248,192,212,102, 62,146, 64,107,234,146,195, 35,112,238,195,223, 76,185,114,229,186, 79,122,148,196,105, 15, 26, -177, 19,124,153,161,255,169,121,115,103, 77,226,231,125,112,141, 76, 29,221, 76,198, 13,105, 40,163,250,215,151, 97,125,107, 75, -159,174, 85,101,112,223,122,226,217,253, 87,233,213,185,154,116,111, 95, 73, 58,181, 42, 47,237,154,151,150, 31,190,139, 27,148, - 35,115,194,119,185,178, 38,122,238,232,253, 4, 90,237,219,183,167,109,131,253, 86,116,151,255,185,113,193,149,122, 10, 59, 11, -111, 45,223,124, 68,242,253,234, 41, 25,202,117,151, 44, 69,106, 99,101, 79, 91,243, 15, 71,198, 66,117,164,116,179,177, 82,161, -213, 68,169,213,101,166, 76, 90,188, 71,162, 68,139,125,203, 25,143,162,198, 73,180, 57,102,194,239, 47,198,248, 54,229,197,232, -241,146, 95,140, 22, 39,201, 69,186,115,136, 17, 63,197,227,168, 49,227, 1,164,197,150,194,197, 75, 11,196, 78, 4, 86,210,182, -199, 16,169,219,162,167,116,251,115,180, 33,160,197,137,148,157,197, 89,226,100,203, 3, 19,157, 75,137, 22,235,200, 11,117, 52, -101, 84, 51, 25, 51,232, 67,253, 12,232, 89, 67,122,183,253, 69,250,253,129,186,234, 82, 67, 58,213,202, 39,109,170,229,150, 86, - 77, 74, 74,211,122, 69, 36,127,166, 68, 65, 89, 51,124,251, 46,123,134,248, 14,235, 72,203, 19, 78, 64, 80,209, 56, 5, 82,188, - 79,240,102, 4,104, 89,193,150,178,235,240,215, 18,217, 70, 12,110, 89,161,131,163,212,165, 90,182, 17, 46,118, 29,126,106,179, - 54,242,252, 97,218,102,241, 80,213,133, 86, 3,120,229, 89,168,167,174, 80, 53, 7,112, 44, 0, 70,202,134, 27,128, 9, 69,114, -228,236,192,243, 15,160,202,180, 16,108,169, 42, 67,130, 46,236, 98,179, 76,153, 50,197, 6,178, 40,201,132,221,163, 5, 82, 52, - 11,104, 82, 66, 30,106, 71,217,202,117,103, 17,104,253, 82,173,145,179,221,172,182,119,193,164,224, 18, 68,255, 2, 3, 37, 65, - 25,165, 93,187,118,138,164, 92, 5, 90, 5, 10, 20, 16, 0,231,215,120, 96, 6,146, 75,137, 30,129,214,236,217,179,131, 73,180, -184, 89,137, 52, 48,190, 82,197, 39, 0,181, 82,189,122,117, 69, 2, 79,123, 79, 3,170,195,253,144,252, 41, 64, 11,188,186, 4, -160,122,105,252,248,241, 87, 0,130,159,215,170, 85, 75, 81, 29,214,174, 93, 59, 16,255,253,135, 14, 29,122, 13,210, 98, 93,160, - 69,144,213, 54,154,135,146,104,227,198, 68,117,115,215,120, 17,229,143, 68,209,100,215,200, 65,193,128,150, 91,117, 24,106, 77, -243,171, 39,228, 12,100,241,195,236,193, 83,104, 0, 45, 29,154,102,249,249,105, 54, 90, 70, 84,135,131, 6, 13,114, 9,180,160, -102,107, 19, 12,241,216,253,161, 90,133,110, 29,232,222,193,236,215, 17, 88,249, 62,126,183,133, 96,139,182, 90, 76,133,138, 20, -123,200, 45,234, 84, 71, 66,218,109,179, 65, 99, 69,234, 0,173, 24, 88, 1,143,134,196,196,144,123, 7,230, 99,126,148,217,169, - 29, 72,174, 44, 73,252, 14,238, 89, 33, 35, 7,212,147, 65,189,107,200,203, 23, 15, 12,165,103,143,174, 74,214, 12,241, 29,185, -121,160, 84,240,214,162,217,107,164,117,131,222,210,170,126,175, 96,169,109,195, 94,210,190,113, 47,153, 55,117,137,146,248,155, -215,152,207,179,203, 40, 73,150, 36,137, 83,169, 9,128,214,237,197, 27, 14, 73,193, 58, 3, 37, 91,165,222,146,250,167, 95, 37, -105,250, 66,182,218,202, 90,172,129, 84,108, 61, 73,170,182,159, 38, 13,122,206,147, 9,139,246, 74,148,232,177,105, 7,227,240, -136,157, 40,213, 69, 62, 60,117,237, 73,133,198,210,173, 39,148,243,142, 67,103,148,243,233,139,215,149,243,132,153, 75, 36, 92, -196,104,207, 93,248,209, 10, 70, 31, 19,152, 15, 30,179,169, 10, 41,193, 80, 85,133, 80,237, 90, 96,187,100,185,122,245,170, 5, -131,184,133,246, 60,122, 64, 43, 87,150,196,126, 7,118, 47,151, 17,253,235, 74,191,158,213, 12,213, 15,235, 81,169,163,244,223, - 58,172, 35,123,160, 69,219, 70,186,222,112,196, 40, 94,199, 78, 44,167,247,213,103, 62,197,135,150,221,174, 67,179,221, 44, 36, -249, 15, 19, 92,178,207, 65,197,171,236, 82,182, 7, 90, 84, 81, 82, 21, 73,144, 69,219, 40, 61,160, 21, 62,124,248, 7,172, 87, - 2, 40,240, 83,169,231,107, 0,211, 43,163, 69,179, 92,158, 58,213, 2,149,190,162, 46,230,117,216,144, 89, 96,208, 30,250, 64, -171, 82,157,217, 4, 90, 21,170,214,159,167,195,148,145,148,214, 94,168, 95, 95,150, 98,158,240,196,142, 85, 38, 44, 2,109, 64, -139,191,123,245,234,165, 44, 64,209,167, 57,134,218,111, 16,178,189,130,160,137,187, 11, 85, 27,173, 26,181,171,194, 30,171, 86, -176,145,180, 67,231,182,210,181, 71,103,249,163,111, 15, 25, 49,122,152, 17,160,181, 15,237,238,210,166, 77,155, 20,181,225,180, -105,211,174,148, 46, 93,250, 53, 52, 20, 65, 90, 99,248, 49, 99,198, 4,193,175,225,107, 0,177,235,122, 18,173,163, 11,231, 5, - 3, 90, 4, 89, 52, 15, 32,200,250, 51,101, 28,217, 5,219, 49,168,147, 95, 83,109, 8, 99,248, 27, 78,140,225, 67,210,222,220, -207,124,229, 28, 8, 45, 27, 45, 59, 0,149, 91,253,255, 1,175, 57,151,134,241,190, 85,162,165,231, 55, 47,212, 56,173,116, 96, - 14,130,122, 64,171,115,231,206, 2, 29,126,136, 37, 90, 88,137, 5,161,243,210, 81, 96,235,144,148,222,145, 68, 43, 67,134, 12, -231, 1,168,174,155, 85, 29, 18, 52,193, 93, 3,198, 24,219,102, 51,219, 64,198,107,176, 13, 81, 92, 59, 80, 20,206,213, 56,141, -123,225,246, 33,208, 10,182, 28, 22, 63,103,230,196,126,187,183, 45,150,126,221,171, 66,106, 85, 78,153,196, 79, 29,152,104, 40, - 57,155,196, 9,180,214,175,246,146,161,253, 86,200,144, 63,151, 59, 76,243,103,239, 22, 38,237,253, 73,163, 55,184,148,104,133, -139, 20,125,215,224, 73,203,165,110,231, 41,146,167, 70, 63, 41, 80,123,144,164, 47,248,255,193, 60,103,169,198, 82,173,195,116, -169,213,117,182,180, 31,186, 82,250,140, 89, 38,209, 98,198,115,170,154, 33,208,234, 63,223, 91,202,117, 93, 38, 37,218,204,146, - 66, 77,198,201, 79,117, 6, 73,142,170, 61, 36, 83,217, 54,146,166, 72, 67,249, 46,111, 53, 89,180,106,139, 75, 9,150, 61, 99, - 85,160, 69, 85, 33, 59,135,179, 4, 99,107, 5,104, 65, 82,228, 82,162,149, 51,115, 34,191, 93, 91, 23,137,103,183, 42,210,181, -109,217, 80,169, 35,109,153, 9,164,104, 60,238, 12,104,209, 31, 26, 12,141,133,103, 87,125,192, 25,208, 82,213,137, 60,187, 2, - 99,142,104, 91, 85,133, 78,157,149,218,239, 54,212, 81, 23,106, 95,161,168, 14, 49,153,190, 37,200,226, 6, 26,168,247,222, 52, -105,210,228, 6, 19, 36, 39,239, 8,180, 8,178, 96, 95,100, 72,117, 8, 67,248,221, 84, 25,114,119, 33,129, 20, 85,199, 48, 55, - 80, 64,214,178,176, 97, 45, 87,167, 79,183, 92,191,126, 93, 1,216, 4, 98,180,223, 67, 91,217,237,130,167,121,113,143,234, 66, -101,247,166, 53,241, 55,175,241,222, 71, 71,249, 42,245,230, 18,104, 65,178, 53, 87,103,188,242,163, 57, 0,205, 33,104,236,207, -197, 40,129, 22,237, 90, 9,176,152,248, 91, 5, 96,180,207, 4, 61,167,245, 79,160,197,197, 40,237,178,104,143, 85,168, 80, 33, - 41, 81,162, 4,121, 42,149, 43, 87, 86,236, 71,235,213,171, 39,224,173, 98, 63, 75, 0,167, 39,209, 66, 93,238,133, 77,154, 13, -104, 77,158, 60,249, 42,164, 87,138,202,176,106,213,170, 65,252,205, 51,255,255,242,203, 47,239, 49,214,249,232, 1, 45,170, 11, - 85, 73, 86,251, 24, 97,164, 11, 36, 89,189, 18, 71,231, 14, 89,101,188,228,216,137,241, 89, 40,201,114,225,222, 33, 36, 83,129, -251,153,127, 49, 7,208, 4, 21,192,164, 73,218,221,133,188,167,238, 58,228,111, 53, 47,205, 1,136,174,180,207,106,239,171, 52, -236,105,133, 15, 1, 43,213, 88,135, 90, 21,162, 46,153,139,180,157, 32,168,128,250,229, 35, 99,120,136,253,149,206, 76,183, 4, - 3, 6, 12, 80,196,214,160,104, 88, 37,135,206,154,175,110,135, 58, 50,126,235, 88,201, 91, 36,207, 19, 60,171,245,169,245, 13, -128, 68,253,148,223,167,216, 88,188, 82,193,151,197,127, 41,224,233,170,180,161,108, 12,127,151,128, 10,171, 98, 73,151, 46,157, -195, 29, 98,170, 49, 48,239,211, 32,158, 42, 31, 74,182,156,149, 49, 71,166, 68,126, 91, 55,252, 37, 93,219,148,145,214, 77,138, -134,202, 36, 78,160, 53, 98,216, 52,201,144, 46,183,164, 75,147,211, 97, 42, 92,176,140, 48,105,239, 55,168,211,209,181, 49,124, -184, 8, 61,170, 53,234,242,102,244,156, 45, 82,176,238, 96, 41, 80,179,175,124,151,181,184, 13,108,166,203, 93, 86,170,182, 25, - 39, 13,122, 45,144,161,179,118, 74,245, 38,221, 94,195,222,138,187, 53, 28, 30, 4, 90,207, 45,111,228,177,255, 43,121,252,220, -162, 0,173, 71, 79, 95,200,195, 39,254,242,224,241,115, 5,104, 93,187,121, 87, 46, 93,187, 25, 34,160, 69,123, 28, 74, 48,176, -129, 64,217,101, 70,127, 74,156,104,177, 74,183,192,254, 77,153,108, 49,153,235, 2, 45,214,209,150, 13,243,164, 75,235,210,210, -178,113,161, 80,169, 35, 43, 67,226, 3,228,173, 0,216,120,206,126,228, 0, 72,225, 82,124,229, 62, 55, 65,132, 4,104,217,251, -213,114, 5,182, 28, 85, 18,141,223, 89,193,108,247,220, 5,203,137,146,139, 8,213,105, 41,165, 17,234,174, 88, 74,221, 12, 58, - 47, 85, 95,149,161,120,241,226, 79,105,139, 72,195,119,218,100, 17, 92,169,118, 59,220,217, 71, 73,214,247,223,127,111,212, 24, -222, 19, 11, 33,127,148, 83,217,244,192, 77, 16,220, 0, 65, 73, 22, 65, 22, 37, 91, 79, 96,183,197,186, 39, 24,195,174,232,167, -176,141,114, 58,126,128, 87,167, 41,105, 84,157,148,178, 60,252, 86,130, 2,124,192, 81,123,126,161,126, 18,244, 30, 50,251,232, - 22,239,231,239,179,102,207, 51, 92, 15,104,209,120, 29,230, 16, 2,181,230, 71,128, 75, 5, 88, 84,247, 65,194, 35,112,117,161, - 11,180,232, 39,171,102,221,234,176,199,170, 35,191, 53,111, 40, 45, 90, 55,147,182, 29, 90, 73,167,174,237,165,251, 31, 93,165, -247,159,127, 72,255, 65,127,202,144, 97,131,100,236,132,209, 70,128,214, 30, 72,255, 20,213,225,234,213,171, 47,161,156, 87,177, - 27, 88, 1, 90, 60, 67,205,201,221,193,202,127, 0,185,247,216, 93,238,131,177,199,165,141, 22,235, 86, 85, 23,170, 32,171,223, -119,113, 21,144, 69, 62,243, 62,198,236,151,176,253,154,230,194, 97,169,238, 4,229,206,224,230,192, 63,140, 3, 33,138,117,152, - 10, 31,177, 13,250,121, 5, 72,208,237, 0,119, 33, 81,186,197, 93,135,220, 41, 71,187, 44,250,106,193,174, 18, 14, 16,219,145, -248,140,209,227,155,220,133,114, 62,156,117,112,146, 52,237,213,144, 29, 79,117,126, 73,144, 53,171,203,200,102,178,233,198, 76, -197,239,214,236, 61, 67,191, 24,208,162,183,117,170, 49, 9,162,140, 0, 45,230,225,224,204,231,156,125,120,182,140, 9,253,214, -175,154, 37,173, 26, 23,150, 6, 53,243,134,202, 36, 78,160,165, 78, 86,156, 28, 93,249, 58, 11,166, 91,192, 31, 29, 23, 2,145, -225,227,202,103,240,148, 85,210,105,232, 18,201, 95,173,155, 28, 60,236,101, 35,113,232,136,183, 84,106, 62, 84,122, 79,216, 36, -253, 39,173,149,168, 49,227,184,116,239, 64,160,245, 44,192, 53,208,242,185,229, 43, 23, 63,246, 4,239,178, 29,129,223,138,234, -144, 6,239,200,232, 84,162, 69, 67,105,238, 58,212,147,104,177,142,214,173,156, 41,191, 55, 44, 40,245,171,231, 10,149, 58, 66, -185,178,193,159,209, 67,246, 29,182,169,219,183,111,219,183,147,108,176,175,121,200, 93, 87,188, 79,191, 77,216,213,102, 74,162, -165, 1, 89,202, 78, 57,128, 34,101, 23,162, 51,176,229,136,169,112,231,112,145,109,201,145,219,137, 79,112, 94,170,188, 10,146, - 94, 47, 2, 23,186,112,224,134, 15, 74,119, 56,134,104,213,133,220,197,203, 77, 32,216, 73,106,200,189, 3,164, 32,183, 89,175, - 4,212, 4, 89, 84, 27,179, 29, 64, 50, 99,121,116,255,190, 2,174, 1,148, 44,120,143,158,123,135,136, 48,174,127, 67, 32,169, -117, 80,202,223,188, 86, 49, 87, 88,105, 90, 34,226,139, 70, 37, 98, 61, 44, 83,177,246, 92, 72,178,230,245, 30, 54,231,232,134, - 35,143, 94,143,153,181,133,238, 29, 42,234, 12,118,183, 23, 46, 92, 40,176,109, 82,252,132, 65, 50,164,184,193, 33, 15,120, 86, - 1, 22,199, 79,128, 14,197,214, 10,244,156,170,225, 41,157, 26, 50,100,136, 2,200,160,222, 83,202, 76,127,127, 28,163, 57, 38, -115,241,203,113,185, 83,167, 78,138,125, 22,129,156, 1,137,214, 30,170, 12, 49,142, 95,234,218,181,235, 37,236,160,190, 10,219, -172,215,144,140,189,135,173,215,187, 82,165, 74,221,226, 25, 96,241, 61,124, 8,190,198,194,218, 16,208, 82,213,133,148,100, 17, -100, 13, 74,147, 80, 1, 89, 42,208,210,216, 34,234,133,232, 49, 58,159,184,243,185, 57,240,119,115, 32, 68, 18, 45,181,208,117, -208, 89,239, 79,159, 62, 93,241,159,197, 1,147,158,211,249, 31,162,100, 9, 27, 54, 44, 13, 77,235, 57,249, 66,151, 14,205, 48, - 80, 77,156,180,101,168, 76,221, 62, 92,190,255,225,251,189, 80, 97,164,195,202,110,106, 47,236,202, 35,192,154,184,222, 83,234, -182,169, 44,118, 18,173,143,104, 58, 81, 29, 94, 48,161, 58,180,209,164,100,138,147,142, 81,137, 22,213, 30,156, 32, 29, 72,180, -108, 52,179,166, 79,112,127,243,250,133, 50,200,179,165,120,246,172, 47, 1,207,125, 13,169, 13,169, 94,180, 83, 29,218,104,130, - 79,183, 40,109, 60,139, 73,149, 19,153, 86,183,237,234, 55, 17,147, 29,208,114, 84, 71,249, 19, 38, 75,245,100,192,196, 21,210, -103,244, 18, 41, 94,189,181, 20,172,216, 66, 10, 87,105, 37,101,107,119,144, 62, 99, 87,200,159, 19,224,143, 43,121,106, 74, 34, - 29,121,135,183,209, 36,208,122,234,255,218,185, 68,171,112, 67,185,122,227,142,140,135, 75, 7,187,144, 59,246, 77, 42, 88, 57, - 9,180,104, 20,205, 93,133, 52,120,231, 36, 75, 85, 18, 85,133,220,214, 79, 67,105,117,119, 26,248,100, 65,219,114,164, 58,212, -212, 81,124, 91, 29,245,237, 94, 47, 84,234, 8,106,194,133,172, 27, 2, 44,130, 9,216,183, 80, 98,101,219,161,201,251, 92,196, -176,253, 80, 50, 58,103,206, 28, 2, 45, 71, 59, 56,109,229,180, 87, 11, 18, 84,209,175, 22, 65, 22,193, 11,141,206, 65,139, 59, -251,168,174,250, 40, 46,162,134,169, 54,154,104, 15,155,156,197, 56,228,214,124,103,206, 75, 29,168, 16, 29, 58, 44, 37,200,128, -183,118,110,239,127,132,109,254,111, 1,128,130,216,111, 96, 28,254, 30,210,177,167, 4, 89, 84,161,161,108, 70, 29,150,150,129, - 51,210, 7, 84, 15,178,158,105,179, 69, 73,102,239,222,189, 45, 88,244, 40,146, 44,130, 44, 76,230, 28,155,202, 56, 24,155,212, -114, 70,130, 42,242, 53,165, 47,244, 21,200,177,141, 18, 59,130, 4,246,173,122,133,194, 41, 78, 74,219, 86, 73, 44, 84, 21, 50, - 81,146, 69,144, 5,105,214, 68, 59,239,240,142,190,189, 62,218,169,133, 32,136,223, 71, 96, 69, 80, 68,167,199, 0,183,138, 20, -139, 0,139,134,236,248, 30,238,200,228,162, 1, 62, 77,109, 71, 48,154, 4, 77,163,177,115,175,105,139,223,164, 85,219,223,165, -125,167,182,210,165, 71, 39,233,217,187,187,120, 98, 71,241,192, 33,253,101,216,200, 33, 50,122,220, 72,153, 48,121,188, 76,155, - 49, 69,215, 97, 41,234,112, 15,190,247, 18,218,143,146,208,127, 46, 1,188, 94,135,154,215, 7,106,217, 96,137,215,192,231, 43, -104, 19,220, 41,174, 61,108,229, 36,128,218, 57,118,196, 71,234, 66, 2,172,113, 57, 83,203,228,252,233,101,239,208, 62,246,155, - 62,232, 65, 94, 13,189,163,210,253, 28,206, 48,221, 52, 67, 23,138,124, 14,126,134,110, 9,191, 50,106,220,126, 60, 21, 78,229, -130, 40,254,167, 67, 79, 72, 84,104,199, 64, 39,115,142, 66,155, 24,234, 44,152,252,114, 86,111,246, 75,208,250,235,179,101,194, -134,126,210,160, 67, 53, 25,181,252, 15, 5,100, 13,153,223, 85,146, 38, 79, 58, 15,121, 82, 56,235,212,234,117, 12, 22,173,175, -223,125,254,145, 49, 60, 65,133,193, 93,135,182, 6, 67, 91, 43,248,225, 9,164,152,155, 59,166,120,230,234,150,131, 49, 39, 69, -213,169, 40, 85, 33,156, 64,233,115,167,111,223,190,142,108,180,108, 52,179,164,143, 63,181, 76,241,204,175,253,124,175,203,211, - 71, 62,178,117,237, 56, 89, 58,167,135,203,180,122, 97, 31,169, 80, 50,195,155,220, 89, 19,159,116, 52,240, 98,194,222, 15,191, - 55,111, 29,217,146,217, 75,176,180,255,177,125,251, 45, 6, 67,120, 42,112, 60,152,255,255,114,184, 2,145,162,196,188, 85,173, - 81,231,183,125,199, 44,129,209,251, 30,153,184,120,175, 98,147, 85,227,183,174,111,163,197,140,115,203, 35, 92,184, 2, 78,218, -113, 48,160, 85,185,207, 38,216,104, 45,213,216,104, 13,148, 28, 85, 96,163, 85,166,181,164, 1,208, 74, 95,184,142,180,198,110, -195, 8,145,163,187, 10,243, 18,172, 83,211, 1, 41, 84, 92,138,138, 80,171, 42,228, 68, 75, 27, 30,134,101, 33,216,160, 52,139, -249,192, 47, 71, 14, 75, 63,107, 29, 1, 52,157,226, 70, 12, 74,130, 97,143, 20,100, 93,197,219, 60,233,227, 27, 78, 17, 24,113, -146, 71,152,171, 32,171,253,150, 75, 79,251,246,224, 73,149,104, 81,146, 69, 90,144,236, 40, 46, 31, 12, 72,180, 12, 13,146, 12, -189,195,246, 67,137, 41,193, 7, 85,138,236, 23,236, 7, 14, 84,136,142,104, 42, 33,120,224,140,148,106, 56, 37, 4, 15,251, 36, -253,208, 89, 13,223, 51,128, 15, 12,207, 99, 54, 4, 79, 73,124,227, 29, 72,213,159, 83,162, 5,144, 96,193, 2, 67,113,243,209, -165, 75,151,103,144, 84,221, 1,205,146, 58,237, 51, 34,128,214, 27, 46, 32,185,176,178,119, 82, 74,137,214,111,197, 35, 88, 26, - 20,143,245,176, 44, 12,224,203, 84,170, 51,135,234, 66,140, 73, 85, 49,230,196,115, 54, 46,129, 47, 17, 49, 62,254,132, 60,141, -112, 30,136, 29,128,119,105,127, 71,192, 53,108,216, 48, 65,249, 4,174, 19, 4,198,229,146, 51,103, 78, 65, 89,233,112,150,145, - 11,226,187, 26,235, 8,180,224,102, 65,177,135, 85,213,142, 60, 99,252, 81, 18,127,243, 94,255,254,253,133,146, 47,186,220,209, - 11,193,131,242,209,173,206, 37, 44,216, 46,161,237, 92,130, 13, 22,213,135, 78, 19,193,152, 46,208, 26, 51, 76,122, 37,141, 33, -253, 82,197,179,169, 11,217,102,166,228,207, 32, 51,139,102,147,125, 31, 3, 45, 71,213,100,168,125,154,156, 71,221, 52, 77, 50, - 76, 39,251,231,224,103,232,150,240, 43,165,150, 15, 58,117,134, 93,241, 71, 42,104,224, 27,116, 43, 2,131, 81,183, 54,253, 27, -218,212,132, 91,111,207,150, 63,103,180, 23,216,103, 45, 4,125,251, 88,136,124,229, 71, 52, 49,129,165, 7,157,182,170,107, 7, -213,189,131,137, 93,135, 90,154,161,181,235, 48, 88, 57, 33,153,218,152, 59,107,210,160,220,217,146, 7, 2,120, 57, 77,216,101, -248,158, 82, 44, 38, 59,144,101,255,237,209, 0, 30, 14, 82, 58,101, 38, 89, 65, 86, 52,125,160,165,228,136, 28, 33, 82,244,158, - 81, 99,196,217, 27, 57, 90,204,123, 81,144,162,199,250,118, 47, 0, 88, 79,222,115, 81,255,193,128,214,213,187,207, 21,160,117, -249,214, 35, 41,213,114,162, 92,185,121, 95,170,181, 29, 45,215,111,251,201,111, 93, 70,200,205, 59,126,146,187, 80,153,192,240, - 81, 98,114,139,187,179,195, 94,162, 53, 1,134,193, 47,232,186,129, 96,138,137,182, 88, 42,176,162, 20,139, 78, 45,121,102, 62, -240,202,101, 8, 30,190,244,255,117,148, 44, 84,234, 8, 59,228,114,192, 16,251, 12,210, 21,128,137, 13,120, 69, 50,237,199,241, - 62,174,159,129,202,204,225,125, 71,117,228, 72, 74,101,243,171,101,149,100, 25,180,209,210,237,155,124, 63,193,148, 51,181,162, -131,248,135, 70,104,134,102, 80,233,216,176,191,234, 7,254,237,135, 52,232, 17, 19,248,185, 31,223,223, 15, 69,119,229,155,202, - 86, 78, 58, 34,165,119,122,170,119, 41,125, 36, 32, 80,213,240,160,241,145,141,150,145,246, 9,112,157, 22,180, 60, 1,248,207, -145, 38, 0,220, 43, 72,178,246,195,217,234,122, 72, 7,131,232,224,153, 82, 44, 0,113, 46, 86,177, 33,209,169, 59,155, 96,252, -252, 28, 65,165, 33,113, 91, 4, 73,234, 57, 0,231, 75,116,243,160, 77,170,148, 75,123,134, 77,220, 37, 60,179,197,142, 15,193, - 36, 90, 27, 61,187,195,133,195, 64,236, 46,236,111,179,197, 99, 27,218, 55,180,175, 2,178,246,246,235,170,235,198,196,209, 56, -111, 96,190,209,203, 98,164,125,234,209,176,191,239,166,105,150, 99,238,252,161,206, 1, 67,141, 16, 64,161,102,170, 31,191,223, - 87,236,151, 2, 47,210,166,255,225, 16,254, 83,111,175, 13,128,171, 45,152, 33,154, 38, 29,150, 26,162,105,146, 59,110,154, 96, -216,255,253,104,165,128, 31,173,164, 54, 63, 90,145, 99,198,191, 8, 7,165, 23, 35, 70,139,115, 49, 66,228,152,151, 34,186, 6, - 89,100,189, 61, 63,227, 96,192,159,128,201,234, 26, 93, 55,208, 6, 75, 77, 84, 19,170,137,146, 44, 43,200,114, 25, 84,218,100, -221,186,202,254, 89,235, 61, 20,119, 29, 26, 42, 39,213,131,206,212,138,184,231,116,194,253, 27,248,249, 13,222,201,100,228,208, -126,187,233, 93,135, 78, 94, 96,163, 9,149, 98, 36,218,156, 34, 53,134,196,168, 19, 82, 67,180,213,132,214,231,114,225,188,214, -154,248,251,111,107, 75,214, 23, 71, 65,217, 22,219,199, 59,116,246, 31,139,134,157,120, 46,216,130, 65,219, 55, 25, 60,156,146, - 91,189,100, 13, 50,254,119,127,187,145,182,162,151,199, 80, 63,210, 35, 98,119,255,191, 76,211, 36,171,254, 81,217,237,253,104, -233,123,138, 15,165,226,255,151, 27,140,251,219, 67,169, 17, 89,201,184,249,233,230,103,104,113,192,221,150, 66,139,147, 31,232, -184,249,233,230,103,232,114,224,235,164,230, 6, 90,255,128,149, 99,104, 52, 29,247,128, 22, 26, 92,252, 63, 13, 55, 63,221,252, - 12, 45, 14,184,219, 82,104,113,210, 13,222,254,203,109, 41,116, 91,209,151,165,102,191,235,144,255,109, 7, 43,213, 81, 50, 83, - 68,103, 52, 92, 93,215,163,239,166,233,184, 94, 66, 90, 95,110,126,186,249,105,180, 13,184,251,166,115, 14, 24,229,161, 54,159, -155,159,110,126, 58,226,192,127,185, 45,233,245, 9,247,125, 19, 28,248, 47, 35,115,247,183,155,104, 40, 6,178,186,249,105,128, - 73, 38,178,184,249,105,130, 89, 6,178,186,249,105,128, 73, 38,178,184,249,105,130, 89, 6,178,126, 45,252, 52,240, 41,255,216, - 44,110,213,161, 78,213,124, 45,141,208, 93,206,208,237, 99,110,126,186,249, 25, 90, 28,112,183,165,208,226,228, 7, 58,110,126, -254, 55,249, 25,186, 95,253,101,169,125, 58,208,138,150, 48,125,134,111, 83,102,157, 19, 39, 89,150,147, 76,252,205,107,255, 81, - 0, 19, 5,223, 93, 7,219,181,183, 98,119,219,115,252,238,224,128, 15,255,134,129, 34, 38,190,171, 58, 18,183,203, 87, 65,138, -106,176,221, 26,250,246,194, 30, 30,225,106,122,120,180,130,135,198,155, 76,252,205,107, 78,222, 97,136,166,193,242,169,217,190, - 8, 77,207,182,137,243,237,217, 88,103, 35,207,142,202,231,217, 41,113,188, 67, 91,106,140, 29,212, 42, 73,220, 80,250,246, 24, -216, 53, 54,141,187, 48,113,190,129, 52, 11,116, 99,217,209,254, 34,223,110,178, 62, 28,101,119,151, 51, 20,152,168, 33,225,230, -167,155,159,161,197,129,207,209,150, 66,171,108,127, 7, 29,151, 54, 90, 30,112,244, 87,216,234, 77, 28,243,220,199, 71,156, 20, -153,155,228, 41, 90,245,210,182,189,199, 46,159,189,116,235,238,201,243, 55,124, 86,110,216,235,157,233,167,178,231,121,207,197, - 23,185,170,136,111,224, 85,190, 22,156,245, 45, 68, 58,101, 77, 11,121, 13,244, 92,109,211, 14, 70, 19,147,201, 30,134,163, 49, -147,240,140, 83,207,198, 6,106,167, 70,138, 20, 41, 2, 24,191,140, 97, 52,224,220,148,158,214,233, 28,209,254,112,250,237,113, -226,164,142, 17, 45,113,166, 62,177,190,203,185, 63,102,210, 76,254, 49,146,102,244,143,145, 60,231,254,104,137, 51,122,242,158, - 9,126,210,159,213,101, 36, 58,250,236, 98,160,236, 46, 39,178, 6,217, 61,222,213,206,226, 33, 76, 13,115,120,188,135,243,214, -109,112, 8,185, 11,177,208,118, 33,112,248,174, 24, 49, 98,108, 6,129,206, 72, 63,232,188,203, 80, 7, 36,176, 26,255,243,207, -239,253, 87,175, 22,191, 14, 29,164, 71,204,152,239,120, 45, 4, 96,227,155, 8, 17, 60,106, 36, 73, 18,254,175,196,137,195,159, - 79,146, 56,252,133,164,137,195, 47,136, 16, 33,108,109,208,114,228,139, 77,125,133,145,114,214, 65,102,198,240,100,226,111,189, -227, 35,154,237,203, 36,218,120,100,251,160, 0,158, 29, 61,220,171,101,170, 78, 7,183,119,190,206,115, 8,190,221,254,145,168, -112,103,113, 29,113, 0,223, 49,172, 15, 19, 28,132,190,199,181,155,200, 72,224,108,230,219,245,190,213,112,155, 71,198,200,225, -194,132,233, 28, 53, 98,196,173,145,194,133,187,207,196,223,188,198,123, 38,218,188,217, 50,185,108,243,161, 65,204, 74,195, 72, - 91, 50,251, 58, 55, 77,179, 28,115,157,223,205,207,127, 56, 63,245,176, 72,232, 22,255, 11, 83, 35,200,226, 43,213,179,246,245, -209, 18,164,203,248, 83,241,106, 23,158,249, 91, 94,249,248,220,121,210,177,213,192,173,205,218,141, 88, 53,114,250,186, 13,187, - 15,159, 59,148, 33, 79,169,179,204, 99,114,130, 72, 1, 71,129,222, 0, 42,111, 49,137, 43, 1, 92,233,213, 26,193, 98, 5, 65, - 76, 95,241, 30,232,217,123,132,119, 56, 65,208, 95,203,133, 29, 91,228,246,201, 99,114,195,235,176,192, 73,165, 18, 24,151,233, -236,166,117,114,114,205, 10, 57,190,124,177,226,213,154,137, 1,115, 17,254,226,174, 93,121,141,118,192, 36,153, 50,101,122, 67, - 62, 49,164, 8, 99,138,193, 91, 62, 99,203,181,118,240,253, 14,105, 70, 75,144,166,104,140,164, 89, 31, 52,233, 62,241,237,250, - 3,155,229,204,181,227, 72,151,100,233,182,115,210,176,243,184,183, 49,146,102,123,192, 60,122,252,132, 99,198,159,224, 60,214, -230,244, 29,249, 5,193,129, 95,104, 19, 0,225, 11,109, 74,158, 60,249, 11, 4,239,189, 2, 31, 54, 57, 28, 77,184, 4, 88,114, -118,129,146,254, 40,228, 65,239,221,135,240,130, 93,106,130, 67,208, 93,136,139,182,171, 82,165, 74,187,240,188,171, 56,111,134, -248, 73, 41, 22, 65, 22,220,162,139, 20, 46, 44,231,240, 13,188,166,247,237,118,247, 83, 37, 74, 20,254,248,136,225,205,222,172, - 94, 61, 91, 54,110, 92, 47, 27, 54,172,147, 85, 43,103,201,152,209,173,224, 5, 63,252,105,228,255,209, 4, 77, 74,212, 6, 34, -141, 66,162,228,242,162, 26,235,147,191,173,215, 70, 1,184,140,196,111, 71,210, 55,219,183, 83,130,213, 1,224,234,215,178, 63, -139,255,179,187,194, 51,255,107, 37, 91,101, 82,167,142,209,230,151, 44, 15,206,120,253, 21,200, 51,255, 27,109, 75,118,249, 20, - 63, 82, 88,112, 76,130, 83, 73, 37, 8,176,122,176, 79,204,157, 59, 55, 16,109,102,182,163,122,119,194,155,180,248,198, 27,240, -155, 20, 44, 80,124,252,172, 85,242,167, 47, 88,191,111,188,140,149, 10,155, 40,103,158,200, 17, 34,220,222,186,100,114,224,163, -155,167,228,205, 75, 63,121,118,249,152,220, 62,119, 72,230, 78, 29,245, 46, 98,184,112,140,239,231,200, 35, 62, 95, 97,168, 45, - 57,249, 6,103,151,221, 52, 77, 50, 76, 39,187,155,159,110,126,134, 10, 7, 92, 97,145, 80,121,193,223, 73, 68, 27, 27,207,190, - 28,241, 82,100,157,191,121,151,215, 69,159,235,119, 30,159, 63,113,222,183, 77,227, 94,107,126,255,125,192,194,250,237,198, 76, - 25, 61,123,227,252, 25, 11, 55,172,101, 30, 19, 19, 89, 10,128, 19, 63,132, 77, 81, 2,140, 34, 62,157, 48, 60, 5,227,188,205, -158, 61, 91, 16, 79, 75,230,226,156, 44,105, 82,130, 33, 71, 96,203, 94,162,229,119,251,228,113,105, 27,221, 67, 73, 12,149,163, - 70,142, 87,175,241,204, 80, 58, 76, 4, 91, 63,252,240, 67, 72,129, 86,245, 14,144,188,144, 95,144,238, 60, 67,249,186, 33, 37, - 53,250,237, 4, 80,223,101, 43,106,217,124,228,152,220,123, 18, 32, 55,239, 63,147, 61, 39,207,201,129,115, 15,228,208, 69,254, -190, 40,179, 87, 45,144,212,217, 11,189,140,250,109,154,210,174, 38, 50,128,197,203,136, 69, 38,139, 23, 47, 86, 18, 1,171,145, -131,161, 70,224, 80,145, 82, 48,245,176,241,211, 30,104, 33,246, 91, 48,160, 5,233,200, 46,120,186,222,133,216,130, 4, 90, 99, - 92,180, 89, 67, 3, 47, 65, 21, 37, 89, 4, 89, 64,250, 33, 1, 90,169,114,230, 76,249,224,190,223, 62, 72, 22,167, 8, 2, 56, -211,227,180,146, 24,160,119,242,164,113, 8, 21,115, 84, 10, 22,252,225, 33,202,154,214, 32, 48, 24,200, 56,158, 0, 43,140, 95, -121,167, 80,161, 66,129,108, 51,227,198,141,163,228,242, 61,128,199, 29, 6, 71,134,227, 80,190,135, 96,203,254,176,125, 59,213, -133,148,100, 17,100,241,224,153,255,121,157,106, 66, 74,176,154,149,203,246,112, 84,255, 14,242,230,181,191,140,236,215, 94,154, -148,203,254,144,215,169, 78,116, 84, 71, 30,213,151,134,205, 92,210, 19,161, 90, 60, 85, 73, 29, 1, 22,127, 43, 41, 97,226, 36, -119,181, 1,198,217,207, 24,195,143,113, 16, 33, 53,214,130, 88, 87,117,148, 22,193,132, 31,146, 14,188,191,223,215,126, 96,150, -226,191,245,127,250,252,197,243,206,253, 38, 47,137,159,161,114, 22,187,143,119, 68, 51, 79,129,159,114,250,251,251, 94,144, 23, -151,182,200, 91,255,237,242, 54, 96,135,120,255, 89, 91,142,141,104, 35,111, 44, 62,114,251,218, 41, 73,151,230, 7, 70,155,200, -109,176,142, 62,117,184, 52,212, 62, 77,190,196, 77,211, 36,195,116,178,187,249,249, 31,228,167, 43, 44, 18,186,236,248, 27,168, -185, 66,145,113,146,103, 62,123,242,188,207,173,118, 45, 7,108,234,216,164,247,234, 30,157, 70, 44,233,211,127,250,252,190, 99, -151, 77, 31, 58,101,205,228,237,251, 78, 45, 99, 30,131,197,254,134,210, 42, 6,110,101,200, 11, 74,178, 24,154,129, 1,119, 17, -235, 77, 9, 86,221,179,115,103,153, 49,126,156,204,156, 48,158, 19, 3, 37, 91, 46,189, 61, 83,162, 69, 73,150, 22,104,169,145, -227,237,129, 22,129, 29, 39, 77,120,186,182, 7, 90, 6,139,239,145,163, 74,149, 42,194,120,143,152,200, 41,201,250,201,232,131, - 84, 9,198, 74,145,249,225,166,195,187,100,237,254,217,178,237,232, 86,185,243,232,181, 92,186, 19, 32, 59, 79, 61,150,129,179, -230,202,175,109, 75, 74,175, 97, 77,101,204,244,126,146,240,199, 76,207, 98,199,254, 94,171,234, 9,246, 42, 72,165,238, 49, 54, - 27, 99,233, 81, 26, 72, 30, 50,126, 28,131, 19, 31, 63,126, 92, 16,255, 77,137,243,120,240,224, 65, 65,144, 88,105,210,254, 79, -105,136, 88,107, 12,224,139,248,110,247, 28,149,155,170,195, 14,249, 60, 20,105, 86,191,114,113, 95,227,249, 67, 4, 87, 76,144, - 4,238, 2, 45, 2, 44,130, 12, 61,160,101,136, 45, 84, 19,246,136, 21, 43,144,146, 44,166, 14,223,124, 19,232, 66,117,104, 79, -243,155, 4, 9,194,159,120,248, 96,175, 60,121, 52, 85, 86,175,248, 14, 65,121,191,161,100, 86, 73,225,194,125, 35, 75, 22,101, -146,167, 79,230, 32, 86,229, 17, 73,148, 40, 2,219,168, 43, 53,162, 74,127, 84,229,202,149,101,231,206,157,194, 64,205,140,233, -135,248,121, 50, 99,198, 12, 89,184,112,161, 45, 38, 94,207,158, 61,249, 30, 74,189,156, 30,148, 92, 81, 93,168,149,104,241, 63, -175,211, 38,139,234,194,211, 71,231, 7, 18,100,241,224,249, 20,254,243, 58,239, 59, 35, 60,118,193,254,178,229,154,142,106,153, - 56, 71,179,236,214,111, 98, 20, 5,164,212, 17, 19, 37,253,206, 66,128, 68,149, 33,193, 55,251,246,166, 77,155,100,197,138, 21, -130, 16, 46, 14,165,133,144,130, 53,135, 29,215, 93, 38,132,179, 25, 8, 64,121,143, 82, 60, 30, 42,208, 82, 37, 89, 9, 50, 85, -236,176,126,219,193,195,190,247, 31, 61,200, 85,166,197,240, 88, 89, 43,197,114,193,130,200, 81, 34, 70,188,253,226,222, 69,121, -178,127,162,188,125,122, 30, 20, 3,229,253,219,155,178,167,221, 47,178,174,110, 97, 57, 48,162, 19,198,128, 59,114,229,252, 73, -137, 20, 62,252, 13,208,138,104,168,241,184, 51,185, 57,224,230,192,191,142, 3,174,176, 8, 6,143,156, 72,229,173, 41, 47,206, -121,172,191,121, 86,239,149,208,228, 97, 94,251,255,218,188,188,175,253,175,253, 77,250,185,172,180,202,224,236,204,126, 86, 91, - 7,170,141,150,214, 86,235,255,247, 93,125, 92,220, 20, 89, 15, 28, 59,115,237,106, 23,207,233, 43, 47, 94,240,185, 54,118,220, -210,101, 51, 22,109, 89,124,199,239,209,149, 21, 91,142,204,221,113,224,244, 66,230, 49, 82,227,180,191,154, 54,109,218, 59, 2, - 30,130, 44, 30,156,200, 8, 12, 24, 20,181, 91,135,246,210,225,183, 70,210,170, 70, 85, 89, 52,105,130, 52,168, 86,229,149,213, -102,203, 41,121, 2, 45,170, 70, 84, 73,150, 22, 92,241, 29,148, 98,241,125, 61, 83, 39, 20,207,108, 63,200,193,191,102,126, 10, -208,242, 64, 60,181, 13, 11, 22, 44,144,213, 80,121, 65, 13,247, 12, 5,115,166, 54, 13, 86,102,218,100,117, 29,253, 71,224,145, -115, 59,165,211,232, 74,178,118,239, 82,121,250,226,157,156,188,230, 47,187, 78, 63,150,218, 29,126,145,154,237,106, 73,249,198, -229,100,216,132,206,210,160,109,205,192, 24,137, 50,245,119,246,225, 0, 90,126, 4, 83,235,215,175,151, 85,171, 86, 41, 18, 22, - 74,133,160, 34,146,137, 19, 39, 10,108,171,100,192,128, 1, 10,120,101,144,217,228,169, 50, 40, 0,132,210, 26, 0, 45, 63, 23, -245,117, 8,192,237, 16,212,184, 74, 66,160, 89, 69,138,213,166, 77,155, 93, 77,155, 54, 85,128,150, 53,141, 49, 82,231,174,242, - 64,127, 25, 62,119,244,232,247,246,173, 92, 25, 52,184,110,221,247,121, 99,196,240, 41,236,220, 24, 62, 24, 41,218,100,205,155, -219,246,245,171,151,199,229,242,133,116, 72,105,164, 71,183,111,109, 64,171, 99,135,228,226,115,181,168,220,184, 86, 78, 44, 1, - 7,160,234,237,242, 38,106,212,176, 13, 13,148, 57, 74,152, 48, 97,110,117,239,222, 61,136, 60,164, 36, 75, 5, 89,228, 51,165, -136, 56, 7, 33, 78,225, 45,208,162,106, 81,247,160,186,144,146,172, 78, 21, 18,239, 3,128,154, 56,217, 51, 85, 70, 74,172, 40, -185,106, 85, 33,203, 3,155, 68, 11,146, 45, 72,180, 30,240,186, 51,195,248,194,133, 61,195, 45,219,113,161,228,218, 3,183,254, -104,210,123,209,212, 68,121,154,247,247,248, 62, 7, 1,121,248, 72, 63,254,218,164, 72,217, 90, 79,182,108,217,162,168,200, 79, -156, 56,161, 0, 45,150, 25,234,222, 64,244, 37,173,234,208, 86,110,132, 96,185,203, 5, 8,251, 75,222,188,121, 95, 16,152,179, -207,240,128, 42, 90,145,104,169,146,172, 78,158, 19,151,164,254,169,206,160,171, 55,238,220,222,178,199,203,251,219, 76,149,202, - 56, 99, 0,237,175,182,111, 88,240,254,253,155, 51, 18,248,246,170, 4,220, 58, 45,167,134, 54,150,131, 61,107,201,171, 23, 39, -144,206,203,179, 39, 23,101, 76,137,159,100, 98,173,106, 50,184, 69,243,119,224,125,123, 93,134,186, 51,184, 57,224,230,192,191, -146, 3, 58, 64,171,188, 58,255, 96,124,238, 65, 16,196,255, 42,176, 82,127,107,230, 40,229,158,253,127,237, 53,251,103,181, 52, -249, 14, 62,155, 47, 95,190,133,184,238,204,252, 68, 91, 15,234,174, 67,243,161,119, 98, 39,203, 60,104,209,234,237,167,182, 31, - 56,227, 53,124,242,234, 69,254, 47, 94, 62, 13,176,188,126,182,247,200,197,213,167, 47,221,218, 56,102,202, 95, 27,152,199, 72, -173,211,240,157, 82, 24, 31, 31, 31,197,134,138, 32,235,216,177, 99,114,248,240, 97,233,218,174,173,180,107,212, 64,126,175, 82, - 81,154,150, 44, 34,253, 26,213,147,209, 61,186, 82,170,197,224,210, 78, 15, 2, 45,210,114,166, 46,228,132,193,244,103,246, 31, -101, 72,161, 28,114,104,193,108,179, 64,171, 18, 86,249,135, 80,128, 94,214, 66,164, 76,154, 52,233, 3,216, 42,201,162, 69,139, - 36,122,244,232,231,113, 61,146,222,247, 39,206,154,213,107,245,158, 37, 50,123,221, 40, 89,189,123,149, 92,190,107,145, 99, 87, -158,203,182, 19,143,100,241,158,123, 50,102,245, 77,233, 49,231,178,180,156,112, 90, 26,116,110, 36, 61,135,245,149, 24,201,114, -241,189, 14, 15, 2, 45, 74, 41,180, 64,139, 18, 23, 26,232,115, 98,189,123,247,174, 98,175, 70,181,236,172, 89,179,132, 18, 24, -130,217,126,253,250,233, 1,173, 93,104, 84,187,160,106,178, 37,168,159,118,213,173, 91,215, 6,180,216,122,173,141, 87,239,179, -131,221,135,196,164, 7,118,105,158,196,249, 12,130, 1,111,128,141,217, 21,216,188, 41, 19, 58, 59, 24,234,242, 6, 30,112, 21, - 12,216, 70, 47, 73,162,240,243,238,220,217, 44,190,119, 90, 43, 32,139,233,202,197, 12,178,111,119, 38,217,191, 55, 23, 64, 86, - 49,185,113,189,156,220,244,169, 34, 15,252,250,201,237, 91,171, 36,105,210,112, 43,116, 10,172, 24,190, 23, 44, 88, 48,144,129, -134,199,143, 31,207,239,124,195,107, 76,173, 90,181,122, 15,181,169,210,102,161,186,125,111,189,174,107, 32,175,238, 58, 28,208, -249,199, 57,251,183,180, 58, 57,236,143, 12,127,170,229,160, 77, 86, 83,168, 11, 41,217,106, 85, 33,171, 51, 27, 45, 77,177, 61, -195,212,108, 63,185,240,162, 45, 23,250,110,240,186, 63,202,115,218,174,101,113,179, 52, 92,235,145,180, 84,238,116, 37, 58,239, -222,125,242,161, 95,178,239,211,189,153, 48,113, 82, 16, 37,113,243,231,207,151,242,229,203, 19,192,216, 27,195,219,104, 2,104, -249, 17,104, 81,138, 69,245, 61, 37,163, 76,129,129,129, 2,187, 62, 5,104,125,155,185, 98,181,117,219, 14, 28,186,235,247,240, -126,194,108, 85,251, 76,152,189,106, 51,127,199,207, 92,145,113, 73, 29, 30, 52,118,127,254,248,154,188,123,189, 23, 18,182,119, -114,162,127, 61,217,219,190,162,108,250,173,164,188,125,125, 69, 94,188,184, 46, 15, 31,249,200,220, 46,237,165, 77,170,239,228, - 47,180, 79, 72,192,184,225,194,125,184, 57,224,230,128,155, 3,193, 56,160, 5, 65,156,127,156, 1, 45,187,235,138, 68, 75,205, -175, 7,206, 28,189,195, 10,198,156,153, 8,105,203, 72,128,101,159,140,213, 98,188,120,105,162, 39, 73,147,247,212,241,115,215, -174,236, 61,122, 97,247,188,165, 27,183,110,216,186,239,192,237,123,143, 15,158, 58,123,229,112,226, 31,243,156,214,217, 41,103, -123, 17,119, 22,250,251,251, 43,234,174,179,103,207, 42,118, 35,216, 29, 37,251, 97,151,213,182,126, 61,105, 86,177,130, 2,178, - 90, 21, 43, 40,221,203,149,148,191, 6,244, 37,208, 58,229,170,164, 42,208,114,164, 46, 84, 65, 22,223, 57,172, 72, 46, 25, 83, -161,168, 28, 89, 58, 95,210,164, 73, 99, 84,117,152, 51, 79,158, 60,111,110,223,190, 45, 37, 74,148,224,164, 27,203, 90,150,204, - 25, 50,100,120, 69, 53, 28,118,227,241,122,115, 61,110,126,159, 39,221,203,147,151, 79,203,161, 11,143,229,212,117,127, 57,114, -233,153,108,242,126, 36,243,119,250, 74,145,106,223, 73,129,242,176, 43,178,166, 95,218,245,148,193, 11, 78, 72,244,196,153, 3, -156,209, 37,208,106,222,188,185,228,206,157, 91,178,103,207, 46, 89,178,100,145,116,233,210, 41,128,202,207,207, 79, 81, 25,174, - 89,179, 70, 81,123, 17,196, 20, 43, 86,140,118,101,202,119,232, 72,180, 20, 85,161, 30,208, 10, 9,216,130,125,211, 37,105,217, - 82, 36,125,122,201,159, 63,191,180,107,215,142,155, 31,108, 64,139,118, 85, 80, 45,191,198, 55,207, 64,162, 90,204,233, 1, 3, -248,115,111,223,250, 42, 82,171, 15, 32, 43,163, 92,189,148, 19,234,195, 48, 10, 8,188,116,161,140,220,242,169, 42,183,111,214, - 1, 24,107, 11,169,214, 81,193,174,196, 43, 58,245,164, 24,190, 19,116,236,221,187, 87,145,100, 33,255, 69, 79, 79,207,214, 35, - 71,142, 92, 14,160,250, 6,103,233,213,171,151,180,111, 15,123,170, 38, 77, 8, 68, 94,232,213, 61,239, 55, 43, 30, 59,230,208, -118,121, 79, 31,219, 55,194,127, 88,187,188,167, 90, 22,254, 54,154,250,156,129, 93,135,193, 94,145,186, 76,155,136,229,155,143, -106, 55,107,221,133,241,235,142, 60,154, 59,109,205,185,205,223, 21,108,179,123,241,246,171,151,230,239, 9,184,240,219, 24,159, - 19, 69,202, 55,120,158,252,251, 31,223, 69,140, 18,235,101,152,176, 17,150,104,218,238, 71,197, 69,189,248,113,241, 67,187,180, - 63,254,248, 67, 57, 83,117, 74, 9, 23,212,136, 10,208, 74,153,178,112,164, 82,181,187, 77,122,238,111, 9,168,212,176,231,204, -186,173,251,207,229,239,159, 43,181, 29,167,177, 23, 11, 70,155, 59, 11,223,190,190, 7,160,181, 79, 30,159,220, 46,123, 59, 84, -146, 13, 13,138,202,146, 74, 63,137,191,255,117,121,240,240,134,220,188, 11, 53,226,134, 77,210, 48, 65, 66,153,212,170,157,240, - 25, 35,252,116,231,113,115,192,205,129,255, 22, 7,180,146, 40, 87, 18, 45, 59,176, 68, 68,102, 8,104,217, 75,186, 84,137,150, -245, 93,206, 54,168, 25,175, 4,189, 45,149, 49,190,205,144,186, 80,185, 58,151,239,250, 61,185,176,117,175,247,230,227,103, 47, -237,125,230, 31,112,161,228, 47, 13, 47, 68, 75,244, 67, 58,163,111, 34,104,186,113,227, 6,118,134,109, 84,236,156, 14, 30, 56, - 32,251,182,109,147,221,107, 86, 73,147,242,101,164,153, 21,100,245,249,165,180,204,106,209, 72,246,207,152, 98, 8,104,113,119, -161,170, 50,212,170, 11,123,165, 77, 42,253,115,166,147, 97, 69,115, 75, 64, 64,128,146, 40,253, 50, 8,180,190,133,228,234,238, -213,171, 87, 21, 9, 6, 38,163,227,214,239,228,174, 48,170, 11,215,142, 29, 59, 86, 81,197,225,247, 8, 61, 30,196,253, 62,195, - 11,175,243,167,100,201, 14,111, 25, 60,103,170, 76, 91,189, 93,102,111,187, 35, 67,150, 94,151, 50,245,139, 7, 3, 90, 37, 26, -214,150,222,179, 79, 27, 2, 90, 4, 88, 0,125,252, 38, 26,185, 11,249,187, 28,146,174,170,117, 91, 72,214, 60, 69,164, 86,173, -218,138,141, 14, 1, 24,164, 72, 46,129, 22,109,180,104,159, 53,162,180,135,140,175, 30,239,149, 10,182, 28, 73,180, 20,116,100, - 78,178, 53,178, 66,133, 10,114,161,126,125, 89, 10, 32, 4,240,162,164, 92,185,168, 6,255, 32,209,226,111,130, 24,168,185, 0, -138,146,144,175,142,140,205, 21, 86, 39, 74, 24,254,220,202,149,203, 5, 59,227,108,234,194,197, 11, 51,217,128,214,166,245,197, -108,215, 33,145,132,164,102,134, 33,160, 69,219, 65, 74,178,232,182,131, 18, 66, 2, 45,168, 96, 23,171,223,107,127,198,198, 10, - 74,188, 92, 30, 29,170, 39,141,156, 51,117,146,158, 93, 91,214,146,171, 23,183, 11,207,121, 82, 39,239,193,235,124,144,106, 66, -218,100,217, 25,192,187,164, 25, 43,101,195, 88, 57, 42,247, 29, 62,123,227,229, 69, 75,246, 62, 90,190,227,116,192,209, 93,231, - 94, 94,108, 63,231,217,193, 49,235, 95, 92, 88,119,228,217,157, 36,249,218,236,244, 72, 94, 49, 61, 8,185,180, 77,131, 27, 15, - 63,170, 11, 41,161,133,228,210,182,193,130,210, 59, 44,100, 66, 12,180, 34,135, 15,127,255,217,165,195,114,114,112, 3,121,126, -103,187,188, 14, 56, 45, 22,255,243,242,240,222, 25,241,204,244,189,180, 77,150, 80,154, 37, 73, 36,127, 86,172, 38, 7,188, 47, -203, 33,175, 11,110,160,165,215,152,220,247,221, 28,248, 23,115,192, 21, 22, 9,137, 68,139,172, 50, 3,180,236,243,218,131, 54, - 29,214,187,118, 88,106,100, 75,101,220, 20, 89,118, 93,186,126,235, 40,212,133,171,175,221,122,176,241,198,109,223, 3,188,102, -166,206,169, 6, 92,187,118,173, 76,158, 60, 89,186,119,235, 38,157,219,180,146,174, 77,155, 72,151,186,181,100,201,208, 1,178, - 22,105,219,240,129,178,103,104, 95, 24,201, 14,146, 77,163,135, 26, 82, 29,158, 90,187,210, 6,180, 84,155, 44, 74,177,250,231, - 78,175,128,172,177, 21,139, 43, 32,203, 98,177, 40, 64,203,136, 49, 60, 64,201, 86, 74,133,104,235, 82, 31,224, 32,107,214,172, -175, 51,103,206,108,129, 90, 73,106,212,168,161,168,224, 40,145,227, 25, 60,208,149,104,193, 79,214,190,121, 27, 78,201,200,121, - 99,165, 76,131,180, 82,180,122, 74,233, 50,113,147,180,155,122, 81, 26, 12, 63, 32,165,154,254,110, 3, 91,149,122, 44,150,134, -158,107,116, 85,135,205,154, 53, 83, 36, 89, 4, 90,248, 38, 5,104,209,142,168, 74,189, 54,210,186,215, 4,201,153,171,144,100, - 73,240,173,252, 1,181, 44,108,227, 4,118, 69, 46,129,150,253,174, 67,216,250, 28, 34,216, 34,208,170, 87,175,222, 46, 72,116, - 20, 27, 45,251,131,215, 12,180, 3, 63, 74,215,200, 83,218,147, 13, 26, 52, 72, 1, 90,109,219,182, 85, 0, 22, 19,127,171, 0, - 12,106, 58,210,116,106, 75, 6,213,225, 95, 75,151, 78,161,254,220, 6,168,202,148, 78, 32,103, 78,149,150,179,167, 42, 74,179, -166,233,108,215, 81,119, 50,104, 96,119,195,170, 67,238, 46, 36,232,160, 29, 30, 36,110,239,186,117,235,246,134,223, 60,120,240, - 96, 27, 77,170, 97,121, 36, 75,150,236,137,179,111,159, 59, 42, 75,146, 97,127,100,234, 51,180,109,222,147, 4, 87, 91,214,206, - 82,158,217,178,118,166, 2,182,120,157,247,167, 15,205,156,212,179,125,172, 88, 59, 86, 87, 29,222,173, 89,108,167, 27, 32,236, -222, 19, 38, 74,154,154,137,179,255,210,107,201,234, 67, 15, 55,204,218,254,120,115,191,165,143,118,244, 94,252,236,232, 6,239, -128, 59,223, 23,237,180,199, 35, 69,153,108, 86,144,229, 18,104, 65,210,233,199, 93,191, 83,167, 78, 5, 48,175,165,168, 15, 9, - 54,185, 3, 24,106, 69, 5,104,197,207, 88,177,114, 72, 84,135,119,189,118,200,129,174, 53,228,202,218,241,242,250,229, 85,216, - 76, 94,147, 59,183,161, 34, 79, 20, 79, 26,127, 27, 79, 26, 36, 72, 36, 43, 23,174,149,189,199,174,203,234, 53, 59,221,170, 67, - 3, 29,201,157,197,205,129,127, 43, 7,140,218,104, 89,237,166,202,171, 82, 39,206, 65, 86,201, 83,113, 29,137, 86,110,123,201, -149, 51, 32,102,157,215,108,116, 13,240,220,222, 70, 43, 56,240, 50,176,165,242,155,108, 89, 82, 94,110, 82,175,224,171,198,181, -242,189, 40, 87,252,251,167, 21, 75,167, 15,224, 53, 3, 47,183,101,161, 97, 59,140,170, 95,241,125,237,127,111, 38, 45,106,214, -144,198,165, 75, 72,115, 72,178,182,143, 31, 37, 59, 71, 14,146, 93,131,250,202,181,213,189,229,236,188, 49, 50,176, 89,227,183, - 70,140,225,143,175, 88,162, 0,173,246,177,194, 42,246, 88, 4, 89,138,186,176, 88, 30, 25, 87,185,164, 76,171, 95, 85, 1, 89, -240, 3,165, 2, 45, 95,157,114, 71,173, 88,177, 98, 16, 39, 69,238,222, 34,216, 34, 61,218,129,209,246,137,106, 22,238,238,235, -216,177, 35,165, 68,116,126, 26, 65,143, 15, 52,134,175,221,110,212,219,237, 94, 87, 0,178, 82, 72,193, 95,146, 74,171, 73,103, -165,193,200, 51, 82,101,192, 73, 41,222,227,128, 20,168,144, 84, 10, 85,254, 65,134, 45,241,146,124,213,186,191,209, 51,134, 87, -129, 86,122,168,226, 84,160, 69, 87, 15, 57, 11,150,151, 92,121, 75, 72, 17,128,175, 95,127, 76, 41,237,161,134,165, 84, 14,188, - 52, 13,180,160, 74,219, 5, 85,228, 46, 76,190,187, 96,255,229, 16,104, 25,148,108, 41, 54,101,116,244, 58,101,202,148,143, 0, -151, 10,176,192,119, 0,162,164, 82,164, 72, 17,151, 64, 11,198,240, 53, 71,142,104,246,102,216,176, 97, 66,127, 98,236, 20,237, -219,253, 8,117, 97, 53,168, 11,235,202,216, 49,133,109,160,136, 46, 57,186,117,173,246, 46, 74,148,176,141,245,234, 9,247,163, -208,133, 3,119, 28, 18, 24, 82,170, 67, 48,237,236, 64, 94,167, 64,235,232,142, 90, 99,104,147, 69,117, 33, 37, 89,218,131,255, -121,157,247,153,175, 85,197, 56, 77, 14,109,255,243, 81, 91,156, 13,148,145, 89, 20,183, 14,113, 51,214,171,210,160,251,220, 45, - 75, 15, 60,219,217,123,209,163,173,203, 14, 89,174, 52,232,185,228, 88,132,239,171,209,147, 63,119, 35, 18,100,185,220,185,139, - 5,208, 93, 74,103, 41,197,163, 74,156,155, 61,184,161,130,246,126,112,113,161, 0,173, 76, 69, 26,247,166, 91, 7,179,198,240, - 27,167,142,120,239, 61,182,151,108,234, 80, 91,158, 62,187, 46,247,252,110,200,229,171, 87, 20,144, 85, 63, 97, 98,233, 94,182, -138,236,242,186, 38,123, 0,180,122,118,239,247,214,109, 12,111,176,246,221,217,220, 28,248, 23,114,192, 21, 22,193,248,169,128, - 36,107,250, 9,231,132, 72,234,206, 67, 94,231,253,240,154,124,138,187, 24, 23,255,213,103, 84,186, 60,171,191,181,187, 21, 21, -186, 6,216,237,218, 70, 75, 79,162,133, 85,109,194, 38,141,171, 19,118, 0,120, 4,202, 57,175,161,178,111,125, 3, 41,156,239, - 7, 78,138,133, 13, 20, 64,205,242, 13, 93, 54, 44,152, 59, 71,198, 13,236, 47,141, 74, 21, 87, 64, 86, 27,216,100, 17,100,237, -133, 1,184,207,250, 94,114,115,195, 80,217, 50,216, 83,162, 27,116,239, 64, 32,164, 74,178,250,100, 72, 33, 3,127,202, 40,195, -177,147, 73,149, 98, 17,100, 45,238,214, 86, 86, 13,248, 67,206,110,223, 76, 80,162, 7,180, 60, 96,228,126,132, 96,138, 64,139, -210,149,178,101,203, 74,233,210,165, 41,217,122, 9,117, 21, 1,230, 22, 36, 74,178,140,184, 12,240,160, 29, 91,244, 36, 89, 30, - 76, 88,126, 92,198, 45,218, 32, 69,170,164,145,218,131, 14, 72,197,126, 39,164, 88, 15, 47,201,211,225,176,148,109, 84, 78,250, -141,253, 67,218,141, 92, 47,209,147,100,125,164,227,222,193,207, 30,104, 97,135,152,116,233,210, 69,106, 66, 93,152, 53, 73, 98, -169,241, 99, 10, 25, 82, 36,175,252, 53,184,191,162, 14,210, 3, 90,246,158,225,241,109, 11, 40,201,194,238,181, 93,176,159, 34, -200, 90,254,161,221,254,255,128,159, 41, 2, 26, 79, 94,215,105, 7,183,169,138, 27, 58,116,168, 52,110,220, 88,170, 86,173,170, - 76,228,148,112,241,172, 2, 44, 72,136,200, 99,197, 15, 22,232,209,145,165,179, 35, 76,252,248,225, 78, 47, 88, 48, 77, 80, 70, -137, 28, 57,156,156, 62, 89, 81, 1, 89,119,110, 53,129, 33,124, 11,168,123,163, 72,185,114,229, 32, 61,235, 42,223,198, 11, 71, -131,118,103,225,125,180,239, 24, 69, 73, 37, 55,109, 64,162, 21,196, 29,177,148,180,241,112, 36,209, 2,208,126,229,172,128,148, - 84, 57,150,104,205,178, 73,180,134,246, 76, 63,168,115,205,111,187, 85, 46,246,211,123,250,217,226,185, 77,197,216,205, 7,183, -136,105,100, 83, 0,219, 94,216,232, 25,234,205,157,182,246,210,161,101, 7, 95, 28,159,186,246,250,229, 40,233, 27,112,119, 33, -191, 85,245,175,229,178,106, 96, 23,215, 60,114,228,200,119,153,240, 61, 3,185,211,112,201,146, 37, 50,102,204, 24,218,245,169, - 18,173,124,233,127,110,216, 51,126,198, 74,157,204,184,119,136, 30, 37,242,109,223,155,231,229,241,195,107, 50,187, 89, 61,105, -155, 34,137,180, 64, 59, 61,122,242,170,236, 61,122, 73,214,108, 56, 32,127,100, 46, 45, 67, 74,214,150, 88,225, 35,112, 39,167, -219,189,131,137, 1,213,157,213,205,129,127, 19, 7,244,176,200, 87,253,173, 6, 62,238,155, 31, 82, 37,147,157,107,251,201,206, - 53,127,202,226, 41, 53,149,148,250,251,164, 92, 1,187,146,230, 56,114, 58,151,226,187,228,201,125,167,143, 30, 37,115,134, 15, - 17,207,186, 53,165,123,153, 98, 80, 23, 14,144, 3,195, 7,200,233, 89, 35,101,203,192, 62,146,245,135, 84, 84, 27,165,112,192, -216,143, 28,150, 18,104,169,146,172, 65,249, 50,201,136,146,249,100,124,213,210, 54, 41, 22, 37, 89,107, 6,245,150,205,227,134, -201,197,125,187,104,207,100, 15,180, 28,149, 51, 25,236,111, 30, 63,121,242, 68,217, 38,111,245, 86,239, 42, 60,142,125, 81, 63, -162, 73,135,165, 73,210, 23,180, 12,253,235,136, 76, 94,115, 66,154, 13, 89, 36,229,250, 30,147,162, 0, 90, 85, 6,156,144, 65, - 11,143, 75,171, 97, 27, 37,193, 15, 63, 5,232, 57, 44,133, 36,229, 94,159, 62,125, 20,213,161, 42,209,130,187, 9, 5,164,112, - 71,100,119,168,101, 91,151, 46, 38,179, 7,245, 23,184,103,128, 79,208,194,138,234,176,118,237,218,246,126,180, 92, 57, 6,164, - 68,132,142, 83,123, 35,149,179, 78,222, 10,232, 80, 1,151, 21,104,233,126, 59, 50,212, 7, 96,183, 16,100, 17,184, 16, 88,177, - 44,180, 9,194, 14, 62, 69,138,197,178, 23, 45, 90, 84,210,166, 77, 11, 91,171, 8, 22, 62,163, 33,236,168,156, 63,230,201,243, -253,195,165, 75,167,195,190,104,138, 60,188, 63, 76,252,238,118, 17,191,123, 61,229,209,195,241,240, 14, 63, 30,146,153, 62,146, - 39,119,138, 71,160,227,200, 13,135, 35,154, 3, 39, 76,152,160, 0, 86,186,112,128, 31,169,247, 84, 29, 59, 59,200, 7,187,143, -255,136, 38,109,177,114,167, 77, 81, 91,107,163,149, 55, 77,242,110,188,190,125, 77,149, 17,148,100,105,157,154,242, 63,175,235, -124, 59,111,127,112, 86, 26,175, 68,226,148, 5, 91,111, 93,180,251,193,201,212,197, 58,237,226,127, 13,200,114, 38,205,114,233, -176, 20,245,113,159,134,255, 88,112, 4, 51, 78, 87, 37, 91,102, 28,150,230,201,153,227,197,213, 75,231,228,210,249,115,210, 26, -117,219, 40,249,119,114,224,132,143,236,132, 36,171,223, 79, 85,101, 96,145, 26,146, 41,245,143,220,248,225,118, 88, 26,188, 49, -185,157,118,134,238,204,234,230,231, 63,156,159, 6,176, 72,232,126, 65,232, 82,115, 29,235, 80,239, 93,148, 90,117,233,216,216, - 38,209, 58,123,116,176,236, 93, 95, 95, 10,231, 79,173, 39,209,114,214,176,149, 16, 60, 13, 43,255,242,106, 84,167,246, 50,183, -119,119, 57, 54,103,186,108,134,125,214,144,166,141,222, 90, 37, 89,142, 64, 22,139,250, 17,208, 34,144,162,227, 83,166,163, 75, -230,139,215,242, 69,226,181,114,137, 2,180,152, 40,217, 58, 3, 73,214,217,221,219,229,220,222, 29,130,176, 52, 70, 61,195, 23, -129, 36, 11,187,220, 3, 5,142, 74,131,240,110,219, 78, 49, 61,158,217,151, 83,205,175,134,224, 41,213,224,207, 55,109, 71,108, - 20,207, 57, 39,165,231,244,227,210,160,239, 42,249,169,106,247, 55,144,100, 25, 10,193,131, 9,240, 48,183,238,115,215, 38, 61, -149,115, 7, 36,109,106,104, 91,196,157,144,127,253,245,151,226,159,108,243,230,205,210,187,119,111, 69,101, 55,106,212, 40,101, - 87, 25,164, 22,135, 13, 76,226,206, 62, 81, 85,201,241,190, 13,116, 57, 3, 27, 0, 42, 17, 97,216,254, 19,236,158, 26,225, 60, -176, 78,157, 58,119,233,114,162, 17,156,167, 82,237, 71, 64, 67,176, 72,137, 97,206,156, 57,105,147, 71,183, 9, 19,144,224,253, - 60,216,225,172, 45,165, 70,152,157, 83,115,231,180,126,125,235,230, 10,236, 46, 60, 36, 1, 47,246,201,245,107,243, 16, 97,160, -217,155,132, 9,194,211, 81,105, 26, 39, 31,227,136,230, 71, 33,120, 8, 10,157, 73,180,140, 0, 45,245,221,195,218,231,243,162, -186,144,182, 89,170, 33, 60,109,179,168, 54,180, 73,180,138,254,244,158,234, 67, 59, 91, 45,167, 19, 4,162, 44,164,192,174, 83, - 0,248, 98, 3, 35,167,174,124, 53, 81,250, 82, 3,113,173, 80,142, 28, 57, 82, 89,129,152,179,122,212,155,116,210, 2,236,222, - 0,216, 12, 30,130, 39, 99,197,124,233, 10, 54,232,149, 48, 83,197,178, 14, 8, 59,163,153, 39, 74,164, 72,183,199,143, 26,243, -110,197,228,233, 50,176,122,109,197,248,125,214,240,169,210,183, 72,249,192, 88, 17, 34,176, 63,186, 67,240,124,204, 80,189, 58, +137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 2, + 90, 0, 0, 2,128, 8, 6, 0, 0, 0, 68,254,214,163, 0, 0, 0, 4,103, 65, 77, 65, 0, 0,177,142,124,251, 81,147, 0, 0, + 0, 32, 99, 72, 82, 77, 0, 0,135, 15, 0, 0,140, 15, 0, 0,253, 82, 0, 0,129, 64, 0, 0,125,121, 0, 0,233,139, 0, 0, + 60,229, 0, 0, 25,204,115, 60,133,119, 0, 0, 10, 57,105, 67, 67, 80, 80,104,111,116,111,115,104,111,112, 32, 73, 67, 67, 32, +112,114,111,102,105,108,101, 0, 0, 72,199,157,150,119, 84, 84,215, 22,135,207,189,119,122,161,205, 48, 2, 82,134,222,187,192, + 0,210,123,147, 94, 69, 97,152, 25, 96, 40, 3, 14, 51, 52,177, 33,162, 2, 17, 69, 68,154, 34, 72, 80,196,128,209, 80, 36, 86, + 68,177, 16, 20, 84,176, 7, 36, 8, 40, 49, 24, 69, 84, 44,111, 70,214,139,174,172,188,247,242,242,251,227,172,111,237,179,247, +185,251,236,189,207, 90, 23, 0,146,167, 47,151,151, 6, 75, 1,144,202, 19,240,131, 60,156,233, 17,145, 81,116,236, 0,128, 1, + 30, 96,128, 41, 0, 76, 86, 70,186, 95,176,123, 8, 16,201,203,205,133,158, 33,114, 2, 95, 4, 1,240,122, 88,188, 2,112,211, +208, 51,128, 78, 7,255,159,164, 89,233,124,129,232,152, 0, 17,155,179, 57, 25, 44, 17, 23,136, 56, 37, 75,144, 46,182,207,138, +152, 26,151, 44,102, 24, 37,102,190, 40, 65, 17,203,137, 57, 97,145, 13, 62,251, 44,178,163,152,217,169, 60,182,136,197, 57,167, +179, 83,217, 98,238, 21,241,182, 76, 33, 71,196,136,175,136, 11, 51,185,156, 44, 17,223, 18,177, 70,138, 48,149, 43,226, 55,226, +216, 84, 14, 51, 3, 0, 20, 73,108, 23,112, 88,137, 34, 54, 17, 49,137, 31, 18,228, 34,226,229, 0,224, 72, 9, 95,113,220, 87, + 44,224,100, 11,196,151,114, 73, 75,207,225,115, 19, 18, 5,116, 29,150, 46,221,212,218,154, 65,247,228,100,165,112, 4, 2,195, + 0, 38, 43,153,201,103,211, 93,210, 82,211,153,188, 28, 0, 22,239,252, 89, 50,226,218,210, 69, 69,182, 52,181,182,180, 52, 52, + 51, 50,253,170, 80,255,117,243,111, 74,220,219, 69,122, 25,248,185,103, 16,173,255,139,237,175,252,210, 26, 0, 96,204,137,106, +179,243,139, 45,174, 10,128,206, 45, 0,200,221,251, 98,211, 56, 0,128,164,168,111, 29,215,191,186, 15, 77, 60, 47,137, 2, 65, +186,141,177,113, 86, 86,150, 17,151,195, 50, 18, 23,244, 15,253, 79,135,191,161,175,190,103, 36, 62,238,143,242,208, 93, 57,241, + 76, 97,138,128, 46,174, 27, 43, 45, 37, 77,200,167,103,164, 51, 89, 28,186,225,159,135,248, 31, 7,254,117, 30, 6, 65,156,120, + 14,159,195, 19, 69,132,137,166,140,203, 75, 16,181,155,199,230, 10,184,105, 60, 58,151,247,159,154,248, 15,195,254,164,197,185, + 22,137,210,248, 17, 80, 99,140,128,212,117, 42, 64,126,237, 7, 40, 10, 17, 32,209,251,197, 93,255,163,111,190,248, 48, 32,126, +121,225, 42,147,139,115,255,239, 55,253,103,193,165,226, 37,131,155,240, 57,206, 37, 40,132,206, 18,242, 51, 23,247,196,207, 18, +160, 1, 1, 72, 2, 42,144, 7,202, 64, 29,232, 0, 67, 96, 6,172,128, 45,112, 4,110,192, 27,248,131, 16, 16, 9, 86, 3, 22, + 72, 4,169,128, 15,178, 64, 30,216, 4, 10, 65, 49,216, 9,246,128,106, 80, 7, 26, 65, 51,104, 5,199, 65, 39, 56, 5,206,131, + 75,224, 26,184, 1,110,131,251, 96, 20, 76,128,103, 96, 22,188, 6, 11, 16, 4, 97, 33, 50, 68,129,228, 33, 21, 72, 19,210,135, +204, 32, 6,100, 15,185, 65,190, 80, 16, 20, 9,197, 66, 9, 16, 15, 18, 66,121,208,102,168, 24, 42,131,170,161,122,168, 25,250, + 30, 58, 9,157,135,174, 64,131,208, 93,104, 12,154,134,126,135,222,193, 8, 76,130,169,176, 18,172, 5, 27,195, 12,216, 9,246, +129, 67,224, 85,112, 2,188, 6,206,133, 11,224, 29,112, 37,220, 0, 31,133, 59,224,243,240, 53,248, 54, 60, 10, 63,131,231, 16, +128, 16, 17, 26,162,138, 24, 34, 12,196, 5,241, 71,162,144,120,132,143,172, 71,138,144, 10,164, 1,105, 69,186,145, 62,228, 38, + 50,138,204, 32,111, 81, 24, 20, 5, 69, 71, 25,162,108, 81,158,168, 80, 20, 11,181, 6,181, 30, 85,130,170, 70, 29, 70,117,160, +122, 81, 55, 81, 99,168, 89,212, 71, 52, 25,173,136,214, 71,219,160,189,208, 17,232, 4,116, 22,186, 16, 93,129,110, 66,183,163, + 47,162,111,163, 39,208,175, 49, 24, 12, 13,163,141,177,194,120, 98, 34, 49, 73,152,181,152, 18,204, 62, 76, 27,230, 28,102, 16, + 51,142,153,195, 98,177,242, 88,125,172, 29,214, 31,203,196, 10,176,133,216, 42,236, 81,236, 89,236, 16,118, 2,251, 6, 71,196, +169,224,204,112,238,184, 40, 28, 15,151,143,171,192, 29,193,157,193, 13,225, 38,113, 11,120, 41,188, 38,222, 6,239,143,103,227, +115,240,165,248, 70,124, 55,254, 58,126, 2,191, 64,144, 38,104, 19,236, 8, 33,132, 36,194, 38, 66, 37,161,149,112,145,240,128, +240,146, 72, 36,170, 17,173,137,129, 68, 46,113, 35,177,146,120,140,120,153, 56, 70,124, 75,146, 33,233,145, 92, 72,209, 36, 33, +105, 7,233, 16,233, 28,233, 46,233, 37,153, 76,214, 34, 59,146,163,200, 2,242, 14,114, 51,249, 2,249, 17,249,141, 4, 69,194, + 72,194, 75,130, 45,177, 65,162, 70,162, 67, 98, 72,226,185, 36, 94, 82, 83,210, 73,114,181,100,174,100,133,228, 9,201,235,146, + 51, 82,120, 41, 45, 41, 23, 41,166,212,122,169, 26,169,147, 82, 35, 82,115,210, 20,105, 83,105,127,233, 84,233, 18,233, 35,210, + 87,164,167,100,176, 50, 90, 50,110, 50,108,153, 2,153,131, 50, 23,100,198, 41, 8, 69,157,226, 66, 97, 81, 54, 83, 26, 41, 23, + 41, 19, 84, 12, 85,155,234, 69, 77,162, 22, 83,191,163, 14, 80,103,101,101,100,151,201,134,201,102,203,214,200,158,150, 29,165, + 33, 52, 45,154, 23, 45,133, 86, 74, 59, 78, 27,166,189, 91,162,180,196,105, 9,103,201,246, 37,173, 75,134,150,204,203, 45,149, +115,148,227,200, 21,201,181,201,221,150,123, 39, 79,151,119,147, 79,150,223, 37,223, 41,255, 80, 1,165,160,167, 16,168,144,165, +176, 95,225,162,194,204, 82,234, 82,219,165,172,165, 69, 75,143, 47,189,167, 8, 43,234, 41, 6, 41,174, 85, 60,168,216,175, 56, +167,164,172,228,161,148,174, 84,165,116, 65,105, 70,153,166,236,168,156,164, 92,174,124, 70,121, 90,133,162, 98,175,194, 85, 41, + 87, 57,171,242,148, 46, 75,119,162,167,208, 43,233,189,244, 89, 85, 69, 85, 79, 85,161,106,189,234,128,234,130,154,182, 90,168, + 90,190, 90,155,218, 67,117,130, 58, 67, 61, 94,189, 92,189, 71,125, 86, 67, 69,195, 79, 35, 79,163, 69,227,158, 38, 94,147,161, +153,168,185, 87,179, 79,115, 94, 75, 91, 43, 92,107,171, 86,167,214,148,182,156,182,151,118,174,118,139,246, 3, 29,178,142,131, +206, 26,157, 6,157, 91,186, 24, 93,134,110,178,238, 62,221, 27,122,176,158,133, 94,162, 94,141,222,117,125, 88,223, 82,159,171, +191, 79,127,208, 0,109, 96,109,192, 51,104, 48, 24, 49, 36, 25, 58, 25,102, 26,182, 24,142, 25,209,140,124,141,242,141, 58,141, +158, 27,107, 24, 71, 25,239, 50,238, 51,254,104, 98, 97,146, 98,210,104,114,223, 84,198,212,219, 52,223,180,219,244,119, 51, 61, + 51,150, 89,141,217, 45,115,178,185,187,249, 6,243, 46,243, 23,203,244,151,113,150,237, 95,118,199,130, 98,225,103,177,213,162, +199,226,131,165,149, 37,223,178,213,114,218, 74,195, 42,214,170,214,106,132, 65,101, 4, 48, 74, 24,151,173,209,214,206,214, 27, +172, 79, 89,191,181,177,180, 17,216, 28,183,249,205,214,208, 54,217,246,136,237,212,114,237,229,156,229,141,203,199,237,212,236, +152,118,245,118,163,246,116,251, 88,251, 3,246,163, 14,170, 14, 76,135, 6,135,199,142,234,142,108,199, 38,199, 73, 39, 93,167, + 36,167,163, 78,207,157, 77,156,249,206,237,206,243, 46, 54, 46,235, 92,206,185, 34,174, 30,174, 69,174, 3,110, 50,110,161,110, +213,110,143,220,213,220, 19,220, 91,220,103, 61, 44, 60,214,122,156,243, 68,123,250,120,238,242, 28,241, 82,242, 98,121, 53,123, +205,122, 91,121,175,243,238,245, 33,249, 4,251, 84,251, 60,246,213,243,229,251,118,251,193,126,222,126,187,253, 30,172,208, 92, +193, 91,209,233, 15,252,189,252,119,251, 63, 12,208, 14, 88, 19,240, 99, 32, 38, 48, 32,176, 38,240, 73,144,105, 80, 94, 80, 95, + 48, 37, 56, 38,248, 72,240,235, 16,231,144,210,144,251,161, 58,161,194,208,158, 48,201,176,232,176,230,176,249,112,215,240,178, +240,209, 8,227,136,117, 17,215, 34, 21, 34,185,145, 93, 81,216,168,176,168,166,168,185,149,110, 43,247,172,156,136,182,136, 46, +140, 30, 94,165,189, 42,123,213,149,213, 10,171, 83, 86,159,142,145,140, 97,198,156,136, 69,199,134,199, 30,137,125,207,244,103, + 54, 48,231,226,188,226,106,227,102, 89, 46,172,189,172,103,108, 71,118, 57,123,154, 99,199, 41,227, 76,198,219,197,151,197, 79, + 37,216, 37,236, 78,152, 78,116, 72,172, 72,156,225,186,112,171,185, 47,146, 60,147,234,146,230,147,253,147, 15, 37,127, 74, 9, + 79,105, 75,197,165,198,166,158,228,201,240,146,121,189,105,202,105,217,105,131,233,250,233,133,233,163,107,108,214,236, 89, 51, +203,247,225, 55,101, 64, 25,171, 50,186, 4, 84,209,207, 84,191, 80, 71,184, 69, 56,150,105,159, 89,147,249, 38, 43, 44,235, 68, +182,116, 54, 47,187, 63, 71, 47,103,123,206,100,174,123,238,183,107, 81,107, 89,107,123,242, 84,243, 54,229,141,173,115, 90, 87, +191, 30, 90, 31,183,190,103,131,250,134,130, 13, 19, 27, 61, 54, 30,222, 68,216,148,188,233,167,124,147,252,178,252, 87,155,195, + 55,119, 23, 40, 21,108, 44, 24,223,226,177,165,165, 80,162,144, 95, 56,178,213,118,107,221, 54,212, 54,238,182,129,237,230,219, +171,182,127, 44, 98, 23, 93, 45, 54, 41,174, 40,126, 95,194, 42,185,250,141,233, 55,149,223,124,218, 17,191, 99,160,212,178,116, +255, 78,204, 78,222,206,225, 93, 14,187, 14,151, 73,151,229,150,141,239,246,219,221, 81, 78, 47, 47, 42,127,181, 39,102,207,149, +138,101, 21,117,123, 9,123,133,123, 71, 43,125, 43,187,170, 52,170,118, 86,189,175, 78,172,190, 93,227, 92,211, 86,171, 88,187, +189,118,126, 31,123,223,208,126,199,253,173,117, 74,117,197,117,239, 14,112, 15,220,169,247,168,239,104,208,106,168, 56,136, 57, +152,121,240, 73, 99, 88, 99,223,183,140,111,155,155, 20,154,138,155, 62, 28,226, 29, 26, 61, 28,116,184,183,217,170,185,249,136, +226,145,210, 22,184, 69,216, 50,125, 52,250,232,141,239, 92,191,235,106, 53,108,173,111,163,181, 21, 31, 3,199,132,199,158,126, + 31,251,253,240,113,159,227, 61, 39, 24, 39, 90,127,208,252,161,182,157,210, 94,212, 1,117,228,116,204,118, 38,118,142,118, 69, +118, 13,158,244, 62,217,211,109,219,221,254,163,209,143,135, 78,169,158,170, 57, 45,123,186,244, 12,225, 76,193,153, 79,103,115, +207,206,157, 75, 63, 55,115, 62,225,252,120, 79, 76,207,253, 11, 17, 23,110,245, 6,246, 14, 92,244,185,120,249,146,251,165, 11, +125, 78,125,103, 47,219, 93, 62,117,197,230,202,201,171,140,171,157,215, 44,175,117,244, 91,244,183,255,100,241, 83,251,128,229, + 64,199,117,171,235, 93, 55,172,111,116, 15, 46, 31, 60, 51,228, 48,116,254,166,235,205, 75,183,188,110, 93,187,189,226,246,224, +112,232,240,157,145,232,145,209, 59,236, 59, 83,119, 83,238,190,184,151,121,111,225,254,198, 7,232, 7, 69, 15,165, 30, 86, 60, + 82,124,212,240,179,238,207,109,163,150,163,167,199, 92,199,250, 31, 7, 63,190, 63,206, 26,127,246, 75,198, 47,239, 39, 10,158, +144,159, 84, 76,170, 76, 54, 79,153, 77,157,154,118,159,190,241,116,229,211,137,103,233,207, 22,102, 10,127,149,254,181,246,185, +206,243, 31,126,115,252,173,127, 54, 98,118,226, 5,255,197,167,223, 75, 94,202,191, 60,244,106,217,171,158,185,128,185, 71,175, + 83, 95, 47,204, 23,189,145,127,115,248, 45,227,109,223,187,240,119,147, 11, 89,239,177,239, 43, 63,232,126,232,254,232,243,241, +193,167,212, 79,159,254, 5, 3,152,243,252,186,196,232,211, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 13,213, 0, 0, 13,213, 1, + 61,214, 88,241, 0, 0, 0, 7,116, 73, 77, 69, 7,219, 2, 27, 16, 38, 47, 61,220,216,191, 0, 0, 0, 26,116, 69, 88,116, 83, +111,102,116,119, 97,114,101, 0, 80, 97,105,110,116, 46, 78, 69, 84, 32,118, 51, 46, 53, 46, 49, 48, 48,244,114,161, 0, 0,245, + 8, 73, 68, 65, 84,120, 94,236, 93, 7,152,213, 68, 23, 93, 64,164, 75, 7, 1,233,189,247,142, 52,233, 69, 81,233, 69, 16,169, +138, 32, 85, 64,113,233, 8,210, 59, 72, 21, 88, 64,164,174,128,130, 72,239, 75,149,222, 59, 75,175, 75,103,231, 63, 39,188,121, +127, 54,155,188, 36,187,111,129,133,228,251,230,203,123,201,204,205,204,157,118,230,222, 59,119,124,124,156,203,225,128,195, 1, +135, 3, 14, 7, 28, 14, 56, 28,112, 56,224,112,192,225,128,195, 1,135, 3, 14, 7, 28, 14, 56, 28,112, 56,224,112,192,225,192, + 27,205, 1,127,127,127, 97,163,128, 21,173,196, 37, 77, 87, 40,107, 33,254, 43,165,105, 33,127, 50,138,221,124, 90,225,171, 85, +154,101, 93,252,236,109, 33,191, 86,105,202, 58,138,136,124,122,179,222,101,217,189, 66, 83,182,119,220,173,210, 53,229,167,186, + 15, 89,236, 79,150,105,218,232, 75,175,156,166,133,182,201, 40, 97,201,167, 89, 27,181, 67,211,106, 95,178, 67,211,106, 95,178, + 67,211,235,237,211, 91,109, 94,219, 38, 45,210,245, 88,118,189,118,110,161, 47,217,162,105,177, 47,189, 22, 52, 45,244,165,176, +230,211, 83, 95,178,212, 62,213,115,187,170,238,173,204, 77, 22,138,245, 6, 70,145, 13,207, 70,209, 76, 43, 66, 77,203, 66, 71, +177, 52,240, 70, 20, 77,213,164,107, 54,144, 91,206,167,197, 50,219, 6,111,145,161,142, 80,246,117,204,167,188,155,228,217, 82, + 91,242,102, 29,169,219,187, 13,186,150, 6, 52, 87,185,149, 9,215, 66, 93, 89,166, 41,105, 89,160,251, 74,105, 70, 20, 63, 45, +240,210,180,111,234,213,187, 5,186,175,154,159, 86,251,146,229,124,122,171,142,180,109,210, 34, 93,219,253, 61,188,109,222,168, +239,152,208,181,149, 79,139,253,211, 22,205,136,226,103,120,219,188,222, 60,108,161,142, 44,124,246, 45,136, 98,147, 81,150, 26, +140,106,210, 41,107,129,133,182,104, 90,160,103, 58,240,170, 59,135, 13,176,105, 41,159, 22, 87, 77,182,129,150,122, 21,225, 13, + 0, 19, 17,117,100,113,101,107,183,236,114,101, 31,110, 0, 35,203,172,119,247,192, 83,211,122, 87,247, 33,139,253,201, 54, 77, +242, 54,188,245, 30,145,249, 84,181,123,179,122,178, 92,118, 27,125,233,149,210,180,209,151,236,228, 51, 34, 37, 90, 94,169, 35, +217, 38, 93,245,212, 59,188, 0, 70, 59,198, 89,232, 75,150,248,169,238, 59, 22,198,209, 48,209,244, 70,223,212,240,211,108,209, +102, 43,159, 22,251,146, 41, 77,109, 91,183, 72,215,226,180,253, 6, 71,179,208,152,213,165,183, 92, 17, 54, 88,102,137,166,197, +149,131,173, 73, 60,178,208,180,184,194,177, 93,118, 27,117,111,169,142, 34, 42,159,106, 96,228,141, 1, 45, 50, 1, 45,111,214, +145,150,150, 5,218,166,245, 30,217,104,218,104,163,182,202,110,129,151,150, 22,128,218,252, 89,160,107, 43,159, 22,251,146,169, +148, 76,221, 15, 45,242,212, 22,205,136,204,103,120,198, 16,163,250, 8, 15,200,140, 44, 52,245,234,196, 98,221,219,128, 3,111, +104, 84, 11, 29, 57, 76, 64, 75, 34, 93, 11,108, 51, 29, 40, 84, 40,154, 40,223,108,101,111,105, 64,211, 27, 40,194,211, 1,213, +160,205,194,170,201, 22, 40, 98,153,189, 77,211,226, 64,246,202,243,137,114, 43, 43,101,111,213,187,106, 96,176,202, 83,211,246, +169,238, 67, 22,251,147,101,154,170, 21,163, 87,164, 16, 54,251,146,229,124,218, 88,180, 88,166,105, 99,181,108,135,102,100,169, +119,175,231,211, 70, 95, 50, 5, 69,234,241,221,226,248,100,139,166,197,241,201, 22, 77,139,125, 41,172, 52, 61,205, 75,182,104, + 90,236, 75,182,104, 90,236, 75,150,250, 81, 24,234,222, 2, 12,112,162,216, 6, 90, 54, 89,102, 90,185, 54,233,217, 6, 90, 22, +233, 59,249,180,200, 40,139,209, 28,126, 90,100,148,197,104, 14, 63, 45, 50,202, 98, 52,135,159, 22, 25,101, 49,154,195, 79,139, +140,178, 24, 45,178,240,211, 98,113,156,104, 14,208,122,193,129,200,210,176,157,124,122,183,207, 58,252,116,248,233, 45, 14, 56, +109,201, 91,156,116,198,228,200,210,150,188, 91,227, 14, 53,135, 3, 14, 7, 28, 14, 56, 28,112, 56,224,112,192,225,128,195,129, +183,148, 3,169, 82,165,242,207,146, 37,203, 17,163,144, 50,101,202,127,223, 82,214,188, 54,197,118,234,232,181,169, 10, 39, 35, +230, 28,136,138, 40,239,184, 2,127, 71, 49, 79,226,196,112, 56,224,112,192,225,192, 27,204,129,140, 25, 51, 30,122,246,236,153, +120,242,228,137,120,248,240,161,184,119,239,158,184,125,251,182,184,126,253,186,184,120,241,162,200,148, 41,211, 9,187,197,127, +255,253,247,215, 3, 28,156,179, 19,144,102,163,201,119, 54,227,125, 96,148, 40, 81,220, 33,106,212,168,129, 12,209,162, 69, 83, +194, 59,239,188,163,132,232,209,163,203,176,203,140,166, 30, 61, 61,154, 42,186, 30,105, 38, 72,144, 96,103,146, 36, 73, 2,147, + 38, 77,234, 14,201,146, 37, 11,148, 33,121,242,228,129, 50,160,204,129, 12,120,199,178, 25, 94, 17, 81, 71,118,235,244, 77,138, +207,246,249,193, 7, 31,156,179, 19, 82,164, 72,225,177,125, 98, 65,178, 27,244,174,216, 8,215,145,102,147, 9, 16, 81,218,188, +167,160,109,191,232, 7, 59,205,218,188, 17, 61, 73, 75,246, 43, 85, 63, 48,163, 41, 63, 25, 21,253,100, 8,250,253, 61,244,131, +171, 8, 87, 18, 39, 78, 28,200,160,238, 19, 9, 19, 38,220,255, 38,181, 39,167, 44, 14, 7, 28, 14, 56, 28,240,200,129,244,233, +211, 31,185,127,255,190,216,181,107,151, 8, 8, 8, 8, 21, 0,180,142,218,101, 33,193,195,229,195, 7, 69,208,205, 27,226, 78, +224,101,241,252,249,115, 65, 48,199,112, 97,223, 30,113, 38, 96,187, 56,177,121,131,120,250,244,169, 18, 30, 63,126, 76, 64,119, +209,228, 59,231, 6, 15, 30, 44, 38, 76,152, 32,134, 15, 31, 46, 6, 12, 24, 32,122,245,234, 37,186,116,233, 34,190,253,246, 91, +209,170, 85, 43,209,172, 89, 51,209,176, 97, 67, 81,183,110, 93,241,241,199, 31,139, 88,177, 98,153,210, 28, 56,112,160, 24, 55, +110,156, 24, 58,116,168,232,223,191,191,248,241,199, 31, 67,208,108,218,180,169,104,208,160,129,168, 93,187,182,168, 94,189,186, +136, 25, 51,166, 71,154,156, 80, 88, 30, 94,193,193,193, 74,153, 89, 70, 2, 89, 62,127,244,232, 81,168,192, 9,223, 83,217, 35, +162,142,236,214,233,155, 20,159,237,115,230,134,189, 98,105,192, 17,177,112,199, 33,165,110,100, 56, 60,126,182, 56, 52,122,166, + 56, 48,124,106,136,231,102,237, 19, 64,236,166, 29,154,151, 46, 93, 10,138, 31, 63,254,124,240,149, 82, 31,163,235,220,131, 7, + 15, 4, 67, 80, 80,144, 59,200,103,108, 75,204, 55,219, 24,219,218,138, 21, 43, 4, 23, 28,102,253,168, 99,199,142,162, 93,187, +118,162,101,203,150,162, 73,147, 38,162,126,253,250, 74,251,174, 85,171,150,168, 81,163,134,168, 90,181,170,168, 84,169,146,248, +232,163,143, 68,169, 82,165, 4, 23, 25, 22,234,159,229,248,165, 90,181,106, 55,152,151,133, 11, 23,138,221,187,119,139, 3, 7, + 14,136,195,135, 15,139, 99,199,142,137, 19, 39, 78,136, 51,103,206, 8,240,255,138, 5,122, 78, 20,135, 3, 14, 7, 28, 14,188, + 25, 28,192, 4,177, 2,106,195,195, 12,105,210,164,185,135,251, 99,117,200,156, 57,243,125, 61,181,162, 39,149, 34, 39, 50,130, +172,246,113,125,148, 64,233, 24,195,141, 27,255,127,198,231,148,156, 49,112,178,192,119, 46,153, 77, 16, 4, 68, 39, 79,158, 20, + 23, 46, 92, 16,200,183, 64,126, 5,164, 61, 34, 91,182,108, 34,119,238,220,162, 64,129, 2,162,104,209,162,226,195, 15, 63, 20, +229,203,151, 55, 5, 90, 88,193,159, 27, 51,102,140,128, 68, 73, 9, 40,147,200,146, 49,131, 24,243, 69, 61, 49,229,139,186,162, + 72,254,124, 34,111,222,188,162, 96,193,130, 10,221,146, 37, 75,154, 2, 45, 74,178, 8,178,246,237,219, 39, 14, 30, 60, 40,142, + 28, 57,162, 76, 48,167, 79,159, 22,231,206,157, 19,152, 96, 21,176, 72,126,200,178, 3,104,157,247, 84,118,117, 29,165, 77,155, +246, 14,234,227, 26,194, 69, 87,184, 6,222,221,181, 91, 71,111, 70,235, 13, 91, 41,216, 62, 9,178, 18,124, 53, 80, 9,119,239, +222, 85, 2,165,185,211,125, 50,184, 3, 23, 32, 4, 56,108,159,228,181, 73, 29,221,180, 74,243,236,217,179, 65, 37, 74,148,248, + 43,117,234,212, 95,154, 1, 45,126,159, 64,229,248,241,227, 10, 72,161,148,249,234,213,171,226,214,173, 91,130,249, 35,120, 39, +176,225, 66,161,117,235,214,150,128, 86,155, 54,109, 24,143,110, 33, 8,162,216, 79,196,123,239,189, 39, 18, 37, 74, 36, 32,109, + 21,144, 72,137,116,233,210,177, 79,138,236,217,179, 91, 1, 90, 4, 89, 3, 43, 87,174, 28,200,188,240, 42, 87,174,156,192,127, + 49,122,244,104,225,231,231, 39,184, 96, 33,176, 99, 57, 28,160, 21,182,118,235,164,114, 56,240, 54,112, 0,195, 71,116,132, 34, + 8, 53, 16,170, 34,148,116,253,230,127, 6,190,147,239,149,255,122,124, 81,197, 81,222,171,254, 87,148,116, 52,207,139,225,121, +121,215,187, 10,184,199,210,124, 71,166,115,231, 67,183, 62,204,252,154, 80, 69, 37, 7, 74, 14,150, 92, 41,115,213,204, 1,253, +206,157, 59, 10, 80,186,114,229,138,192, 68,193,137,231,184, 81,165,115, 34,163, 36, 75, 13,180,152,246,230,205,155,238,103, 18, +104,145,174,107, 34,243, 8,180, 8,138, 70,140, 24, 33, 10, 21, 42,164, 4, 35,144,197, 21, 56, 65, 22, 7,249,216,177, 99,123, +156, 28, 73,147, 19, 20, 1, 86,249, 98,249,196,218,222,205,197, 3,223, 38,226,106,167, 47,196,165,230,159,137,235,165,115,138, + 13,109,191, 16,141,170, 85, 81, 64, 86,153, 50,101, 76,193, 27,129, 22, 37,120, 70, 32,139,252,203,147, 39,143, 2,178, 56,177, + 83,218,101, 6,180,212,124,206,144, 33,195,159,168,163,109,168,158,117, 12,168,163,109,168,163,195,168,163,107,118,234,232,109, +232,176,158,218, 39, 37, 89,106,160,197,186,208, 2, 45,130, 28, 74,143,216, 62,179,102,205,106, 10,180,172,208, 36,200, 66,253, +255, 83,164, 72,145, 6,133, 11, 23, 46,109, 6,180,216,247,164, 36, 72, 15,100,177,159,178, 13,179, 63, 80,162,107, 65,250,116, +206, 21, 79, 76,154, 52, 41, 84, 64, 91, 20,144,160, 42, 32, 43, 71,142, 28,202, 66,131,170,120, 15,237,133, 54, 88,239, 0,156, +221, 86,143, 29,148, 42, 55,106,212, 72,172, 91,183, 78,145,108,181,109,219, 86,145, 58, 19, 44, 98,225,224, 72,180,222,230, 14, +232,148,253,173,231,128, 39, 44,130, 33,173, 66,247,238,221,123, 16, 27, 97, 65,234, 71,224,195,223, 50, 72,208,165,249, 31, 2, +108,185,192,154,146,206,149,158, 63,212,255,149,231, 8, 10,120,146,241,228,119,121,199,243,106,242,191,138, 78,136,124, 24, 1, + 45,197,185,161,145,243, 68,170,168, 56,177, 24,169, 17,213,170, 69, 12,196,134,182, 91, 4, 90, 4, 27, 82,146, 37, 1, 23,239, + 92,137, 19,100, 16, 20,244,207,156, 76,140,204,159, 65, 28,241, 95, 72,224,230, 17,104,193, 94,228,220,207, 63,255, 44, 32, 5, +240, 8,178,228, 74,154, 42, 16, 51,160, 69,154, 84, 65,102,206,148, 81, 60,159,255,133, 56, 61,174,173,232,214,232, 19,247, 4, +211,189, 97, 3,177,161, 67, 59,113,248,235,150,162, 74,133, 10,138, 42,197, 76, 29, 73,160, 69,128,122,244,232, 81,183, 36,235, +252,249,243,138, 36,139, 32,139,128, 51, 95,190,124, 10,120,165, 77, 28,227,218, 1, 90,144, 52,140, 7, 0,152,129,201,107, 60, +234,131, 97,198,206,157, 59,151,225,190, 29,225,162,213, 58,122,155,123, 58,219, 39,193,147,148,100,173,242, 41, 34,100,144, 82, + 44,130,172, 54, 67,125,149,240,251,218,149,150, 36, 90,102, 52, 9,178,210,100,206,176, 28,160,164, 14, 58,112, 65,128,173, 15, +173, 0, 45, 46,108,180, 32,139,223, 82,131, 44, 0,112, 69,197,109, 5,104, 49, 30,165, 88,122, 64,139,116,208, 23, 69,206,156, + 57,149,118,202, 69,141, 21,160, 5, 53,232,149, 69,139, 22, 41,146,172, 58,117,234,136, 41, 83,166, 40,170,204,175,191,254, 90, + 1, 89, 92,120, 80,170, 75,105, 28, 22, 54, 14,208,122,155, 59,160, 83,246,183,158, 3,158, 60,199,171,129,143, 26, 84,201,223, +218,247,106, 48, 37, 25,171, 6,107, 70, 64, 75, 11,158,244,128,152,140, 99,144, 15, 93, 73,154, 2,176, 60,121,102, 87,171,168, +164, 58,209,232,110,166, 58, 36,128, 48, 82, 23, 18,100, 49,140, 42,144, 81, 76, 45,151, 79, 28,251,211, 26,208,234,215,175,159, +178,218,166,186,144, 42,196,203,151, 47,187,213,133,148,100,113,144,167,109, 9, 65,214,167,159,126, 42,226,196,137,227, 81, 10, + 65,160,229,235,235, 43,114,229,200, 38,196,191,221, 68,233, 98,133,220, 32, 75,170, 11, 43, 66, 58,182,226,199,129,162, 54,108, +190,172, 72,201,104,244,206, 73, 80,170, 11, 37,200,226, 4,195,252, 21, 47, 94, 92,228,207,159, 95, 1, 89,140, 71, 41, 0,128, +214, 5,163,158, 7,155,175,157,210,104,222,117,191,131, 59,195,109, 87,184,131,111, 94,128,196,101, 20,194, 31,168,175,237,178, +206,156, 29,163,250, 92, 85, 3, 45, 74,177,212, 64, 75,218, 66,113,193, 33,129,214,188, 53,203,109, 1, 45, 61,154, 82,146, 69, +144,133, 78,251, 1, 66,102,171, 64,139, 32, 93,170, 11,165, 42,147, 32,107,216,176, 97,238, 69, 7,234, 94,124,246,217,103,150, +128, 22,129, 80,188,120,241,220, 64,171,115,231,206, 66, 6,210,201,149, 43,151, 2,178, 32,113,227,138, 82,196,136, 17,195,204, + 70, 43, 42,128,214,101,170,203,217,255,104, 39,185,124,249,114,177,117,235, 86, 65, 53, 37, 37, 89,167, 78,157, 82, 22, 26, 92, +100, 57, 64,235,173,159,103, 29, 6,188,229, 28,240,132, 69, 48,180,149,215, 72,150,220, 18, 45, 61,192,163, 5, 90,136,163,168, + 21, 85, 32, 73,170, 14, 67, 73,180,212, 96, 75, 79,114,166,150,116,169,223, 75,240, 22, 38,137,150,183,234,158, 19, 25,129,150, +158,186, 80,130, 44, 74, 19,166,125, 84, 64,204,251,164,180, 56,185,114,177,169,106, 6, 54, 37,231,104,252,206,213, 54,109,178, + 56,160,195,240, 86,177,157, 82,131, 44, 26,172, 19,100,113, 50, 49, 3, 90,164,217,163, 71, 15,168,242,114,138,139,135, 39,138, +146, 37,138,133,178,201,170, 92,169,178, 24, 63,110,177,168,247,121,109, 5,192,153, 73,201, 8,180,104, 55, 67, 21,137, 4, 89, +156, 0,201, 11, 74,196, 56,113,209,150,140, 42, 67,130, 70, 94,158,128, 22,121, 73,245, 45,105,202, 32, 13,234, 9,214, 40,129, + 97, 28,111,213,221,219, 64, 71, 2, 45,169, 46,212, 2, 45,105,108, 46,129,214,156, 85,254,166,237,147,198,240, 4,206,122, 52, + 9,178,208, 78,151, 67,189, 87, 7, 96, 61, 47,170, 60, 13, 66, 86, 43, 64,139,192,138, 32,139, 0,197, 19,200, 34, 56,170, 89, +179,166,153,244,201,135,234,114, 26,189, 99, 39, 96, 8,160,165, 52, 68,205,197,182, 74,117,185, 5,160, 21, 5, 59, 9, 47,209, +150,140,106,204,213,171, 87, 43,146, 44,130,172,255,254,251, 79, 89, 20,181,111,223, 94,121, 70,254, 0,108, 58, 18,173,183,161, +163, 57,101,116, 56, 96,192, 1, 19,137, 86, 9, 45,160,242, 36, 89,210,188,115,131, 44,151,250,175,130, 74,202,165,167, 58, 84, +236,173,244, 0,151, 5, 9,151,177, 68,203,147,234,208, 91,173,130, 19,217,249,189,187,221,246, 88,106,117,225,207,217, 83,138, +177, 69,178,136, 25, 21, 10, 42, 32,129,193,138, 13, 12, 65, 17, 24,167,168, 52,212,134,239, 90,144,197, 73,132, 32,139,171,234, +184,113,227,122,148,104,145, 38, 87,242,249, 10,231, 21, 35,239, 15, 20, 37,202,125, 24,194,240,157,147, 76,181,106, 53, 68,247, +249,251, 68,131,250, 13,149, 93, 89,102,224,141, 64,139, 64, 72, 45,201,226,142, 46, 78,130, 21,160,126,100,126,169,142, 97, 57, +168,166,113, 1, 45,195,124,146,151, 4, 88,218,141, 5,242, 63,193,150, 3,180,236,181, 92,242,235,236,230,241, 98,101, 71, 31, + 37,168,213,133, 61, 51, 23, 21, 50,144,183,172, 75,130, 98, 43, 54, 90,122, 52, 9,178,222,143,243,222, 63, 4, 89, 46, 73, 86, +154,122,245,234,229, 29, 52,104,144, 37,213, 33, 65,159, 30,200,194,166, 8, 69,178,171,150, 64, 85,169, 82,197, 18,208, 98, 91, + 4, 15, 76,129, 86,217,178,101,149, 54,139,157,182,166, 64, 30,134,244,151,168, 46,255,245,215, 95,197,182,109,219,220, 54, 89, +148,236, 6, 6, 6, 42, 32,139,146, 45,242,211, 1, 90,246,218,171, 19,219,225,192,155,198, 1, 43,170, 67,130, 31, 23, 88,178, + 98,163,165,150, 96,169,127, 71,247, 4,180,248,206, 19,160, 10,147,141,150,182,178, 92,170, 66, 67,103,165,218,157,108, 86, 85, + 81,156,200,206,236,220,230, 6, 7,210, 38,139, 82,172,113, 69,179,138,233, 0, 89,191,127, 86,214, 61,193, 89,153,200, 36, 40, +162,113,174,220, 93, 72,208,194,213, 50, 87,252,148,100,169, 65, 22,119, 57, 89, 1, 90,116, 13, 81,160,100,126, 81,245,217, 71, +226,195, 42,229,220,187, 11, 9,178, 40,129,170,249,201,167,162,233,138,107,162, 81,147,166,202, 22,120, 51,160, 69, 31, 89,156, + 88,168,214,108,209,162,133, 34,201, 34,240,163,187, 9, 74,225, 74,151, 46,173,168,100, 40,129, 8, 47,208,250, 46, 94, 20,197, + 88,155, 42, 68,216,204,117, 65,125,141, 69, 88,142,122, 90,243,166,117, 76,111,150, 71,105,159, 27, 70,185,129,150, 90, 93,168, + 6, 90, 82,114,104,165,125, 82,162,165,165,105, 32,201, 74,215,188,121,243,188,163, 70,141,178, 4,180,152, 7,173, 36, 75,130, + 44, 74,118,217,142,168,138,102,155,226, 38, 16, 51,233, 19,213,229, 4,100, 52,158,151, 59, 11,105,244,174,119, 85,172, 88, 81, +145, 26, 91, 5, 90,220, 81, 72, 3,120, 74,178,168, 70,228,127, 41,201, 98, 63, 32,112,229,229, 0, 45,111,182,102,135,150,195, +129, 55,139, 3, 82,245,231,146,106, 81, 66, 85, 84, 74,184, 84,207,220,187, 14,117, 36, 90,242,157,214, 64, 94, 62, 55,218,117, + 40,159,203, 59,119, 33,170,191,109,109,215,161,182, 58,104,252,206,129,143,134,235,148, 42,201, 65, 93, 58, 45,229, 46,193,107, +215,174, 41,182, 21,116, 77, 96,213,121, 41, 39, 50,250,201,162,212,165, 83,130,104,138, 61,150, 52, 60,158, 81,177,144, 88, 80, +187,188, 88,254,229, 39,202, 4, 66,160,224,154,200, 60, 26,195,195, 32,247, 92,135, 14, 29, 20,105,144, 90, 93,216,184,113, 99, +101,183, 21,237, 88, 24, 40,201, 34,200, 34,200,129, 29,138, 71,137, 22,105,210, 80,183, 64,177, 2, 34,215,211,180,226,139,195, + 93, 68,189, 31, 58, 40,234, 18,130,172,134, 63, 14, 19,245,253,207,137,218,235, 30,137,250, 13, 27, 41,254,134,204,192, 27,129, + 22, 13,127,137,216,185,221,158,121,129, 4, 67, 1,129,156,224, 72, 27, 42, 35,101,130,164, 68,226,239,191,255,166,234,208,176, +236, 82,162,165,221, 88, 32,213,178,228, 31, 0,219, 93,240,114, 60,234,237,111,212,213, 41,171,245,244,102,117, 79,235,165, 33, + 79, 79,175, 27, 22, 2,104, 73,117,161, 22,104, 81,154,104,165,125, 18,104,169,105, 74,155, 44,151, 36, 43, 53,186, 89, 90,180, +213,188,104, 19, 84, 29,102, 66,200,137,157,172, 30,141,225,169,230,147,254,189,216, 79,105,147,101, 4,178,168,230, 35,136,183, + 2,180,104,107, 40,141,222,229,206, 66, 61,160,197,197,203, 39,159,124, 66,195,121, 83,137, 22, 84,145,151,184,232, 97,127,148, +110, 28,216, 31,165, 36,139,252,149,151, 3,180,172,183, 85, 39,166,195, 1,135, 3,198, 28, 80,129, 50,125, 53,222,235,192, 60, + 76,244, 71,184,202,212,115, 84, 26, 30,231,165,210, 6, 70, 74,178,126,201,149, 90, 76, 40,153, 67,252, 86,185, 72, 8, 53,205, +214, 31,218,138, 61,131,186,137,171,155,215, 80, 5,226, 17,104,189,251,238,187,231, 56,104,211,152, 92, 79, 93,200,119,116,194, + 72,149, 29, 47,238,210,130,111, 32, 83,160,245,213, 87, 95, 41,210,128, 74, 13,170,138,182,127,247, 23,223, 30,221, 40,218,174, +191, 41,106,174,186, 43,210, 46,125, 46,190,248,125,159,104,218,174,179, 2,178, 56,137, 88, 1, 90, 92,205, 83, 37,201, 60, 65, +122,161,236, 6, 35,208,226, 4,199,188, 83, 34, 71,149, 15,119, 80, 82, 10,129,137,199, 35,208, 34, 0, 86, 3,173,239,222,139, +170,184,202, 96, 32, 88, 5, 96, 14,194, 78,209, 63, 80,103,188,110,134,197,201,236,235,208, 30, 95, 86, 30, 36,120,149,146, 44, +191, 31,235, 11, 25,164,186,144, 60, 31, 56, 37,167, 18, 22,175,233,100,218, 62, 9,180, 8,202, 72,147, 32, 43, 71,198, 15, 86, +160, 94,234,192,174,143,192, 42, 45, 66,122,130,172,239,190,251, 46, 31,126,103, 65,200,101, 5,104,209,214, 81, 13,178, 80,183, +138,141,162, 90,146, 37, 65, 22, 23, 7,102,210, 39, 74,134, 25,143, 52,212, 59, 11,245,128,150,148, 16, 91, 5, 90,220, 85,184, +118,237, 90,101,199, 45, 37,197, 92,196,112,161, 70,158,112,145,196,254, 64,208,234, 0,173,151,213,210,157,239, 56, 28,112, 56, +240,202, 57, 0, 21,211, 74,163, 51, 14, 1, 2,232,168, 84,215,121,169,142, 10, 49,196,137,225, 18,104, 73, 73,214,164,146, 57, +197,111, 85,138,138,133,117, 42,184,165, 88, 92,225,238, 29,220, 93, 28, 25, 63, 64, 92,223,185, 65,111, 34, 11, 65,147, 64,139, + 18, 34,174,218,229,238, 66, 61,117, 97,183,110,221,220, 94,227,117,128, 86, 40,154,148, 56, 21, 43, 86,204,237, 39,171, 82,149, +170,226,155, 17,191,137,214, 99,255, 16,159,215,123,225, 17, 94,130, 44, 74,206,116,128, 86,168,178,115,146,102,217, 57,193, 72, + 27, 31,189,137, 76,181,194,215, 2, 45, 55, 77,105, 12, 47,109,178,164, 36,235,199,148,241, 68,223,244,137,149,111, 96,146,127, +128,186,250, 29, 97, 3,235, 19,245,243,183, 78,227,138, 44,167,186, 71,120, 62,213, 64,139,237, 80, 13,180,212, 27, 15, 36,208, + 90,248, 79, 7, 2, 19,195, 58, 34,175, 37,208,146,146, 44,130, 44,212,175,158, 36, 43, 75,223,190,125,243,255,246,219,111,133, +116,128, 86,136,178, 83,205,199, 54,194,147, 16, 40,201,146, 32,139, 54,138, 84, 23, 82, 50,170, 6, 89, 4,242, 58, 64, 43, 4, + 77, 2, 45,218, 94, 73, 26,114,103,161,148,226, 82,234, 42,119,237, 74, 91, 71,108, 0,209, 74,180, 66,213, 17,118,199, 94,162, +212,155,198,239,116, 40, 44,253,102,209,254,141,151,148,108, 81, 66,103, 0,180, 34,188,222,189, 52,224, 58,249,244, 18, 35, 93, +100, 28,126,190,157,252,244,110,169, 35, 43, 53, 74, 69, 56, 64,114, 69, 45, 87,234, 84,255, 81,141,168,163,154,210, 5, 27,242, +200,153, 19,127,251,139,147,171,253,197,233,213,127, 42,170, 66, 25, 46,111,254, 71, 92,221,182, 14, 97, 45,237, 69,180,210,167, + 16, 52,161, 18, 57,199,227, 66, 40, 1,162,173,147, 30,200,162,186,144, 3, 60,237, 66, 40, 81,194, 89,107, 30,105, 18,188,209, +177, 34,165, 76,114,162,225,100, 37,105,107, 65,150,129, 58, 82,183,236,156, 80,184,122,167, 90,214,236, 2, 48,186,172,105, 39, + 33,128, 22,165, 44, 4, 90, 82,146,197,205, 5, 4, 89, 3,179,190,111,103,215,161, 51,160,185,152, 44,193,171,180,193,218,189, +114,150, 8, 88, 62, 67,236, 92, 54, 85,177, 35,146, 97,201,191, 93,196,162, 53, 29,197,188,191, 90,153,182, 79, 0,173, 91, 0, + 24,202,238, 66, 56, 36,253, 28,199,220,228, 68,189, 39, 69, 72,130, 54,153, 21,109, 50, 51,126, 39, 68, 72, 0,169, 86, 58, 24, +134,167,129,100, 83,171, 58, 12, 5,180,168,130,166,212,149,109,159,109,149, 82, 38,182, 79,182, 83,246, 5, 45, 64,210,145, 62, +133,160, 73,117, 57,219,187, 4,106,210, 17, 47,141,222,121,244, 14, 13,229,185, 75, 86, 58, 28,229, 66,196, 42,208,162, 20,153, + 18,101,218, 76,114, 65, 64, 19, 4,121,201, 99,168,248,223, 1, 90,161,102, 5,167,111,122,119,162,116,248,249,250,243,211,187, + 57,140,172,212, 8,166,140,212,138, 58,170,169, 16, 13, 91,199,247, 83,160,198, 23, 84,168,255,112,244,169, 61,172, 89, 59, 65, +108,166,253, 9, 3, 87,237, 12,156, 84, 24, 56, 17, 48,192, 80, 93, 9,144, 58, 41, 1,191, 45,211, 84,211, 85,211,214,210,199, +119, 60,210, 68, 57,118, 98,210, 13,148, 1, 32, 42,208, 44, 48,141, 39,160, 37,109,217,180,231,222, 81, 90,192,201,204,226,174, + 67,103,240,113, 49,153,252, 54,107,143,218,247,102,237, 19,182,121,219,209,230, 22, 66, 18,220, 28, 82,162, 50, 86, 2,128, 86, + 49,100,137,158,213,229,165,149, 62,109,246,112, 96,186,210, 23,180,253, 1,109,215,176, 45,241, 35,112,104,186, 89, 30,186, 46, +211,235,245, 41,117,187,199,111,143, 52, 73, 23, 54, 90, 91,104,159, 40,249,198,246,111,212,238,193, 75,189, 67,165,157,246,233, +221,201,194,225,167,195, 79,111,113, 32, 34,218,146,183,242, 22,185,233, 80, 61,104,164, 86,212, 81, 77, 69, 68, 69, 56, 52,209, +132,172,128, 86,198,177,208,218, 28,126, 90, 96,146,141, 40, 14, 63,109, 48,203, 66, 84,135,159, 22,152,100, 35,138,195, 79, 27, +204,178, 16,213,225,167, 5, 38, 57, 81, 34,150, 3, 78, 35,244, 46,127, 29,126, 58,252,244, 22, 7,156,182,228, 45, 78,190,160, +227,240,211,225,167,183, 56,240, 54,183, 37,111,241,240,173,162,243, 54, 55, 24,167,236,222,109,234, 14, 63, 29,126,122,139, 3, + 78, 91,242, 22, 39, 29,144,233,180, 37,239,182,165, 55,150, 26, 27,138, 94,176, 83, 96, 35, 26,158,158,155,209,119,104,234,215, + 75, 88,235,203,225,167,195, 79,171,109,192,233,155,198, 28,176,202, 67,117, 60,135,159, 14, 63,245, 56,240, 54,183, 37,201,143, +176,206,103,102,125,234,173,122,239,160,125,239, 86,183,195, 79,135,159,222,226,128,211,150,188,197, 73, 71,170,227,180, 37,167, + 45,121,151, 3, 14, 53, 91, 28,112, 58,160, 45,118,153, 70,118,248,105,202, 34, 91, 17, 28,126,218, 98,151,105,100,135,159,166, + 44,178, 21,193,225,167, 45,118,153, 70,118,248,105,202, 34, 91, 17, 34,130,159,182, 50,224, 68,118, 86,121,102,141, 48, 90, 24, + 26,137, 33, 77,184, 33, 74,132,144,194, 32, 36,242,240, 45, 79, 52,163,128, 94, 12,132,120, 46,250,252, 6,127,243,153,218,253, +128,150,188,155,166, 16,189,163, 94,184, 48, 58,239,249,179, 19, 90,158, 59, 55,241,235, 51,103, 38, 22, 23, 98, 69, 12,153, 32, +238,251, 57,114,166,200, 84,232,187,132,105,114,143, 78,145,177, 80,235,152,201,179,166, 55,200,171, 25, 63,195,192, 78,199,128, + 57, 44, 76, 11, 75, 91, 10,199,119,156,122, 15, 7,243,116,146,154,241,243, 99,164,217,131,176, 23,161,158,197, 79,155,209,180, + 72, 38, 68, 52,135,102, 88,184,102,156, 38,178,240,211,187,165,126,221,169,225, 60,192,157,241,227,199, 15,132,115, 79,119, 72, +148, 40, 81, 32, 3,124,227, 40, 1,238, 3,220, 1, 62,112,248,206,212,175,142,170,220,239,224,119, 67,124,103, 10,210, 29, 97, +224,111, 62, 67,224, 59,163,203,172,193,196, 71,194, 86, 8,235, 93,129,191,249,204,211,229,137,102, 94,240,224, 56,202,119, 12, + 4, 18, 51,160,220,199,192,155,227,248,157, 55, 12,249,140, 10,127, 69, 35,225,201,158,131,217,183, 54,219,129, 39, 80,148, 18, +103,224, 61,214, 11, 0, 69, 41,237,230, 19,105,222, 69, 72, 54,122,244,232, 28,240,253,212, 24,126,144,134, 48,240, 55,159,241, + 29,227, 24,208,117,231,147, 32,107,215,206, 14, 19,151,255, 89,225, 22,195,238,221,157, 38,158, 63, 63,185,140, 16, 1,209, 99, + 39,201,154,178,192,135,213,199, 28, 61,118,106,210,147,103,207, 38,173, 92,191,125, 98,166,124, 31,141, 53, 0, 91,102,245,110, +147,149, 74,116,135, 38,152,128,147, 18,118,202,126,110,212,199,217,191, 25,146, 37, 75,230, 14, 24, 3, 12,251, 59,105,154,141, + 23, 90,122,244,183,133,103,155, 53, 21,233,174, 35,244,185, 45, 70, 99,143, 30, 45,233,191, 75,199,205,137,154,166,146, 79, 45, + 93, 89, 94, 53, 93,210,147, 52,193, 7, 79,249,220, 25, 17,249, 12, 11, 77, 79,249,116,241, 57, 42,238, 99, 92, 60,202,138,223, +219,120,122, 5,125,241,193,143,218, 62,252, 47,128,182,177,155,113, 16, 24, 87,239,114,250, 81, 88, 70, 31,227, 52,111, 51, 63, +189,203,201,215,157, 26, 65,150,218,131,115,112,112,176,226,209,156, 94,179,233, 32, 83, 58,197,100,167,228,217,133, 60,115,143, +131,176,209, 32,169,121,158, 7,244,143,254,252,243,207,143, 78,157, 58,165, 28, 92,205,192, 51,209,126,249,229,151, 71,124,135, +248,121,108,116,106, 14, 0,149, 16,252,224,236,241,241,159,127,254,169,120,241,102, 30,231,207,159,207,243,223, 30,243,157, 43, +142,222, 96, 97,212,176, 63,132,131,197,243, 39, 78,156,120,190,106,213,170, 39, 24,112, 86, 51, 32,159,207,241, 44, 24,131,240, +121,208,164, 23,111, 59,131, 79, 29,120,167, 15,100, 89,113,228, 9,193,150,188, 40, 33,242, 36, 37, 98,188, 80,249, 84, 73,178, + 8,166,132, 94, 32,208,114, 73,186,244, 36, 91,122, 52,227,226, 32,224, 52, 0, 86, 63, 19,184,105,105,242, 25,223, 49, 14,232, +198,213, 41,188,155, 38, 37, 89, 4, 88,247,111, 30, 22, 12,211,166,151,187,211,250,219,198,126, 41, 51, 21,252, 53, 97,234,220, + 99, 14, 30, 62, 54, 9, 52, 38,253,187,227,232, 36,223,241, 43, 38,125,246,237,200,137, 73,210, 21,104,237,137,166, 23,251,206, +219, 60,160,185,203,158, 48, 97,194,203,242, 72, 28,189,131,228,121,242,131,236,231,242,156, 82,222, 9, 58,140,250, 59,193,139, + 60, 48, 90,142, 29,242, 68, 8, 62,151,231, 73,242,187, 50,112,188,129,119,248,115, 70, 52,145,207, 75, 50,159,164,201,211, 41, + 56,110, 72,186,106,239,253,234,179, 41,113,186,132,229,124, 90,161, 73,218,112, 64,123,209, 40,159, 4, 68,140,195, 75,230,147, + 99,167,204, 39,199, 80,117, 94,229,127,140, 53,134, 39, 65,232,209, 52, 43, 59,191,225,137,159,174,252,143, 57,114,228,136, 50, +166,227, 16,251,235, 56,245,226, 41,219, 0,199, 80,140,165,193, 56,214,236, 9,207,165,252,242,203, 47, 57,182, 16,108,217, 25, +235,194,211, 85,157,190, 25, 30,238,133, 78, 27, 89,248,233,221, 82,191,238,212,184,194,229, 64, 49,119,238, 92,241,199, 31,127, +136, 37, 75,150,136,229,203,151, 11, 0, 14,241,239,191,255,138,141, 27, 55,138,109,219,182, 41, 7, 79,243,176,100, 14,188, 22, +129, 86,225, 12, 25, 50, 4,241, 88, 14,245, 37,207, 1,100,135,231,225,179, 24, 28,131,192,163,194, 22, 38,220,207,241,221,203, + 99,198,140, 81, 14,170,213,187, 56,112, 28, 60,120, 80,240,188, 67, 72,205,120, 54,221,231, 70,131,164,124, 14, 79,239,181, 50, +103,206, 28,136,203, 77,114,224,192,129,103, 23, 46, 92,120,141,131, 49,207,111,219,180,105,147, 72,147, 38, 77, 32,142,236,169, +101, 33,159,140, 18, 3, 43,199, 61,199,143, 31,127,190,119,239,222,167,240, 24, 62,207,149, 14,139,199, 24, 67, 48,168,173,195, +255, 22, 30,218,134, 30, 40,114, 75,178,144,209,219, 8, 65,154,112, 91, 74,185, 12, 36, 91, 33,104, 82, 45,184,123,247,238,180, +240, 36, 30, 64,128,133, 99, 98,206,224,104,159,171,152, 48, 30, 35, 60,193,239, 64, 28, 21,115,150,239, 24,135,113,153,198,136, +159, 84, 23, 74,160,117,104,255,122,241, 69,139, 50,143, 78,156,220,187,241,206,221,187,179, 86,111, 57, 48,233,232,217, 43,147, +150,174,219, 63,105,210, 31,155, 39, 21,110, 60,100,210,199,223, 77,156,148, 50, 91,209,177, 9, 62,200, 85, 22, 52, 13,189,163, +123,169,255, 68,150,193, 39, 66,243, 9, 80,116,153,141,124,233,210,165, 98,197,138, 21, 98,245,234,213, 98,221,186,117, 98,243, +230,205, 98,251,246,237, 2,117,172,156, 85,200, 9, 25,224,154,135, 99, 11,130, 47,157,147, 7,220,249, 36,208, 34,205,191,255, +254, 91, 25, 47, 54,108,216, 32,182,108,217, 34,118,238,220, 41,246,236,217,227,166,135, 5,139, 66,143,227, 1,193, 23,128, 1, + 23, 47,234, 75, 77,243, 18,251, 50,199, 30,230,109,199,142, 29,238,188, 29, 62,124, 88,168,105,241,184, 31, 30,174, 78, 48,130, +241,230,170, 17, 77, 2, 24,230,147,229,101,127,102,121,113, 16,187,216,191,127,191, 32, 77,244, 85,113,230,204, 25,229,156, 70, + 30, 51,198, 35,132, 72, 19, 64,203, 16,188, 73,154,158,202, 76,154, 44,179,154,166,167, 35,183, 36, 77,150,125,235,214,173,110, + 62, 30, 56,112, 64,169, 23,150, 93, 75,147,192, 14,224,201,144,159,228, 9,234, 41,128,124,231,161,223,172, 31,130, 93,150,155, + 99,253, 95,127,253,165,148,155,188,152, 62,125,186,192, 2,152,146, 45,189, 43, 66,219,167,151,250, 58,201, 56,249,244, 34, 51, + 35,136,159,134, 57, 68, 55,141,142, 80, 4,161, 6, 66, 85,132,146,174,223, 21, 93,247, 98,184,151,119,253,174,128,123, 81,215, +111,198,231,111,190,231,111, 25,138,168, 63,166,162,205,111,200,239,200,184,242, 27,218,255,242,185,246,125, 8,218,202,119,120, +110,154, 43,112,114, 83, 46, 9,180,172,128,172, 67,135, 14, 41, 64, 75,103,133,171,101, 90, 76,128,139,179, 28, 92,212, 23, 87, + 94,124,198,193,130,131, 58,239, 28, 68,161,126,224,132, 30,211,164,109,156, 35,240, 33, 80, 51,187,152, 71, 14,250,160,167, 93, + 53,135,250, 4, 85, 6, 92,197,147, 54, 7, 50, 78, 62, 28,184,152, 87, 74,225, 56, 8, 77,153, 50, 69, 25,160,200, 43,139,237, +247,187, 1, 3, 6, 60,226, 96,141, 51,237,174, 35,141,148,134, 13,152, 52,105, 82, 32,191,131,243,230,214,226,185, 22,184,132, + 34,143,178, 74,155, 44,183, 36, 11,207, 30, 32, 4,104,194, 3, 36, 86, 36, 93,184,164,100, 43,161, 94,126,241,158, 54, 89,201, + 81,246, 81,140,143, 65,253, 24,254, 63, 65, 56,131,112,192, 21,248,251,209,154, 53,107, 14, 51, 14,227, 50, 13,211,234,209,164, + 77, 22,213,133, 4, 91, 93,186,127, 24,180,255,191,127, 14, 61,125,122,199,127,199,129,211, 51, 70,204,250,119,210,194,127,246, + 42, 18, 45,134,253,199, 46, 76,106,213,119,238,164, 1, 19,151, 77, 42, 80,174,246,216,120,169,114,213,176,200, 87, 39, 90, 56, + 56,128, 73,252, 50, 1, 12, 65, 22,235, 20,192, 92, 64,189, 45,112,196, 14, 23, 38, 2,146, 36, 46,162,148,126,137, 5,144,192, + 2, 68, 64, 26,237,241,136, 39, 2, 3,210, 68, 59, 81,104,105,105, 98,130, 23, 28, 55,212,224,128,139, 44, 29,160,229, 46, 25, +210, 92, 98,127, 36,208, 80, 3, 64, 9,178,212,180, 8,178, 8, 6, 41, 73,202,152, 49,163, 22,104,185,105,202,124,106, 65, 22, +243, 70,144, 69,201,179, 26,100, 73,154, 58, 64,203, 77,147, 38, 21,148,100, 25, 1, 75, 45, 32,146, 52,117,128, 86, 8,154,228, +167, 4, 89, 88,220, 9, 79, 32,139, 99, 23,203,174, 3,180,180, 45, 37, 39, 37, 89,139, 23, 47, 22, 12,203,150, 45,115,131, 44, +142,121, 12,148,110,225,240,114, 74,182, 11,132,163,153, 57, 73, 29, 14,152,114, 64, 15,139,200, 68,152, 35, 42,116,239,222,189, + 7,199,168, 18, 37, 74,248, 17, 48,185,230, 53,247, 93,190,231, 93,190,103, 28,237,127, 85, 58,133, 60,226, 18,196,185,233,168, +211,170,191,161,154, 75, 67,125, 91,190,211,210,118, 23,154,133,227, 31,121,231,111,130, 7, 14, 22, 92,229, 74, 73, 22, 65,133, +148,100,113,213, 71, 73,150, 28,144,216,177,205,128, 22,206, 83,235, 2,251,158,199,158, 64,214,250,245,235, 21,208,199, 21, 52, + 14,224,125,204, 52, 38,181,163,172, 72,185,194, 93,180,104,145,178,226,214, 94, 28, 48, 71,142, 28, 41,124,125,125, 21,218,160, +103, 8,140,242,229,203,215,187, 97,195,134, 91, 27, 55,110,124,129, 3, 21, 87,224,228, 67,239,222,189,197,177, 99,199,148, 85, + 40, 39, 36,222, 81,121,202,192,132, 67,124, 47, 20, 44, 88,112, 3, 38,161,222, 30,242,250, 46, 6,180, 91, 84,177, 98,133,248, + 28, 3,229, 98, 87,220,118, 63,252,240,195,101,174,234,145,255, 91,120, 62,200,180, 53,190,168, 73, 61, 73,214, 29, 53,200, 66, +190, 3, 80,134,155,152,192,110, 97,226,185, 74,201, 86,212,168, 81,239, 34, 78, 10,189,111,224,121,108, 28, 22, 92, 18,239,158, + 65,106, 69, 70, 18,100,237, 83,211, 4,189, 0,208,218, 7,192,121, 7,124,162,221,218, 51,166, 97, 90,125,154, 43, 98,208, 38, +107,195,186, 1, 93,211,102, 72,127, 41,123,246,108,247,227,196,137,251, 44,109,186, 12,183, 51,231, 46,118,112,207,254,195, 51, + 8,178, 46, 92,185, 61,105,214,138,157,147,190, 25,244,251,164,134, 61,127,155,212,113,200,239,147,226,165,204, 59,216, 10, 47, +156, 56,225,227, 0,192,198, 37, 74,105, 40,173,102, 31,151,160,131,139, 30, 41,217,145,210,162, 75,151, 46, 41,146, 99, 74, 65, + 60,157,165, 73, 0,195,254,195,254, 76,192,161, 39,125,210, 74,138,184, 88,242, 4, 12,100, 62, 37, 45,173,212,169,107,215,174, + 74,191,148, 32,139,139, 34,130, 19, 0,173,107, 70, 28, 34, 40, 98, 62, 41,157,151,146, 44, 53,200,194, 96, 33, 40,213,230,226, +136,128,136, 96,144, 52,205,128,150, 28, 59,176,160, 82,198, 28,179, 59,105,162,236,148,182,235, 94, 50,159, 28,143, 8,178, 56, + 4, 72, 73,150, 17,125, 23, 77,173, 68, 75, 77, 95, 49,124,255,228,147, 79,158,114,252,230, 88, 6,218, 15,241,108, 47, 67,141, + 26, 53, 30, 17,104, 46, 88,176, 64, 96,124, 11,118, 61,183,106, 32, 31,190, 70,233,164,126, 43, 57,160,135, 69, 36, 35,180, 64, + 72, 15,104,189,152, 26, 67, 3, 48,237,115,198, 65,112, 75,157,212, 32, 78,190,211, 3, 94,174,119,138, 84, 75,143,166,124,166, +166,237,174, 72, 61, 20, 73,209, 63, 7, 11, 43, 32,139,157,209, 64,149, 16,162,177, 96,176, 88,203,213,161,188, 56,104, 81,146, + 69, 32,196, 65,142,226,123,230,101,206,156, 57, 74,231,246,243,243, 19, 76, 99,210,226, 20,160,197, 21, 46, 3, 7, 76,174,204, +168,158,224,128,220,183,111, 95,209,169, 83, 39,241,253,247,223,139, 94,189,122, 9,168,254, 60, 2, 45,128,135, 29, 28,160, 32, + 42,191, 65,128,245,219,111,191, 9,128, 14,209,161, 67, 7, 69,106,199,129,124,218,180,105,162, 75,151, 46,202,115, 78, 76, 45, + 91,182,188, 70, 62, 21, 41, 82,100,171,135,188,150, 99,124,242,180, 81,163, 70,207, 16,143,149, 92, 18, 54, 17,215, 56,144, 99, +165,250, 8, 19,201, 95,120, 38,237,168,162,123, 42, 55,129, 22, 43,213, 85,177,161, 36, 89,152, 56, 3, 0,234, 2, 80, 55, 1, +152,144, 2, 46, 95,190, 76, 9, 26, 37, 11, 4,186, 70, 64, 43, 1, 38,165,110,140, 7, 21,194, 37,196, 59,167, 6, 89,152, 8, + 3, 48,201, 42, 52, 33,213, 59, 6, 30, 31, 98, 92,166, 65,188, 4, 70,249,141, 31, 63, 78, 37, 72, 39,111, 67, 13,253, 28,170, + 71, 69, 74,200,201,112,246,156, 57,207,177,179,224,209,164, 41,211,150,206,251,123,215,164,214, 3,230, 77,170,222,110,226,164, + 10,173,199, 76,234, 53,118, 25,128, 86,110, 75,160,243,173, 28,145,188, 88,104,244,177, 75, 4, 37,108,203, 82,138, 69,137, 19, +165, 88,148, 22, 73, 41, 86,142, 28, 57, 4, 22, 34, 2, 27, 34,148, 69, 11, 15,136, 54,202, 6,129, 1,129, 19, 23, 64, 80, 57, + 81, 58, 45, 72, 19,139, 49, 74,173,148, 69, 11,199, 2, 9, 98, 56,209, 27,168,186,220,159, 32,208, 34, 77, 9, 0, 37, 32,146, +128,141, 11, 31,142, 39, 18, 16,177,175,241,130,234,208, 35,208,226,119,181, 11, 71, 41,201, 34,208, 34,200, 98,254, 56, 94, 73, +154,102, 64,139,192, 85,171, 34,213,147,100,145, 38,227,114,172, 49, 3, 90,204, 39,105, 50,175,236,119,122,234, 66,153, 79, 21, + 77, 79, 64,107, 27,121,197, 75,170, 11, 93, 6,240, 10,207, 1, 14,143, 83,106,198, 49,112,242,228,201,130,230, 25,104, 31,122, + 7,127,123,177, 53, 58,164,222,102, 14,152, 72,180,202, 27, 73,172,212,160, 71, 53, 47, 26, 74,157, 92, 64, 73, 97, 53, 65,145, + 6, 84, 41, 0, 76, 15,104,201,239,224,157,162, 42, 52,250,175, 91,135,122, 40,146, 64,139,131,154,122,149,171,183,234,147,131, + 28,117,251,158, 86,184,252,112,156, 56,113,110,203,129, 74, 15,100,113, 69, 69,144, 53, 97,194, 4, 69, 2,197,255, 76, 99,210, +240, 66, 0, 45, 9,184,120, 7, 0, 18,223,124,243, 13, 37, 99,110,160, 69,240, 6,122,134, 19, 68,158, 60,121,230, 97, 69,255, +156, 18, 53,168, 77,175,208, 22,139,246, 30, 52,194,229,157,229,229,160, 68, 94, 16, 12, 98, 21,125,117,232,208,161, 4,113,207, + 49,248,206,245,144,215, 65, 20,193, 19,100,208, 38,134,241, 96,227,180, 28,246,104,207, 33,205,122,158, 41, 83, 38,110, 0,200, +134, 16, 23,131,221,232,202,149, 43, 7, 64,250,244,157, 17, 61, 79, 64, 11,188, 13,192,132, 19, 0, 0, 27,128, 65, 57, 0, 82, + 5,254,190,194, 70, 97, 2,180,146, 66,146, 57,219,213,120, 8,200,168, 46, 84, 84,145,144, 96, 16,172, 5, 96,130, 84,104, 66, + 74,177, 15,121, 63,201,184, 76,131, 56, 73, 13,242,154, 12,117,120,199,200,126,142,252, 76,144, 48,225,163,161,211,252,103,244, +157,180,114,210,144, 25,255, 76, 26, 48,117,229,164,178,117, 59, 76,136,251,126,182,178,111,243,160,243,178,202, 14,245,239, 37, + 74,168, 40,201, 82,247,113,173, 74,142,237,159, 64,153,125,129, 19,185, 25,208, 98, 31,151, 42, 62,181,244, 73,130, 24,130, 44, + 74,120, 9, 14,248,125,151,170,235,130, 81,185, 9,180, 8, 8,217, 55, 9,178,216,175,185, 0, 98, 27, 34,173,158, 61,123, 42, +160, 72, 13,136,172, 0, 45,142,115, 82, 58,239, 83,231,128, 96, 56,127,254,188, 66,147, 64, 75, 13, 94,228, 34, 17,160,136,253, + 73,247,162,217, 1,105, 50,159,102,146, 44,249,158,116, 49,126, 24, 74,180, 36, 77,169, 46,100,191,147,192,205, 72,162, 69,154, +200,167, 33, 63, 65, 99, 27,235,147,233, 41,165,167, 61,157, 4, 90, 63,254,248, 99,235,126,253,250,221, 27, 63,126,188,178, 64, + 37,175, 91,180,104, 65,233,125, 80,133, 10, 21,246,228,204,153,115,209,203,106,159,206,119,222, 30, 14,152, 72,180, 74, 16,220, +168, 1,142, 4, 58,118,239, 46, 58, 33, 0,149, 75,189, 88, 65,114, 91, 15,104,201,239,235,229, 65,243, 44,116,165,169, 80,100, +111,249,150,162,127, 14, 88, 82,149,224, 9,100,113, 21,105,166, 74,112, 1,139,251, 4, 26,164,203, 65,140,171, 90,174,206,248, + 13, 53,200, 26, 60,120,176, 64, 39, 87, 12, 48, 1, 70,238,155, 52, 51, 67,160,197,129, 65, 11,180, 72, 19,244, 60,217, 84,197, +202,146, 37,203, 48, 72,167,214, 96, 37,239, 7, 99,247, 43, 92,121, 83, 2,195, 21, 37, 3, 85,148, 28,148, 8, 44, 49, 0,206, +135, 68,103, 13, 38,157, 97,160, 27,203, 40,175,176, 83,217,205,213, 35,249,136, 56, 51, 17, 10, 32,127,193,156, 56, 48,168,209, +142,170, 45, 66, 66,216,176, 65, 32,183,248, 14, 7,122,236, 74,164, 65,186, 46, 77, 35,160, 5,192, 27, 0,169, 91, 0, 38,201, + 0,168, 25, 2,254,249,231,159, 0,228,151,224,136,187,164, 76,129, 22,164, 15,243, 17, 47, 24,244,105,244,118,128,234, 71, 76, + 52, 1,224,129,155, 38,236,110, 2, 86,174, 92,185, 23, 18,195, 19,140,203, 52, 70, 64, 11,229,153,132,239,191, 16, 45,168, 46, +182, 3,242,149, 3,253,176, 97,195,130,227, 39, 76,254, 95,162, 52,121, 39, 37, 73,151,143, 42,195,159, 95,128,172,222, 70,219, +201,223,158,145,231, 37,148,148, 64,139, 11, 37,182, 77, 41,113,210, 74,177, 8,178, 74,150, 44, 41,176, 97, 67, 96, 17, 32,160, +238, 22,176, 41,242, 40,209,226,152, 64,233, 19, 38,123, 37,164, 79,159, 94,217,232, 34, 65, 12, 65, 22,165,196,140,199,126,229, +146,234, 24, 2, 3, 74,222, 24,151, 0,144, 99, 7, 1, 27,105, 81, 90,205, 49, 8,253, 72,201, 23,129,129, 92,208,153, 1, 45, + 2, 24,246, 65, 2, 55, 53, 77,130, 45,230,143, 64,203, 29, 84,237,215, 12,104,145,166, 26,168,170,237,188,180, 82, 39, 73, 86, +103, 39,163,187,246,101, 62,165,186,144,124, 84, 27,211, 27,209, 52, 1, 90,138,234, 16,146,202, 39, 28,207, 48, 86,136,234,213, +171, 63,198,184,116, 6,147,206,125,109,159, 85,255, 71, 26,186,183,113, 46,135, 3, 94,229,128, 30, 22,209, 2, 31,206, 99,106, +155, 43, 51,224,165,141,207,255, 12,174,116, 90,201,149, 91,147,164, 7,180, 52,105, 37, 13,229,110, 10,180,244, 56, 69,160,197, +149,171,167,157, 56,178,163, 19,132,112, 5,231,105,133,203,111,128,230,102,166,225,228,170, 6, 89,180, 3,155, 61,123,182,224, +234,137, 32,139, 3, 38, 85, 19,216,229, 39,152,198,155, 64, 11, 70,231,102, 64, 75,251,185,138,121,243,230,189,200,129,156, 18, + 41,230, 13,118,102, 52, 8, 38,112,161, 75, 9, 75, 87,246,236,217,159,177, 54, 40,253, 66,130, 47, 17,198, 83, 13, 64,240,133, + 50,210, 88, 55, 29,140,142, 55,195,248,244, 17,165, 63,144,188,221, 6,200,252,217,136,184, 6,104,221,131,186, 51, 0,124, 13, +128,116, 44, 0, 59, 44, 41,113, 10,192,224, 25, 0,169, 91, 0, 84,157, 4, 92,220, 0, 96, 6,180, 18,192,232,245, 7,198,195, +132,118, 5, 52,207,161,110,221, 52,161,222, 84,104, 66,253, 26,128, 58, 59, 56,107,214, 44,250, 42,163,161,236, 15,200, 79, 2, +189,188, 66,218,117, 82,170, 39,228, 64,205, 73,149, 54,105,156,216,185, 51,139,118, 60,144,242, 81, 13,233, 92,175,128, 3, 80, + 17, 94,228, 68,173, 85,159, 73,137,137,220,193, 71, 48,198,126, 78,213, 58, 47, 79, 64,139,192,128,241, 41,201,210,130, 24, 72, + 70, 21, 16, 67,144,197, 49,134,237, 65,210, 4, 48,208,186, 77,112,115, 68, 2, 45,105,164, 78,155, 44,170,240,185,155,152,146, +172,159,126,250, 73, 89,196, 17,176,113,161, 38,193, 22, 0,158,161,234,144,249,100, 26,142, 71,220,228, 34, 37, 90,188,147, 39, + 4, 89, 82, 13,167, 0, 46,215,133,124, 26, 26,216,115,247, 53,105, 74,213,158, 21,144, 69,178,158,128,150,150,166, 21,144, 69, +154,158,248,233, 98,108, 78, 72,168,110,177,174,184, 81,136, 0,142,210, 61,142, 83,188,228,196,162,190,243, 57, 22,160,134,245, +244, 10,154,176,243,201,183,128, 3,104,118,234,157,128,252, 45,119, 21,106,119,254,233,237, 4, 84,199, 15,177,235, 80, 69, 55, + 44,187, 16,229,183,212, 59, 21, 67,239, 56, 52,170, 31,218, 88,176,243, 25,109,119, 86,131, 44,198, 51, 83, 37,240, 59, 0, 14, +125,176, 83,239, 41, 7, 33, 41,201,210,130, 44,174, 72,169, 14, 24, 52,104,144,128,189,212, 83,166, 49, 3, 90,148,142,168, 85, +134,242,183,158, 68,139,118, 6,160,103,117,151,160,242,105, 74,174, 56, 88,114, 48,134, 91, 6,101,231, 15,249, 99,163,109,191, + 75,187, 22, 94, 44, 31,210, 81,183,251, 47,249, 64,160,129,223, 19, 16,218,112,163, 0, 39, 30,240,232, 62, 36, 96, 83,201, 50, + 43, 64, 11,147,212,117, 76, 86, 55, 49, 49, 4, 34,127, 1,216,176, 16, 0,155,177,128,121,243,230, 5,192,238,237, 52,164, 79, +103, 0,100, 21, 53,159,137,234, 48, 14, 12, 99, 41, 58,229,138,225, 63,186,115,192,100, 11,146, 47,104,130, 78, 0,252,146, 5, +204,152, 49, 99, 55,232,159,196,206, 15, 58,172, 20, 76,131,162,197,209,203, 43, 54, 51, 40,126,121,228, 37,119,109,210,118,135, +246,114,148, 48,146, 7, 80, 89, 80,170,231, 92,175,128, 3,144, 98, 93, 36,232, 81,111,110, 81, 27,170,115, 33,165, 5, 89, 86, +128, 22, 1, 54, 65, 22,119, 41, 66,213,228,182,239, 82, 75,198, 24, 71,221, 62, 76,236,148, 20,137, 22, 37, 89, 4, 89,148,102, + 17,176,177, 79, 17, 20,113,195, 10,199, 33, 94,106,160,133,133, 0,237, 19,117, 47, 2, 24,210,148, 32, 75,130, 64, 2, 45, 62, + 39,184, 34,112,115,161, 14, 53,208, 50, 4,111, 18, 20,145,135,118, 84,135,158,192,139,154,166, 4, 61,191,254,250,171, 82,110, + 19,213,161,161, 58,146, 12,201,157, 59,247, 94,246, 73, 26,217,211,182, 21, 99,134, 64,255, 86,198, 96, 79, 23, 22,135, 55, 95, + 65, 83,117, 62,233,112,224,205,226, 0,129, 4, 59,177,118,231,145,167, 85,174,167, 21,174,139, 59, 9, 96,175,115,157,210, 12, +174, 74,169, 46, 84, 75,178, 56, 96,182,111,223,222, 45,254,103, 92,164, 75, 96,194,217,243, 28, 40,152, 47, 14, 22,106,192,165, + 6, 90, 61,122,244, 80,192, 27,165,100,160,231,201, 64, 52,212,231,184,155,146, 3, 49,125,113,241, 27,148,192, 80,226,103,163, +198, 19, 82,229,194,139, 3, 24,210,149,133, 65,176,178, 43,128,131, 26,254,183, 71, 88, 8,158, 4,163, 28,193, 0, 67, 43,241, +223,147,119,124, 46,173, 19, 35, 31,233, 25, 0, 82, 30, 51, 64,242,112, 5,106,216, 0,240, 53, 0,124, 13,128,132, 48, 0,131, +240, 41,128,157,199,209,162, 69,123,204,184, 0,137,233,144, 86,247, 72, 30, 60,143,138,240, 62, 84,129,115, 56,152, 3, 12,237, +199, 4,123, 23,118, 33,199, 33,201,218, 7, 21,224, 94,216,173, 29, 2,253,211,168,167, 85,140,195,184, 76,195,180,122,252,128, + 68,235,148,148,104,113,226,226, 42,159, 59, 87,105,223, 70,201,224,168, 81,163, 20,176, 5,137, 22,221, 69, 56,215, 43,224, 0, +129, 22,165,204,122, 46, 13, 36,200, 98, 31,227,130, 70,125,153, 73,180, 88,239, 82, 82, 68, 91, 71,130, 24, 74,107,165,157,151, + 90, 58, 38,233,122, 2, 90, 84,113,114, 33, 66,128, 69, 90,236,211, 52,128,167,109, 22,219, 22, 55,190, 80, 18,206,160, 86, 29, + 90, 1, 90,146,166, 90,162, 69, 73,155, 7,213,161, 41,208,178, 42,201,146,101,183, 2,180,212,146, 44,246, 63,181, 49,189, 30, + 48,242,196, 79, 54, 53,140, 11, 99, 57,230, 18,180,145, 79,216,236,240, 4,227, 70,240, 23, 95,124,225,194,150,161,157, 32,243, + 5, 22,192,220,157,232, 92, 14, 7, 28, 14,132,135, 3,210,143,148,122,123,183, 17,200,146, 3,176,206,192,171,231, 32,174,114, +214,172, 89,131, 40, 25,226,192, 78, 63, 93,156,108, 57, 72,246,233,211, 71,241,207, 67,155, 11,172,224,232,176,180,178, 78, 25, +180, 52,191,128,231,247, 7,244,107, 69, 21, 7,237, 34,184,219,144,128,139, 64,171, 93,187,118,202, 74,119,200,144, 33,226,243, +207, 63,167,113, 61,233,126,161,161,235,209,145, 29,129, 22, 69,234, 84,245, 81, 18, 67, 91, 6,110, 22, 48,225,175,154,102,106, +108,149, 86, 6, 46,230, 9,233, 74, 22, 47, 94, 92, 17,243,208,158, 4,255,107,194,206,235, 22,255, 99,135, 15,183, 81,119, 48, +160,173,117, 46, 74,191, 87,238,221,135,152,212,206, 3, 20,157, 7,152, 58,139, 60,158,134,196,232,228,196,137, 19,233,130, 65, +234,164,233, 71, 75,235,239, 74, 75, 51, 22, 86,181, 89, 32, 81, 59,205,116, 95,127,253,245, 62,148,251, 63,128, 76,210, 61, 54, +115,230,204,109,200,251, 54,190, 99, 28,198, 5, 77,173, 29,153,155, 38,108,180, 38, 35, 31, 79, 41,105, 32, 15, 9, 82,233,173, +159,155, 29, 56, 73,114, 71, 83,155, 54,109,158, 33,222,104, 27,252, 12, 79,211, 86,167,117, 28, 24,130, 27, 80,249, 95,144,234, +124,181,223, 40,181,155, 4, 45,200, 98, 91,245,212,223, 41,129,225, 66,141, 11,148, 66,133, 10,209,239, 13,109, 14, 69,165, 74, +149, 4,251, 2, 65,150, 30, 77, 44, 64,180, 18, 24,119, 29, 73,163,125, 9,216,244, 84,143,122, 96, 3, 0,226,134, 81,127,151, + 18, 45,181, 58, 83,109, 51,166, 71,143,207,144, 79, 45,208,114,231,147,227,133,220,236, 99, 83,162,165,181, 79,211,165, 73, 53, + 41, 36, 81, 10,184,100,191,242, 36,209,242,196, 79, 23, 79,148, 35,120,176, 96,162,116, 90, 57,130, 7,167,115,136,143, 63,254, +216,168,232,106, 0, 38,217,234,244, 35,111,141, 72, 47,232,188,205,252,244, 46, 39, 95,119,106, 4, 90,236,208,242,200, 13, 14, +154, 92,161,114, 69,201, 65,132, 3,165,219,118,193,213, 37, 45, 2, 45, 22,189, 10, 38,214,235, 88,137, 62, 33,208,162,100,139, +187, 1,251,247,239, 79,215, 7, 79, 93,146,172, 42, 86,192,134, 43, 78, 50,220,199, 2, 0, 60, 35,224, 34, 32, 36,144,163,237, + 6, 12,173, 21,112,131,242,208,165,194, 88, 4,198,213, 94,102, 64,235, 50,119, 16,101,203,150, 77,192, 80, 94,217,161, 67, 39, +143, 54,128, 65,114, 76, 48,138,254, 1,106, 54,130,158,124,248,175, 0,173,122,245,234,241,127,238,138, 21, 43, 42,255,155, 52, +105,194,255, 70,142, 1, 67,229, 19, 73,220,146, 45, 72,174, 4, 3, 86,169,238,128,157,139, 4, 55,138,228,139,113,173,148, 29, +241,226, 79,157, 58, 53,171,148,108, 33, 77, 40, 91, 13,190, 99, 28,198, 53,161,153, 12,117,125,135,254,205, 40,213,160, 27,140, +113,227,198, 41,192,151,171,104, 14,234,240,194, 79, 53,132,167,131,175,223,246,193, 39, 66, 7, 94,244, 91, 5,104,233, 57,231, +212,147,100,201, 25,216, 10,208, 98,157,211,247,150,220,177, 40, 85,144,122, 32,203, 5, 96, 12,129, 22, 64,145,162, 58, 84, 75, +197,212,246, 93, 70,200, 0,146, 34, 67,160, 37, 65, 17,105,170,129,155, 91, 93,104, 64,212, 12,104,145,111,210, 45,132, 4, 68, +102, 52,145, 79,143, 64, 75,210, 84,247, 71, 51,154, 22,128,150,182,251, 74, 3,121,229, 12, 33,245,183,212,172,112, 61,119,128, +214,219, 13,138, 34, 98, 92,122,221,161,145,119,243,199, 3,162,229, 1,178,234,195, 84,105,175,196, 64,195,119, 6, 14,182, 50, + 0,204,216, 57, 84, 58, 62,196,207, 63, 65, 69,185, 17,190, 89,238, 50,240, 55,159,161, 36,122,147,183,149, 78,157, 9,145,230, +127,244,209, 71,193, 4, 67,180,227,128,219, 4, 74,136,184,147,142,239,140, 46,143, 13, 6, 59,108, 86,211, 23, 23, 37,112,180, + 99,105,222,188, 57,119, 80,173,182, 1,180, 40,162,159,134, 85, 61,193,222, 52,166,131, 99,192,105,240, 2,255, 28, 64,232, 55, +254,231,251, 98,197,138,241,191, 39, 23, 17,186,249,164,148, 74, 45,217,210, 2, 35,190,211,145,100,121,228, 39,165, 84, 8,239, +215,173, 91,183, 28,118,160,117, 7,176,154,203,192,223,124,198,119,140, 99,192, 3,109, 62,203, 3,108,221,130, 20,235, 41, 61, +133,211,219, 52,253,242,124,251,237,183, 4,213, 4, 89, 70,231, 69,170,201, 71, 68,167,118,104,130,195, 84, 99, 83,122, 69,160, +161, 94, 76,153,129, 24, 51,160, 69,122, 4, 86,218,197,153,218, 38, 75,139, 99, 60, 29, 67, 35,129,150, 92,228, 81, 61,104, 6, + 52, 72, 31,234, 51,143,210, 39, 2, 33, 73,147, 0,208, 10, 77,240,204,240, 88, 31, 9,222,200, 63, 46, 70,173,210,132,228,205, + 16,104,113,204,229, 2,151, 52, 89,110,171, 52, 61,241,211,211,248, 5,187, 58,158, 10, 97,120, 57, 64,203,205, 61,103, 12,241, + 46,244,112,168,133,129, 3,175,170, 17, 22, 70, 94,151,185, 2,127,155, 93,102,249,140,137,157,135,191, 97,176, 59,142, 65,244, + 56, 84,159, 4, 71,102, 71, 3,233,209,212, 2,147,120,154,140,105,255,107,243,109,152, 79,140,136, 60,146,135,128, 74, 47,120, +146, 22,121,162, 73,155,173, 56, 8, 9, 16,146,186, 2,127,243,153, 39,215, 11,122, 52,147,226, 56,151, 95, 97,179,117,154, 6, +242,220,141, 72,215, 15, 40, 96, 18,179,202,113,189, 55,171, 35,139,100, 66, 68,115,104,178, 2,146, 36,217,166, 93, 76,233, 45, +164,212,139, 42,254,246,180,176,130,196,119, 39,105,202,133,153,209,226,204, 14, 77,124,111,139,167,133,158,150,150,252,143,242, +237,211, 52, 14,119,189,227,221,206,176,208,244, 84,118, 73, 83,242, 80,187, 32, 53,202, 39,242, 65,149,188,238,226, 34,172, 52, +109, 46,126,221,223, 6,144,220,134,180,119,209, 71, 31,162,191,114,129, 24, 66,186, 5, 41,180,218,143,152,211,143,194, 50,250, + 24,167,121,155,249,233, 93, 78,190, 37,212,222,230, 6,227,148,221,187,141,220,225,167,195, 79,111,113,192,105, 75,222,226,228, + 11, 58, 14, 63, 29,126,122,151, 3, 14, 53, 91, 28,112, 58,160, 45,118,153, 70,118,248,105,202, 34, 91, 17, 28,126,218, 98,151, +105,100,135,159,166, 44,178, 21,193,225,167, 45,118,153, 70,118,248,105,202, 34, 91, 17, 34,130,159,182, 50, 16,153, 34,147, 89, +122,193, 78, 25,140,104,120,122,110, 70,223,161,169, 95, 47, 97,173, 47,135,159, 14, 63,173,182, 1,167,111, 26,115,192, 42, 15, +213,241, 28,126, 58,252,212,227,192,219,220,150, 36, 63,194, 58,159,153,245,169,183,234,125, 68, 32, 94,135,166,119,155,144,195, + 79,135,159,222,226,128,211,150,188,197,201, 23,116, 28,126, 58,252,244, 22, 7, 34, 75, 91,242, 86,121,223, 42, 58,145,165,114, +157,124,122,183, 89, 58,252,116,248,233, 45, 14, 56,109,201, 91,156,116,192,155,211,150, 94,255,182,228,221, 28,190, 37,212,156, +134,237,221,138,118,248,233,240,211, 91, 28,112,218,146,183, 56,233, 0, 24,167, 45, 57,109,201,187, 28,112,168,217,226,128,211, + 1,109,177,203, 52,178,195, 79, 83, 22,217,138,224,240,211, 22,187, 76, 35, 27,241, 51, 27,156,113, 30,132,195, 95,250,137,106, +102, 74, 37,100, 4,187,117,212, 8,142,139,175,195, 31,223,223, 32,147,205,224, 91,118,105, 90,201,178, 67,211, 10,151,172,199, +113,248,105,157, 87, 86, 98, 70, 22,126, 90, 41,139, 19, 71,195,129,200, 82,185, 78, 62,189,219,116, 29,126, 58,252,148, 28,200, + 6, 31,116,215,228, 25,133,112, 30,170,117,244,105,198, 41, 91,109, 9,135,183, 95,160, 67, 79,156,249, 41,224,191,138,190,158, +244,192,150, 25,205,108,112, 30, 74, 96,200, 51, 81, 27,153,101,208,245,222,140,166, 36,211, 12,142,139,111,224,108,210,191, 60, + 0, 65, 25,215, 42, 77,139, 89, 84,162, 57, 52,237,112,203, 60,174,195, 79,207, 60,202,131,215,121,205,217,232,196, 8, 15, 7, +156, 70, 24, 30,238,133, 78,235,240,211,225,167,183, 56,240, 50,218,146, 27,100,241,136, 27, 28, 76, 46,112, 34, 2, 1,134,157, +203, 86, 62,225, 20,119,255,186,117,235,148,195,203,255,253,247, 95,145, 33, 67, 6, 2, 59, 45,216,242, 68, 51, 4, 48,164,211, + 85,139,153,181,148,207,162, 69,139, 94,164, 87,119,230, 17,158,238,141,128,160, 3,180, 28, 64,104,177,217, 89,142,102,169,125, + 90,166,246, 34,162, 17, 77, 58,243,254, 34, 74,148, 40,219,243,228,201,163,156,203,137,223, 91,240,172, 46,194, 59, 54,191,241, +102, 69,199,193,164,235, 24,222,172, 82, 57,165,113, 56,224,112,224, 21,113, 0,227,107,110, 8,178,238, 43,231, 28,142, 29, 59, +150,231,131, 62, 65, 94,254, 65, 88,162, 19,122,226,153,167,163,183,212,197, 96, 60,198,215,163,243, 15,191,195,239,241,124, 77, + 28,178,206, 51, 74, 31,232,128, 45, 61,182,184, 65, 22,243,204,115, 57,225, 21,221, 46, 48,244,200,110, 28, 99,245, 31, 15, 86, + 39, 16, 36,240,132, 55,120, 51,176,245,138,170,207,249,172,195, 1,219, 28, 72,143, 20,131,177,216,185,193, 67,201,113, 22,174, + 88,186,116,169, 88,184,112,161, 24, 49, 98,132, 40, 95,190,188,128, 36,151,230, 3,221, 16, 18, 26, 81,127, 99,177, 8, 79,127, + 71, 40,203, 96,155,181, 78, 2,135, 3, 14, 7, 28, 14,132,230,192,102,158, 33, 72,192, 66, 80,193, 51,255,140,174,192,192, 64, +193,195,229,161,234,251, 15,100,204, 14, 23, 79, 84,176, 96,193,195, 60,228, 94,125,241,252, 68, 30,186,204,179, 26,175, 95,191, + 46, 46, 92,184,160,124,247,252,249,243,202,225,206,160,171, 61,134, 71,155,227, 16, 32,107,229,202,149, 2,199,222, 68, 4, 8, +202, 6, 41,217, 21,130, 44,230,143,103,127,226,252, 80, 61,169,155,211,166, 28, 14, 68, 38, 14,116,255,252,243,207,159,127,243, +205, 55, 98,210,164, 73,196, 19, 98,193,130, 5, 98,230,204,153, 98,198,140, 25, 98,246,236,217, 98,214,172, 89, 98,204,152, 49, +162,118,237,218, 2,103, 41, 63, 68,225,198, 35,100, 85, 23,242,141,198, 34, 44, 92,100,170, 81, 39,175, 14, 7, 28, 14,188,246, + 28,216,199, 67,165, 9,162, 8, 40,172, 4,130, 15, 23,216, 50,146,108,197, 39,200,162,148,140,170, 72, 43, 52, 9,180, 8,188, +192,173,205, 30, 56,150, 30, 42,142,235, 82,250,246,215, 95,127, 81,250,246, 24,241,141,164,111, 75,240,110, 42, 66, 58, 3,154, +124, 62, 2,129,241,244,194, 63, 80, 27, 62,102,121, 41,117,219,191,127, 63,165,110,215, 17, 55,195,107, 95,171, 78, 6, 29, 14, +232,115,224,200,161, 67,135,196,127,255,253,167,168,236, 87,172, 88, 17, 2,104, 17,100,253,246,219,111, 98,218,180,105, 74,152, + 50,101,138,104,211,166,141,200,152, 49, 99, 48,200,245,146, 36,223,104, 44,242, 70, 23,206,233, 22, 14, 7, 28, 14,188, 10, 14, +100,195,225,235, 15, 8, 36, 8,118, 60,169, 14,161, 62, 59, 41, 37, 60,148,108, 33,179, 84, 11,234, 93, 61, 41,201,146,246, 94, + 76,167, 3,100,254,129, 93,214,147,197,139, 23, 43,223,165,234, 48,123,246,236,247, 17, 47,183, 7, 38, 12,163,212, 75, 74,223, + 30, 63,126,108, 40,125,147, 47, 40,173, 3, 88,210, 5,111,144,132,173,225,123,179,139,223,145, 82,183,227,199,143,179,220,211, + 94, 69, 69, 57,223,116, 56,224, 5, 14, 28,217,179,103,143,232,214,173,155,152, 63,127,190,210,239,182,110,221, 42,150, 45, 91, + 38,126,255,253,119, 69,154, 37, 65,150,250, 78,149, 34,190,125,228,109, 1, 90,189,223, 88,189,168, 23, 90,144, 67,194,225,128, +195,129, 48,113, 32, 27,141,209,119,237,218, 37, 78,159, 62,173,216, 36,197,137, 19,103,191, 14,165, 68, 4, 77, 84, 47, 18,120, +184,192,147,222, 7,151, 16,188, 48,142, 11,100,133, 82, 51,114, 55, 31,193,216,163, 71,143,196,134, 13, 27,140,140,225,181,180, +167, 93,186,116, 73, 92,185,114,197,146,148, 76,170,252, 8,168,244, 50, 73, 0, 38,237,176, 60, 73,221, 78,157, 58, 37,206,157, + 59,167, 0, 66, 23,208, 26, 22, 38, 46, 59,137, 28, 14,188,122, 14,252,183,109,219, 54, 69,138, 53,120,240, 96,209,181,107, 87, + 49,111,222, 60,183,132, 75, 11,180, 90,183,110, 45, 10, 21, 42, 36, 58,119,238,172, 5, 90,111, 54, 22,113,108,180, 94,125, 75, +117,114,224,112,224, 13,228, 64,182, 84,169, 82, 93,161, 45,210,225,195,135,169, 26, 60,107, 80, 70, 55,136,178, 2,180,140,226, +208,222,137,146, 41,170, 47, 60,184,119,208,102, 33, 67,142, 28, 57,174, 19,240, 92,188,120, 81, 88, 84, 29, 82, 53,152,206,160, + 44,124, 78,213,226, 18,131,240, 15,164,125,143,105, 79,118,239,222, 61,181,234,144,198,196,206,229,112, 32, 50,114,224, 83,244, +243, 91, 3, 7, 14, 84, 92,171, 80, 77,200,223, 93,186,116, 17,126,126,126, 10,224,162,148, 89, 2,172, 82,165, 74,137, 6, 13, + 26,136, 86,194,135, 64,139,182,153,238,203,193, 34,145,177,250,157, 60, 59, 28,112, 56,240,170, 57,144,141,110, 29,224, 67,139, +198,229,122,126,169, 18,213,169, 83,231, 34, 13,218,195, 43,209, 2,253,102, 0, 88,231, 92,146, 51, 35,135,165,122,252,200,150, + 37, 75,150,171, 4,131,148, 50, 69,164, 49, 60, 84,153,215, 8,178,104,188, 79,201,151, 99, 12,255,170,155,167,243,125, 47,113, +224, 61,208,233, 7,187,171,135, 67,135, 14, 85, 22, 44,191,254,250,171, 24, 48, 96,128, 34,185,130,255, 56, 37,212,173, 91, 87, +116,234,212, 73, 84,173, 90, 85, 96,135,226,109,164,249,204, 75,223,119,200, 56, 28,112, 56,224,112,192,225,128,139, 3,233,112, +119, 27,139, 19,100, 81,213,199,157,130,102, 54, 90,151, 47, 95, 22, 12, 46,215, 8,106, 27, 45, 79,198,233, 86, 25,159, 45,125, +250,244, 87,119,238,220,169,168, 58,233,222,193, 64,213,105,149, 94,168,120,177, 99,199,254,155,170, 77,130, 44, 74,249, 28,247, + 14, 97,102,165,147,240,245,229, 64,114,100,109, 76,174, 92,185,158,142, 28, 57, 82, 44, 89,178, 68,177,209,252,244,211, 79, 21, + 27,174,250,245,235,211,190,241, 17,226,252,140,144,224,245, 45, 70,228,201,217,203,116,146, 22, 30,174, 56,249, 12, 15,247, 66, +167,117,248,233,240,211, 19, 7,254,162,177,172,188, 40,201, 34,200, 50,216,117,168,110, 75,241,115,230,204,121,136, 82,167,179, +103,207,134,112, 25,193, 29, 79,248,224, 58,139,108,247,232,176,148,146, 55,170, 63, 92,170,206,115, 94,160,233, 38, 1, 32,119, +133,170, 77,130, 44,199, 97,169, 71,206, 58, 99,136,197,134,103, 49,218,171,224, 39, 85,225,179, 96,139,245,124,244,232,209,202, + 46, 67, 72,111,159,227, 25, 23, 69, 31, 88,204,183, 19,205, 2, 7, 94, 69,229, 90,200, 86,168, 40, 78, 62,195,194, 53,227, 52, + 14, 63, 29,126,122,226,192, 58,170, 20,212,134,226, 30,252,104,105,219, 82, 34, 24,216, 31,248,243,207, 63, 67,164, 31, 55,110, + 28,129,150, 85,231,162,102,237, 51, 27,140,234,255,134,205, 9,253, 91, 53,179, 88,149,102, 52, 37,153, 70,180, 83,179,168,218, +180, 74,211, 98, 22,149,104, 14, 77, 59,220, 50,143,235,240,211,156, 71,220,241, 59, 15, 97, 46, 66, 78,243,232, 78, 12,187, 28, +112, 26,161, 93,142,121,142,239,240,211,225,167,183, 56,240, 42,219, 82, 58, 20, 66,107, 44,110,228, 25, 94, 47,159,122,158,225, + 61, 25,167,107,121,246, 42,203,110,167,254,156,124,218,225,150,121, 92,135,159,230, 60,178, 19, 35, 34,248,105,231,251, 78, 92, + 23, 7, 34,162, 34, 28,154,222,109, 94, 14, 63, 29,126,122,139, 3, 78, 91,242, 22, 39, 95,208,113,248,233,240,211, 91, 28,136, + 44,109,201, 91,229,125,171,232, 68,150,202,117,242,233,221,102,233,240,211,225,167,183, 56,224,180, 37,111,113,210, 1,111, 78, + 91,122,253,219,146,119,115,248,150, 80,115, 26,182,119, 43,218,225,167,195, 79,111,113,192,105, 75,222,226,164, 3, 96,156,182, +228,180, 37,239,114,224, 13,164,198, 78,162, 23,236, 20,213,136,134,167,231,102,244, 29,154,250,245, 18,214,250,114,248,233,240, +211,106, 27,112,250,166, 49, 7,172,242, 80, 29,207,225,167,195, 79, 61, 14,188,205,109, 73,242, 35,172,243,153, 89,159,122,171, +222, 59, 43, 29,239, 86,183,195, 79,135,159,222,226,128,211,150,188,197, 73, 71,162,165,215,150,162,128, 45, 12, 81, 93, 65,254, +183,202,245, 87,209, 62,153, 71,187,215,203, 42,123, 68,240,243,117,164,105,151,255, 78,124,151,164, 76,143, 17,172,224,104,174, +142,104,151, 81,175,162, 3,218,205, 35,227, 71,246,124,106, 7, 73, 59, 60,136,236,101,183, 83, 86,109, 92,167,236,225,225, 94, +232,180, 14, 63, 35, 31, 63,229,216, 17, 29, 89,143,129, 16, 19,129,191, 9,186,172,130,153,151, 89,239,204,215, 59,174, 60,218, +157,151,180,249,140,136,178,191, 77, 52,189,219,218, 35, 1,181,252,113,227,198, 93,146, 56,113,226,255,112,120,234,222,152, 49, + 99,206, 68,158, 75,216,204,183, 94,103,153, 10,111,200,207,223,121,231,157,167, 56,150,227, 41,232, 62,141, 21, 43,214, 83,248, +149,121,154, 32, 65,130, 59, 22,232,235,118,192,100,121, 62,237,146, 50,239,103,231,146,231,249,228, 7, 53, 13,163,231,154,239, +188,204, 78,109,161,136,134, 81, 94, 86, 62,163,160,110,106,195,223, 79,203,104,209,162,181,136, 30, 61,186, 18, 80, 87, 45,224, +217,186, 5,234,169,153, 73, 33, 66,228, 51, 81,162, 68,219, 51,103,206,124, 44, 91,182,108,199,112,166,220, 49, 56,157, 60,150, + 60,121,242,237,146, 6,234,127, 83,210,164, 73,143,224,123, 71,224, 44,242, 72,218,180,105,143,160,205,109,114,234,200,205,129, +151, 85,239,225,105,155, 33, 22, 23,191,255,254,123,180,187, 91,226,101,123,176, 57, 90,253, 71, 91,163,182,225,157,255,249,220, + 74, 80,101, 36,210,149, 61,188, 76,124, 21,101,135,223,176,145,232,119,247,209, 87,175, 96,204, 15, 68,255, 11, 68,159, 84, 2, + 28,171, 42, 1,125, 86, 9,120,183,211, 67,223,148,160, 0, 36, 99,140,131,131,202,251,160,113,133,206, 89,153, 22, 99,127, 32, +250,185, 18, 82,166, 76,233, 14,136,227,137,102,136,207,129,214, 36,208, 13,114,209,189,140,255,238,128,103,151, 84, 97,131,201, + 24,162,228, 21,249, 28,163, 42,251, 21,111,149,157, 52,193, 75,210,187,162,199, 71,242,130,193,164,236, 33,248, 25, 81,249,116, +213,187, 87,203, 30, 70,154, 94,236, 62,145,128, 84,129, 2, 5,142, 60,121,242,196,237,189,249,193,131, 7,202,169,220,200,250, + 32, 27,217,215, 14,146, 51, 75,151, 46,173, 16,229, 1,147, 60,192,245,210,165, 75,202,233,245,103,206,156, 17,239,189,247,222, + 83, 11,180,117, 7,222, 44, 37, 26, 95,191,119,255, 65, 80,166,226,141,120,158,154,251, 50,122,238,161, 3,230,199,187,133, 8, +123,109,134, 85,136, 95,208,104,144, 68,163,219,204, 14,108, 39, 48,141,167,129, 34, 34,104,226,123, 4, 89,117, 42, 84,168,208, + 18,213,212, 10, 30,184, 91, 93,187,118,173,213,149, 43, 87, 90,161,174,148,255, 56,159,170,133, 29,160,133,179,175,142, 76,157, + 58, 85, 57, 58,101,204,152, 49,130, 71,144,228,201,147,231,136,164, 65,144, 5,250,226,217,179,103,202, 59,122,253,198,161,187, +238,247,174,120,145,110,194, 45, 86, 32,117,255,226,133,210, 76,144,161, 88,190, 84,253, 45,180,111,189, 40, 33,202,142,193,123, + 23,156,105, 94, 52, 11, 0,173, 23,101, 96, 26,147, 73,135,175,233,201,185, 3,192,245, 56, 76, 62,255, 34,156,198,239,135, 12, + 0,195,167,177,240,226,179,113,140,227,138,171,205,171, 59,159, 4, 85,247, 54, 68,237, 21,184,202,103,219,189, 83, 63,223, 86, +238,248,111, 21,108, 25,245,163, 48,242,207, 48,159, 6,244,120, 70,226, 62, 4,246, 63, 58, 91,180,114,121,106,159,244,130,253, + 13,194, 24,244,173,229,184,207, 64,104,135,144,213, 69, 56, 29,192, 2,199,135, 53,248,159, 78,175,236,104, 67, 59, 75, 22, 73, + 23, 88,178,240,139, 80,188, 80,106, 45, 48,177,146, 71,198, 9,149,207,168, 81,163,142,170, 93,187,246, 93,142,203, 60,126,136, + 99, 61,143, 68,122,252,248,177,114, 84, 16,255,171, 3,193,129,135,182, 68,233,208,187,160, 57,161,113,227,198,119, 72,147,199, + 25,113, 46, 97,255,230, 41, 0,193,193,193,238,121, 69,254, 32,232,242, 64,211,253, 10,237,120,106,147, 38, 77,148, 57,132, 71, +187,108,222,188, 89, 28, 61,122, 84,249,134, 54,160,127, 92, 48,161, 25, 13,249, 28, 91,175, 94, 61, 37,159, 91,183,110, 21, 65, + 65, 65, 94, 41, 59,142,153, 81,104,238,221,187,215,205, 79,242,128, 60, 85,135,167, 79,159,242,240,115, 75,252,196, 25,129, 10, +205,128,128, 0, 37,159,172, 27,214, 83,120,234,232, 53,164,105,181, 29,191, 25,241, 0,180, 78,223,191,127, 95,172, 90,181, 74, +252,243,207, 63, 98,207,158, 61,130,147,225, 71, 31,125, 68,176,101, 85,178,165,238,212, 83, 37,200, 98, 99,105, 28,199, 71, 12, + 77,224,163, 52, 58, 94,199,143, 31, 23, 9, 19, 38,124, 98,129,123, 33, 6, 10, 72, 89,154, 98,240, 63,145, 42, 77,150,251, 87, +174,222, 9,226, 29, 82,151,211, 50,164, 74,235,122,142, 59,158,157, 0, 72,104,170,243, 13, 55, 77, 28, 44,123, 80,230, 41,212, +104,224,225, 1,121,133, 65,224,152,222, 32,201,103, 88,205,157, 99,135,224, 32,195,193,134, 29,140, 29, 79,118, 20,118, 28,210, +184,119,239,158, 2, 54, 0,110, 4,211,120, 26, 40, 60,209, 36, 45,126, 71, 94,252,142, 5,154,138, 36, 75,130, 44, 2,173, 65, +131, 6,181,154, 49, 99, 70, 43, 28,178,219,106,227,198,141,173,118,237,218,213, 42,126,252,248,182,128, 22,120,122,132,160,154, + 39,183,223,186,117, 75,180,106,213, 74,228,205,155,215, 13,164, 48,200, 30,225, 32,140, 83,219,197,134, 13, 27,148, 67,125,113, + 78, 86,164, 7, 90, 4, 88,224,161,159, 12, 85,202,103,255,181, 88,193,180,227, 95,132,212,227, 75, 20, 78,205,251, 56, 6, 76, +156, 99, 11,231, 77,213,215,160,253,135,104,243,148, 46,168, 23, 65,102,237,148,109,141,105, 76, 38,157,234,185,115,231,126, 52, + 97,194,132, 96, 30, 15,131,186, 86, 38, 30, 78,188, 12,219,183,111, 23,219,182,109, 19, 91,182,108, 17,139, 22, 45, 10, 46, 87, +174,220, 99,208,171,110, 68,147, 18, 44,130,171,223,127,246, 81,178,199, 59,255,243,249,107, 46,209,202, 6, 62, 60, 96,127,100, + 91,133, 20,246, 62,202,104,229,112,106, 61,160,149, 8,105,167,247,232,209,227, 25, 23,147,236,147,172,139, 27, 55,110, 40,188, +196,145, 36,193, 4, 95, 8, 51,249,189,127,255,253,151, 99, 43, 29,175,202,203, 77,179,100,145,244,129,234,122,254,184,114,158, +155, 37, 10,167, 13,100, 40, 94, 72, 27,210, 4, 22,205,255,129, 17, 16,211,230,115,200,231,159,127,126, 93,210,110,222,188,185, +114,198, 35,243,247,223,127,255, 41, 32,230,212,169, 83,202, 17, 73, 28,255,201, 19, 15, 64,139,210, 23,170, 8, 71, 54,108,216, +208, 77,179,111,223,190, 10, 45, 46,180, 88, 78,246,117,237,101, 5,104, 17,100,213,170, 86,205,157, 52,103,186,116,162, 43,206, +205,235,251, 85,115, 49,236,219,182, 74, 24,218,174,173, 24,211,161,189,114,106,128, 9,208, 34, 32, 28,129,115, 54,175, 73,130, + 92, 4, 18,188,177,236,251,247,239, 15, 81,118,142, 95, 86,203, 14,154,238,178,119,236,216, 81, 57, 90, 10,227,166, 50,199,177, + 29, 72, 62,146, 23,108, 15, 30,202,238,230, 39,128,176,155,102,187,118,237,196,210,165, 75,149, 62,186,111,223, 62,113,228,200, +145, 48,213,209,107, 74,211, 2, 4,120,179,162, 80, 58, 67, 41,205, 94, 0,153,179, 95,126,249,165, 82,177, 60, 58,131, 3,131, +197,162,202, 78, 29,133,234, 66,117,231,170, 19, 59, 36,208, 98, 3, 68, 71, 10, 11,208, 58,177,191,125,251,160,134, 85,191, 12, + 90,226,191, 45, 40, 83,154,108, 65, 23,198,143, 15, 58,254,221,119, 65, 71,218,182, 13,106, 88,177,209,139,231,169, 50, 7, 29, +255,241,251, 32,172,202, 79,120, 2, 90,144,164,156, 36,208, 97, 71,179, 19,120, 36, 8,128,226,126, 35,160,133,242,159, 35,240, +225, 10,135,160,213, 44,184, 58,181, 71,160,229,137, 38, 0,146, 2,228,120,166,156,252,150, 5,154, 81,169, 46, 36,192,146, 1, +167,176,183,194,196,216, 10, 96,187, 53, 38,222, 54,200,127, 27, 72,210, 90,161,156,158,108, 45, 66, 12,230,152,172,142, 80, 26, +122,251,246,109, 5,100,241, 82, 3,173, 52,105,210, 28,225,228,195,213, 41,207,151, 35, 32, 84, 75,188, 92, 60,141,124, 18,173, +130, 33,129,214,161,125,171,253, 14,237, 89,229,119, 0, 97,255,238,191,252,246, 7,252,229,183, 47, 96,165,223,158,157,203,253, + 86, 46, 30,233, 87, 36,111,170, 9, 86,129, 22,121,200, 73,144,225,216,177, 99,202, 32,206, 1, 87, 30,107,115,242,228, 73,101, +240,101,224, 69,181,141, 39,160, 5,128, 29,192,180,189,123,247, 22,101,202,148, 17,101,203,150, 21, 85,170, 84, 17, 24,140, 69, +203,150, 45, 5,192,130, 24, 54,108,152,152, 57,115,166, 2, 8, 40, 61, 0,224, 14, 48,162, 73,117, 33, 37, 89,234, 62,127,227, + 72,255,199,124,254, 26, 3,173,108,104,151,215, 8,136,120, 30, 97, 96, 96,160, 32, 31,113,228, 15,143,226, 49, 3, 91,161,218, + 39,206, 53,220, 72,137, 61,129,197,245,235,215, 21, 9, 62, 37,247, 28,235, 72,251,238,221,187,226,175,191,254, 98,221, 60, 32, +159,200,127,124,103,137,222, 24, 82, 2, 82, 44, 53, 47,207, 30,223, 36,206, 28,219, 36, 78, 31,219, 40, 78, 29,217, 32, 78, 30, + 89, 47, 78, 28, 90, 39,142, 31, 90, 43,182,173,157, 38,138,229, 79,173,173,239, 80,224,141, 15,208,247, 20, 73,150,188,122,245, +234, 37, 86,175, 94, 45,118,239,222, 29, 10,100,221,188,121, 83, 1,139, 30, 36, 48, 4, 47, 49,160,222, 10, 65, 19,224, 93,233, +215,228, 1, 23,177, 92,108,174, 95,191, 94, 84, 41, 95, 66, 52,172, 95, 71,121,110, 6,180,168, 46,252,226,139, 47, 94,172,202, + 93, 87,195, 10, 21,196,250,177, 35,197,145,249,211,197,141,213, 11,149,112,253,239, 69,226,159,145, 67,205,128, 22,199,174,119, +180,101, 31, 63,126,188, 88,177, 98,133, 2,138, 56,246,147, 7, 92,100,112,113,193,179, 47,195, 82,246, 1, 3, 6, 40,105, 57, + 14,179,238, 89,239, 28,135, 9,178,228, 98,201, 67,217, 21,126,106,243,233,235,235, 43,176,240, 85, 22, 63, 60,227,147,109,244, +231,113,189, 67, 4,179, 58,178, 66, 83,130,107,171,245,174,165, 89,189,122,117, 81,180,104, 81,241,225,135, 31, 10, 44,204, 20, + 33, 77,197,138, 21, 69,165, 74,149, 4, 1,189, 1, 63, 13,161, 5,170,189, 8, 66, 13, 85,168,232,250, 45,239, 69,152, 88, 39, +158,124, 30, 93,245,174, 42,126,151, 52,160,103, 68,167,168,134,182,252,174,204,147,146,206,240,162, 36,193, 21,202,170, 34,101, +128,180,104, 10,109,180, 24,208,208,149, 21, 46, 43, 23,170,132,219,242,185,250,238,178,227,122, 95,231, 67,209, 96,227,243,148, +200,158,146, 44,130, 44, 2, 1, 54,190,165, 73,125,196,159, 8,156, 92, 81, 81,193,210,118, 11,224,206,146,237, 22, 85, 26,199, + 59,117, 10, 26, 19, 55,105, 80, 70,132,134,239,127, 16,180,183, 92,153,160, 13,209,125,130, 54,197,136, 18, 52, 41,113,178,160, +204,239, 37, 13,106,154, 58,117,208,185, 46,223, 4, 65, 61,121,198, 4, 36,186, 1, 38,226,237,181, 17,168,110,164,218, 81,247, + 66,195, 63,199, 1,151,237, 32, 74,148, 40, 2,252, 16,200,187,128,132,141, 0,141, 18, 7, 14, 54,228, 1, 7,118,185,122,242, +120,160,173,154, 38,233, 2, 68,114,181,169,240, 85, 2, 45,254,199,132,104,149,102, 84,218,100,161,131, 41,146, 44,130, 44, 74, +179,176,194,109,141, 65,238, 76,139, 22, 45,158, 55,106,212, 72,177,167, 67,253, 60, 66,254, 31,225,247, 35,208,191,238,137,167, +176,201, 58, 66, 73, 29, 37, 90,188,180, 18, 45, 76, 72, 71,216,169, 9, 24, 56,232,114, 32, 86, 3, 49,147,250,122,109, 95, 99, +178,155,176, 31, 64,202,111,106, 39,191,217,147,191,243,155, 57,177,131,223,140, 9,237,252,166,141,105,231,247,117,205,130,187, +106,229,120,255,202, 39, 57,146, 95,249, 36,219,139, 80,250,253,216, 23,203, 38,137,177, 14,225, 59, 79,133,162,116,138,124,228, + 0,203,186,238,215,175,159,104,208,160, 1, 85,239, 2,253,135, 19,161,128, 45,156, 50,152,113, 66, 51, 0, 90, 33, 62,129,246, +248, 45, 0,148, 34,205,234,208,161,131, 64,125, 43, 32,235,211, 79, 63, 21, 92,100,113, 2,230, 68,180, 96,193, 2,101,112, 71, + 8, 70, 27,248,214, 40,159,122, 18,173, 61,115, 99,222,252,165, 83,130, 29, 37, 11,167, 93,132,176, 16,146, 24, 37,148, 44,148, +246,143, 34,224,149, 26,128,189,130, 74, 13, 1,178, 36, 96, 37, 40,226,196, 11,233, 8, 77, 18,204,192, 86,136,108,163, 13,159, +167,244,130, 19, 54,219, 60,251, 53,164,234, 55, 96,175,248,156,255,201, 71, 2, 58, 78,238, 6, 64,203, 77,143, 82,171, 83, 0, + 83,107,150,245, 23,171,151,244, 19,127, 47,234, 35, 86,254,225, 43,150,255,254,147,240,159,247,163, 88,234,215, 83, 44,158,221, + 67, 44,252,237,123,177, 96, 70, 87, 81,212, 24,104,133,200, 35,237,104, 88,190,182,109,219, 42, 32,123,250,244,233, 10,176, 32, + 48, 34, 72,151, 18, 24, 57,217, 18, 40,233, 0, 3, 73, 83, 1, 6,180,157, 98, 90,130,140, 73,147, 38, 41, 96,146, 82,106,142, + 1, 82,202,142,177, 68,220,220, 48, 78,236,154,212, 74,124, 88,172,128, 39,154, 10,109,140, 17, 65,106,144,197,223,157,234,214, + 21,155, 39,141, 22,199, 23,205,112,191,186,241,207, 66,241,207,104, 67,160, 37,243,169, 72,138, 96,107,122,133,115, 26, 15, 60, + 30, 57,114,164, 34, 37, 98,251,102,221, 19, 20,179,110,102,207,158,173, 0,130,137, 19, 39, 42, 32,209,172,236,228, 39, 23,211, + 93,187,118, 21, 63,255,252,179,152, 53,107,150,216,177, 99,135,178, 16,162, 68,143, 32,139,244,168, 97, 72,157, 58,181, 50,254, + 91,161, 73,192,247,221,119,223, 9, 74, 7,167, 76,153,162,244,107,126,135,121,101, 29, 37,204,233, 19, 34,120,131, 38,219,174, +157,122,103,217,205,242,105, 70,211, 0,139, 40,245, 70, 80,196,155, 12,242,191,230,110, 20,143,207, 43,116,239,222,189, 7,211, +151, 40, 81,130,154, 6, 79,244,116,233,200,244, 47,178,163,155,222,120,232, 98,225,248, 86,222,241, 51, 3, 78,220,190, 78,201, +142,250, 34, 34,167,116,132,192,128, 43, 91,118, 30,181, 10,131, 43,106,164, 29,173,243,165, 40, 4, 78,108, 96, 84, 23, 50,112, +130, 32,125,127, 23,208,226,187, 33, 67,134,132, 80,119,113,194,229,115, 79,182, 91, 84, 17, 18,104,173,139,234, 19,180,239,163, + 50, 65,255, 85, 40, 19,180, 45, 97,204,160,109,113,163, 4,237,136, 31, 53, 40, 32, 81,212,160,227,181,202, 5,157, 64, 56,254, + 81,126, 2,173,211,175, 96, 16,247, 33, 40,162,152,152, 29,142,128,194, 44, 80,250, 3,144,116,222, 83, 94, 61,209,100, 39,231, +247, 56, 25,203,111, 89,160, 25,133, 70,239,136,167, 0, 44, 74,178, 8,178, 96,107,113,254,167,159,126,122,206,250, 98,157,115, +194,101,135,225,192, 65,123, 42,240,244,145,167,124, 82, 13,200,182, 37, 65, 22,239,106, 32,133,137, 71, 81, 45, 50,127,242,122, + 19,128, 22,193, 67,192,182,101,126,191,142,108,227, 55,121, 68,107,191,137,195, 90,250,141, 27,210,220,175, 85,213,252,187, 62, +122, 63,246,147, 7,107, 23, 9,134, 27, 63, 53, 14, 17,202, 38,137, 30, 88, 54, 81,244, 98, 70, 60,165,116,138,124, 34,239,209, + 79, 21,213, 62, 37, 76, 4, 90, 28,136, 41, 69, 97, 96,253,112, 5,205, 75, 71,221,163, 37, 31, 3,246, 92, 7, 48,241, 60,151, +105, 57, 41,176,127,179, 29, 81,250,194,137,135, 99, 0, 86,211,207, 17,247, 32, 39, 85,163, 60, 74, 27,173,221,115,222,185,113, +239,228,144,167,151,215,165,191, 19,184,163,206,169,147,123, 38,111, 63,180,127,245,186, 67,251, 86,173, 59,184,103,213,186,255, +118,175, 90,183,115,203,162,117, 69, 11,164, 94,252, 10,129,150, 27,100,113,193, 71, 96,192,114,115, 18,227,111,242,150, 0, 20, +124,183, 11,182, 26, 99,194,187,129,201,148, 38, 5,180,209, 74,232,226, 23, 15,214,253, 23,139,170,103,180, 93,164, 4, 73, 5, +180,252,245,120, 90,188, 96,154,192,163,255,173,209, 5, 85,243,167,117, 17,115,167,116, 18,115, 38,127, 39,102, 77,108, 47,102, +142,255, 86, 20,201,151,202, 72,162, 21,130, 60, 13,223,105,127, 69, 9, 9,219, 17,129, 7,199,102, 45,200, 34, 72,146,210, 40, + 15,147,184, 2, 96,104,248,206,184, 4, 2, 4,147,108,167,178, 45, 73,251, 44,218,232, 54,174,144, 75, 60, 88,214, 65, 28, 28, +223,192, 20,104,113,113,193, 58,200,159, 41,147,104, 14,245,225,247, 88, 88,140,106,223, 78,236,153, 57, 73,156,245,159,243,127, +160,181,230, 15, 43, 64,139, 60,136, 70, 67,117, 74,150,152, 23, 74,107, 71,140, 24, 33, 70,141, 26,165,244, 25, 2, 12,182,121, +140,123,162, 91,183,110,162,125,251,246,202, 2,208,172,236,164, 73,126,178,221, 80,146, 69,144,197,121,145, 96,136, 82,123,206, +103,108, 91, 92, 80,150, 47, 95, 94,249,134, 21,154,204, 39,213,154, 4,229, 4, 89, 4,239, 28,215, 57, 30,115, 44, 38,208,178, + 83, 71,178,236,146,102, 7,223, 9,162, 88, 93, 95,145,239,147, 94, 34,125,133,238, 33, 66,201, 6,131, 44,151, 93,230,147,210, + 44,128, 25, 1,115, 33,165,156, 48, 71, 81, 36, 89,148,146, 87,173, 90, 85, 89,116,235,241, 83, 7,139,184,219,171, 26, 80,241, +183, 25,208,146,113,112, 47,164, 6,106,170,231, 10,208,210,251,111, 49,190, 34,209, 82,209, 80,190, 99,120,105, 11, 71, 73, 22, + 27, 0, 43,145, 8,149, 43, 30,118, 26, 6,234,218, 33,197, 80, 86,184, 84,151,241, 61,159,177, 67, 17,132,225, 35, 90, 3,110, +229,187,220, 89,200,134,192, 70,198, 64, 73, 22, 65,150,188, 40,237,161, 20,102,254,252,249, 74, 99,218,180,105,147,162,127,230, + 32,135,149,135,161,145, 60,129,214, 31,181,106, 6,141,133,244,106,124,172, 40, 65, 19,226, 64,138, 5,144, 53, 57,126,148,160, + 41, 9,163, 4, 77, 75, 28, 53,104, 70,178,168, 65, 51,147, 71, 13, 90,152, 51,137, 93,160,101,102, 24,175, 53,128, 55,228, 49, + 58,211, 57,150,155,188,163,132, 9, 13, 93,145, 62, 97,194, 18,216, 65, 35, 0, 54, 68,246,236,217, 5,236, 67, 4,236,227, 20, + 16,106, 6,180, 36, 77, 86,180,107,101, 68, 35,114,133,103, 18,104, 97, 37,168, 72,201,172,210, 36,208,194, 32,163,216,100, 81, + 93, 72, 73, 22, 68,213, 10,200,226, 32,193, 65,233,235,175,191, 86, 6,102,170,146,217, 54, 80, 63, 30,129, 22,164, 1,255, 2, +108, 29, 84, 7, 62,147,204,194, 32,186,137, 96,140,224, 74, 6,148, 77,187,235,208, 99, 27,126, 29, 95, 22,130, 42,112,219,134, + 69,126, 35, 7, 53,245,235,215,163,182, 95,239,110,159,250,253,216,169,166,223, 39,121, 82,156, 90,245,203, 15,162,111,206,248, + 74, 8, 90, 61, 75, 92,174,157,210, 29,110, 14,250, 66,148, 77,242,238, 18,163, 50, 73,160,197, 9, 17,210, 66, 5,252,204,153, + 51, 71, 89,233,177, 63, 18, 96, 17, 20,113, 48,103,176, 8,180,248,185, 4, 48,200, 62,134, 85,120, 48, 7,114,218,203,177,158, +185,202, 7,240, 22, 99,199,142,165, 26, 49, 24,109,152,192, 33,129, 39,158,203, 93,135, 67, 32,193,186,184,163,249,209,237,139, + 42, 30, 92, 62,187,201,118,191,201, 29,215,205,154,212,126,221,111,227,219,175,155, 62,190,221,186,105,163,191, 94,247,235,232, +182,235,138,228,251,224,149, 1, 45,140, 33,171, 57,222, 17,100,177,188,224,193, 35, 9,124,248,155,207, 8,186, 40,145,135,212, + 88,109, 30, 16,166,102, 71,163,119, 78, 72,234,139, 96,214,165, 58,164, 65,124,168,171, 88,254, 52,129, 7,118,255, 37, 8,170, + 38, 13,111, 37, 70,255,252,165, 24, 49,224, 11, 49,180,111, 99, 49,216,183,190, 24,248, 99, 93,129, 54, 38,124,187,125, 42,126, +236,252,177,248,176, 72,218, 7, 5,243,164,184, 87, 32,247,251,247, 10,229, 73, 97, 40, 25,231,230, 28, 2, 3,182, 27,105,239, +195,197,153, 84,111, 18,112,168, 39,112,230,217, 4, 24, 68,101,251,228, 88, 39, 85, 79, 4, 49, 77, 62,173, 40, 90,212,174, 32, +190,172, 85, 70, 52,169, 94, 92, 52,172, 84, 64, 52,173,156, 87, 44,243,173, 41, 30,205,111,100, 10,180, 64,243, 50,213,121,189, + 32,105,221, 1,233,210, 78,132,189,144,236,156,156, 63, 91, 81, 23, 82,146,197,160,168, 14, 71,153, 74,180,200,223, 40,178,236, + 4,151, 61,123,246, 84, 0, 22,109,170,216, 22,164, 81, 60,165,186,148,194, 81,237,101,165,236,164, 73, 91, 92, 26,172,115, 94, +164,100,176, 86,173, 90,162,112,225,194,138,105,132,218, 38,153,115, 40,193,146, 25, 63, 73,147,249,225,120, 75,141, 18,231, 97, +166, 35,128,149,160,144, 64, 75, 2, 97,171,249,212,210, 76,247, 81, 55,145,254,163,239,221, 52,101,189,143,156,249, 98, 33,224, +141,124,154,181, 37, 43, 64, 75, 13,142,228,111,213, 61,132, 36,202, 5,132,148,254,132,223,229,165, 68,138,119, 9,146, 12,232, +133,162,163, 1,118,146,166, 27,104,153, 14, 6,218,194, 81, 29, 72,198,178,177,112,160, 1,129,189,152,128, 31, 82,226, 64,155, + 16,252,191,203,103, 8,199,138, 23, 47,174, 52, 74, 54,168, 78,157, 58,241, 93,103,189, 15, 82,221,164,150,144, 81, 93,200,160, +190,106,214,172, 41,180,129,104, 29, 34, 73,143, 64, 11, 52,130,144,215, 32, 52,192, 32, 52,238, 32,128,190, 32, 52,196, 32, 12, + 24, 65,104,140, 65,232,240, 65,152,124,130,144,127, 91, 64,203,204, 48, 94,199, 0,222,144,215, 18, 20,113,240,177, 18,216,217, + 33,177,242, 40,209,242, 68,147, 54, 81, 4,175,156,116,229,247,172,208,164, 11, 7,238, 50,196,170, 73,177,201,162,186, 80,130, + 44, 14, 32, 4,193, 20, 97,115,181,198,193,153,147, 61, 36,156, 30,129,150,105, 3,124, 67, 35, 16,104,109, 88, 51,223,111,224, +143,245,253,186,182,171,230,247,224,222,149, 80,161, 89,201,188, 87,236, 2, 45, 74,167,216,111, 8, 12, 24, 8,166, 62,249,228, + 19, 2, 94, 5,192, 83, 69, 53,121,242,100, 69, 66, 40,251,156, 5,137,150,172,133,100,160,113,102,218,180,105,138,132,131, 43, + 94,130, 56,170,128,168, 82, 68, 63, 62,131,136,201,204,170, 76, 74,167,138, 22, 76,189,120,207,142,229, 10,168, 26,216,171,254, +186,190, 61,234,172, 3,224, 92,215,179,211,199,235,186,127, 87, 99, 93,215,118, 85,214,117,108, 83,113, 93,169, 34,105,255,197, +102,128, 53, 5,243,166, 92, 83, 56,127,170, 21,102,244,189,249, 30,160, 63,144, 32,135, 70,224, 24,239, 46,129,182, 50,179,184, +128,207,106, 62,227, 59,142,113,232,147,103, 45,124, 59, 30,226,124,143,192,197,196, 18, 85,152,138,223,202, 14, 67, 74, 37,164, +122, 82,222, 41,221,194,251, 1,122,244,169, 10,220,179,253, 79, 49,125,220, 55,162, 95,207,218,226,242,185,189, 74,184,164,132, + 61,226,210,217,255,135,139,103,119,139,139,103, 94,132,189,219,230,139,252,185,146, 27,142,159,156,196, 57,142, 17,196, 80,242, +162, 7,178,168,230, 82,239, 20,244, 48,225, 50,235, 81, 8,180, 8, 28,217,246, 8,226, 42,127, 88, 80, 60,221,241,171,120,186, +117,156,120,178,225, 23,241,228,159,222,226,201,138,206,226,209,226, 54,226,241,242, 78,226,241,146, 54,166, 64, 11,237,247, 18, + 23,144, 67,218,180, 17,103,177, 24, 63, 51,111,158,184,128, 5,192,149, 37,139,197,213, 63, 23,139,107, 43, 94, 4,254, 94, 53, +220, 18,208,242,145,101, 39,192,164,234,253,179,207, 62, 19, 53,106,212, 80, 64, 85,169, 82,165, 68,193,130, 5,149,197, 47, 23, +194, 80,135,154,129, 13,165,236,116,227,192,249, 80,238,132, 36,200,162, 10,149,252,165, 52,231,155,111,190, 81,198, 76, 2,187, +185,115,231, 42,194, 9, 51,126, 50,159, 4, 40, 4, 88, 7, 15, 30, 84,180, 34, 20,130, 72,144,197,119, 4, 90,118,234, 72,143, +166,148,100, 73,112,109,183,222,213, 52,177,235, 82, 87,146, 69, 73, 23,231,120,170,170,245,192,155, 21,160, 69,192,131, 80, 72, + 3,124, 72,206,109,191,133,186, 80,255,151, 54, 87, 37,100, 28,249, 94, 19,207, 80,194,165, 77,231,250,175,216,140,169,104,121, + 30, 26,180,122, 81, 9,180,216, 0, 49,176, 60,226,127, 72, 68, 20, 67, 68, 54,118, 12, 20,244,119,149, 13,131,238, 60,105,224, +183,112,225, 66,218,135,108,197,115, 58,126, 11,117, 65,226,242,148,226, 99, 45,192, 82,255,167,161, 61,197,195,156,192,217,233, +169,194, 96, 35,194,247, 13, 7, 10,228,225, 52,129, 22,242, 26,132, 70, 24,132,116, 65, 44, 56, 65, 22, 86,101,202,111,130, 44, +136,109,131, 64,203, 22,208, 50, 51,140,215, 49,128, 55,100, 52, 6,115, 69,117, 40,237,176,224,242, 64,145, 62, 65,146, 35,242, +229,203,167,172,120,164,168,149, 29,221,101, 40,168,221,158, 28,130,190,164, 73, 9, 25, 37, 99,180,203, 41, 86,172,152, 34, 74, +150, 64,139,180, 97, 88,174, 12, 30, 86,104,210, 79, 22,129, 22,234,160, 53, 13,223,105,147,197,213, 45, 37, 89, 82,210, 72,195, +104,174,172, 56, 96,112,146,112,129,113, 11,243,207,219, 21, 5, 18,133, 9,171,255,154, 13, 41,214,199,126,109,154,126,168,128, +172,125,155,199,133, 8, 13, 11,166, 11, 51,208, 34,144, 98,224,228, 8,213,188, 98,164,206,254,194,192,186,230,128, 47, 37, 39, + 58,198,177,158, 42, 35, 53,250,220, 5, 26, 49, 3, 48, 41,118, 59,156, 24,208,135,217, 30, 83, 91,169, 69, 55,208,130, 74,112, +199,230,165,235,198,255,210, 98, 93,183,246,213,214, 61,184,119,213, 99, 56,127, 98,253,186,252, 57,147,235, 74,117,172,124, 55, +140,113, 26,130, 63,167, 49,150,236, 70,250, 76, 4, 70, 42,160,181,132,207, 48,182,249, 83,170,130,223,141, 44,124, 99, 0,199, + 73,237,197,133, 10,104, 80,226,159, 14,129,160,139,180,101, 32, 40, 35, 56, 35, 72, 11,117, 81, 21,184, 99,211, 18, 49,238,151, +175, 68,183,111,171, 9,240, 81, 28,219,247,187,105, 56,180,115,134,200,151, 35,169,225,248, 73, 96,192, 5, 24, 65, 36,219,145, +156,192,169,230, 98, 59,210, 78,182,122,147,163, 54,179, 4,245, 28,235, 88, 94, 46,246,168,142,171, 88, 40,163,168, 85, 60,163, + 56, 52,185,169,120,188, 0, 1, 0, 43,248,230,255,121,100, 2, 54,124, 36,208,226,120, 94, 15,134,213, 12, 93,234,213, 19, 87, + 48, 46, 49, 44,134,157, 34,159,241,190,106,168, 53,160,165, 46, 59, 85,240,148, 8,113, 92, 86,187,160,224,247,120,201,187, 89, + 62,169,226,100,159,163,180,137,243, 23,141,193, 37,136, 37, 48,154, 7,128, 72,213, 25,165,196, 92, 32, 17,112,155,209,148,249, +164,214,136,227,173, 94, 29, 17,104,169,175,176,208,148, 64, 43,172,245,110, 37,159, 90,215, 30,218,124, 90,177,209,114,129, 27, +183,196, 73,130, 29,214,145,171,158,244,108,175, 66, 72,168,180, 18, 45, 15,233, 66,216,132,105,109,180,108, 1, 45,157,126, 61, +153, 6,145,108, 32,106,187, 25, 54, 12, 54,160,117,235,214,113,101,123,142, 3, 49,117,249, 68,218, 80, 81, 81,202,197, 1, 68, +247, 2, 24, 80, 36, 90,158,128,150,158, 68,139,141, 30, 21,104, 10,180, 48, 80, 40, 82, 44,228, 39, 8, 18, 48, 69,178,133,134, +173,252, 70,227, 84, 64, 22, 58,126, 16, 86,253, 92,145, 26,218,150,104, 50,111,102, 24,239,209, 0, 94, 77, 75,130, 34,174, 22, +172, 4,174, 4, 49,184, 92,244, 52,168,123,162, 73,160, 69,222,177,254,228,247,172,208, 36,208,162,207, 44,128,214, 86,224,103, +235,166, 77,155, 62,101,122,170,145,104,111, 32,141,175,217, 54,216,233, 41, 45, 67,253,120,148,104,153, 57, 36,197,251,237,160, +113, 12,147,221, 49, 0,198, 99,104, 75,199, 48,209,187, 29,154, 90,152,216, 94,203, 40,249,243,188, 63, 97,229,178, 25,126,157, +218, 84,244,107,244,105, 65,175, 3, 45, 2,106,246, 41, 26,195, 19, 72,115, 98,147,190,117,164,175, 30,105, 67,105, 19,104,145, +159,153,177, 91,244, 6,193, 53, 37, 45, 72,127,139,207,172, 50, 90, 2, 45,170, 4, 55,175, 93,176,238,151,190,141,215,125,253, +101, 89, 5,100,237,223, 50,222, 99,120, 5, 64, 75, 91, 44, 45,208,178, 90,108, 25,111, 13, 39, 61,105, 43, 39,239, 28, 83, 93, +190,178,180,244,232,141,220,227, 85, 56,111,202,192, 77,107, 23,136, 95,250, 52, 18,109,155,149, 81,128, 22, 64,187,165, 96, 6, +180, 36, 88, 87, 79,224, 4, 95, 4, 89,106, 23, 49,114, 34, 55,155,196, 9,180, 8,176,164, 27, 7,210,104,142, 13, 21,126, 63, +126, 38, 30,251,127, 43, 30,205,254, 20, 32,235,148,216,117,228,138,104,208,235, 79, 37, 88,160,169, 72,180,228,100,106,118, 55, +112,239, 16,130,199, 4, 6,178,236,220, 72,132,141, 64,110, 64, 37,203,170,254,142, 21,144, 73,160,197, 69, 14, 53, 9, 4,171, +172,243,202,149, 43, 43,255,169,122,166,164,139,207, 9,154, 40, 49,230, 98,221,172,236,234,124,202, 58, 90,183,249, 31,241,195, +144, 78,162,209,183,181, 68,217,218, 5, 20,137,150, 93,160,165,173,119, 9,180,100,189, 47,248, 59, 32,204, 52,225,235, 44,132, + 77, 22, 37, 89,148, 22,202, 57,222, 72,162,229,169, 19, 32, 51,220,245,167, 72,179, 24, 79,245, 95,187,251, 79,251, 95, 27,159, + 52, 10, 35, 20,115,209,147,146, 48, 51, 58,252,190, 58, 13,165,106, 33,242,100,214,143,181,239, 51,208,160,145,232,155, 98, 74, + 54,112,138, 44,201, 36, 78,184,156, 92, 33, 78, 13,230,123, 78,190,240,195,194, 6, 90,223,211, 71,160, 94, 82,108,180,216,129, +141,252, 84, 81,106, 34,237,178, 8,234,228, 36,129,188,120, 4, 90,136, 23, 4, 41, 76, 16,164,107,138, 20,235,171,175,190,122, + 4,117,135, 34,197,130,234,235,209, 31,127,252, 17,132,198, 19,132, 85, 86, 16,242, 74, 27,139,158, 54,192,150, 93,222,233,198, + 7,128, 80,118, 29, 74,137,131,217,157,141,221, 12,104,121,162,201,141, 5,228,181,244,205, 37, 87, 41,102, 52,233,140,148,142, + 73, 49, 80,209, 57,105,107,216,228, 60,101,135,148, 62,117,216, 22,176, 27,209, 13,178, 88, 79, 88,165,123, 4, 90,102, 14, 73, + 49,249, 28,145,245,205, 58,167, 97, 60, 93, 66,120,133,241,175,144, 72,254, 92,239, 79, 88,186,104,170, 95,203, 47, 74,249,125, + 92, 57,155,215,128, 22, 65, 19, 71, 64, 26,190,195,217,162,248,248,227,143,149,129,155, 82, 4,233, 20, 82,235, 24,210,108, 48, +215, 99, 19,164,216,138,143, 33, 78, 22, 0,191,116,113, 96,249,146, 64,171, 80,222,148,139,215,174,158,187,174,111,247,207,214, + 53,169, 83,232,109, 1, 90,202,206, 15, 2, 44, 26,186,115, 50, 45, 82,164,200, 51, 48,111, 53, 66, 70, 23, 19,185, 67,175, 9, +220,104,156,193, 4, 68, 13, 65, 51, 79,204,133,157, 85, 32,248, 40,250,124,255,153,104, 92,187,160,215,128, 22,129, 1,251, 55, + 39,112, 9, 14, 60,129, 44, 43, 96,131,237, 83, 74, 46,216, 14,191,194,238,215,185, 4, 89, 80, 17,222,152, 84, 9, 54, 89,141, +149, 9,156, 0, 43, 87,195, 25, 74, 48,107,159, 28,183, 56,246, 84, 45, 91, 75,244,248,122, 64,168,176, 98,209, 63,130,129,239, +190,172,243,181,145,123,135, 16, 44, 86,151,253,197,188,253,127,201,149, 26,104,169,159,155,229,147,106, 83, 74,180, 8,166, 36, + 31,105, 72,239,231,231,167,128, 44, 41,177,225, 78, 71,204, 83,202,174, 94, 51,154,218, 58,154, 48,115,164, 24, 48,166,151,232, + 59,178,135,168,210,184,164, 72, 87, 44,129,200, 94, 38,133, 45, 80,164, 87,239, 90, 35,248, 82, 13,127, 14, 55,205,240,182, 37, +203, 3, 78, 36,142,152, 1,121,159,140,176,215, 21,214,225,222, 22, 42,138,191, 97, 92,253,148, 58, 88, 2, 35,238,212,192,243, +233,102,229, 68, 71,185,131, 9,245, 41,165, 83, 4, 78,248,255, 20, 29,242, 41, 38,212, 96,110,171,213,147,102,241, 25, 47,198, + 53,162, 79,213, 33, 12,127, 21, 73, 22, 36, 47,138, 20,139,192,170, 79,159, 62,138, 20, 11, 13, 59, 8, 70,246, 65,232,240,180, + 62,101,156, 91, 16,221,210, 59,243,122,179, 60,107,222, 75,195,120,203, 6,240,234,244, 4, 69, 28,116, 8,160,172, 4, 78,154, +102,160, 40, 34,104, 66,146,212, 12, 82,192, 22, 12,168,175, 22,220,241,201,173,205,224,167, 24, 56,112,160, 2,178,248,159, 96, +155,224,200,165,142,244, 8,180, 48,144,120,116, 72,138,114, 42,187, 14,105,239, 71,245, 41, 13,177,233, 18,194,102,253,188,118, +209,243,231, 72, 54,241,223,213, 75,253,122,247,104,225,247, 67,215, 70,126,247,239, 92,242,138,234, 80, 2, 45,233,189, 91,110, + 48, 49,186, 91,153, 28,245,152,151, 63,127,126, 5,104,209,136, 55,172, 64, 11, 54, 87,139, 87,173,152,181,174, 59,212,134,159, + 86,205, 25,233,128,150,107,167,225, 18,240, 71, 29, 20, 91, 43, 15, 13, 78,145,136, 17,104, 81, 26,200,182,205,190, 66,187, 57, +172,236, 31,102,202,148,233, 40, 0,242, 67,170,122, 57, 38, 80,165,132,190,236,209,246,171, 96,238, 20,129,224,163,248,190,125, + 53, 81,171, 74,118,175, 3, 45, 53,200,162, 84, 84, 79,146, 37,103, 93, 51, 96, 32,219, 39,227,255,240, 67, 79, 49,239,199, 79, +197,227,133, 95,138,201, 95,229, 18, 65,227,138,136, 71,191,125,108, 27,104,225,155, 10,208,106,220,168,147,152, 60,225,223, 80, +225,223, 53, 7, 5, 3,223,253,208, 99,162, 45,160,197,178, 19,104,153, 5, 43,253, 72, 2, 45, 53,192,160,244,159,234, 66,130, + 47, 2,173, 46, 93,186, 40,139, 35, 74,180, 40,149, 54,227,167, 4, 69,178,142, 8,174,138,127,146, 83,148,172,149, 91,100, 43, +155, 66, 36,207,247,174, 24, 63,115,120,152, 64,145,186,222, 37,208,146,132,236, 74,180,212,249,164,107, 25,150, 89, 45,201,146, + 82, 44,117, 70,205,202,254,218, 13,234, 47, 49, 67,223,115, 7, 18,141, 67,169, 86,224,142, 54, 76,206,199,105,199,197, 35, 58, +144, 15,195, 99,104,244,242, 8, 9,202, 19,118,108,173, 93,150,166, 50,212, 64, 43,132, 99, 64,164, 63,141, 1, 45, 8,187, 67, + 20,213, 33,164,101,138,244,138,119, 74,186,176,194, 87, 0,150, 54,192,151,149, 90, 53,101,234, 12, 83, 26,198,219, 48,128, 15, + 65, 19, 62, 83,206,113,149, 71,255, 57, 28,116,121,247, 20, 24,151,118, 9, 26,158, 69, 56, 77,109, 29,209, 79, 22,119,176,113, + 99,132,180,201, 82,131, 44, 74, 80,208, 89,180, 64, 43, 68, 62,205, 28,146, 66, 5,122,132, 3, 59,237,243, 40,209,228,247,116, +220, 59,152,214, 81, 24,250, 64,132,210,204,147, 61, 73,139,170, 31,229,153, 25,120,233,180,223,237, 27,167,253, 86, 45, 27,237, +183, 96, 70,143, 16,225,179,220,169,220, 54, 90,220,109,200,221,135, 58,187, 14, 67,228,147,131, 19,251, 7,219, 15, 39,115,179, +182,100, 48, 65,152,150, 93, 13,180, 32,193,182, 34,209,114,211,148, 18, 45, 0,132, 37,155, 55, 44, 95,215,167,103,203,117,189, +186, 53, 94,119,255,238, 37,187,170, 67,211,124, 70, 64,189,247,164,119,112,170,159,244, 60,240, 83, 98, 65,131,118, 15,125,211, + 13,180,208,127, 30,114, 55, 53,109, 89,217,239,229,174, 43,130,100, 78,198,124, 78,191, 72,112, 24,187, 82,167, 28,238,178, 67, + 58,122,101,211,250, 63, 69,239,158, 45,196,143,221, 26, 9,128,118, 75,106, 67,170, 23, 53,170,195, 16,252, 36, 48,160,250,153, +121, 99,126,204, 64,150,149,182, 36,219, 39,227, 86, 44,154, 67, 60,158, 87, 95, 76,250, 50,187,200,153, 35,187,216,209, 37,173, +120, 48, 36,157,120,126,229,160,153,234, 80,219,230, 47,208, 76,197, 8,104, 45,247,223, 35, 24, 76,128,150, 97,217, 9,178,212, +146, 43, 27, 18,173, 16, 52,169, 54,101,221,178,141,112, 28,163, 20,171,115,231,206,138,173, 35,165,206,148,100, 81,128,192,121, +196, 3,112,245, 88, 71,171,215,175, 16, 69,107,102, 19,197,106,230, 16,159,182,172, 40,182,239,217, 28, 2,100, 89,169, 35,189, +122,215, 2, 45, 45, 81, 29, 80, 20, 17,109, 41, 12,221,249, 13, 76, 2,137,212, 94, 14, 14, 52,158, 36, 66, 87,175,124, 56, 40, + 97, 0, 82,123, 94, 55, 29, 36, 97, 51,245,132,131, 15, 85,147, 20, 95, 83,140, 45,105, 74,137, 22, 38, 98,143, 64,139, 32, 10, + 59, 30,131,170, 85,171, 22, 4, 49,124, 16, 86, 11, 65,216,237, 17, 4,177,108, 16,118,146, 40, 32, 12,103, 58, 5, 53,107,214, + 44, 8, 82,154, 19, 46,144,165,246, 87, 99,154, 79,105, 24,111,195, 0, 94,219, 8, 55,129,103,161,207,158, 8,213, 69, 94, 60, +128, 29, 28,165,126, 90,169, 91,132,211,212, 54, 89,128,231, 71, 92,117, 25,129, 44,230, 21,171,113,143, 64,203,204, 33, 41, 15, +145,102,253,151, 44, 89, 82,217,237,195, 21,254,155, 0,180,200,203,124, 57,147,117,131,157,210, 28,248,212,154,147, 47, 71,178, + 80,225,195,247, 99, 41, 64,203, 5,174,148,187, 25,208,130,196, 96, 35,140,104,159, 26, 52,157, 80,143, 25,151,105, 60,129,118, +189,161, 10, 27, 41, 20,137, 22,119,152,162, 95,135, 9,104, 21,200,245,126,215, 26,149,243,175,190,121,237,210,186, 91,215, 79, +175, 3,216, 92,247,251,204,158,186, 97,169,223, 79,235,106, 86,206,249, 79,209,124, 41,167,169,242, 99,218, 55,195, 48,204,154, +209,140, 15,126,253, 7,201,120,168,157,129, 4, 95,148, 68,233,216, 90,169,105,142,160, 61, 36,205, 42,144,183,223, 16,166,176, + 93, 83,250, 79,251, 86,110,205,231,157,155,127,240,156,199,240,204, 71, 72,226, 9,104,229,203,153,124, 82,141, 74,249, 30,221, +184,134,163, 96,174,159, 22,224,163,248,125, 70, 15,143, 97,137,223, 79,162,102,165,156,143,139,228, 75,185,215,136,159,156,112, +165, 73,135, 52, 94, 55,107, 87,102, 19,174, 26,104,209, 37, 72,245,226, 89,176, 99,181,189, 34,205,105, 93, 44,150, 8,234, 19, + 95, 60, 28,147, 79, 60, 15,220,111, 25,108,128,166, 2,180,190,108,218, 93,145, 88,105,195,224, 65, 51, 5,131,124,110,225, 8, + 30, 30,139,230, 46,187, 90,154,165, 46,191,246,185, 89,217, 9,180, 56, 15,114,211, 19,125, 72,113, 19, 9,213,134, 4,178,148, + 96, 81,210, 35,253,166,217, 1, 90,222,174, 35,189,122,247, 6,208,178,146, 79, 74,182,194, 98,163, 21,134,126, 30,121,147, 96, +229, 53,131, 13, 94,138, 28,185, 26,146,129,210, 8, 12, 64, 60,140, 85, 94,102, 3,154, 15, 84, 84, 79,216, 8, 41, 22, 38,112, +211, 91, 65, 66, 26,100, 8,180,120,164, 14,210, 7, 45, 91,182, 44, 8, 91,209,131,160,206, 12,194, 89,108, 65,216, 5,169,168, + 16,177,187,195, 29,104,183, 5, 85,152,199, 35,120, 60,212,140, 52,140,183,106, 0,175, 45,123, 92, 76, 86, 91,216, 81,173, 4, +116, 88,238,224,140, 99, 50, 57, 70, 4,205, 16,159,164, 51, 82,214,181, 52,124,151,234, 66,245,121,101,168, 31,143, 64,203,204, + 33, 41, 15,157,230, 38, 11,174, 0,229,245,166, 0, 45,179,158, 78, 79,240, 4, 90,240,155,117,134,113,121, 55, 3, 90,136, 22, + 27, 64, 96, 29,165,164, 86, 2,227, 50,141, 93,160,197,227,104,176, 10,127,142,250,161,243,203,210,102,101,193,251, 80, 18, 45, + 74,182, 0, 54, 7, 23,205,159,118,109,209,130,105,215, 2, 48, 24,133,127,105, 4, 95, 24, 32,139,105,236,140, 33, 22,242,165, +141, 98, 58, 46, 33, 65,124, 4,218,114, 46,209, 9, 60,143, 48,157, 7,126,166, 35, 16, 83,237, 48,100, 84,154, 30,116, 39, 45, + 24, 93,239,192,125, 17,194, 96,215,115,163, 34,132,200, 39, 36, 83, 43,138,228, 75, 29, 92, 36,127,154,231,121,115, 36,243, 24, +192,243,103,148,100,105, 64, 22,191, 19, 74, 2, 35, 15, 40,214, 59,131, 80, 15,116,153,129, 13, 53,208, 82,167,167,148,158,134, +225, 51, 62,143, 45,130,250, 37, 22, 65,125,227,139, 7,163,242, 40,193,140, 38,207, 45,228,188,163,117,137,225,233,191,217,161, +210, 4, 69,178,236,224,139, 87, 36, 90, 84,155, 82, 80,192,147, 63, 40, 33, 36,168,166, 11, 7,238, 46,164, 6,136,238, 30,184, +112, 85, 95,102,101, 87,231,211, 91,117,164, 71, 51,188, 64,203, 75,249, 12, 67,119,126, 51,147,164, 69,177,230, 96,167,216, 62, +128,174,125,104, 80,251,112, 2,250, 94, 72,137,246,226,185, 22,132,152, 14,104, 24,140,238,208,125,131,214,118, 11,141,239, 41, + 36, 37, 79, 9,178,224,203,132,198,162,242, 10, 65, 19,187, 25,191,130,250,240, 4, 61,190,171, 3,158,159,150, 1, 82,179,211, + 12, 4, 89, 0,118, 95,233, 84,139,105, 62,195, 80,149,111, 4, 77,212,205,117,250,201,162, 11, 7,238, 46,164,225, 59, 93,126, + 80, 93, 72, 73, 22, 65, 22,164,125,218, 35,120, 66,148,221,204, 33, 41,104,254,139, 58, 54,116,104,234,226,253, 27,193, 79,109, + 59, 42,155,244,221, 25, 18,100,201,119,252, 95, 54,113,244,145, 70,109, 62, 12,109, 81, 47,137, 41, 63,177,136,185,128, 62,195, +115, 77,181,128,223, 20, 24, 88, 57,207,208, 83,156, 87, 93,246, 48,240,216,148,159,175, 35, 77,244,235,157, 4, 7, 12, 86, 22, +128,140,131,113, 64,123, 96,117,136,178,243,189, 85, 90, 50,158, 25, 77,140,219,251, 48,145, 95,177, 19, 80,182, 93, 26,158,135, +200,103,100, 41,123, 68,228,243, 53,166, 25,134,110,226, 36,137,148,131,143,151,170,205, 41,187,151, 24,249, 38, 3, 45,139, 44, +122, 85,109,201,212,237,128,167,137,204, 98,217,204,162,189,170,178,155,229, 75,251,222,201,167, 93,142,121,142,239,240,243,237, +228,167,119, 75,253,150, 80,115, 58,139,119, 43,218,225,167,195, 79,111,113,192,105, 75,222,226,228, 11, 58, 14, 63, 29,126,122, +139, 3,111,115, 91,242, 22, 15, 95, 59, 58,172, 84,189, 96, 39,163, 70, 52, 60, 61, 55,163,239,208,212,175,151,176,214,151,195, + 79,135,159, 86,219,128,211, 55,141, 57, 96,149,135,234,120, 14, 63, 29,126,234,113,224,109,110, 75,146, 31, 97,157,207,204,250, +212, 91,245,254,109, 70,230, 78,217,189,219,212, 29,126, 58,252,244, 22, 7,156,182,228, 45, 78, 58,210, 60,167, 45,121,183, 45, + 57,212,194,192, 1,167, 17,134,129,105, 30,146, 56,252,116,248,233, 45, 14, 56,109,201, 91,156,116,192,134,211,150,156,182,228, + 93, 14, 56,212,108,113,192,233,128,182,216,101, 26,217,225,167, 41,139,108, 69,112,248,105,139, 93,166,145, 29,126,154,178,200, + 86, 4,135,159,182,216,101, 26,217,225,167, 41,139,108, 69,136, 8,126,218,202,128, 19,217, 89,229, 69, 68, 35,116,104,122,183, +103, 57,252,116,248,233, 45, 14, 56,109,201, 91,156,116,230,142,183,185, 45,121,183, 21,189, 37,212,222,230, 6,227,148,221,187, +141,220,225,167,195, 79,111,113,192,105, 75,222,226,164, 3,138,156,182,228,221,182,228, 80, 11, 3, 7,156, 70, 24, 6,166,121, + 72,226,240,211,225,167,183, 56,224,180, 37,111,113,210, 1, 27, 78, 91,114,218,146,119, 57,224, 80,115, 56,224,112,192,225,128, +195, 1,135, 3, 14, 7, 28, 14, 56, 28,112, 56, 96,153, 3, 60,236, 83, 6,203,137,156,136, 14, 7, 28, 14, 56, 28,112, 56,224, +112,192,225,128,195, 1, 47,113,224,141,198, 34, 44,156,151,248,228,144,113, 56,224,112,192,225,128,195, 1,135, 3, 14, 7, 28, + 14,216,230,192, 27,141, 69, 28,105,150,237,246,224, 36,112, 56,224,112,192,225,128,195, 1,135, 3, 14, 7,188,200,129, 55, 26, +139,188,209, 40,210,139,141,192, 33,229,112,192,225,128,195, 1,135, 3, 14, 7, 28, 14, 68, 12, 7,222,104, 44,242, 70,235, 69, + 35,166, 61, 56, 84, 29, 14, 56, 28,112, 56,224,112,192,225,128,195, 1, 47,114, 32,146, 99, 17,154, 96,169,205,176, 28,147, 44, + 47,182, 13,135,148,195, 1,135, 3, 14, 7, 28, 14, 56, 28,112, 56,240,118,114, 64, 2, 42,163,251,219,201, 21,167,212, 14, 7, + 28, 14, 56, 28,112, 56,224,112,192,225,128,195, 1, 47,114, 64, 43,205,122,105, 18, 45,199,145,157, 23,107, 17,164, 28,126, 58, +252,244, 22, 7,156,182,228, 45, 78,190,160,227,240,211,225,167,183, 56,240, 54,183, 37,111,241,240,173,162,243, 54, 55, 24,167, +236,222,109,234, 14, 63, 29,126,122,139, 3, 78, 91,242, 22, 39, 29,144,233,180, 37,239,182,165,200, 78, 77,218,105,189, 52,105, +150,179,202,243,126,147,113, 58,181,119,121,234,240,211,225,167,183, 56,224,180, 37,111,113,210, 1,111,111,115, 91,242,110, 43, +122,185,212,180,224,234,165,129,173,183,185,193, 56,101,247,110, 35,119,248,233,240,211, 91, 28,112,218,146,183, 56,233,128, 34, +167, 45,121,183, 45, 69,102,106, 14,208, 50,169, 61,167,179,120,183,121, 59,252,116,248,233, 45, 14, 56,109,201, 91,156,116, 64, +145,211,150, 94,255,182,228,221, 28,190,124,106,142,234,208, 3,207,157, 14,232,221, 6,233,240,211,225,167,183, 56,224,180, 37, +111,113,210, 1, 90, 78, 91,122,253,219,146,119,115,248, 26, 81, 99,227,211, 11,118,178,104, 68,195,211,115, 51,250, 14, 77,253, +122, 9,107,125, 57,252,116,248,105,181, 13, 56,125,211,152, 3, 86,121,168,142,231,240,211,225,167, 30, 7,222,230,182, 36,249, + 17,214,249,204,172, 79,189,138,247,101,241, 81, 74,180,228,221,177,209,210,212,130,179,210,241,110,179,116,248,233,240,211, 91, + 28,112,218,146,183, 56,233, 72,180,156,182,244,250,183, 37,239,230,240,229, 82,211, 58, 44,125,105, 95,119, 26,182,119, 89,253, + 42,248,249, 14,138,192, 96,116,233,189,127, 21,249, 12, 11,167,157,124,134,133,107,158,165, 19,222,165,232,248,167,114,248,233, + 61, 14, 56,253,221,123,188, 36,165,136,224,167,119,115,248,114,169,169,237,179,180,199,241,232,230, 36, 11,158,206, 64, 88,162, + 10, 61,116, 98,206,209,196,153,141,255, 76, 43, 47,195,138, 16, 66,188,139,144, 12, 33, 13, 66, 22,132, 76, 8,169, 16, 18, 35, + 68,247,192,159,136,168, 92,135,166, 62,195, 75,224,241, 32, 87,224,111,237,101,244,254,141,228,103,202,148, 41, 99,231,202,149, +235,211,199,143, 31,215,223,189,123,119,253,145, 35, 71,214,227,127, 62,183,210,230,195,209,231,223, 72,126, 90,228,199,203, 46, +123, 21,228,107,157, 43,240,183,213,203, 40,159, 81,226,196,137,211, 33,121,242,228,171,210,166, 77,123, 48, 85,170, 84,135, 18, + 36, 72,176,250,157,119,222,233, 10,194, 81, 77,136, 27,209,172,149, 56,113, 98,255, 82,165, 74, 29, 5,189, 53,160,209, 28, 33, + 46,239,252,207,231,124,143,255,181,116,232,191,204,124, 90,229,157, 94,188,151, 93,239, 97,205,171,147,207,176,114,206, 73,231, + 51, 27, 96, 39,196, 5,158, 44,209,242,229,163,143, 62,186,255,236,217, 51,241,228,201, 19,241,232,209, 35,241,224,193, 3,162, +184, 25,102,147, 14, 8, 39,217,180,105, 83,161, 60,121,242, 12,196,128,176, 58,122,244,232,119, 25, 48, 0,173,202,154, 53,107, +255,191,254,250, 43, 39,226,188,103, 80, 15,158, 26,246, 59,160,211, 18,131,218, 18,208, 61,159, 40, 81,162,243,252,141,103,109, + 64, 43,172,224, 45, 6, 6,197, 78,113,227,198, 93, 21, 51,102,204, 43, 12,252,205,103,160, 25,195, 67, 91,241,148,207, 88, 49, + 98,196,232,146, 44, 89,178, 85,241,227,199,191,194,192,223,124, 6,122,177,194, 72, 51,172,205,214, 40,159,148, 84, 13, 66, 61, + 12,101,136, 26, 53,234,144,226,197,139, 55, 44, 81,162, 68,253,146, 37, 75,214,227,157,207,228,123,198, 69,144,146,175, 72, 55, +248, 36, 77,154,148,109,113,166,167,144, 49, 99,198, 67, 0, 89,226,183,223,126,123,134,201,236,218,180,105,211, 30,141, 31, 63, +254, 89,142, 28, 57, 70,233,181,249, 36, 73,146, 12, 71,189,206,178, 18, 24,247, 85,214,123,211,166, 15,133, 58, 32, 47,153, 76, +218,183,233,228, 24, 33, 52, 31, 54, 21, 77, 17,152, 63,222,229,111,155,121,245,212, 62,215,141, 95,125, 87,140, 91,117,151,223, +216, 96,163, 83,233,210,252,224,131, 15,126,251,225,135, 31,158,254,254,251,239, 98,254,252,249, 98,246,236,217, 98,202,148, 41, +162,121,243,230,207,222,123,239,189,223, 77,232,235,209,108,249,253,247,223, 95,193,152, 27,204, 1,154,247, 89,179,102,221,142, + 29, 59,246,126,222,213,207,187,119,239,126, 5,244, 59,107,190,241,178,242,105,131,117,186, 81, 35,221, 24, 18,222, 2,155,205, +155,225,164, 31, 89,248, 25,206, 98,190,210,228,101,241,117,181,141, 86,111,179,220, 44, 97, 39, 70,164,203, 8, 75, 92,193, 76, +162,117,249,254,253,251, 76,195,248,242, 10, 85,185, 32,155,190,113,227,198,141, 0, 42,206,126,241,197, 23,219, 48,121,223, 26, + 58,116,232,133, 97,195,134, 93, 46, 82,164,200,245,134, 13, 27,110,122,247,221,119,207, 86,173, 90,181, 54, 37, 94, 58, 25, 53, +106, 48,185, 48, 73, 30,157, 58,117,234,227,139, 23, 47, 42,224,143,147,226,169, 83,167,196,232,209,163, 31,227,221,113,208,202, +101, 80,112, 35,154, 69, 48,128,157,253,229,151, 95,158, 30, 56,112, 64,220,184,113, 67, 92,184,112, 65,252,253,247,223,162, 99, +199,142,143,249, 14,244,138,216,164, 89, 20,128,242,252,226, 65,131,158, 6, 6, 6,138,167, 79,159, 42,121, 37,221,185, 3, 7, + 62,229, 59,208, 43,106,147,166, 89,125,122,122,111, 9,104,197,138, 21,107,232,137, 19, 39,126, 57,127,254,188, 18,248,155,207, +222, 20,160, 69, 48,132,197,130,127,112,112,176,110, 64, 61,249, 3, 92, 62, 98,191,200,155, 55,239, 67, 72,177, 82,231,207,159, +255,234,225,195,135, 69,206,156, 57, 47,233,181,121,210, 68, 27,244, 71,146, 80, 1, 11, 20,127, 44, 76,252,239,222,189,235,127, +237,218, 53,127,198,245, 80, 73, 47, 99,144,252, 0,223, 31, 46,193, 17,126, 47, 69, 32,216,138, 98,163,113,105,243,233,109,154, + 81, 84,224,106,153,234,183,221,188,122,226,231, 25, 2,173,106, 67,174,112, 44, 59, 24,142,178, 43, 73,179,101,203, 22,112,240, +224, 65,177,118,237, 90,129,197,165,248,247,223,127,197,156, 57,115,196,136, 17, 35, 4,198,185,253, 38,244, 67,229, 51,115,230, +204, 91,217, 6,255,252,243,207,199,245,234,213,187,139,241,238, 33,255,159, 59,119,238, 57,239,252,207,231,124,207,255,144,184, +174,215,124, 67,183,236,222,206,167, 13,190, 25, 69,125, 25,109,222, 11,217,140, 16,245,217,219, 92,118,111,212,201,171,162, 97, +251, 80,105, 9,180,150,200, 28, 67, 42, 84, 32,117,234,212, 51, 83,164, 72,177,138,129,191,249, 76, 85,162, 37,152, 52, 60, 2, + 45, 74,178, 8,178, 32,105,186,188,107,215,174,195, 0, 44,103,191,254,250,235, 75,120,190,145,129,191, 33,205, 58,179,101,203, +150, 77,241,226,197,187, 88,174, 92,185,207,240,156, 34,113,245,165,215, 8,115,229,206,157,251,206,205,155, 55,181,130, 56,247, +255,179,103,207, 10, 12, 82,183, 65, 40,143, 78, 45,232,209, 44,154, 37, 75,150,187, 0, 21, 34, 40, 40, 72, 1, 66, 4, 91,219, +183,111, 23,219,182,109, 83,194,210, 69, 11, 69,234, 15, 62,184, 3,122,122, 96, 75,151,102,169, 92,185,238,158,243,247, 23, 39, +199,142, 21,228, 23,243,204,192,223, 39,230,205, 19,199,151, 45, 19, 69,178,101,187, 11,154,122, 96,235,101,116,192,152,248, 54, + 3,175, 18,148, 90, 17, 80, 53,104,208, 96,232,132, 9, 19,134, 14, 31, 62,124, 36, 3,127,243, 25,223, 49, 14,227,170,248,250, + 50,242,233,141,206,228,206, 39,129, 14, 1,209,177, 99,199, 66,132,128,128, 0,255, 21, 43, 86,248, 67,138,229, 95,160, 64,129, + 71,172, 43,180,181, 71,153, 50,101,138, 1,192,117,245,232,209,163, 4, 90, 92,144,200, 43, 20, 77,128, 49,127,117,248,239,191, +255,252,183,110,221,234,143,201,215, 31,125,192,127,193,130, 5,107, 64,239, 40,232,156, 71, 24,243,254,251,239,167,179,208,230, +195, 91,126,109, 29,197, 80,129, 44, 46, 74,254, 66, 8, 47,208,242, 54, 77,130, 62, 69,146,133,251,110,121, 15, 67, 94, 61,181, +207,245, 85, 7, 95, 17, 8,143, 64,151,234, 55,171,151, 17,128,217, 65,160,213,167, 79, 31,209,182,109, 91, 81,187,118,109, 81, +186,116,105,209,168, 81, 35,129,241,115,175, 9,113, 61,154, 77,208,254,182, 33, 93,111,132, 36, 8, 93,134, 12, 25,114,157, 3, + 29,239,252,239,122,254, 35, 36,173, 91,241,187,161,149,182, 4,160,229,237,124, 90,229,155, 81,188, 72, 55,134,132,183,192,145, +121,252,244, 98,217, 13, 73,161,137, 23, 65,168,225, 10, 69,113, 47,166,249,175,104,152, 84,241, 42,186,222,107,239,146,134,124, +174,204,223,170,116, 70,194, 19,179, 98,122,182,209,242,199,196, 47,131,139, 82, 8,160, 5,245, 91,251, 42, 85,170,252,123,229, +202,149, 0,100, 70, 9,252,205,103,124, 39,211,220,185,115, 71, 11,180,220, 25, 67,154,119,169, 46,196,196,124,158, 32, 11,255, +247,118,235,214,237,228,210,165, 75,247,224,247, 90, 6,254,230, 51,252,222,189,113,227,198,173, 24,136,206, 64,228, 78,219,173, +104, 30, 74, 24, 61, 97,194,132,199, 41,109, 50,187,142, 28, 57, 34, 16,247, 20,104,189,107,194, 49,100, 51,214,121,130, 43,150, +137, 82, 49,148, 87, 64,242,160, 72,179, 22, 47, 90, 36,230,205,156, 41,252,231,250,137, 63,102, 78, 23, 46,201,150, 39, 53, 34, + 63, 23,139,210,170,115, 0, 82,187,219,183, 23,127,188,255,190,184,126,253,122,136, 48, 35, 81, 34,177, 25,239, 14,248,249, 9, +151,100,203,147, 26,209,172,210,195,242,254,107, 36, 10,114, 5,254,246, 1,152,168,139,242, 43, 32, 11,192,247,159,104,209,162, + 61, 97,224,111, 62,227, 59,198, 9,203,199, 94,167, 52, 18,104,105, 65,209,142, 29, 59,220, 64,171,102,205,154,103,127,253,245, + 87,209,191,127,255, 39, 0, 68, 55, 6, 13, 26,116, 23,106,160, 96,252,158,172, 87, 22, 79, 52,215,172, 89,131, 46,231,239, 15, +213,227,154,194,133, 11, 63,129, 74, 41,248,210,165, 75,148,118, 60,131, 74,253,134, 14,216,138,104,118, 69, 81, 1, 45, 74,114, + 42, 35, 72,192, 29,214,111, 71, 4,205,152, 82,146,229, 2, 90,127,123, 41,175,178,140,243, 0,178, 30, 35, 16,180,140, 9,107, +193,153, 14,166, 21,121,208,102,206,253, 52,239,178,232, 48,232,119,209,186, 67, 79,241, 89,195,150,162,228,103, 93, 68,145,230, +115, 4,192,117, 32, 22,148,122,182,143,118, 63,251, 45, 18, 80,114,213,193,110,194,151,156,207,176,100,207, 73,243, 22,113, 64, + 7,139,184, 75, 79,208,132, 63, 10,152,129, 90,188,135,206,255,242,140, 44,159, 27,221, 37, 13,245,123, 9,216, 94, 36, 87,190, +227,253,139,133,211, 80,165,154,112, 9, 66, 15, 74,173, 8,168, 36,192, 82,223,239,221,187, 23,128,193,228, 95,151,100,203,157, + 70, 47,135, 72,151,156, 54, 89,173, 91,183, 62,128,223, 4, 90,107,171, 85,171, 22,120,245,234,213,141, 80,203,172, 99,224,111, + 62,131, 42,109, 29, 84, 46,255, 65,125,184, 22, 54, 14,125, 16, 87, 43,213, 82,127,162,233,228,201,147, 21,149,142,209, 5,117, +144, 2,152,110,223,190, 45, 96, 47,241, 16,249,109,235,137,139,176,191,234, 2,117,227, 19, 74,178, 78,159, 62,173,168,247, 32, +154, 23, 0,127, 98,201,194, 63,196,239, 51,166,139, 89,163, 71,138,169,253,122,139, 53,126,179, 68,235, 6,245, 30,187,108,182, + 12,201,210,254,106, 33, 84,131,199, 71,141, 18, 11, 0,178,230, 39, 73, 18, 10,104, 77,137, 27, 87,140,143, 21, 75,236, 28, 60, + 88, 76,236,210,229,169,203,102,203,251, 21,174, 79,145,147,106,144,228, 97,148, 40, 81,158, 66, 85, 54, 27,170,221,117, 45, 91, +182, 60, 80,171, 86,173,131,144, 92, 41,234, 9, 94, 4, 91,148,108, 1, 28, 12, 45, 88,176, 96,157,151,149,201,136,250,142, 17, + 40,218,179,103,143,255, 63,255,252,227,255,199, 31,127,248, 67, 98,176,166,104,209,162, 79,102, 2,100, 83,101, 8, 41, 87,112, +190,124,249,110, 64,186,155, 81, 47, 95,122, 52,247,237,219,231,191, 97,195, 6, 5,100, 97, 17,225,255,249,231,159,159, 6,189, + 96, 0,184,167,133, 10, 21,186, 62, 99,198,140,251, 0, 93,207, 40,217,138,168,178,234,209,213,128, 44,130,151,204, 8,118,212, +134,161,200, 70, 4, 77, 87,158,212,246, 89,187,241, 44,103,120,243,170,202,252,108,130, 44,132, 51,120,246,139,234, 57,251, 71, + 94, 4,203,224, 19, 18,208,173, 24,211, 68,239, 37,143, 68,129,222, 65,226,189,111,159,138, 56, 95, 63, 22,153, 58, 5,138,154, +190, 59, 68,175, 94,189, 4,236, 61,153,255, 87,122,189,132,124,166, 67, 57,127,135, 77,218, 70,222, 81,216,116,225, 45,112,165, +204, 62, 21, 63,201, 17,245,124,165, 76, 62, 66,185,227,127,120,105, 58,233, 95, 61, 7,116,176,136, 59, 83,152,118,220, 18, 45, + 60,148,128, 72,123, 55, 5, 90, 18, 84,153, 0,178,176, 48,195,154, 68, 75,143, 50, 85,132,106, 73,150, 4, 90,176,131, 10, 56, +116,232, 80, 0,212, 31, 1,140, 99,150, 43,164, 75, 3,131,227,191, 49,201,156, 4,136,218,249,240,225,195,245, 48,170,190, 78, + 80, 37,129, 22,127, 99,114,191, 1,245,204, 70, 72,143,118,206,157, 59,119, 11,118,236,172, 64,218,248, 70,244, 49,153,205,161, + 77,150,209, 69,251, 39,170,123, 8,148, 96, 87, 36,160,154, 20, 52,144,247,148, 95, 26,187, 83,250,197, 52,183,110,221, 18,199, +143, 31, 87, 36, 89, 75,255, 0,200,154, 62, 85,204, 30, 61, 66, 76,239,223, 91, 76,233,242,157,152,223,187,167,152, 1,192,197, + 52,158,104,210,216,157, 18, 11,170, 8,165, 36,235,183,100,201, 4,172,175,197,244, 4, 9, 4, 65, 22, 37,104, 4,118, 84,115, + 98, 87,155, 96, 26, 51,190,122,241,125, 8,160, 5,137,158, 56,121,242,100, 48,242, 20, 76,245, 41,121,199,103,111, 27,208, 66, + 27,247,223,188,121,179, 34,213,130,138,207, 31, 0,124, 45, 84,202,167,160,106,185,138,133,195, 76,216,106,101,245,208, 54, 21, +117,164, 90, 74, 70, 85,228,234,213,171, 21,224, 6, 80,229, 15,105,224, 35, 2,120,170, 35, 51,100,200, 16, 31,147,222, 85, 74, + 78,241, 95,109,247,229,197,106,214, 39,165, 99,184, 78,240, 98, 38,165,245,152,175,136,160,233,250, 96, 12,151, 52,235, 0,254, +135, 69,197,105,148,111,150,247,207, 54, 83,111,156,249,118,198,141,255,240,123,146, 11, 20,116,198,194,227, 15,216, 59,253,203, + 59,158,209,192, 60,165, 89,165, 0,132,111,163, 29,230,229,203,151, 5, 1, 23,199, 41,170, 17,151, 47, 95, 46, 6, 99, 49,245, +233,167,159,134, 9,104, 97, 67,206, 87, 24, 75,127, 79,147, 38,205, 78,180,191, 93,144,138, 45,196, 34,136, 27,126,194, 4,140, + 35, 42,159,146, 63, 4, 87, 3, 7, 14,188, 4,233,237,165, 22, 45, 90, 92,114,129, 45, 51,246,121,124, 79,112,117,114,213,120, +241,120,223, 92,177,125,116, 3, 5,108,133,139,160,147,248,181,224,128, 70,179, 22, 42, 79,106,112,100, 0,148, 76,129,150, 4, +105, 17, 0,180,152, 95, 99, 39,165,158, 80, 36,237,177, 36,184,226, 29,210,161, 0, 76,190, 1,176, 81, 10, 88,182,108, 89, 0, +212,129, 1,220,186,108, 86, 75, 72,155, 5, 18,154,219,152,184, 46,130,198, 70, 24,206,175,175, 84,169,210, 85, 60, 95,203, 64, +176, 5, 99,228,117, 21, 42, 84,184, 10, 64,178, 9, 3,211, 22, 12, 72,255, 65,114,114, 11,239, 19, 27,209,199,128,115,130, 70, +239,122, 23,192,156, 50,192, 81,245, 7, 73,130, 98, 95,181,119,239, 94,193, 29,137,158,242,203,157,133, 4,103,176,165, 81, 64, + 17, 13, 88,151,253,177, 64, 44,152, 54, 85,248,141, 30, 46,102,246,253, 73, 76,237,220, 65, 76,110,221, 76,204,254,182,165,248, +103,236, 8,193, 52,158,104,114,103,161, 4,125, 18,104, 17,100, 77,139, 31, 95, 76,142, 19, 71,140,143, 25, 83,201, 39, 1, 30, +120, 36, 8,110,152,198,140,175, 94,126,255, 53, 37, 89, 4, 84,157, 58,117, 82, 36,120,234,192,103,124, 71,201,150, 84, 29,130, +159, 67, 33,125,209,218,129,120, 57, 91, 17, 79,206, 72,162, 69,144, 4,155, 65,127,180,117,127, 0,127, 37, 64,253,236,103, 37, + 71,122, 52,105,155, 69,208, 6,169, 21,213,134,254, 0,107,143, 70, 65,202,137,141, 32,207, 97, 83,115, 14,255,131, 40,121, 5, + 0, 11,180,242, 13, 47,198,161, 61, 22,141,202, 41, 97, 89,134,192, 93,144, 52,102, 87, 95,118, 38,114,197,158,202, 2, 77,219, + 69, 80, 25,193, 19,100,121, 67,197,201, 60,148,203,158, 48,198,158, 37,213,210,156, 57,123,237,241,129,235,119,159,109,253,166, +119,254, 85,177,227, 68,223,214,166, 77,155, 67, 24, 71, 30,112,140,129, 13,223,131, 38, 77,154,144, 71,180,133,242,120,161,157, +116,195,238,194,227, 11, 23, 46, 12, 38,184,146, 70,240,216, 53, 40,234,212,169, 19,156, 62,125,250, 99,144,132,119, 55,163,163, +126, 15, 96, 53,165, 75,151, 46, 79,230,193,158,147, 1, 82, 85,129,118, 36,234,214,173,251, 12, 0,198, 82,187,212,126, 15, 54, +179,157,190,250,234,171, 3,200,231,115,111,229, 83,253, 13, 72,178, 54,140, 25, 51,230, 18,128,229, 37,240,227, 18,255,219, 41, +179, 94, 92, 74,178, 30,253,247,187,184, 61,161,152,184, 59,175,190,224,255,240,210,116,210,191,122, 14,120, 73,162, 85,158,170, + 69,148, 38,132,138, 81, 11,210,240,191,170, 58,158, 42,126,133,112,114, 66,191, 45, 90, 5, 90,207,159, 63, 15,128,180, 37, 0, + 19, 79, 0,212, 30, 1,232,224, 1,216,221, 18,128, 9,101,181, 89,198, 80,168,204, 0, 35, 55,225,123,232, 33,212, 36, 71, 1, +124,182, 17, 84, 73,144,133, 29, 88,235,161,138, 92,143, 9,252, 26,232,239,192,138,239,120,211,166, 77,239, 1,104,209,208, 51, +161, 17,125, 2, 45,186,150,208, 94,148, 28, 81,130,132,129, 81,145, 14, 65,146,166, 72,165,120,183, 2,180,152,150,192,108, 21, + 36, 96,254, 11,126, 23,127, 76,155, 34,252, 70, 14, 19, 51,251,244, 18,211, 58,125, 43,166,180,106, 42,102,126,213, 80, 44,104, +221, 84,172,249,165,191, 37,160,197,124, 18,192, 73,160, 37, 65,214,216, 24, 49,196,200,119,222, 81,212, 81,251,247,239, 87,192, + 32, 37, 91,175, 0,104,249, 96, 39,221, 84,126, 91, 11,178,228,127,190,171, 94,189,250,127,180,207,130,106,151,134,240, 67, 81, + 55, 84,177, 84, 51,107, 3,175,243,123, 79,170, 67, 26,173, 83,154, 5,119, 14,254, 19, 39, 78, 36,208,154,107,165, 44,164,201, + 93,140,106,137, 22,165, 99, 4,109,148,102, 65,245,234, 15,119, 38,143,203,148, 41,173,184, 71, 9, 8,216, 41, 96,175,165,212, + 61, 36, 90, 47, 27,104, 81,154, 67, 96, 68, 73, 86, 14, 4,170, 67, 21,137,150,218,141,130,234,183,251,189, 7, 94, 24,210,180, +194, 63,163, 56,216,177, 71,155,192, 41, 8,148, 46,217, 53,216,215,146,173, 22, 35,106,148, 11, 93,243, 39,185, 17,248,101,182, +179,183, 90,102, 63,176,117, 64,231,173,115,102,247, 93,221,111, 90, 41,255,172,185,147,157,191,121,243,198,115, 44, 40,131, 90, +181,106,117, 0,139,174,107,232,159,143,177,224, 32, 24, 53, 28,151,240, 46, 86,179,102,205, 62,236,209,163,199,196,138, 21, 43, +110, 66, 61, 31,130,196,242, 28, 76, 33,206,192,254,242, 95,236, 56,228, 68, 80,200, 46, 31,184, 59,144,155,114,216, 31, 1,218, +197,250,245,235, 5, 93, 71, 64,210, 42,176,144, 53,219,197,232,233,115,249, 81,166,238,176, 13,252, 35, 93,186,116,155, 17, 54, + 0,128,253, 30,214,124,170, 63, 4,173,196,239, 24,203, 47,129, 31,151, 96,106,114,137,255,237,150, 91, 27, 31, 18,172,179,219, +199, 54, 18,247,230, 55, 20, 43,218,167,167, 68,139, 59,192,157, 43,146,115,192, 4,104,153,217,104, 41, 0, 9, 88, 32,134, 39, +201, 23,163,188,136,246,194,176, 94,254, 86, 61,139, 30, 14, 54,134, 13,240, 75,213, 33,164, 49, 1,152, 0, 2,208,193, 3,176, +146, 10,128, 59,134,128,177, 99,199, 42,193,162,234,240, 3,116, 92,170, 14,207, 78,159, 62,253, 52,118,223, 92,194,128,243, 24, +234,195, 27, 24,136,174, 18,116, 81,149,200,103,159,125,246,217, 37, 0,173,211, 0,114,235, 0,206,168, 58, 52,180,209,162,234, +144,146, 32,121,209,158,138,234, 62, 74,132, 8, 92, 96,204,252, 66, 34, 5, 35,116, 6,124,219,146,234,144,105,182,111,221, 34, +252,127,159, 47, 22, 78,157, 44,230,141, 24, 42,102,245,249, 81, 76,235,216, 78, 76,107,217, 68,204,250,178,129,152,247, 69,109, +177,188,221, 87, 98,102,251,214,150, 84,135,103,206,156, 81,108,197, 36,208,154, 4, 73, 22, 65,214, 8,128,172,159, 81,241,148, +186,237,220,185, 83, 1, 90, 28, 64, 95,178,234, 80,105, 91,176,183,154, 76,144,105, 4,180,248, 14,171,223,125,148,100, 17,100, +129,239, 74, 64, 82,130,173,120,225,104,160,175, 52, 41, 65, 17, 93, 56,104,141,225, 9,140,120,193,142,202, 31,146, 39,127, 95, + 95,223,149,112, 10,185, 7, 64,104, 43, 84,136, 29,169,238, 51,202,184,116, 25, 33,105, 82, 13, 9,190,250, 99,211,135, 63,182, +225,251,163,141,251,131,142,178, 61,255,151,225,131,185, 21, 63, 24, 54,132, 2,139, 17,238,100,220,249, 10, 24, 66, 41,148, 58, + 48, 11, 70, 46, 21,150,224,157, 21,144,163, 71, 83, 22, 77,190, 51,250,111,196, 2,250,216, 43,139,160,167,222,180, 75,243,240, +131,249, 3,111, 60,152,211,239,236, 77,128,172, 49,165, 83,110, 75, 26, 43,218,232,247, 18,188,219,239,163, 90,105,150, 85,251, +164, 52,119, 69,139, 70, 77,234,112, 34, 95, 92,185,114,229,205, 84,163, 99, 65, 66,169, 76,110,163, 12, 2, 76,228, 69, 93, 79, + 69, 93,207,130, 20,138,198,234,197, 16,180,227, 24, 7,249, 25, 8, 4,238,107, 17,168, 25,232,229,169,222,195,185, 59,208, 19, +233,242,144,166,238, 65,190,213, 62,225,220,241, 1,184,250,162,173,238,192,131,234, 97,104,151,233,176, 97,104, 1, 84,156, 91, +120, 71,250,116, 97,160, 17, 34, 9,109,178,106,229,140,118,134,146, 44,229,238,216,104,133,151,165,175,125,122,116, 67,245,174, + 67,254,230,206, 67,185,131,144,255,221, 0, 73, 21,151,207,101, 58,185,203, 80,157, 70,251, 46,172, 59, 14,201, 63,219,158,225, + 67, 24,195, 99,112,249, 23,224, 32, 0,147,107, 0, 86,246, 1,152,112,148, 0, 7,121, 1, 48,150,222, 96,209, 24, 62, 49,157, +145,194,176,122, 63, 10,126, 8, 43,125,197, 24, 30,224, 99, 51, 85,133, 0, 70,155, 97, 11,181,165,124,249,242, 87, 33, 53,219, + 12,245,228, 94, 0,175,245,112,228,232,139,248,158, 12, 80,155, 2,244, 41,147, 21,165, 2,180,111,161, 68,128,106, 63,174,248, + 96, 15, 35, 22, 97,151, 32, 69,236, 68,203, 0, 9,143,172, 24,195,119,237,220,233,241,190,157, 59,196,162, 41, 0, 89,195,127, + 17,179,125,127, 20, 51, 58,126, 35,166,183,104, 44,102,127, 89, 95, 44,106, 93, 87,108,237,223, 68,108,236,249,157,104, 91,161, +204, 19, 43,198,240,179,250,244,121,122, 12,134,212,148,100, 77,140, 29,219,109, 55, 70, 85, 33,193, 85, 31, 84,212, 79, 81,162, +136,197,173, 91,139,193, 95,125,245,178,141,225,149,142,102, 5,104, 33,206, 42, 0,129,250,136,254,203,155, 4,180,232,215, 74, + 13,180, 8,140,104,184,190,120,241, 98,127, 72, 97,253,123,246,236,185, 10,147,209, 99,170,246, 40, 25,197,238,195, 71,217,179, +103,191, 10,143,223, 41,244, 70, 41, 2, 45,168,200, 67,208,212, 1, 90, 79,216,118, 11, 21, 42, 40,176,104,225,102, 13, 1,131, +123, 1,186, 47,213, 70,139,249,167, 77, 21,110,169, 17,212,182, 89,122, 46, 21,118, 33,206, 74, 4, 83,160,101, 64,211,231, 97, +211,166,130,193, 69, 35,134,234,191,169,164, 76,229,164, 84,237,145, 63,172, 52,119, 18,100, 81,146, 85, 34,101,236, 45,200, 79, + 85, 4, 69, 69,138, 5,228,222, 79, 63,173,245,148,245,243,121,237,207,158, 0, 88,223,130, 52,247, 1,129, 22, 92, 52, 60,192, +216,180,209, 96,118,138, 86,191,126,253, 54,144,166,239,129, 68,107, 26,226,148,213,139,135, 93,135,219,164,131, 81,185, 80, 68, + 60, 67, 51,140,178,101,203,102,195,198,164, 83, 67, 22, 93, 20,157, 6,249,137, 54,237, 58,138,218,245,155,136,146,159,180, 23, + 37,191,156, 36, 0,250, 47, 96,161,154, 63, 12, 51,102,121, 44,110,207, 64,163,240, 28,125,155,106,209, 80, 30,235,161,214,222, +206,247, 40, 23,205, 46,106,134,225, 27, 78, 18,135, 3, 14, 7, 52, 28, 88,194,157,122,120,182,132,207,233,194, 1, 34,223,181, +216,125,165, 24,191,211, 54, 11,162,106, 5,100,169,221, 59,208,216, 83,166,209,114,148,104, 19,170,187, 92, 16,111,159,135,212, +230, 40, 6,152,221,157, 59,119, 62, 9,187,133,253, 0, 71, 27, 97,112,191, 17,246, 47,251, 32,158, 63, 11, 35,244, 93, 80,173, +252, 3,137,201, 25,172,250, 63, 64, 90, 79, 71, 85, 40,238, 29, 56,248,113, 2,228, 29, 59,197, 20,137,204,202,149, 43, 21,177, + 58, 84, 62, 2,180, 5,118, 39,210,109,130,101,247, 14, 43,255,248, 93,172,153, 59, 27, 32,171,167,152,217,161,141,152,241, 85, + 35,225,215,180,174, 88,210,170,142, 8, 24,218, 76,236, 29,209, 78, 44,248,230, 43, 17, 59, 86, 44,174,118,205, 12,135, 21,247, + 14,135,144,143,127, 91,182, 20,163, 33,201,162,145,189, 4, 89,148,188, 17,100, 77,173, 88, 81, 44,133, 13, 7,212,134, 28,208, + 94,182,123, 7, 75,170, 67,170, 23, 93,245, 75,117, 33, 37, 89,111,132,234, 16,210, 70,127,216,206,248, 99, 19,128,114,103,248, +248,227,143,253, 97, 75,232, 95,166, 76, 25,218, 83,157,160, 68, 18, 82,138, 96,168, 77,175, 66,178,251, 20,106,172,167, 0, 69, +244, 35, 22,234, 34,208,130,116,213, 31, 91,252,253,209, 55,148,187, 54,192, 16,249,209,185,115,103, 33,193,202, 17,140,137,156, +126,180,130,232,163, 13,210, 3,181,111,174,151, 49, 64, 41,174, 24,240, 33,218,102, 17,236,168,237,177,194,234, 82,193, 19,205, +212, 18, 92,169, 64, 22,109,196,198, 33, 16,236, 25, 93,138,132,205, 32,159, 97,161, 89, 9,180, 86,184,198,173,114,234,143, 66, +194,120,204, 45, 42,199, 15,142,137,180,179, 4,224, 80, 22, 73, 48, 70, 63,102,148, 73, 72,226,155, 97,193,120, 30,109,137,142, +152, 57,142,114,241, 74,213, 6,157, 38,115,247, 34,191, 59, 5,253,252, 48, 54,232,220,179, 2,180,176, 81, 98, 51,141,235,191, + 95,240, 72,100,253,225,145,136,245,245, 51, 17,179,237, 83,145,170,195, 13, 81,233,199,221,226,199, 31,127, 20,144, 26, 5,216, +108, 44, 13, 97, 59,117,142, 32, 10,142, 78, 47,184,120, 65,231,185,218,240, 39,226,157, 87,197,171,109,243, 59, 78,116,135, 3, +111, 58, 7,202,162,128, 90,169,150,199, 50, 47,225,209, 58,174,193, 71,137, 40, 29,150,210, 30,139,198,239,122, 14, 75,169,174, + 83,167,193,239, 16, 91,110, 49,152,196,167,199,119, 12, 46,151, 33, 17,216, 11,251,174,147,208,221, 99, 83,206,229,173,152,136, +182,192,153,233, 37, 24, 9, 31,135,154,102, 61, 0,217, 69, 76, 96,213,145, 70,235,243, 74,215, 97, 41,157,145, 82,245,198, 1, +144,234, 55,238, 46,196,206, 46,229,216, 11, 74,180, 96, 91, 35,160,242,185,141, 60, 89,118, 88,154, 30,206, 72,151, 65,109,184, +113,230, 20,177,184,123, 71,177,160, 85, 19,177,164,121,125,177,123,120, 27,113, 96, 92, 39,177,232,219, 22, 34,109,226,132,182, + 28,150, 22,134, 19,212, 93,240,197,180, 9, 91,187,169,242,164,228, 13,126,197, 20,112,184,160, 89, 51,177,180, 91, 55,145, 59, +109,218,123,200,231,171,112, 88,106,201, 24,158, 6,243,200,159,226,103, 11, 23,213,133, 90,149, 97, 68,108,181,142, 80,154,176, +219, 27, 5,155,188,101,144,176, 42, 14, 75, 41,205,162,107, 7, 6,212,143, 18,138, 21, 43,166, 72, 78, 1, 52, 31,194,214, 38, + 55,119, 8,114, 23, 25, 38,100, 78, 80,242,114,231, 19, 18,143,161,235,214,173, 91, 74,144,133, 73,215, 31,192, 58,148,106, 18, +139,149, 71, 92, 28, 0,196, 61,164, 26, 18,192,235, 42,255,131,166,174,183,121, 47,142, 84, 90,126, 74, 80, 68,251, 25,170,228, +212,139, 27,183, 84, 75,229, 36, 84,207,165,130, 29,154, 92,152,148, 85,129, 44,238, 32,164, 91, 9, 14, 86,234, 69, 75,104,154, + 47,128,150, 58,159, 18, 20,134,149,166, 46, 91,181, 64, 75,186,123,225,162,136,139, 36, 24,179,211,177,107,168,122,119, 61, 40, + 64,160,142,197,223, 35,140,165,193,240,155,118,151, 71,226, 64, 34,116, 17, 46, 61, 46,124,251,237,183,129, 88, 4,222, 1, 77, +152,190, 62, 23,144,150,210, 94,149,229,154, 99, 68, 19,237,109, 27,253,249,113,131, 15,253, 6, 94,186,116, 25,187, 24, 15, 41, +182,167,144,234, 11,208,181,178,139, 81,205, 79, 58, 60, 61, 8, 77,128,114,156,143,213,203, 53, 55, 28, 66, 90, 9,136, 35,180, +111, 70, 96,155,247, 6,105,167,236,222,224,226,155, 65, 67,235, 25,222,180, 84, 75,104,235,132, 88,102, 71,240, 72, 21,227, 18, +198,165, 91, 2,220,249,219,104,240,161, 5, 90, 50,216, 99,125,198, 99,118,176,186,223, 10, 81,245,213,174, 93,187, 94,192,145, + 54,167, 48,201, 4, 66,109,178,154,146, 44, 23,200,138,163,147, 83,163,134,173, 28,193, 3, 81,253, 35,218, 98, 81,162, 5, 9, +156,152, 52,105,146,192,174,161, 71,148,122,129,150,221, 35,120,138,210,113,105,135,134,245, 30,205,237,231, 43,214,143,254, 69, +172,255,185,143,152, 3,233, 86,187, 74,229, 30, 99,213, 26,150,227,114,148, 35,120, 70,183,107,247,148, 71,114, 16,108,209, 96, +159,192,112,224, 23, 95, 60,117, 73,178, 94,197, 17, 60,161,220, 59, 80, 5, 75,155, 44, 6,254, 86,187,119, 0, 47,233,216,212, + 72,165, 27, 25, 7,159,120,104, 63, 99,177,136,152, 99, 20,208, 38, 31, 82,162, 5,105,211,125,148,253, 29,128,163,171,172, 59, + 72,161,212,134,235,234,178,199, 36,216,242,116,214, 33, 22, 8, 71,208, 70,131,177, 43,235, 49, 38,210,235,176, 75,188,143,255, + 90, 63, 90, 47,131,159, 81, 96, 55,166,156, 29,104, 96,240,174, 72,181, 80,110, 79, 46, 21, 66,129, 34,210, 84, 75,174,144,222, +173, 26,212,145,104,125,133,247, 90,155,183,151, 65,211, 18,208,226, 17, 99,236, 7, 4, 90, 92, 24,105, 36, 90,122,117, 84, 30, + 70,229,219,113,132,215,117, 44, 38, 21, 21,164,250, 34,200,130,164,253, 14,212,144,148,136,175, 3,192,126,140, 59, 85,141,186, +227, 39,218,231,143, 29, 58,116, 56,178,106,213, 42,193, 32,119, 49, 98,204, 19, 56,165,129, 39, 95,156,198,184,234,107, 50,186, +107,243, 89, 47,140, 18,173, 6,158,198,121,211, 25,198, 60,194,203,104,243,230,185, 48,143,225,228,211,156, 71,111, 75,140,178, + 40,168, 45,137,214, 12,186, 76,160,123, 4,174,226, 40, 42,215, 0, 40,201,184, 37, 84, 23, 82,146, 69,144,197, 65, 8, 47,102, +155,117, 64, 12, 54,113, 49, 72,100,166, 51, 82, 24, 95,254,133,157,133,119, 24, 0, 92, 86,210, 38,203,165, 46, 52,242,222,238, +169, 97, 71,196,161,210,177,232,192, 84,231, 80,233,240, 28, 0,253, 58, 30, 42, 29,202, 97, 41, 36, 55, 19, 1,132,199, 51, 0, + 4, 79,166, 36, 75,165,226,120,211,128,150,233, 96, 0,128, 53,139, 78, 74,161,162,185, 3,123,195, 27,188,243, 63,159,155,181, +121, 35,226,244, 0,143,244, 55, 96, 3,246,140,174, 61,120,231,127,141,103,248,151, 49,152, 75,119, 12, 52, 86,166, 10,143, 18, + 35,233,226, 65,109, 16,239,201,165, 66, 40, 80, 4, 26,180,227,210,210,116,171,248,240,142, 82,172,131, 42,201, 22, 7, 43,143, + 18,173, 8,160,169, 91, 61, 90,137, 22,199, 68, 74,147, 88, 79,180,209,131, 84, 95,173, 58, 52,170, 35, 74,141, 90, 35, 44,131, +171,156, 67,240, 19,120, 22, 7,146,159, 5, 0, 59, 9, 45, 1,109,194,122, 35,208,168,158,129, 42,120,181, 95, 54, 61,154, 37, +176,104, 28,136,111, 47,133,170,121, 19,164,106, 91, 0,192,252,177, 8,194,126, 26,159,146,166,141, 88,163,101,112,197,119,219, +104,193,105, 46, 37, 85,161, 46,216,104,109,244, 96,163,245, 50,218,167,133,162,153, 70,113,242,105,202, 34, 91, 17, 34,130,159, +182, 50, 16,217, 35,103, 65, 1, 8,152,150,168,130,222,161,210,106,137, 22,227,206, 64, 96, 90,121, 25, 86, 4, 38,236,104, 4, + 92, 8, 9, 16, 18, 35, 36, 68,136,135, 16,211,196, 38, 43, 34, 42,215,161,249,162,198, 66, 29,193,163,105,200,102,239, 77,235, + 61, 28, 29,227,149,215, 17, 22, 6,137, 96,111,211, 14,170,232, 46,144, 62,116,225,157,255,249,220, 74,155, 55, 42, 59, 65, 21, + 61,193, 99, 50,123,149,103, 29, 50,123,210, 29, 3,221, 59,168, 93, 60, 16,132, 81, 77, 52, 14,129, 0,204,200, 8, 94,175,142, +140,104, 74,122, 4,117, 85, 92, 65,207, 70,235,101,209, 12, 85, 61, 80,229,174,128, 63,179, 99, 88,100, 28, 71, 56, 70,224, 5, +169,230, 49, 24,177, 31,163, 52, 11,174,101,104,219,101,183,205,211, 39, 32,157,157,154, 29, 3, 70,186, 47,179,205,151,227, 78, + 90,158, 93,170,215, 78,177,216,236, 11, 30,236,195, 59,189,227, 73, 94,102, 62,195, 49,132,188, 84,126, 58,249, 12, 15, 7,156, +180,182, 56,224,116, 64, 91,236, 50,141,252, 50,248,169, 62, 84, 90, 47, 67,102,239, 95,246, 4, 97,202, 52, 15, 17, 94, 6, 63, +195,147, 63,187,147,184,157,111, 25,149,221,200, 29, 3, 1, 19,213,126, 4, 89, 70, 27, 63,236,208, 84,211,147,109,138,180,181, +187, 14, 95, 38, 77, 59,252,211,198,117,218, 82,120,184, 23, 58,173,195,207,183,147,159,222, 45,245, 91, 66,205,233, 44,222,173, +104,135,159, 14, 63,189,197, 1,167, 45,121,139,147, 47,232, 56,252,116,248,233, 45, 14,188,205,109,201, 91, 60,124, 21,116,180, +246, 89,101,213,153, 96,165,234, 5, 59, 25, 53,162,225,233,185, 25,125,135,166,126,189,132,181,190, 28,126, 58,252,180,218, 6, +156,190,105,204, 1,171, 60, 84,199,115,248,233,240, 83,143, 3,111,115, 91,146,252, 24,129, 31,122,161, 21,158,171,131, 89, 31, +122, 29,223,135,205, 75,124, 24, 74,242, 54, 35,115,167,236, 97,104, 48, 30,146, 56,252,116,248,233, 45, 14, 56,109,201, 91,156, +116,164,121, 78, 91,242,110, 91,210,163, 70,192, 21,217, 46,130,172, 16, 18,173,136, 44,128,211, 8,189,203, 93,135,159, 14, 63, +189,197, 1,167, 45,121,139,147, 14,216,112,218,146,211,150,188,203,129,144,212, 34, 35,208, 50,231, 7, 28,233, 69,147, 1,110, + 23, 90, 34, 5,119,155, 40,129,255,213,239,245,126,171,190,224,238,128,102,105,204,190,163, 71, 51, 87,214,248,109,203, 22, 77, +121, 36,111,214,248,109,224,126, 33, 7,104,212,145,129,255,205,190, 25,150,124,234,125, 39,119,246,132,223, 48, 31,185,179,196, + 83, 55, 8,103,240, 49,111,106,118, 98,152,241, 51, 41,136, 53,127, 47,214,187, 75, 75,164,140,123, 45,238,187,209,150,240, 63, +130,122, 71,160,246,123,102, 52,237,228, 79,198,125,105, 52,225, 46, 32, 59,206,190, 27,136,176, 12,219,253,183,243,206,255,124, +110, 33,227,238,124,150, 77,239,115, 6, 65,184,194, 25,117, 90, 79,239,116,190, 17,162,236,149, 51,249, 60,228, 89,116,149, 51, +251,208, 63,148,251,170,146, 89,255, 57,227, 41,241,145, 78,175,111, 90, 40,147,213, 40, 47,173,142, 92, 25,162,111,176, 58, 8, +125, 17, 62, 67,208,243, 15,168,151,247,151,157, 79,171,252,123,163,250, 81, 88, 11,237, 74,231,212, 81, 56, 25,104, 33,121,100, + 1, 90, 90, 85,161,103,213, 33,192, 68,249, 68, 9,226, 29, 76,152, 32,238,165,104,209,162, 62,225, 25,130,188,120,231,255,132, +239,197,189,132,119, 7, 25, 47, 60, 64,203,206,119,244, 6,222,210, 69, 82,220, 16, 87, 70,137,210,133, 83,222,134, 79,154, 86, +240,249,213, 6, 94,150,219,240,206,255,137, 19, 36,248, 34,105,210,248,245,224, 17,254,131,240,228,147,233,147, 38, 77, 84, 47, +113,226, 4, 95,232,125,231,195, 66,239,223,103, 62,202, 20, 73,161, 62, 54,197,233,128, 22,122,144,141, 40,158,248, 25, 35, 93, +162,184, 7,151,124, 83, 83, 92,157,208, 89, 4,126, 83, 72,156,110,145, 71, 76,171,156, 94,164,142,247, 46, 29,108,218,221, 37, +103, 35, 91,161,162,190,140,122,143,150, 49, 99,198,246,240, 42,191,101,255,254,253, 1,104,239, 1, 56, 30, 38, 0, 14, 53,149, +243, 72,249,156,239,145,179,104, 30, 10,162, 6, 90, 66,172,239,165,132,146,105, 20,135,123,244, 17,215,150,129,224, 75,190,227, +111, 60,235, 42,223,185,238,159, 24,129, 34,128,166,224,199, 91,134,138, 42,153,124,158,171,211, 84,207,234,243, 80,236, 28, 21, +234, 57,227, 49, 62,211, 25,209,172,146, 37,202, 83,130, 49,163,192,247, 72,219, 76, 39,208,133,132,188,212,117,196,231,134,241, +107,100,143, 22,104,244, 45,190,211,163,217,180,128,207,211,134,121,125, 4, 67,179,130, 62,207,224,160,120, 53,156,150,174,133, +255,173,181, 93,186,116, 89,251,222,123,239,209, 23, 25,121,156,217,164,161,189,140,182, 20,158,182,174,199, 79,111,208, 35, 13, +167,236,222,226,228, 11, 58,145,133,159,122,165,142,108, 64,203,154,135,248, 4,241,227, 30,219,248,207, 2,177, 96,206,120, 17, + 59,118, 44,229,172,192,161, 67,135, 42,247,216,177, 98,138,153,147, 6,139, 37,243,198,137,248,239,197, 57, 22, 30, 0, 99,231, + 59,122, 3, 26,129, 13, 1, 78,249, 98, 31, 4, 1,180,181,129, 23,234, 54,200,167,114,143, 27, 55,118,155,223, 38, 14,110,179, +116,238,248, 54, 73, 18,190,215, 32, 60,249, 76,146,228,189, 6, 27, 86,253,209,230,143,217,227, 41, 57, 11,245,157,143, 74,164, +185,163, 0,190, 34, 41,110, 26, 77, 16, 94,234, 51,145,165,179,188,236,124,246,253,219,247,107,113,121,216,215,226,194,215, 69, +197,149,111,139,138,171, 93,202,138, 11,109,242,139,153, 85,210,179,209,227,188,110,221,235,101,231, 51,172,205, 32, 68, 62, 9, +162,224, 13,124, 11, 22, 21, 1, 88,255, 40, 1,206, 36, 3,112, 60, 75, 0, 15,127,199,130, 40, 0, 19,186, 4, 91, 70,223, 52, + 4, 90, 56, 22,106,220,221,187,119,135, 50,104,129,150,250, 29,223,131, 56, 1,153,238,132, 43,129, 86,227,194,113,131,212,233, +154, 20,121,239, 62,129,150,222,115, 51,160, 69,208, 35, 86,182, 53, 12, 45, 74,190,247, 16, 96,115, 48,248,225,171, 14, 46, 48, +165,151,207,102,218,184,252, 47,227,123,250, 30,223,233,149,157, 0, 75, 28,152,163,132,161, 85,124, 4, 78,217, 88,139, 58,114, + 7, 28, 94,190, 22, 62,216,214,214,170, 85,107, 45,210,171,129,170,182,174, 34,101,251, 12,107, 35,215,164,115,202,238, 37, 70, +186,200, 68, 22,126, 70,118,160,101,221, 51, 60,164, 89,129,251,119,252, 37,222, 79,150, 72,224,172,182, 16,199, 70,240,127,178, + 36, 9,196,154, 63,167, 19,104,241,188, 46,183,154, 81,254,214, 27,124,244,226,217,249,142, 30, 77,170,234,170,148,203,116, 37, + 99,218,248,139,113,216,181, 34,205,146,129,255, 83, 36, 75,210,102,141,255,244, 54,137, 19,196,107, 26,158,124, 38, 77,156,160, +233,222,237,127,181, 73,149, 34, 73, 27,189,239,100, 78,155, 96,118,229, 50, 25,174,100,201, 16,175,187, 3,180, 94,254,234, 41, +115,138, 36,219, 3,231,143, 17,135,234,102, 19,115, 42,166, 21,141,114, 36, 19,255,126,247,177,184,246, 67, 53, 69,178,149, 34, +110,244, 77,111, 10,208,162, 90,144, 18, 43, 53,200,194,177, 64, 1, 23, 46, 92, 8,192,185,139, 1, 91,183,110, 13,192,153,141, + 1,240, 96, 30, 0, 47,223, 91, 60,168, 17, 67,168, 14, 41,201, 82, 66,250,232,119,113, 36,203, 48, 28, 91,213, 31,135,190,247, +171,144, 53,230, 29,169, 86, 44,159,249,221, 59, 95,125,245,213,112, 95, 95,223,126,184,134, 88, 5, 90,181,115,191,115, 95, 77, +179,110,222,119, 21,160,197,231, 56,223,116, 56, 64, 97,127,210,172,151, 47,198,125,171, 64,107,239,184,186,226,200,175, 13,196, +153,153,141,197,149,121, 95,138,135,219, 39, 40,224,171, 89,209,216, 15, 27, 54,108,216, 15,121,239,254,211, 79, 63,125, 63, 96, +192,128, 94,106,224,164, 51,233, 40, 64, 11,231, 18,254,132, 3,237,187,227, 40,176,159,244,128,214, 63,131,106,138, 45,195, 63, + 19,251,198,215, 21, 15,255,234,172,124,203, 42,208,130,180, 49, 4,208,226,255,107,215,174,173,197,241, 77, 4, 90, 35, 61,204, +167,145,101,114,116,242,249,118,130,162,136,168,247,200, 12,180, 60,183, 2,127,127,255,178, 8,130,129, 49, 9,128,254,219,177, + 82, 12,235,211, 74,100, 76,151, 66,164, 75,157, 92,164,253, 32,153, 18,210,165, 73, 46,122,119,109, 36, 86, 47,155, 98, 5,104, +185, 63,108, 4,180,172,126, 71,175, 4,180,209, 34,208,170, 82, 38,251,162,204, 25, 82,181,201,144, 46, 69,155, 12,169, 93, 1, +191,123,119,107,210,102,213,210,169, 86,128,150,199,124, 18,104,253,183,125,121,155,225,125, 91,183,209,251, 78,245, 10, 57,253, + 42,151,206,112, 37,107,186, 56,221,188,219,223, 28,106, 86, 56,240,105,209, 60, 55,206, 79, 31, 44,118,213,204, 40, 42,125, 16, + 55, 8,105,226, 54, 41,153,251,193,205,145,173,196,185,150,121, 69,241,148,113,175, 90,161, 19, 25,226,208, 6,139,234, 66, 41, +201,146, 32, 43, 32, 32, 96, 55, 22, 1,187,113,192,112,192,130, 5, 11, 2,182,108,217, 18,128, 67,213,119, 50, 62,202,101,197, +201,108, 87, 74,157, 62,254,248,227, 17, 99,199,142,109,191, 98,197,138,230,160,213, 28,135, 21,247,229,243,122,245,234,141,192, +113, 67,237,113,116, 86,123, 28,218,222, 28, 82,227,190, 58, 64, 43, 4, 11,165, 68,139,128, 74, 77, 19,128,234, 30,129, 86,157, + 60,209,239,147,230,182,109,219,154,147,102,253,252, 49,239,233, 0, 45, 45, 77, 5,228, 28,156, 84,255,255, 82,173,191,190, 22, +226,191,217,110,160, 53, 99,198,140, 86, 0,155, 13, 64,179,193,148, 41, 83,186,233, 0, 45, 53, 77, 5,104,225,112,251, 30, 88, + 68, 54,152, 48, 97, 66,136,248, 82,162,181,110,200, 39,255,255,222, 1, 63, 61,160,229,166, 73,213,225, 15,101,124, 20,105,214, +216,186, 73, 31,222,186,117,107, 45,193, 21, 3,164,141,107, 81, 55, 4, 88, 2, 99,162, 25,208,138, 12, 77,210,201,163,195, 1, +175,113, 64,139, 69, 92,132, 35,147,234, 80, 45,229, 14,105,163, 37, 1,150,228, 22,129,214,222,173,254, 98,241,140,159,196, 31, + 83,127, 16,243, 39,247, 16,126, 19,186,137,223,198,118, 17,211, 71,117, 20, 83,134,183, 23, 43,254, 24,239, 21,160,101,245, 59, +122, 53, 41,109,180,202,151,248,224, 46,242,217,102,254,228, 31,218,204,157,216,173,205,111, 99,186,181, 65, 62,219, 76, 29,222, +190,205,242, 63,198,123, 5,104,237,222,234,223,102,209,244,222,109,244,190, 83,190, 88, 42,197, 70, 11,249,185,226,181, 22,231, + 16,178,204,129,134, 31, 22,185,115,110,214,104,177,165, 82, 90, 81, 44,105,108, 69,125, 91,187, 72,206,219, 55,166,252,160, 0, +173, 15, 63,136,167, 86,233, 90,166,251, 58, 70,164,193, 59,109,178, 8,180, 36,200,250,238,187,239,206,226, 48,225,231, 12,144, +230,156,133,138, 63,128, 1, 7,149, 7,224, 28,188,253, 40, 7,193, 39, 3,143, 80, 50,186,218, 18, 56,181,104,209,162,191, 4, + 89,171, 87,175,110, 62,106,212, 40, 5, 80,181,111,223,190, 63, 1,209,238,221,187,155, 67, 53,215,124,250,244,233,150,129, 22, + 1, 21, 0, 76,123, 2, 55,210, 84, 3, 45, 2, 55, 73,211, 14,208, 58, 54,181,161, 74,125, 24, 18,104,205,154, 53,171, 21, 65, + 22,232, 54, 0, 31, 44, 1, 45, 72,240,186, 19,104,225, 64,111, 93,160,181,113,104,173,255,127,239,200, 66,143, 64,203,197, 96, + 69,138, 5, 0,172, 4,128, 99, 69,138,245,237,183,223,174,109,217,178,165, 2,180, 92, 97,228,235,216,206,156, 60, 57, 28,120, + 21, 28,208, 98,145, 72, 8,180,152,101,125, 27, 45, 89, 56,162, 73,198, 34,208,218,181,105,177, 33,200,154, 48,248,107,177,116, +238, 72, 17, 63, 94,108, 51,213,161,187,174,140, 36, 90,158,190, 51,233,151,118,238,239,232, 85,186,180,209, 42, 91, 44,213, 3, + 61,144, 53,113,104, 59,216,104,141,242, 10,208, 10,216,180, 72, 23,100, 17,204,125, 84, 60,245, 11, 27,173,194, 41,110,189,138, +198,249,182,127,179,115,227,186,247, 78,110,248, 83,252, 92, 62,153,168,157, 61, 17, 1,133,207,247, 95,212,185,183,122, 84, 55, +225, 91,248, 29,241, 89,246,196,247,223, 20, 30,113,119, 33, 13,223,105,147, 69,117, 33, 37, 89, 4, 88, 82,191, 31, 45,218, 59, +193, 21,234,119,187, 90,174,110,183,171,159,182,236,127, 53, 74,148,104,193, 22, 15, 2, 87,128,214,215, 95,127,221, 95, 2,162, +245,235,215, 55, 31, 51,102,140, 2,168,186,117,235,214,159, 82, 39,130, 44, 72,184,154,207,156, 57,211, 22,208, 2,128,105, 79, +144, 69,154,106,160, 53,119,238,220,246,146,166, 29,160, 69,149, 97, 8, 91, 45,218, 68,185, 84,135, 4, 90, 4, 89,251,246,237, +107, 0,137,153, 37,160,213,161, 67,135,238,144, 52,133,146,128, 73,137,214,214, 17,159,253,255,123,199,255,180, 13,180, 8,182, + 78,157, 58,181, 22,170, 82, 55,208, 98,189,168, 6,229, 55,165,137, 58,229,112, 56, 16,102, 14,104,177, 72, 36, 5, 90, 18,108, +233, 75,180,212,170,195,237,107,231,235, 74,178, 42,149, 45, 32,178,102,205, 34,202,150, 42, 40,222,139, 23,251,138,137,237, 83, + 8,160, 21, 53,106,212, 89, 56,128,247,132, 12, 41, 83,166,124, 86, 48,127, 94,145, 55,119,118,241, 97,209,156, 33, 36,102, 4, + 89,227,127,110, 43,254,152, 57,152,223, 81,239,238,113,211, 84,108,180,202,100,188, 82,171,114,222,197, 90, 73, 86,166,188, 37, +214, 36, 74, 87,224, 88,146, 12, 69,142, 69, 73,152,245,176, 79,194, 28,235,101,136,154, 56,215, 40,230, 91,175, 53,232,149, 39, + 73,146, 68, 45,210,231, 46,179, 59, 93,254, 26,143,115, 22, 44,189, 74, 45, 49, 35,152,171, 91, 35,223,236, 74,165,211,107,109, +180,194,220,216,156,132,246, 56,208,167, 93,235,160, 39, 15,131,196,154,165,243, 69,197, 28,233, 20, 80,245, 75,247,142, 65,207, +159, 61, 21,219,182,108, 18,149,114,166,191,107,143,226,235, 27,155, 18, 45,105,248, 78,155,172, 53,107,214,132, 0, 90, 49, 98, +198, 18,191,175, 59, 39, 22,111,185,162,220,249,223, 12,104,169, 93, 56,124,148, 37,198, 29,170, 11, 41,201, 34,200,170,152, 45, +182,219, 70,171, 82,246, 56,183, 41,201, 34,200, 2,112,210,179,209, 10,193, 56,169, 58,164, 68,235,135, 31,126,248, 69,210,164, + 45, 22, 85,135,180,213,130, 13,213, 80, 73, 19, 64, 75,207, 70, 75, 75, 83, 1, 57, 87,255,128, 20,107,219, 80,168, 12,103,189, + 8, 46,160,245,101,177, 56, 15,251,246,237,219,135,146, 44,130,172, 95,127,253, 85,207, 70, 75, 77, 83, 81, 29,210, 54,139,106, +195,113,227,198,133,136, 47,129,214, 61,255,111,133,216, 59, 69,136,195,127, 8, 97, 17,104, 81, 85, 40, 37, 90, 70, 64,203, 1, + 91,175,111, 95,115,114,246,242, 57,160, 2, 90,106,144, 18, 89, 84,135,158, 25, 22,218, 70, 43,110,224,230, 85,179, 93,234,194, +206,110,117, 33,193, 79,206, 28,217,149,113,123,196,136, 17,226,157,104,209, 30,231,201,147, 39, 14,193, 9, 64,212, 40,124,101, +189,235, 30,234,131, 46, 96,179, 62, 48, 48, 80,200,112,254,252,121, 1,245,135, 66, 47, 91,230, 15, 66,124,135, 32,107,204,128, + 86,194,239,215,126,134, 64, 75,177,209, 2,208,250,180, 82,238, 69,191,141,233,236, 86, 23, 18,252, 16,100,109, 60, 46,132, 94, + 32,224, 50, 2, 90, 4, 97,124, 47,193, 88,158, 74,149,226, 68, 77,152,109,255,183,125,127, 83,104,165,206, 83,245,201,228,161, + 29,190,166, 36,139,223, 25, 63,184,109,155, 79,171,229,243,171,244, 97,122,199, 70,235,229,247, 75,229,139,141, 27, 53,186,205, + 54,180, 99,199, 14,145, 38,117,234, 39,240,165,182,189,117,235, 86, 79,229,179,148, 41,222,191,241,138,178,230,245,207,210,230, + 10,210, 26,101,119, 33,237,176,104,147, 69,117, 33, 37, 89, 4, 85,181,191,236,250,124,212,220,173,143,198,204,223,241,104,244, +188,173,143, 62,253,162,211, 99, 62,143, 18, 37, 42,221, 30,232,170, 14, 61,237, 44,180,185,235, 80, 23,104,133,115,215,161, 46, +208, 82,164, 89,180,205,250,235,155,255, 7, 60,179,184,235, 48, 20,208, 50,218,165,104, 99,215,161,155,166,218, 70,107, 76,157, + 36, 15, 37,216,210,147,104,169, 64,240, 75, 59,174,195,235,141,210, 33,232,112,192, 75, 28,136,228, 54, 90,101,193, 6,233, 17, +222, 92, 90,157, 40,126,220,192,117, 43,166, 65,194, 20, 18,100, 17,252,228,203,153, 94, 1, 89, 18,108, 69,137, 18,229,111,130, + 45,130, 44,215,234,108,189, 30,207, 93, 96,172, 55,128,216,124,164, 89,132,201,240,250,196,137, 19, 5,193, 22,175,172, 25, 83, + 41,182, 95, 82,146, 69,144, 53,178,111, 11, 49, 99,220,143,226,189,184,250, 18, 45,183,141, 86,241, 15,238, 74,155, 44, 9,126, + 18,165,201,175, 0,173,197,155,206,139, 54, 61,199, 8,159,132, 57,111,248, 36,202,177, 81, 13,162,116,219, 6, 64, 22,211, 49, + 30, 65, 86,148, 68,185,254,150, 32,139,247,180, 57,138,109, 85,131,172, 49,253, 91,183, 41,231,216,104,121,169,155,133,137, 76, +226,164, 73,147,222,129, 74,230, 57, 12,185,159,103,202,148,233, 17, 85,107,216,153,247, 8,234,160,231,117,235,214,125, 30, 39, + 78,156, 59,160,156, 56, 76,212, 95,179, 68,220, 69, 88,180,104,209, 45,116,225, 0,155,169, 0,244,171, 0, 24,124, 7, 80, 93, + 72, 9,214,136, 57, 91, 30,207, 88,186,243,182,223,202,189,183, 71,204,248,251,230,168,249,187, 46,240,121,202,146,109,199, 26, + 21, 69, 11,166,212, 59, 1,181,239, 96,171, 53,124,200,144, 33,253, 70,143, 30,109, 75,162, 5,154,195,212,187, 11,165, 49, 60, +119, 49,246,238,221,187, 63,105, 90,145,104,209, 79, 22,193, 20,119, 23,202, 64, 41, 22, 3,159, 55, 45, 30,255, 42,104,246, 3, +205,238,240, 93,245, 61,164,114,150, 36, 90, 48,134,255, 9, 82,173,238,189,122,245, 10,235,174, 67, 55,123,181,238, 29,184,187, + 80, 74,180,154, 52,105,178, 22, 59, 44, 21, 27, 45,237,229, 26,164, 95,179, 22,231,100,199,225,192, 43,231, 64,100,145,104, 89, +243,159, 37,217, 9,255, 86,199,231, 97, 23,215,202, 63,198, 10,255,121, 35,197,226,217, 67,197,130, 25,131,196,220, 95,251,138, +105,163,123,138, 92,217, 51,132, 2, 91, 72,187,209, 12,104, 17,108, 65,109,152,232,157,119,222,217, 49,123, 54,118, 9,225,194, +224,171,220,115,229,200, 20,226, 59,179, 38,252, 36,166,143,233, 41,126,241,109, 43,226,197,141,117, 92,175,170,165,141, 86,185, + 98, 31, 60,240,135, 45,214,162,217, 67,219,252, 49,125, 80,155,185,147,251,182, 73,156,190,176, 2,180, 8,178,120, 39, 72, 34, +104, 34,120,210,113, 67,241,127,242, 18,104, 1,148,105, 65, 86,138,204,197, 15,250, 77,253,249, 91,245,119,126,155,216,187,141, +219,143,150, 99,163,245,178,123,100,226,152, 49, 99,254, 11, 73,214, 78,186, 59,160,113, 56, 37, 61,244, 39,117,249,242,229,128, + 75,151, 46, 41, 62,165, 22, 46, 92,184,131,241,222, 20,176, 69, 63, 90,157, 58,117,218, 74, 23, 14,148,106,209,240,189, 66,131, +239,175, 80, 93, 56,106,238,182,199,115, 86,236,185, 61,126,238,250,155,147, 23,238, 56, 48,246,143,189,167,249,252,131,210, 29, + 40,113,214,189,212,170, 67,186,112,144, 59, 1,105,164, 78,117,161,116,239, 80, 41,123,236, 27,203,151, 47,111,127,230,204,153, +230,216,217,104,106,163, 5, 15,239, 79,170,101,137,250,188, 78,190, 56,129,106,154, 95, 20, 79,124,145, 82,174,186,249,227, 6, + 46, 89,178,164,253,201,147, 39,155,147,102,211, 18, 73, 46, 50, 62,211,121,104, 72,205,232, 39, 11,238, 24,250,115,119, 33,237, +177, 96, 80,223,170,127,255,254,125,248, 28,128,169,255,226,197,139, 91,129,102,131,211,167, 79, 55, 64, 62, 45,217,104,181,109, +219,182,199,129, 3, 7, 26,248,249,249,133,123,215,161, 30,208, 66, 93,173,133, 36,127, 45,212,164,107,199,143, 31,175, 11,180, + 28, 53,226,203, 30, 62,156,239, 69, 18, 14, 68, 38,160,101,221,143, 86,156, 56, 49, 42,199,127, 47,246,113,250,201,114, 7,216, + 73,209, 86, 74, 9,113, 99, 95,129,135,248, 32,181,100, 11, 21,118,195, 12,104,105, 65, 86,247,238,221,161,210,136,242,140,233, + 64,239,177,242,173,144,223, 9, 36,200,138, 19, 35, 70,101,189, 6, 65, 27,173, 15, 11,167,184,156, 62,245,123,191,211, 87,150, + 12, 9,240,155,118, 89, 46,201,212, 61,181, 68, 74, 13,182, 60, 75,180,114,222, 80,167,139,154, 48,235,190, 68,137,226,183,208, +126,135,223,202,152, 38,222,116,230, 67,227, 71, 43,146,180,225,200,155,205, 24, 49, 98,140,223,188,121,243,142,199,143, 31, 43, +224,138,192,138, 1,147,182,226, 33,125,195,134, 13, 1,171, 86,173, 10, 56,123,246,108,192,228,201,147,119, 48,126,228, 45,109, +136,156, 43,158,225, 11, 20, 40,176, 5,139,134,157, 43, 87,174, 12,168,221,118,160, 34,209,162,218,144,146, 44,130,172,197,155, + 47, 47, 39,208, 50,147,104,185, 40,119,161, 27, 7, 0,149,225,234,157,128,180,159,226,115,248,152, 26, 14,177,126,123,124,171, +253,185,115,231,154, 3,188,154, 2, 45,208,109,107,133, 38, 65,150,164,201,248, 72, 71,239,243, 70,151, 98, 83, 69,227,117,186, +112,144, 70,239, 0, 93, 10, 64,250,254,251,239,187, 67,130,164,128, 44,208,108,128,124, 90, 2, 90,244,187, 69,160, 53,127,254, +252,112,239, 58,212,122,134, 71, 65,230, 80,146,181,103,207,158,181,165, 74,149, 34,200,250, 3, 33,132, 64,171, 76,153, 50, 28, +160,123,243,249, 27,210, 70,157, 98, 56, 28,240, 22, 7, 34, 11,208,178, 87, 94,179, 51, 2,249,158,234, 66,170, 13, 37,216,130, + 81,171, 50,112,224, 75,106,213,161,219,161,153, 30,200,130, 26,113, 14,226,111,144,233, 60,125, 87, 85, 2, 55, 77,218,104,149, + 41,154,242, 88, 54, 56, 10,213,166,165,234, 79, 1, 90, 58,146, 41, 9,182,244,104,202,116,158, 36, 97,218,111,241,172, 67,230, + 67,227, 71, 43, 34,156,185, 57, 52,255, 95,105,229,155, 55,111,174, 56,238, 84,131, 44, 76,176,110,144, 5, 96, 16, 0,201,169, + 34,241,193,228, 27, 0,149, 27, 29,151,150,215,173,119,123, 93,196, 83,236,151, 86, 71,242,172, 67,186,112,128, 13,150, 98,163, + 85, 11, 54, 89, 35,231, 7,156, 27,243,199,222,147,163, 23,236, 57,245,105,179, 46,119, 13,108,180,180,249, 84,118, 29,114,119, +161,116,183,160,222, 93,216,167, 79,159,254, 18, 16, 93,188,120,177,249,210,165, 75,245,128,214,203,160,169, 0,173,174, 93,187, +118,167, 11, 7,238, 44, 36, 64,146,187, 11, 97, 8,223, 93,130, 44,228,179, 1,242,169, 7,180,212,249, 84,232,193,211,126,247, +195,135, 15,135,146,128,217,216,117,232,169,222,185,241,134, 71,253,244, 66,168,142,240,142, 4, 90,242,238, 2, 90,218,118,245, +210,218, 82, 56,155,191,147,207,112, 50, 80,147,252,109,230,167, 30, 39, 35, 11,208, 42,235, 90, 40, 73,169, 22,255, 27, 95,102, + 64, 75, 26,190,131,194, 70,132, 27, 4, 89, 88, 61,122, 4, 90,176,201, 90, 44,213,133,148,100, 17,100, 65,252,255, 46,129, 25, +141,227,121,183, 11,180,164,141, 22, 84,136,161,220, 76,184,129,150,129,173, 21,192,214, 66, 3,160,181,193,204,182, 75,155, 79, +117, 62,222,148, 73, 60,156,227, 70,132, 15, 20,112,105,208,143,224,137,234, 66, 41,201,146, 32, 11, 46, 4, 2, 36,200,194, 46, +178,128,129, 3, 7, 42,182, 76,216, 85, 22,192,116,111, 88, 29,209, 25,105,144, 20,143,216,216,117,168, 11,138,122,246,236, 57, +132,206, 72,229, 78, 64,236,218, 83,108,177,208,199,135, 80, 93, 72, 73, 22, 65,214,188,121,243, 76, 61,195, 35, 95, 10,120,243, + 50, 77, 9,140,126,162, 51, 82, 74,178,212,187, 11, 81,215, 63, 81, 93, 72, 73, 22, 65, 22, 36, 84,150, 60,195,195,166,235, 39, +170, 13,161,138, 12,235,174, 67,187,109, 94,109, 44, 43,199, 78,173, 52,203, 46, 77, 43,221,214,161,105,133, 75,214,227, 56,252, +180,206,171,176,198,140, 44, 64, 75,219,127, 61, 75,167,205,128, 22, 65, 81, 40, 75, 78,215, 3,190,211,153,200,222, 73,159, 62, +253, 3, 72, 31,132, 26,100,169, 13,228, 1,188,122,219, 5, 90,210, 70,139, 64, 71,155, 86,111,247,160,218,230, 42,117,190,234, +138,191, 37,215,245,255,206,226,146,132,121,218,173,168,253,150, 58, 31,111,216, 36, 30,214,142, 17,225,131, 15,212,128, 67,224, +184,115, 26,108,178,166,193, 30,107, 26, 64,214, 52,168, 11,167, 65, 93, 56, 13, 32,107, 26, 38,204,105,240, 70, 62, 13, 19,239, + 52, 76,162,202,111, 62, 71,186,193,111, 88, 29,133, 0, 90, 81,162, 70,123,154,161, 92,251, 41,153, 43,118,153,152,241,163,246, +147,248, 95,181,179,141,109,158,241,121,233, 2, 45,121,198,161,213, 59,193,148, 7,126, 42, 64,203,110, 48,161,169,123, 54,161, +222,121,133,175,234,172,195, 48,116, 26, 7,104,133,102, 90,132,143, 33, 97,168, 39,189, 36, 78, 62,189,196, 72, 15,100, 34, 19, +208,178,110,163,101, 6,180, 84, 18, 45,130, 42, 25, 54,240,183,198,189,131,187, 17,226,249,247, 56,181,254, 20,238,227, 40,201, + 50,251, 70, 40, 85,160, 14, 40,162,141, 86,217,162, 41,143, 80,117,103,133,158,226,170, 33,113,174,153,169,114, 87,125, 16, 53, + 81,174, 95,244, 38, 8, 9,208,212,126,183,180,254,183,180,223,202,155, 53,126, 27,230,131,170,204, 55,108, 18, 15,107, 23,138, +240,193, 7, 27, 42, 62,194,236, 84, 1,106,195, 10, 48,124,174, 0,117, 87, 5, 28, 65, 83, 1,198,213, 21,224,231,169, 2, 12, +142, 43, 12, 26, 52,168, 2, 64,150, 18,248,123,227,198,141, 21,152,238, 13,172, 35,186,109, 32,136, 98,208,186,112, 48,122,167, +173,163, 79, 92, 0,135,109,216, 78, 96, 58,121,189, 12,154, 84,193, 53, 11, 67, 96, 58,189,124, 26,209, 83,226,215,200, 30, 45, +144,234, 67,189,192,119, 94,108, 75,210, 70, 75,221,231, 34,188, 31,133,181,131,107,210, 57,249,244, 18, 35, 93,100,222,102,126, +234,113, 50,178, 0, 45,239,182, 2, 27,212,222,230, 6,227,148,221, 70, 67,177, 16,213,225,167,103, 38,121, 58,207, 80,239,157, +195, 79, 11,141,206, 70, 20,135,159, 54,152,101, 33,170,195, 79, 11, 76,178, 17, 37,178,240, 51, 50, 3, 45,173, 52,235,165,109, +108,137, 44,149,235,228,211, 70,143,181, 16,213,225,167, 5, 38,217,136,226,240,211, 6,179, 44, 68,117,248,105,129, 73, 54,162, + 56,252,180,193, 44, 11, 81,223,102,126, 70,102,160, 37,243,174, 11,176, 88,169,122,193, 66,123,112, 71, 49,162,225,233,185, 25, +125,135,166,126,189,132,181,190, 28,126, 58,252,180,218, 6,156,190,105,204, 1,171, 60, 84,199,115,248,233,240, 83,143, 3,111, +115, 91,146,252,176, 50,159, 69, 38,213,225, 75,147, 98,169, 27,212,219,140,204,157,178,155, 77, 47,246,222, 59,252,180,199, 47, +179,216, 14, 63,205, 56,100,239,189,195, 79,123,252, 50,139,237,240,211,140, 67,246,222, 71, 22,126, 70,102,137,150,163, 58, 52, +105,147,145,165, 17, 58,249,180, 55,184,152,197,118,248,105,198, 33,123,239, 29,126,218,227,151, 89,108,135,159,102, 28,178,247, +222,225,167, 61,126,153,197,142, 8,126, 70,102,160,101,198,175, 8,123, 31, 17, 21,241,106,104,166,173,245,163, 79,234, 90, 15, +148,144,166, 86,111, 11, 28,123, 53,249,180,144, 49, 77, 20,119, 62,177, 27, 52,154,157, 80,176, 96,171,232, 62, 5,123,143,142, + 95,102,224,153,168, 5,251,124,171,162,107, 84,246, 40, 73, 51, 22,108,154, 46, 87,233,237, 41, 50, 23,189,150,165, 96,197, 3, +137,211,230,109,135,116, 81, 84, 33, 1,206,240,203,129,255,241, 85,207, 72, 58,210,241,211,126, 85, 24,166,112,202,238, 69,102, + 58,109,201,197,204,132, 57,211,248, 36,202,213,219, 39, 81,206, 97,238,144, 32,199,151,161, 88,205,103,234, 56,137,114,246,195, +217,177,105, 60,244,119,217,159, 19, 29, 63,126,188, 0,226, 37,210,244,113,190,215,123,167,254,180,211,230,223,206, 54, 31,153, +129, 86, 89,100,222,186,123, 7, 91,245,155,229,243, 12, 62, 25,234,244,241, 73, 95,231, 36,238, 60, 90, 34,108,157, 37,211,103, + 31,248,100,168,251, 57,194, 64,208,249, 59,110,174, 47,174, 69,205, 92,255,128, 79,166,122,236,168,246,105,102,168,211, 22,116, + 2, 13,130,218, 13,131,181, 73, 60,245, 39, 15,119,156,122, 38,142, 95,121, 46, 20,176,101,126, 89, 25, 40, 98,112,208,135,203, +139,142,241,226,197,251, 5,247,174,248, 95,207, 53, 48,233,125,193, 10,205,168, 72,216, 50, 94,220,184,139,114,167, 76,124,246, +189,232,209, 54,227,255, 32, 43, 52,237,131, 44,223,233,223, 13,251, 75, 60,121,250, 92,196, 41, 53,240,188,135,129,151,175,162, +164,206, 86,114,105,215, 62,163,238,158,185,124, 71, 60,123, 30, 44,206, 5,222, 21, 61, 6,140,123,244, 65,182, 18,127,195, 5, + 67, 84, 6, 56,182,253, 18, 14, 72,251,226,222,140,255,225,194, 65, 14,218,122,101, 79, 9,186,234, 1, 63, 46,254, 23, 71,104, +236,186,243,191,167,203, 10, 63, 35, 5, 77,156,188,144, 42,101,202,148,190, 56,150,103, 39,239,252,239,133,178,155,183,114, 15, +125, 19,117, 55, 9,175,233, 35,202,206, 93,251, 77,143,117, 20, 43, 86, 44,186, 88, 80, 6, 55,215,111, 43,121,182, 82,239,161, +232,152,124, 43, 76, 52, 95,105, 29, 1, 48,253,125, 80, 4,168,131, 2,168,180, 23,158,133,142, 7,128,246,255, 75, 93,246, 40, +236,179,236,187,184, 58,179,238, 57,190,201,254, 45,239,218,119,170,126, 46,169, 70, 62,126, 90,105,121,214,226,188,205,101,215, +227, 80,100,177,209,178,119,168,180,105, 91,200, 89, 39,174, 79,134,218, 95, 2,196,172, 47,219,120, 80,240,220, 85, 7,133,223, +154, 83, 2,255,143,106,210,154, 55,152,116,205, 98,250,100,172, 59, 52,111,173,159,158, 15,152,182, 81,172,218,121, 65, 28, 56, +123, 95, 28, 56,255, 88,124, 59,241, 8,105,110,179, 77,147, 9, 0,178, 78, 4, 62, 21, 27, 14, 63, 18, 27,143, 60, 18,155,142, + 62, 18, 91,142, 61, 18,127,239,123, 64,154,106,255, 55,140,109,158,207,212,181, 30, 19,100,213, 24,113,159, 64,235,177, 41,143, +204,105,166, 79,150, 44, 89, 95,120,220, 30,190,108,217,178,233,171, 87,175,246,195,125,214,176, 97,195,126,137, 29, 59,118,127, +208, 47,162,243, 13,179,124,166,205,156, 58,213,182,191,134,255, 36, 2,151, 78, 19, 55,126, 31, 37,174,253, 54, 64,108,234,213, + 84,228, 74, 28,235,186, 65, 57, 77, 37, 90,101,203,150,125,135, 65, 2,177, 23,146,172, 23, 32,139, 23,239,248, 79, 48,103, 56, + 72, 38, 78,159,255,139, 14, 61,127,185,251,228, 89,176, 56, 21,248, 72,236, 60,126, 95,185, 63,122, 18, 44, 58,246, 26,121, 47, + 89,134,130,109,232,159, 12, 4,102, 3,104,177, 29,205,150,131, 50,126, 19,108,105,203,222, 23,207,158, 33, 60, 71,248, 13,192, +172,113,197,138, 21,127,130, 39,112, 95,248,213,242,229,253,147, 79, 62,249,137,207,241, 62, 55, 66,116, 27,252,100,220,220,175, + 59, 77, 0,170,216, 56,126,167,109,190,124,249,246,124,243,205, 55,193,127,255,253,183,192,185,142,226,175,191,254, 18,237,219, +183, 15,230,115,190,103, 60, 27,101,183,208,180, 13,163,104,235,136, 3, 15,193,176,213, 32,227,171, 63, 96,214,230,221,190,147, +145,200,170, 33,170, 25, 77,163, 2,122,250,150,150,230, 65, 28, 81, 22,200, 0, 80,161, 4,180, 39, 37,192,151,155, 18,162, 71, +143,174, 4, 56,209,229,243, 19, 22,234, 40, 27,226, 80,218,107, 53,100,247, 72,211, 5,160, 32,157,250,219,178, 68, 11,113, 9, +186, 52,128, 44, 4,208,114, 45,144,184,224, 83, 28, 91,243,174,227, 23,209,253, 14, 81,148, 69,150,171,159, 27,142, 33,225,105, +152,174,180, 97,173,119, 79,159,118,104,122,161, 98, 76, 72, 68, 22,160, 85,214, 53, 6,169,165, 90,182,185, 19,197, 39, 83,237, +178, 62,233,107,207, 72, 87,166, 93,208,240, 89, 27,197,234, 93,129, 98,217,174, 32, 49,234,175,187,162,210,183,243, 8, 96,250, +104,168,122,110,132, 25,234, 21,126, 39, 75,189, 67,195,253,118,138,128,147,143,196,180,245,247,196,128,197,183, 69,207,249,183, + 68,175, 5,183,196,215,227, 15, 11, 72,202,120, 8,171,157,129,247, 69, 92,128,169,181,135, 30,138,190,139,110,139,254,160, 57, +104,233,109, 49,216,255,142, 24,186,252, 78,216,128, 86,170,170,251,191,248,121,135, 40,250,221, 54,225,131,223, 22,184,231,169, +236,185,178,102,205, 58, 24, 96, 96,242,200,145, 35,253,126,250,233, 39, 63,120, 48,247,155, 56,113,162,223,220,185,115,121,159, +130,163, 98, 8, 36,146,218, 40,123,142,234,133,243,222,186,184,118,153, 56, 51,168,141, 56, 92, 63,135, 56,214, 48,187, 56,211, +170,136,184,244, 93, 89,113,174,101, 30, 81,244,253,184,119, 65,239, 3, 35,154,106,137, 86,206,156, 57,223,197,193,197, 77, 33, + 33,153,136, 51, 2,151,148,173, 90,127, 81,137, 6,195, 38,103,106,184,228,251,120,213,230,172,232, 52, 98,141, 26,100, 77, 87, +192,215,255,175, 80,101, 79,147,171,244,230,147, 23,110,137,147,151, 31,137, 47,199,158, 23, 62,117, 14,136,166, 99,206,137,189, + 39,239,138,128,195,129, 34, 85,246,146,123, 52, 64,235, 7,254, 87, 13,192,106,154, 84, 69,224, 44,233,199,193,204, 68,204,152, + 49, 5, 0,234, 20,120,136,247,213,134,163, 71,143,250,226,232, 29,223, 18, 37, 74,252,128, 52,181, 60,241, 51, 86,172,216,103, +217, 81, 98,197,142,125, 31, 71,187,244,129,183,249, 80,244, 72,223, 14, 77,126, 47, 65,130, 4,191,162,190,167,120,147, 38, 78, + 90,248,187,126,253,250, 79,113, 84,142,128,122, 70, 60,120,240, 32, 84, 56,114,228,136,192, 97,218,226,243,207, 63,127,202,248, + 54,218,146,133,230,173, 27, 37, 68,189,187, 36, 89, 4, 89,150, 46,131,248,102, 19,217,107, 9,180, 0,176,206,145,247,168,115, +129, 35,130, 4,142, 53, 82,234, 2, 71, 66,137,209,163, 71, 11,158, 17, 59,116,232, 80, 49,100,200, 16, 1,103,186, 34,110,220, +184, 23,117,152,164, 45,123, 54, 20, 54, 13, 66, 90,215, 61, 53,238, 31, 32,164, 68, 72,129,144, 28, 33, 25, 66, 18,132,196, 24, + 67, 8,204,180,215,255,105, 74,160,133, 59,192,248, 95, 89,178,100, 57,226, 41, 48, 14, 1,150, 9,208, 74, 68, 9, 22, 62, 74, + 71,214,203, 93, 64,235,182,235,191,218,193,245,109,215,187,229,124, 71, 9, 23,238,236,215,242, 50,171,119, 75,109,234,101,183, +249,176,100,202, 66,189,123,131,108,100,225,167, 94, 89, 21,160,133,246, 82, 4,161,134, 42, 84, 84,253, 46,138,223,197, 92,255, +213,207, 25, 95,254,151,119,210,145,180,152, 78, 77, 87, 79,192,225, 13,254,251,248,224,104, 18,101, 37, 40,239,186, 84, 51,212, + 89,241,213, 79,179,197,226, 13,167,197,210,157,119,196,144, 63,239,136, 62, 0, 49, 3,150, 0,196, 44,185, 37,222,203,223, 42, +216,135,106, 68,171, 87,250,218,157,243,126,210,231,217,206,163,183,197,140, 13,247,197, 55,211,111,136,150,227,207,136, 79,122, +173, 23,197,154,207, 20,105, 42,254, 36,162,102,105,180,215, 39,125,221,210, 86, 73,134,136, 7,160,245,239,193,135,194,247,143, +219,161,192,150,142, 68,203,252, 19, 73, 63,156,215,103,201,195, 23, 18, 45,252, 54, 79, 96, 24, 35, 15, 6,179,159, 49,248, 78, +249,241,199, 31,253, 58,118,236, 56, 13,147,112, 87, 12,138,253,211,165, 75,215,113,240,224,193, 19,112, 38,164, 95,131, 6, 13, +120, 84,140, 85, 36,159,251,147,226, 5,238, 93,223,185, 94, 28,233, 90, 91,236,171,149, 73, 12, 44,242,190,168,150, 38, 94,240, +183,121,146,138,163, 95,228, 20,151, 90,229, 21,171,106,103, 21,209, 95, 28,228,173,123, 73,160,133, 1, 53,117,230,204,153, 23, +248,250,250,110,198, 17, 55,187,174,220,126,190,111,236,138, 43,103,227,212, 88,252,204,167,194,239,162,225,192, 45,226,194,181, + 32,209,113,196, 63,148,100, 41, 32,139,105, 61,241, 36, 69,150, 98,151,159, 60, 13, 22,219,143,129,127, 0, 89,255,236,189,165, +220,151,109,185, 36, 78, 92,188, 39,146,103, 44,242, 16,233,103, 35,240,236,194, 89,188,243, 63, 85,137,184, 39,208,208, 14, 5, +180,224, 9, 94, 23,104, 93,187,118,205, 23,135, 5,251,226,252, 67, 95,208, 96, 48,188,240,173,167,193,128,110,113,227,198, 11, +254,243,207, 63,199,220,184,113, 67, 23,104,217,161,201,143, 1,176,222,106,221,186,245,189, 74,149, 42,157, 34,168, 6, 0,234, +167, 5,132, 56, 0,217,119,205,154, 53,190, 43, 87,174, 52,205, 39,105, 22, 47, 94, 92, 60,125,250, 84, 60,123,246, 76, 0,112, +234, 2,173, 71,143, 30, 9,156, 5, 41, 64, 91, 48,126, 56,218,108, 88,147,134,146, 80,153,168,223,244, 36, 90, 30,191, 29, 70, +213,161, 33, 77, 23,216, 35, 6, 8,165,238, 36,160, 71, 66, 75,106, 74, 2, 45,156,197, 40,160,194, 21,169, 83,167, 22, 25, 50, +100, 16,217,178,101, 19,185,115,231, 22, 5, 11, 22, 20,197,138, 21, 19,165, 75,151, 22, 31,125,244,145,232,223,191,191, 17,208, +210,230, 83, 2, 45, 74,120,163, 97,204,232, 9,233, 55, 79,219,120, 26, 39, 78,156, 51,200, 95,111, 60, 87, 22, 60,200,127, 66, +220,244,128,214,255,105,170, 64, 19, 1,150, 27,177,234,252,120,248,240,161, 96, 28, 3,160,229,166, 73,155, 44,242, 78, 69, 98, +157, 7,186,234,119,147, 92,246, 92, 97,109,107, 78,186, 55,128, 3, 6, 88, 68, 2,173, 26,178,255,189,104,226,194,253, 31, 71, +251,245,144,255,213,207,213,241,212,239,213,191,153, 86,210,117, 61,143, 24, 78, 90, 4, 90,155,107,118, 93, 34, 58,206,186, 41, +186,250,221, 20, 61,230,189,144, 58,245, 89,120, 91,124, 57,116, 7,165, 68,234, 51, 14, 61,103, 52, 67,157, 82,249, 63,239,247, +252, 16,212,131, 93,230,220, 20, 95, 77,186, 38,138,183,254, 93, 68,203,210,224, 18,108,180,198,249,100,172,211,204, 39, 99,189, + 92, 62, 62,158, 39,111,143, 31,201, 88,251,250,154, 3, 15,197,143,191,223, 10, 5,182, 94, 33,208,202,151, 61,123,246,159,113, +120,237,212,206,157, 59,251,125,245,213, 87, 19, 49, 56,246, 66, 57,106, 35,208, 22,168, 48, 64, 78,119, 2, 45,172,114,103, 97, + 0,165, 84,203,236,202,215,181, 89,163, 7, 71,119,239, 20,235,191,111, 38,182, 85, 75, 39, 42,164,140, 67,149,218,247, 8,180, + 1,251,168, 94,230,132,207, 47,181,204, 43,142, 55,207, 45,114, 36,142,117,201,136, 32,193, 18, 37, 89, 4, 89, 48, 72,223, 25, + 28, 28,188,139, 97,221,161, 39, 71, 9,178, 54,254,119,237, 57, 91,119,224,205,135,162, 94,191, 45, 34, 94,213, 57, 43, 36,200, + 50, 3, 90, 89, 11, 85,218, 39, 37, 90, 95,140, 62,171,128,172, 58, 67, 78,136, 85, 1,151,133,255,198, 99,162, 84,229,122,143, +168, 50, 36,200,114,221,249,155,161,175,203, 56, 94,155,109,242, 38, 24, 19, 90, 48, 36,110,187, 54,109,218, 52, 2,128,195,247, +214,173, 91, 10, 56, 34, 72, 58,127,254,188,239,214,173, 91,125, 33, 61,240,197,177, 60,166, 0, 70, 13,180, 32, 89, 28, 3, 32, +227, 27, 94,154,204, 52, 0,180,178,122,223,191,127,191,232,213,171,215,131,170, 85,171,158,235,210,165,203,194,128,128,128, 65, +204, 35,250,159, 47, 58,187,111,171, 86,173,124, 33,161, 50,205, 39,105, 66,210,168,204, 95, 56,239, 81,240, 12, 81, 6, 2, 46, + 78,136, 4, 88,124, 14, 64, 40, 40,213, 58,117,234,148, 96,124,179,134,228,237,247, 46,176,162,149,104,185,231, 93,215,224,230, +254,172, 65,124,111,103,203,140,158,161,186, 19,109,139, 11, 0, 75, 18, 58,244,221,115,148, 54, 18, 96, 1,104,139,230,205,155, +139,205,155, 55, 43,117,243,223,127,255, 9, 28,180, 45, 42, 84,168, 32,208, 22, 20,160, 5, 27, 77, 61,137,150, 54,175, 10,208, +162, 26, 31, 0,115, 59, 36,154, 15, 72,235,254,253,251, 98,251,246,237,226,211, 79, 63,125, 8,201,216, 94, 36,138,142,120,220, + 76,226, 25,104, 73, 35,119,220, 9,162,216,118,208, 38, 13,131, 2,180, 84,105, 12, 24, 73,137, 22,165, 83,156, 15, 66, 72,173, + 92,207,164, 84, 43,132,180,203, 37, 5, 83, 75,180,204,234,201,121,255, 6,114,192, 10,208,114, 73,173, 20,201, 22,199, 16,189, +187, 17,168,114,141, 57,134,105,240,162, 68, 56,216, 90, 86,210,119,221,249,255,255, 23, 11, 39,131,225, 71,210,213,121, 31, 32, +232,116,133, 14,161,193, 86,238,218, 35, 0,180, 96,179,101,229, 74, 89, 51,118,212,204, 13, 78,108,135, 36,171,195,111, 55,197, +167,131, 14,139,100,165,190, 71,250,186,211, 0,128, 56, 56,132,255, 74,255,121,158,228, 69,219, 62,255,115,247, 3, 69, 13,169, + 5, 91,175, 8,104, 21,196,138,118, 16, 6,235,169, 0, 15,126,109,219,182,253, 21, 43, 82, 78,170,165, 84, 5,142, 10,219,141, + 95, 8,180,160, 98,240,195,123, 74,181,184,122, 53,186, 10,118,109,209,244, 65, 48,164, 26, 71, 0,180, 62,203,144, 84,148, 75, + 30,155, 32,171,166, 58, 65,166, 4, 49,206, 94,132,234,240, 76,139, 60,162, 66,218,247, 56,145,196,210, 35, 72,176,132, 73,161, + 25, 37, 89, 18,100,241,190, 96, 91,208, 73, 74,178,120, 21, 44, 87, 71,185,243, 63,213,136,106,117,163,167,138, 75,152, 58, 87, +219,118,223,255,252, 40,232,209,115,168, 11,239, 8,255,173,151,196, 63,187, 46,139,157, 71,174,139, 90, 95,116,125, 18, 43,254, +251,180,197,163,122,143, 18, 45,218,104, 73,137, 86, 51,252, 54,106, 23,147, 41, 25,132, 90,102, 4, 38,181, 17,180,205, 2,192, +240, 69,246,124, 15, 30, 60,232, 59,106,212, 40,223, 54,109,218, 40, 0,134,234, 67,208,177, 44,209, 26,131,107,231,206,157,190, +201,146, 37,191,205, 78,147, 40,113,146,123, 97,161, 73,158,164, 73,147,230,142, 27, 93,224, 7,192,149,128, 4,238,113,173, 90, +181,142,125,247,221,119, 74,254,100,176,146, 79,210, 4, 32, 86, 72, 66,226, 40, 0, 42, 5, 14, 80, 86,164, 91,188,110,223,190, +173, 0,172, 29, 59,118, 40,129,170, 69,198, 15,127,199,178, 77, 65, 79, 66,101, 8,180,200,103, 4, 75, 64,198,118, 78, 44, 38, + 48, 1,123,150,243, 7,208,126,238,215, 95,127, 85,164, 88,205,154, 53, 83,128, 47,206,226, 20, 0,240, 98,203,150, 45,226,216, +177, 99, 2, 18,109, 1, 59, 66,187, 64,235, 3,140, 11, 63,212,171, 87,239, 1,129, 53,212,216, 2,237, 84,161,119,225,194, 5, + 81,173, 90,181, 32, 44,222,250,161, 28,239,161,200,158,129,150,138, 39, 70,170,195, 50,101,202, 4, 74, 0,166, 0, 45,243, 75, + 49,132,119,153, 1,132,176,195,146,118, 90,200, 91, 40,251, 45, 29, 27, 45,243, 47, 57, 49,222, 56, 14, 24, 96, 17, 74,180, 90, + 73,240,196,113, 66,130, 45,249, 91,123,247, 4,180,180,116,100, 90,151, 84,172,124, 24,153, 90,214, 53,126,169,147,115,188,224, +243, 23,151, 37,137, 22,118,255,165, 40,254,245,221,127,246, 92, 23, 29,102,222,124, 33,217,130, 52,170,227,140,139, 80,241, 53, +184,239, 67, 3,121, 43, 87,134,218, 99, 7,206,216, 46, 38,254,115, 87,212, 30, 25, 40, 18, 22,253, 46, 88,217,109,232,173, 43, +125,189,188,200,231,205, 53,123,175,139,159, 32,113,251,126,238,173, 23, 54, 95, 42,201,214, 43, 0, 90, 41, 96,248, 62,156, 32, + 11,131,150, 31, 6,220,217, 48, 82, 38,136,210,162,231,210, 80,241, 12, 90,186,116,169, 31, 84,136, 51,240,190,183, 7,182,164, + 46, 87, 48,223,125,130, 44, 14,226,219, 54,109, 20,117,138,228, 10, 5,178,144,190,100,171,162, 25,159, 95,106, 95, 74,156, 6, +208,202,152, 32,230, 5, 35,154, 46,137,214, 28,170, 11,213, 64,235,255, 18,173,171,138, 68,107,253,254,171,207, 99, 85, 91,248, +140, 54, 91, 86,129, 22,190, 25, 37, 85,182,146,203,218,116, 29,116,119,243,190,243,226,240,185,219, 98,241,218,195,162, 86,211, +174, 79,146,101, 42,170,236, 58,212, 26,195,107,108,180,244,178,237, 11, 73,142, 47, 86,243, 33, 2,165, 89,106,240,194,223, 4, + 93, 32, 96, 11,104,145, 46,128,175, 82,102,118, 34, 0,163, 17,106,186, 86,104, 50,211,169, 82,165,186,171, 6, 90,242, 55,140, +247,175, 65, 10, 49, 60, 44, 52, 51,101,202, 36, 80, 71, 10,208, 82, 7, 74, 76, 36,192,146,119,130, 46,198,247, 86, 23,179, 74, + 71, 13, 90,212, 42, 62,169,130,211,238, 18, 52, 1, 57, 86, 63,235, 19, 78,117,162, 33,152,178,147, 63, 2, 45,216, 90,138, 60, +121,242, 8, 28,102, 46,254,253,247, 95,197, 70, 11,109, 90,172, 90,181, 74,236,217,179, 71,108,216,176, 65,212,173, 91, 87, 1, + 90,239,189,247,158, 85,137, 86, 42, 72,173, 14,239,219,183, 79, 64, 37, 46, 32,201, 21,187,118,237, 18,135, 14, 29, 82, 54, 66, + 96, 83,141,128, 77,224,105,228, 53, 30, 24,102, 25,104, 25, 49, 87,170, 20, 41,233, 10, 15,208, 98, 95, 38,192, 98,208,130, 48, + 11,253,220,114,221, 59, 17, 35, 55, 7, 94,134, 68,203, 12,164,133,145,131,114,124, 45,235, 74, 47,239,255, 31,119, 77,129, 22, + 64,214,251,197,190,190,189,106, 55, 65,214, 13,241, 89,191, 93,162, 84,219,133, 10,216,170,212,233, 79, 24,172,215,157,105, 41, +115,233,235,100,205, 81,163,119,240,150, 99, 15, 69,173, 97, 87, 69,246, 6, 51,152,118,180,165,180, 86, 34,165,171,147, 15,249, +188,185, 26,249,236, 60,251,166,168, 51,112,183,136,158,173, 9,128, 92,157, 27, 26, 55, 15, 90,247, 14,166,212, 99, 39, 46,178, +184,203,244,211,162, 98,159, 19, 34, 86,242, 2, 75, 77, 19,104, 34, 0,104,213,130,125,206, 88,216,224,204, 78,148, 40,209, 47, +120, 77, 55, 4,234, 75, 49,144,199,128, 54,115,209,162, 69,126, 80, 43,112, 23, 95, 19, 79,223,129,184,125,200,170,105, 19,196, +166,245,235, 68,157,146, 5,159, 34,110, 53, 77,252, 28, 21,243,102,189,121,117,193,104, 17,216,189,170, 88,252,177, 50,217,206, + 48,162, 73,149, 4,212, 92,155, 1, 94,220, 64,139,191,143,157,187,185,175,207,172, 67,103, 9,174, 40,201,138, 89,245,143,103, +223, 79, 10, 56, 75, 3,121,245,110, 68, 19,158, 40, 43,221,164, 25, 11, 55, 3,224,218,145, 52, 93,129, 71,165,171, 54,124, 8, + 73,214, 86,185,187, 48, 12, 64,107, 40,164, 3,195,181, 64,139,234, 56, 45,208, 2,112,245, 58,208,178, 66,147, 60,121,255,253, +247,239,233, 1,173,114,229,202, 93,215, 2, 45,171, 52,105,251, 67,117,161, 22,104, 17,116,107,129, 22, 39, 97,198,183,219,102, +189, 16, 95, 13, 90,220, 44,240, 96,235,100, 89, 98,100,146, 55, 79, 82, 51,143, 73,189, 37,209,194,110,194,115,144, 90,138, 66, +133, 10, 41,170, 61, 74,178, 22, 46, 92, 40,254,249,231, 31, 69, 2, 69, 73, 20, 37,155, 77,154, 52, 81,128, 22,192,145, 85,160, +149, 18,224,255, 1,165,150,172,103, 9,178,176,113, 67, 92,185,114, 69, 4, 6, 6, 10,188,127,138,114,196, 65, 65, 29,160,229, +133, 70,236,144,120,121, 28,176, 2,180,144, 27,101,225,171,150, 76,105,109,180,204, 36, 90,234,247, 94,178,209,146,227,171,209, +221,132,137, 46,144,181, 50,224,154,104, 51,229,186,168,238,187,147,224,229, 14,213,136, 37, 90,207, 19,201, 75, 67,237,151,177, +110, 57, 75, 85,145,177,246, 23, 61, 39,108, 16,189, 97,215, 85,238,199, 3, 34, 74,166,250,167,124,146, 55,225,128, 16,254,203, + 5,178,254,222,117, 77,124, 59,227,134,248,164,239, 46,228,243,139,219, 62,216,217, 24, 94,226,141,223,125,183, 86,243,252,201, +159, 29, 57,185, 73, 28, 60,181, 94,228,175, 27,243,105,202, 15, 67,237, 96, 51,253, 12,236, 48, 62,197,106,123, 20, 34, 22,213, + 68,206, 3,137,195, 32, 24,108, 79, 33,200,130,129,252,100,128,168,129,136, 99, 69,149, 58,172, 96,250, 15,158, 32,110, 85, 13, +205,220, 53, 11,229,186,115,117,245,239,226,162,111, 29,113, 4, 6,241,217, 18,197,184,141, 56, 41,172, 2, 45,168, 38,118, 97, +240,222, 5,149,217,174, 21,107,182,239, 27, 60, 99,211,209,142,195, 87,159,236, 54,116,201,209,153,243,150,239, 43, 92,184,240, + 82,187, 64, 75,170, 15,144, 7,233,198, 65,217, 93,168, 90,213,186,221, 59,152,172,116,105,163,245,156, 54, 90,144, 2,110, 81, +131, 45,168,202, 66, 1,173,126,253,250,121, 29,104, 89,161, 73, 94, 3,100, 7,233, 1,173, 82,165, 74,221,208, 2, 45,171, 52, +147, 38, 77,170,168, 10,181, 64,235,238,221,187,161,128, 22,237,120, 24,223,180,129,122, 57,130, 6,180,132, 0, 63,242,143,107, +208, 84,190,108, 71, 98,100,146,213, 48, 3, 45, 87,126,116,213,151,118,242, 7,245,222, 57,104,159, 5,118,187, 42, 18, 45,218, +103, 81,117, 72, 96, 68, 85, 46, 1, 17,213,125,180,221,130,139, 23, 59, 64,235,125,140, 35,135, 41,201, 98,122, 74,181,206,156, + 57,163,128, 44,214, 61, 65,156, 75,162, 69,151, 30,150,129,150, 39,213, 33,153, 25, 94,137,150,148,100, 73,201, 22,242, 22,194, +245,131,163, 58,244,114,231,123,179,200, 89,217,117,200,157,131,220, 65, 72,219, 45,245,174, 66,245,111,189, 93,135,220,169, 40, +211, 41,105,195,200, 58,181, 68, 75,173, 50,180, 48,238, 2,100,193,214,233,246,159,219,175,138,102, 19,175,137, 10, 61,119,136, +119,178, 54,185,165, 56, 17, 85,108,182,234,108,132,225,250, 95,200,152, 39, 59,162,255,231, 59,125,237, 81, 11, 55,156, 19,141, +199, 93, 19, 57,155, 46, 36, 64,163, 33,120,248,175, 76,159,231, 79, 94,244,235, 91, 43,119, 94, 21,173, 1, 6,171,253,180, 19, +249, 36,200,250,188, 80,120,136,127,133,237,198,173,226,198,154,183,170,102, 41,113,172, 99, 3,113,228,196, 90,241,223,249,127, + 69,255,128,212,162,241,164, 68, 34, 77,165,168,243, 62, 40, 30, 98, 75,178,149,207,105,221, 43,228,131, 72,126, 16, 86,186, 83, +105,155, 5,144, 53, 5, 59,137,250,129, 80,126, 43,196, 92,113,180,254,114,242,117,109,222,232,193,222,141,107,197,182,159,154, +139, 99,141,115,136, 26,233,226, 83,173,168,149,120,133,248,132, 90,117, 8, 21,212, 46,216,124,236,130,138, 98, 23, 0,224, 46, + 0,192, 93,176,133,218,133,237,232,187, 96, 92,174,220,233,250,193,134,234, 48, 49,192, 99,119, 2, 44, 87, 8,177,187, 80,245, +124,146,198, 70,203,210,174, 67, 12,212, 83, 36,216,162, 45,149, 90,162, 5,159, 82,190, 48, 62,182, 5,180,176, 99,108,140, 39, +213,161, 85,154,100, 48,212,196, 15,244,128, 22, 0,226, 77, 53,208,178, 73, 83, 1, 90,148,108,168,193,150,148,116, 72,169, 22, + 39,118,170,153,144, 7, 11, 29,222, 70,139,179, 22,213, 45,161, 82,171,243, 94, 96,170, 23,151, 26,104,121, 2, 57,234,207,153, +169, 6,205,222,123,202,186,183, 36, 90, 4, 90, 80, 45, 11, 44, 68, 4, 54, 62, 8,180, 73,101, 51, 4,236, 8,197,213,171, 87, +149, 93,162,116,245, 0, 27, 66,197,189,131, 13,137, 86,114, 72, 4,127,168, 94,189,122, 16, 37, 98,231,206,157,115,131, 44,238, + 66,229,115,142, 31, 40, 7,237, 48,109, 25,195,235,181, 81,249,204, 13,180,172, 25,195, 75,247, 14,118,140,225,181,238, 29,172, +181, 48, 39,214,219,192, 1,171,187,239, 95, 37, 47,202,106,198, 50,230, 37,164,141,150,110,238, 0, 94,146, 21,105,115,123,217, +182, 43,162,193,152,107,162,116,215,109,216, 21,216,248, 5,200, 10,235,149,161,206,166,109, 71,239,137,170,131,175,136, 15,170, + 13,167, 1,188,199,137,223,210,103,148,124,182,189,181,124,199, 85,241,229,164,235,162,162, 4,131, 25,235, 20,180,148,222, 32, + 18,165, 88,131,179,166,190,113, 14, 0,235,110,167, 58,226,230,103,121,197,144, 82,201, 68,221, 33, 9,196,232,115,233,196,152, + 11,233, 68,159,157,169, 68,145, 86, 49,175,135, 69,186,229,250,108, 65,236, 74, 26, 4,155,162, 41,216, 33,230,247,195, 15, 63, + 76,197, 32, 57, 0,239,212, 6,242,118,139, 81,176,123,171,102, 15,130,159, 63, 19,251,183,111,129,129,124, 18, 81, 37,117, 60, +130,172,207,204, 8,169,141,225,159, 60,121,162,128, 44, 0,192, 93, 88,133,238,154, 52,105,210, 46,248,250,218,213,163, 71,143, + 93,240, 3,180,171,114,229,202, 91,232,103,203, 42,208,194,138,190, 48, 0,212,111,170, 29,133,218,221,133,114,151,161,118,231, +161,222,174,195, 80,238, 29,134, 15, 31, 62, 5,118, 47,138,173, 22,192,133, 2,180, 8, 92,160,174,245,253,250,235,175,125,193, +103, 2, 45, 30,247, 99,120, 73, 63, 90,177,227,196,121, 48,103,206,156, 81, 84, 65,106,109,180,236,210,228,199, 0,114,142, 98, +119,217, 3, 74, 27,212, 23,212, 74,183, 8,180,194, 66, 19,234,231,251,116, 13,192, 9,156,234,194,155, 55,111, 42,128,139,119, +130, 44, 78,140,156,216,225,166, 66,113, 37,192,248,102,245,239,237,247, 70,160,197, 8, 8,217,144, 24,133, 71, 98, 21,170,152, + 90,251, 49,215,238, 66,126, 67,207,163,189, 37, 99,125, 56, 33, 61, 71, 95, 89,112,233,161,236, 44,236,214,173,155,192,130, 69, + 49, 88,167,205, 28,165, 93,216, 16, 35, 58,116,232, 32,126,254,249,103,145, 48, 97, 66,171,170,195,164,148, 34, 67,170,181,253, +195, 15, 63, 12,130, 61,167,160,218,144,180,209, 30, 30,196,143, 31,127, 47, 10,200, 93,135,220,113,108,203,189,131,165, 93,135, +250,126,180,220, 60,117,220, 59,120,187, 23, 57,244,192,129,200, 0,180, 88, 81,101, 93,224, 74, 46, 32,249,223,228, 2, 40, 34, +200,170, 59,234,154, 40,214,113, 75, 88, 65, 86, 8, 39,105,177,114,125,121,151,222,217, 9,180,226, 21,254, 14,246, 89, 13,146, +155,101, 67,231,125, 72,199,107,200,167, 63,242,217, 8, 82,178,178,223,111,123, 33,113,179, 15,178,220, 52, 1,176,122,125, 25, + 43,198,227,121, 21,139,139,139,112,151,112,167, 89, 25,113,244,163, 76,162,207,251,239, 93, 39,248, 34,168, 34,184, 34,200, 34, +216,234,183,251, 3, 81,173,119, 60,145,170,124,148,199, 41, 75,133, 48, 94, 55,115, 16,151, 2, 6,176,195, 8,178,176,186,245, +195, 64, 57, 59, 73,146, 36,122, 6,242,106, 22,152,209, 76, 93, 36,107,166,123,193, 88,217,210,127,210,150, 13,235, 68,195, 18, +121, 8,178,106,121,224,179,155,166,218,189, 3,140,119,119,210, 40, 30,119, 69,146,245,203, 47,191, 40, 64,139,210, 44,248,132, +218, 73, 23, 16,116, 5, 97, 0,180,244,242, 73,137, 22,253,149, 80,162, 21,106,119,161,235,185,244,163,197, 93,135,156,228,232, + 71,171, 25,238, 84,161,106,105, 74,207,240,116,241,176, 13,182, 46, 35,232, 47,139,206, 68, 9,180,160,142,241,237,211,167,143, +111,145, 34, 69,124, 93,219,205, 9,188,185,219,201,140,159,140, 83, 16, 0,171, 51, 38,199, 16, 64, 11,229, 30, 17, 70,154,239, +128,102, 23,216,106, 93,134, 75,143,135,148,106,240,202,159, 63,255, 29, 72, 52,134,135,149, 38,164, 32, 35, 1,160,158, 54,106, +212, 72, 49,132,102,157, 19,104, 29, 56,112, 64, 81, 85,125,252,241,199,156,192,159, 50, 30,190,207, 60,152,149, 61, 12,221,209, + 35, 77,187, 54, 87,122,241,245,218, 82,120,129,150,150,166,150,158,153, 39,123, 61, 62,133,160, 73,160, 5, 39,186,162, 70,141, + 26,202,206, 66,244, 19,209,176, 97, 67,209,180,105, 83,209,178,101, 75, 1,240,175,128,172,174, 93,187, 10,216,229, 17, 8, 91, +117, 88, 74,103,164,138, 31, 45, 72,182,122, 2, 88,157,162, 91, 18,220,207, 96,145,214, 27,207,165, 31,173,119,241,251, 85, 57, + 44,149,238, 29,236, 56, 44,165, 20,204,113, 88,250,162,101,153,141,243, 97,233,167,145,133,166, 94,217, 34, 11,208,178, 89, 47, +112, 64, 25, 61,251,151,247,186,204,186, 26, 30,144, 21,170,193, 68,201, 88,119, 87,133,222, 71,197,135,221,247,138, 40,153,235, + 31,182,153, 43, 25,253,255, 13, 70,149,207, 18,157,183,134, 21, 12,134,200,103,147,119,223,125,240, 8,222,213, 31,239,217, 44, +182,151,201, 34, 22,229, 73, 41, 90,196,137, 57,143,106, 68,153, 1,170, 11,169, 54,164,250,176,227,242,228,226, 72,208, 66,113, +246,209,122,241,126, 41, 31,245, 25,136,166, 13, 59,121,242,228,159,208, 64, 30, 82, 35, 35, 3,121, 45,139, 76,105, 34,193,144, +101, 99,126, 6,200, 90, 47, 26,150, 41,162,183, 11,209,144,166,214, 97, 41, 38,131, 45, 56,214, 69,145,106, 65,194,179, 11,128, + 96, 87,149, 42, 85,182, 16,100,209,169,169,246,108, 68, 21, 97,189,124, 42,198,240, 70,187, 11,117,108,183,204,142,224,225,231, +228, 89,135,156, 92,202, 96,149,223,131, 18, 44, 74,181, 48,193,249, 66,125, 67, 96, 87, 70, 78, 62, 58,237,205, 19, 63, 21,154, +152,196,220,187, 14, 75,150, 44, 57, 34,156, 52,227,208,101, 7,220, 61, 92,131, 63,173, 39,185,114,229,186, 3,169,196,240,240, +208,132,237, 85, 92, 0,169, 63, 0,210,159, 67,237,172, 72, 55, 0, 8,169, 42,124,142,231, 11,249,222,160,159, 89,105, 75,118, +187,104, 8,154, 6, 18, 33, 35, 73,145,124,174,149, 24,133,202,103,120, 84,131,174, 2,153, 1, 45,187,229, 14, 53,214, 1, 4, + 41, 64,139, 1,139, 20, 37,208, 11, 60, 65,149, 12,252,207,231,140, 99, 3,104, 37, 6,163, 18, 33, 36, 64,136,143, 16, 15, 33, + 46, 66,108,170, 11, 17, 98, 34,188,139,192,246,107, 13,104, 57, 71,240,132,165,190, 67,207, 71,225,161, 18, 50,109,132,247, 77, + 47,101, 53, 34,242,249, 22, 1, 45, 22, 53, 99,237,111,163,103,111,118, 61, 74,166, 6, 39,124,160,158, 11, 99,197,132,172,136, +244,117, 42, 70,201,220,224, 8,104,110,193, 81, 62, 31,122,133,166,151,243, 73,160, 69,144,117,237,211, 60,162,107,162, 56,193, +148, 98, 25,229,147,210,173, 92,245,163, 7, 19,100,141,187,152,214, 54,208, 34, 93, 26,200,195,171,179,158,129,188,222,103,173, + 54,236, 97, 69,179,164,163,129,188, 21,213,108, 8,137,150, 4, 79,174, 35,120,154,225, 62, 39,109,218,180,155,185, 27,145,191, +233,103, 75, 43,201,146,105,204,128, 22, 87,226,170,195,163,155,185, 14,143,254, 82,125,224, 44, 37, 88,234,231,174,213,187,222, + 89,135,122,252,225,198, 10,150,153, 18, 51,222,205, 54, 90,152,242, 19,234,196,115,160, 35,222,141, 17,243,158,183,104,130, 78, +114,212,249, 20, 0,109, 30,229,228,149,124, 2, 88,165,194,100,189, 25, 82,210, 96,222,249,223,164,127,153,150, 61, 12,253, 83, +143,166,153,116, 72,239,189,250,211, 17,158, 79, 47, 0,183, 80, 64, 11,187, 14, 15,146,174, 12,144, 54, 5, 50,160,222, 3,225, +158,193, 29,208,255, 3, 81,103,129, 0,102,175,224,172,195, 92,189,195,126,168,116, 78,218,145,234,129, 13,245,161,210, 29, 9, +182, 41, 81,214, 57, 84, 58,196, 59, 85, 63,215,163, 25,134,166,168,155, 36,194,219,146,151, 50,250, 54,231, 83,143,133,111,168, + 68, 43, 68, 81,149,195, 62,195,122,189,196, 6,227,157,124, 54,122,247,221, 62, 4, 91, 8, 15, 1,178, 6,152, 21, 60, 69, 73, +159, 1,148,100, 49,164, 40,229,243,163, 9,216, 48, 34,167, 53,144, 55,138,103,135,159,122, 7,202,234,209,213, 5, 90,106,105, +149,246, 80,105,173, 36,203, 34,208,226,183, 9,152,100,136,239,242,248,158,192,194,243, 80, 19,153, 73,189,120, 60, 14, 40,140, +117, 20, 41,104, 98,247, 42,109,115,172, 92,118,218,146, 21,122,118,235,200,161,105,206,129,136,173,163,132, 57,211,224, 72,157, +126,238, 3,165, 97,127,165,120,126,215, 94,210, 0,158,239,149,144,171, 55, 14,162, 78,227,161, 31,201, 62,158,200,117,172, 14, +181, 1,234,190,207,223,122,239,212, 95,142,216,178,155,243,222,106, 12, 39,159, 86, 57, 21,246,120,111, 3,208, 10, 59,119,144, +210,105,132,225, 98, 95,168,196, 14, 63, 29,126,122,139, 3, 78, 91,242, 22, 39, 95,208,113,248,233,240,211, 91, 28,120,155,219, +146, 30, 15, 29,160,101,210,178,222,230, 6,227,148,221, 91,195,142, 51,145, 57,109,201,105, 75,222,226,128,211,150,188,197, 73, +103, 92,138,136,182,244,198, 2, 45, 50, 75, 47,216,105,142, 70, 52, 60, 61, 55,163,239,208,212,175,151,176,214,151,195, 79,135, +159, 86,219,128,211, 55,141, 57, 96,149,135,234,120, 14, 63, 29,126,234,113,224,109,110, 75,146, 31, 86,230,179,200, 42,209,122, +105,249,142, 8,196,235,208, 52, 27,182,237,189,119,248,105,143, 95,102,177, 29,126,154,113,200,222,123,135,159,246,248,101, 22, +219,225,167, 25,135,236,189,119,248,105,143, 95, 97,137,253,210, 0, 75, 88, 50,247, 58,164,113, 26,161,119,107,193,225,167,195, + 79,111,113,192,105, 75,222,226,164,163, 66,114,218,210, 75,110, 75, 21,179,250,164,172,154,201,199,234, 38, 42,230,206, 99, 29, +145,150, 77,122,166, 52,189,200,146,200, 2,180,184,131,154,121,149,193,146,115, 99,111,240,201,233,128,222,224,226,255,105,168, +249,153, 5,143,103, 32, 44, 81, 5,250,141,210, 94,115, 52,113,232, 20,148,105,229,101,169,142,176, 69,123, 16, 14, 65,190, 3, + 71,158, 63, 89, 40,146, 30,205,116,240,189, 53, 63, 85,170, 84, 39, 17,206,225,144,227,127, 65,203,210,183, 93,223,211,139,155, + 49, 69,138, 20, 11, 16, 36,205, 53,160,105,237,220, 77,227,201,241, 61, 56, 22,173, 6,215, 11, 95, 33,180, 66, 62,233, 81,223, + 78,135, 9,145,207, 58,189, 15,190, 91,169,203,190, 56, 12,252,205,207, 90,125,102,183,142, 44,212,139, 58,138, 29,222, 91, 37, +237,208,180,202, 41,107,241, 28,126, 90,227,147,213, 88,145,142,159,240,224, 27, 77, 27, 42,103,242,249,185, 82, 70,159,103, 8, +207, 43,103,240, 25,161, 23, 71, 62,211, 27, 67, 60,208,123, 70,218,158,232,241,157, 21,154,146, 6,188, 78, 71, 55,163,167,161, +169, 87,151,145, 5,104,105,243,105, 45,223,245,129,154,235,228,244, 81,111,227,125, 15, 92,160, 3,200,150,174, 59,255,123,186, +172, 52,236,200, 66,211,106,103,182, 5, 96,108, 18, 85,243,115,118,136,243, 92,240, 7,180,150,104,233,225, 88,142,251, 60, 19, + 15, 71,234, 8,156, 95,168,156,177,134, 56, 51,108, 78,226,201,233,213,154,105,107,214,172, 73,255, 92,241,236,212, 59,252, 58, +213,129,255,173, 64,120,153, 15,126,248,240,145, 8, 14, 22,202,129,184, 0,110,215, 1,102,166, 88,228, 65,136,182, 4, 63, 81, +141,225,202,224,234,154, 53,107,148,178,241,156,183,173, 91,183,138,162, 69,139,222, 4, 80, 26, 23, 22,154,112,250,153, 21, 52, +219,254,245,215, 95,157,239,223,191,223,249,249,243,231,157,113,148, 77,103, 28,149,243, 13,104,150,181, 75,147,128, 42, 75,141, + 65,245, 50, 84,242, 61,203,192,223,197,135,111,137,101,229,153, 4,101,174,111, 90,233, 71, 22,179,231,142,230,208,180,203,177, +240,143,117,118,191,232,212,145, 93,142,189, 97,117,164, 5, 41,141, 82,249,124, 64,128, 37,214,247, 18, 12,252,205,103, 70, 96, +198, 12, 20,233,208,123,246,197, 7, 62,169,194, 11,222, 8,176, 98,225,116,141,178,165, 74,253, 28,221,199,231, 43, 51,176,101, + 82,205,214, 0,139,119,219, 74, 88,168,169,165, 89,242,183,103, 58,181,115,250,244, 69,120,134,240,188,106,102,229, 40,148, 86, + 56,183,235,151,249,243,231, 15, 61,113,226,196,208,121,243,230, 13,197,209, 18,191,240, 57, 40,241,252, 67,240, 51,212,101, 52, + 80, 48,110,129, 72, 64, 51, 44,204,150,105, 34,122,144, 92, 66,160,133,143, 93, 70, 88,226, 10,102, 18,173,203, 0, 16, 90, 64, +102, 37,159,197,120,132, 8, 15, 40,230,113, 34,248, 86, 94, 27, 64, 43, 53,174,107, 87,174,223, 18, 87,111, 63, 22, 23,111,190, + 8,103, 47,223, 21, 39,207, 92, 32,189,219,112,216,248,133, 5, 70,171,243,153, 1, 78, 84,175,177, 44,188, 0,136, 4,206,167, + 19,103,206,156, 81,206,247,171, 80,161,194,109, 56,138,172,109,147,230,123, 4, 89, 0,147,157, 65, 82, 9, 0,166,157,175, 92, +185,210, 25,199,250,116,198,217,142,223,224, 88,149,140,118,104, 82,138, 69,128,181,241,184, 16, 12,252, 93,182,247,193,184, 86, +158, 49,173,222, 32,105,225,251, 86,163, 88,169,119,171,180, 94, 86,155,183,155, 31,163,248, 78,217,141, 57, 89, 8,167, 9,156, +198,235,233, 8,222,242, 29,151, 21,253,177, 30,250,207,119,184,127, 7,135,173,245, 64, 59,171,141, 49, 36, 84,212, 36,153,202, +125,156, 36, 87,141,197, 73,114, 86, 59,147, 12, 33,121,110,252,206, 90,238,227,112,211,204, 89,125, 9,104,158, 5,205,211,164, +153, 52,123, 57, 51,167,207, 17,218,150,180, 0, 37, 67, 28,159, 10,149, 50, 69, 9,246, 22,208,210,161, 23, 10,104,213,207,232, +147,186, 97,122,159,180,118,164,100, 16,221,215,234,218,185,243,208, 51, 39, 79, 14, 43,247,225,135,131,215,226, 8, 48,139,224, + 77,175, 10, 35, 11,208,178, 55, 62, 65,138,149, 8, 0,235,241,211,127,123, 42, 21,218, 32,223, 59, 98,198,196,145,126,240,216, + 61, 84, 27, 48, 9, 13,197, 41,244, 67, 75,148, 40,241, 51,190, 82, 95,243,165, 16,141,176, 74, 38,159, 7,149, 50,249,136, 26, +217,223,185,231,231,231, 55,244,212,169, 83,161,232,145,190, 29,154,252, 94,165,204, 81, 79, 86, 47,150,121,225,156, 57,179,134, +121,139,166, 61,142,233,198,142,208, 14, 72, 96,229, 2, 90, 4, 89,242, 74,132,227, 93, 74, 65, 69, 87,145,129,191,241, 66,125, +126,216,146,187,119,239,218, 1, 90,116, 86,219, 7, 96,232, 57, 15,173,229,161,197,148, 32, 85,171, 86,237, 41,158, 19,212,209, +241,160,222,229, 46, 59, 36, 86,191,250,251,251, 7,223,184,247, 84,164,251,250,168,120,183,193, 65, 37, 36,254,242,160,216,180, +227,128, 66, 15,121,165,247,117,179, 75, 77,115,246,170, 85,171, 32, 23, 19,144,142, 5,139,219,183,111, 43,103,253,253,247,223, +127,202, 25,127,139, 23, 47, 22, 84, 39,154, 17,196,123, 55, 77,170, 11, 41,201, 34,192, 2,143,122,160,172, 61,209,150,122,130, +102, 15, 74,181,112, 56,115,103,228,179,133, 29,154, 14,208,178,192, 45,243, 40,158,250, 17,129, 64, 29,120, 97,159,151, 35, 71, +142,147, 80, 27, 47,112,141, 65,122,139, 62,245,151,172,244,205, 10, 80,113,111, 71,162, 38,230, 89, 84, 98, 88,161,105,145,148, + 59,218, 75,167,137,126,112,150,103,113,118,238,220,153,227,132,149,197,138,167,178,227,116,169,119, 27, 98,129,222, 29, 71,120, +249,162,175,251, 46, 95,190,220, 23, 7,106,251,150, 42, 85,234,123,120,201,111,136,196,138, 58, 93,231,210, 45,123,146,172, 37, +227, 1, 8,253,249,113,171,129,119,230,172, 58, 34,214,236, 14, 20,254, 91, 47,138, 97,115,119,138, 10,141,127,188,149, 50,119, +245, 63, 25, 39, 44, 52,235,126, 59,252,206,175, 75,247,139, 5, 27,206,137, 95, 87,156, 16,223,143, 91, 39, 10,127,210,233, 70, +138,220,213, 23, 37,207, 83,201,232,148,137, 8,173, 35, 53, 56,249,214,199, 39, 70,178, 36, 73,186,124,223,180,242,118,130,173, +138, 25,125,130,245, 84,135,140,103, 5, 20,105,233, 41,170, 72,141,234, 80, 79, 77,169,226,173,187,236,234,124, 86,194,137, 28, +201, 19, 39,254,249,228,209,163,195,246,239,222, 61, 44, 65,220,184, 63,105, 65,214,240, 15,124, 98,125,146,198, 39,135, 78, 62, +245,170, 46,178, 0, 45,123,170, 67, 61,160,181, 96,214,175,186, 64, 11, 43,254,161, 56,204,119, 40, 38,226,161,224, 16,131,225, + 5,144, 21,252,248,159, 30,162,113,225,184, 65,152, 16, 39,227, 64,101, 93,160,101,135, 38, 63, 70,240, 54,176, 94,166,135, 29, + 42,167,190, 49,169, 95,187,191,143, 29, 57, 56, 74, 15, 20,162,163, 15, 93,177, 98,133,105, 62,237,142,134,175, 40,126, 8,160, + 5, 96,145,189,116,233,210,149,142,159, 58, 85, 19, 96, 65, 9,135,143, 31,175, 9, 0, 92,137,239, 92,121, 92,194,131,135,241, +123,137,197, 60, 15, 0,136,118,107, 40, 9,106,228,197,243,217, 64,163,151, 25, 29,124,251, 8,191,121,227,238, 19, 17,163,225, + 65,177,251, 76,176, 56,120, 17, 7,177,213, 63, 32,150,174,218, 44,252,253,255, 20, 56, 59,241, 26,232,152,169,161,221,159, 2, +120, 59, 45,165, 89,164,125,254,252,121,128, 44, 30,164,188, 69,252,245,215,223, 98,222,188,249, 34,125,250,244,164, 25,203, 44, +127,242, 61,109,178,168, 46, 36,208, 34,200,146, 64,107,195,134, 13, 61,113,214, 99,231,133, 11, 23,118,134, 20,237,107,196,215, + 30,206,108,248, 9, 47,170, 14,173, 22,195,155,241,146,193, 46,111, 26,164,124, 7,113,159, 9,194, 41,194, 73,188, 8,210, 15, +196, 49, 52,171, 1,138,206, 97,146, 93,131,255, 92,156,149, 8, 35,221, 24,160,177, 14, 7,157, 43, 0, 27,253, 93, 28, 60,120, + 80, 57, 79, 16,199,218,108, 5, 77,179,227,151, 60,126, 54, 67,134, 12,103,217,174,112,190,229, 99, 68,140, 25,198, 60,106,147, + 17, 24, 82,250,111,180, 64,241,210,103,194, 76, 38, 85,245,234,213, 21, 94, 98,209,193,254,109, 85, 5,175,251, 65,130,172,190, +125,251,254,180,113,227, 70, 95,156,233,232,219,179,103, 79, 95,158, 69,138,131,233,125, 9,188,112,150,106, 47, 72,179, 9,182, + 44, 95, 4, 89,253,126, 93,253,124,227,129,107,162,235,175,251, 69,227,193,219, 69,243, 97, 59, 69,183, 41,251,197,232, 37,199, + 69,243, 94,179,158,165,202, 91,253, 79,203, 4, 17,145, 52,135,254,182,254,249, 63,123,174,136, 14, 19,246,186,104, 6,136,206, +147,247,137,222,179, 14,137,106,109,199, 62, 73,149,167, 58, 65,252, 75,191,212, 0, 5,141,176,236,128,126,253,134,220,184,118, +109,216,151, 13, 63, 31,153, 55,161, 79, 41,245,123, 24,222, 38, 73, 20, 55,110,157, 10,101,203,182,195,192, 87,204,200,246, 73, +166, 9, 65,175,254,167,163,180,244, 74, 39,246,201,174,167,166,212, 99,130, 58, 31, 88,229, 52, 31,216,191,255, 48,230,179,245, + 87, 95, 13,195,119, 62, 84,191,255, 40,141, 79,141,170, 89,223,185,222,169, 74,106, 81, 46, 93,148,205, 70,249, 84,125, 39,178, + 1, 45,153,223,208,249,134,212,129, 29,203,125, 81,117,248,121, 14,159,224,218,185,162, 4,119,109, 80,106, 63,236, 95, 38,195, + 22,102, 40, 84, 52, 67, 47, 95,190, 60,148, 32,233,194,133, 11, 67,241,124,232,240,225,195,135,206,152, 49,195, 20,192,168,129, + 22, 0,143, 66, 47,188, 52,153, 97, 2, 45,177,178,173, 56, 62,233,115, 49,166, 89,206,199,223,148,127,255,238,136, 46, 13, 54, +254, 23,176,117,220,185,115,231,134,162,108, 67,187,119,239, 62,180, 85,171, 86, 67,167, 77,155,102,154,207,151,222,155,194,246, + 65, 74,148,150, 32,240,158,136, 32,235,193, 99, 81,255,202,237,231,173, 79, 93,126,210,238,196,197, 71,237,206, 93, 10,106,115, +238,226,181,250,197,139, 23,175,204, 56,174,184, 50,141,167,175, 18,160, 20,128,186, 80, 57, 80,153,246, 84,101,202,148, 9,194, +121,108,103, 97,243, 21, 4, 73,143,130,183, 96,175,197, 67,171,115, 34, 24, 2, 26,172,144, 79, 61,124,248,208, 13,180,182,157, +124,166,128, 45, 2,173,223, 22,172, 16, 51,103,254, 38,112,118,226, 77,208,200,100,149, 13, 80,109, 92,124,252,248,177,160,116, + 14,109, 80,108,218,121, 64,204,249,115,187, 24, 63,119,173, 24, 58,117,185, 24, 48,102,158,200,148,171,240, 45,208, 75,111,149, + 38, 13,223,105,147, 5, 91,175,206,148,100, 49,236,219,183,175, 39, 36, 89, 61, 9,178,166, 78,157,218, 25,147,239,247,160,151, +216, 42, 77,198, 83, 27,190, 39,120, 63, 93, 58, 60,138,166, 99, 12, 31, 43, 73,234,252, 41,181, 70,243,118,190,227,229,184, 49, +147, 37, 75,118, 96,221,186,117,202,164,187,105,211, 38, 74, 29,143,226, 27, 97, 1, 47,113, 0,212,198,126,249,229,151,193,171, + 87,175, 22,232,143, 10, 77,222, 41,205, 68,159, 20, 48, 33,152, 12,218,102,118,127,234, 34, 70,133, 26,106,241,236,217,179, 5, +204, 24, 4, 14,232, 22,144,154, 60,255,241,199, 31,149,182,138, 3,202, 5,218,234, 42, 36, 48,147,108, 25,177, 45, 93,227,198, +141,149,124,118,235,214,141,227, 98, 73, 47,240, 55, 30, 84,232,187,190,248,226, 11, 74, 91, 3,108,150,151,159,175, 5, 9,219, + 49,244,149,235, 86, 3, 54,114,156,101, 19,180,145,247,218,190,190,190, 98,203,150, 45,138,132, 24, 64,105, 15,210,182, 70,224, +152,193,126,110,231,202, 10,201,119,119,130,172,246,237,219,251,182,107,215,142,192, 74,185, 19,112, 97, 1,231, 59,107,214, 44, +223, 34, 69,138,116, 3, 81, 51, 53,162,242, 93,170, 11, 63,105, 51,228,206,134,255,174,137, 90,190,155, 69,205, 94, 27, 68,173, +159,254, 21,181,125,255, 17,205,126,222, 36,126,250,237,160, 24,252,251, 17, 81,188, 86,231,235, 73,178, 86, 52, 83, 35,186,105, + 54,233, 52,242,238,202,157,129,162,230, 79,155, 69,169,230,147,159,165, 43,214,232,114,134,146, 77, 46,215,236, 48,227, 89, 23, +128,185, 31,103, 30, 20,121, 43,183,190,145, 40,115,153,136,144, 94,121,228,169, 4, 40,189, 33,249,203,252, 65,210,209,251,183, +111,154,248,223,222,189, 67, 99, 71,143,222, 92,190,163, 90, 46,182,143, 79,161,226, 69,139,118, 89,191,118,237,207,199, 33, 73, + 42, 86,176, 96, 27,218, 73,233, 17,103, 58,210, 75,157, 34,197, 0,130, 33, 45, 61,190, 7,189, 2, 37,242,229,240,213, 83, 83, + 26,209,100,186,154, 62, 62,177, 65, 87, 1, 89, 7,246,238, 29, 22,243,221,119,123,203,124, 82,138, 85, 38,173,207,212,111, 62, + 74, 17,124,118,110, 27,197,198,172,117,217,228,162, 92,202,144,245,175,197, 34,248, 94,100, 2, 90, 90, 59,173,144,236,210, 41, +156,207,123,239,250,204, 94,185,120,174,223,204,153, 51, 39,255,246,219,111,147,105,155, 5, 27,150,161,152, 99,135, 98, 21, 57, +116,228,200,145, 67,219,180,105,163, 0,152, 9, 19, 38,152, 2, 24, 53,208, 34,205, 29, 59,118, 40,246, 94,225,161,201, 82, 72, +160, 69,176,197,112,121, 86, 67,241, 91,187, 2, 79,191,173,152,234, 86,135, 14, 29,148,252,201, 96, 37,159,118, 70,147,215, 33, + 46, 85,132, 16,247,215,184, 25, 36, 90, 37,168,183,241,238, 59, 31,175, 11,102,224,239, 19,103,175,181,132, 68,166,134, 75,141, +104,154, 93, 12,174, 3, 48, 64, 62,169, 90,181,170, 50,193,242, 2, 80,187,141,132,201, 93,137, 83,193,136, 93, 49,142,130,113, +187, 96, 60, 0,174, 96,188, 67,223, 13,125,113,167, 33,233,156,190,112, 93,100,109,127, 24,106,195, 3, 74, 72,241,213,126, 49, + 96,200,104,209,168, 81, 35,218, 84, 5, 87,172, 88,241,113,182,108,217,238,193,126,131, 82, 35,143, 23, 38,156, 63,169, 34,188, +120,241,162,128, 52, 85,204, 93,190, 29,170,200, 3,226,157,122, 47, 66,172,122, 59, 68,201,106, 77,158,231,201,147,231, 42, 0, +212,133, 4, 9, 18,132, 62,191, 77,243, 5,238, 46,220,189,123,119,103, 44, 32, 58, 67, 50,210,131,146, 44, 44, 6,122, 66,197, +253, 3, 54, 2,108,194,121,143, 79,144,207,167, 0,156,143, 33,129,187,101,209, 6, 76,126, 37, 26,212, 90, 35, 49,209, 92, 6, +240, 92,134,135,234,243, 67, 19,228,206,157,123, 91,147, 38, 77,206,227,121, 87,179,178,191,164,247,109,209,183, 21, 73,209,199, + 31,127, 44,246,236,217, 35, 38, 78,156, 72,192,209,209,230,247, 99, 3, 84, 28, 36,240, 33,104,249,245,215, 95, 5, 0,151,192, +162,224,105,179,102,205, 20,154,172,195, 69,139, 22, 9,130, 8,208,182, 10,182, 90, 80,146, 69, 48,128,182,248, 16,233, 56,169, +242,140,199,106, 80, 73, 5,209, 86, 15,139, 63,230, 23,218,145, 48, 93, 29,153, 87,230,217, 53, 46,170, 15, 80, 14, 11,193, 24, +216,104,177,158,253,133, 52, 9, 56,177, 65,100,189, 43,207,150,232,161,125, 30,133, 10, 91,105,239, 86, 3,235, 13,146, 93, 43, + 42,116,153,135, 97, 44,239, 55,223,124, 35, 78,159, 62,205,141, 37,226,187,239,190, 83,190,151, 43, 87,174,251,136, 20,215, 82, +102, 17,137, 54, 89, 4, 82,148,100, 17,104, 77,154, 52,201,119,231,206,157,190, 11, 22, 44,240, 5,120,245,133, 68,220, 23, 11, + 24,223,193,131, 7,251, 98,225, 68,155, 45,211, 43, 25,108,178,166, 47, 63,168, 72,154,106,246, 90, 47,250,254,182, 87,172, 10, +184, 44, 70, 45, 62, 34,154,244, 95, 45,126,248,117,135,152,184,252,148,232, 60,114,149, 72, 87,168,214, 98, 83,130,136, 64, 59, +175, 37, 27, 78,136, 54,163,118,137, 82, 95,253, 26,156, 44,103,149,191, 19,102, 40,149,134,225,253,156,149, 87,180,234,247,251, +179, 95, 87,158, 22,223, 13, 91, 33, 82, 23,252,216,207, 10, 77,111,198,145, 32,165,108, 26,159,233, 84, 21, 86,201, 20,245,121, +205, 34,105,183,188,239,227,147, 78,190, 67,195,175,254, 83,207,158,253,207,157, 57, 51,236,204,169, 83,195,250,247,238,253, 19, +164, 72,101, 60, 73,180,146, 96,231,249, 55,109,219, 14,123,250,228,201,176, 38, 13, 26, 12,213,208,171,252,125,215,174,253, 72, +175,103,243,106,219, 43,103,138,242, 92,173,166,212, 43,159, 90, 74, 38,233, 54,110,216,112,152,148,172,241,125,185,116, 62, 91, +103,118, 44, 45,158,173,253, 65, 60, 95,251,163,152,211,165, 44, 37, 90,123,181,249,140,196, 64,203,188,234,245,128, 22, 82, 13, +197, 10,127, 40, 14,255, 13, 17, 40,205, 82,131, 23,254, 38,232, 98,124, 79, 95,210, 2, 45, 53,221,176,210,228,247,180, 64, 75, + 2,174,150,165,226, 63,106,208,160,193, 56,117, 94,173,228,211,156, 91,175, 87, 12,218, 99, 1,247,212,184, 29, 36, 90,251,212, +248, 87, 92,187, 39,148,192,223, 7,143, 93,104,189,125,251,246, 26,144, 80, 88, 89,141, 69,175, 85,171,214, 19,238, 78, 4,232, + 80, 36, 70,148, 28,161,180,255,169, 75, 12, 9,197, 81,105,128,190,119,239, 94,101,215, 31,128, 18, 39, 60,189, 3,200, 11,112, + 5,126,224,208, 81,177,110,203, 46,177,116,197,191, 98,246,252,165,162,243,247, 63,138, 78,157, 58,139,160,160, 32,101, 23, 34, + 3, 36,165,162,126,253,250,207, 48,169,248,155,112,184,120,190,124,249,110,114, 2, 64,217,196,212, 5,235,132, 79,157, 3,138, + 74,146,129,191,247,158, 2, 3,112, 81,197, 8, 41,194, 45,240,104,170, 9,205,148, 80,179,126, 13, 73, 86,103, 2,174,181,107, +215,118,254,227,143, 63,186, 2, 68, 94,199, 68, 17,172,206, 39,165, 49, 80,177, 60, 3,104,154, 97,161, 37, 64, 96, 19,109,204, +220,185,115,239, 48, 63,224,239, 41,164,193,130,209,125,229,128, 61,204, 21,190,131,218,235, 58,158,246,180, 64, 51, 66,163, 96, +226, 59, 68,176,130, 69,148, 2,174, 8,142, 88,102,186,230,192,127, 59,106,175,113,216, 52, 35, 14, 28, 56,192,246,241, 8,105, + 59, 33, 80,202, 72, 26,233, 16,218, 3,192, 62,128,228, 80, 1, 91,104, 87,102,117,164,148, 27,124, 63,200,252,125,251,237,183, +204, 95,117, 13, 51, 62,162,148,140,249,133, 4,233, 68, 24, 24, 21,143, 18, 86, 74, 74,153,119, 2, 35,180,139, 32,208, 73, 26, + 6, 90, 76, 18, 21,170,204,197, 28, 95, 9, 94, 0,182,149, 59,237, 8,177,168, 32, 24,208,235, 51,161, 62, 5,160,115,137,237, + 29,192, 55,216,138, 68, 11, 11,160, 96,198, 47, 88,176,224, 13,139,249,142, 13,112,180,141,224,181, 64,129, 2, 2,192, 72, 1, +153,252, 79,251,204, 1, 3, 6,144,215,166, 11, 22,249, 45,208,106,255,247,223,127,251, 66,202,168, 0, 45,104, 62, 20,176, 69, + 73, 22,109,180,186,116,233,226, 11,186,190, 75,151, 46,245,197, 14,226,246, 86,242,152, 44, 87,245,147,127,110,187, 40, 26,255, +188, 93,124,218,107,141, 88,177,253,162,232, 62,237, 63,209,105,210, 62,209,101, 98,128,104,222,255, 79,241,231,118, 0,175, 69, + 71, 69,218,130, 31, 91, 2,152,169,242,126,124,254,175,157,151, 68,157,126, 91, 69,186, 98, 13,175, 38,200, 86,150,237, 82,185, + 18,101, 44,157, 58,127,165, 22,129, 84, 41, 14, 95,112, 64,164, 41, 80,195, 18, 77, 43,101,177, 26,135, 32,164, 78, 90,159,244, + 53,178,189,163,216, 75, 63, 93,251, 67,112,197, 12, 62,207,190,124,223, 39, 41,223,161, 81,102, 6, 80, 26,120,231,198,141, 97, + 59,182,109,251,165,100,145, 34, 61, 1,110,138, 83,202,229, 9,104, 1,156,213, 88,186,120,241,176,231, 0, 90, 73, 18, 37,114, + 75,157,176,154, 78, 95,247,179,207, 20,122,187, 2, 2,126,129, 33,123,207,212,241,124,106,213, 79,247,127, 96,167,151,119, 9, +180, 32, 66,235,160,162, 59, 84, 5, 20, 59,252,220, 56,183, 34,197, 58, 55,175,173,104, 87, 33,165,248, 48,181,207,202, 79, 83, +249, 36,126,131,128,150,185,228,205, 8,104, 81,181,167, 5, 90, 84,199,105,129, 22, 86, 38,225, 2, 90, 97,165,201, 74,183, 3, +180,172,228,211,106, 39,120, 93,226, 73,160,117,237,246, 19, 5,104, 93,184,249, 92, 9,252,189,107,255,137,214, 0, 13, 86,129, +150, 15, 84, 46,191,114,162,162,234, 4, 43, 80, 5,172, 64, 50,196,193, 90, 74, 27, 18, 64,220,127,155,207,169, 98,128, 36,134, +113,131, 97,123, 51,214,136, 31,152, 24,123,195,214,229, 38, 39, 83,128, 23, 65,251, 46,174,154, 31, 60,126, 22, 98, 39,226,149, + 91, 79,196,237,123, 15, 5,118,248, 61, 3, 56,129, 20,218,248, 2,205,193,152,164,111, 46, 89,178, 68,140,153,185, 66, 1, 87, + 84, 73, 50,168,129, 22,243,121,243,230, 77, 74, 62,110, 64,170, 84,222, 19, 77, 0,188,178,248,118, 59, 72,178, 58, 99, 34,236, +140,178,109, 36,200, 98, 62,175,220,194,110,201, 27, 47, 2,127,223,131,158, 22,223,127, 10,154,158,108,140, 66,128, 44, 23,144, +234,172,201, 67, 20, 68, 26, 45,129,216,107, 0,182,202, 19,192, 80, 61, 12,169,203, 94,230, 53,126,252,248,219,169,146,195,228, +200,201,214,108, 23,150, 44, 94, 17, 74, 43, 9, 84, 32, 9,164,157, 83, 46, 3,222,103,133,132,235, 33, 37, 91,205,155, 83, 27, +226, 83,218,164, 95,149,236,212,169,147,146, 63, 72,137,168,218, 10,117, 37, 76,152,112,203,241,227,199, 69,143, 30, 61, 72,239, + 35, 27,253,244, 93,180,255,149,108,167, 24,243,168, 58,123, 72,245, 38, 54, 94, 8, 72, 69,119,168,250,128,101,146,160, 55,133, + 42, 78, 2,191, 42, 85,170, 16,108,126, 11, 16,244,136,246, 95,144,234, 11,168, 64, 45,185, 55,145, 64,203, 42,112,178, 17, 63, + 14,128,224, 22, 72, 85,159, 66,130,245,156,134,240, 40,247,113,128,203,231, 4, 89, 93,187,118,229,162, 66,217,205,139,118,186, +194,106,193, 1, 34,219, 99, 78,241, 29, 52,104,144, 47,234, 75, 81, 19, 66,155,224, 59,125,250,116, 5,112, 17,104, 97, 23,179, + 47,164,123,148,104, 89,146, 60, 38,207, 93,253,196,156, 53,103,196,151,176,201,170,227,187, 90, 12,157,127, 80, 1, 89, 63, 76, + 63, 32,122, 76,217, 37,154,247, 91, 38, 54, 31,188, 46, 38, 47, 63, 33,210, 23,250,228,184,149,188,126,144,239,227,243,243,214, +158, 81,236,178, 50,151,254,242, 90,162, 76, 31,230,144,233, 96, 84,159,181,100,173,111,174,236, 59,117, 71, 76, 88,122,232,245, + 1, 90, 25,125,158, 18,104, 53,131,237, 96,250,180,105,127,188,114,233,210, 48, 74,159,210,124,240, 65,119, 56,252, 75, 45,193, +141, 39,160, 69,215, 11,119,111,221, 26,182,125,235,214, 97,216,141,208,144,113,105, 28,159, 38, 85,170, 30,151,206,157, 27,118, +249,194,133, 97,160,221, 19,244,210,168,233,121,162,201,119, 80, 21,254, 44,233,194,152,181, 39,159,209,133, 68,253, 66,241, 30, +222, 91,217, 85,220, 89,209, 69,212,207, 31,247,121,241,148, 62,223, 24,229, 51, 18, 75,180,204,221, 59, 24, 1, 45, 72, 55, 66, + 1, 45, 12, 98,161,128, 86,159, 62,125,194, 5,180,194, 74,147,157,194, 8,104,181, 40,249, 94, 40,137,150,149,124, 90,233,160, +175, 83, 28,170, 5,177,122,173,113,233,218,221,150, 73, 26,110,188, 17,189,214,186,231, 12,137, 27,108,184,177,117,207,225,150, + 24,232, 45,171, 14, 93,229, 74,139,123,117,168,119, 20,235,119, 74, 28,176,138, 14,196,179, 0, 12,200,215,105,116,204, 11,210, + 39,170, 12,177,201,196,220, 80,154,206, 73,105, 24,159, 46, 93,186,171,152, 4,130, 9,126,180, 59, 17,147,126,117, 88, 28, 58, +113, 73, 64,165, 32, 0,122, 14,152,241, 24,147, 84,117,208, 60,154,189, 72,245, 91,113,235,110,118,239,104,228,238,198,253,103, + 94, 72,180,248,157, 35, 71,142, 8,168, 44, 72,243,111, 11, 52, 51,114,119, 33, 12,223,191, 65,153, 31, 75, 67,254, 20,173,254, +191, 99,146,191, 47, 92,185,163,128, 70,196,221,104, 68, 19, 18,154, 97, 26, 0,181, 26,113,199,235,132, 9,152,196, 54,202,184, + 88, 12, 80,178, 69,219,152,151,126, 1, 84,237,160, 4,138,170, 57,124, 28, 99,185,114,213,167,237, 14,118, 3, 11, 72, 70,247, +227,191, 21,169, 86,111,216,183,137, 41, 83,166,144, 14,237,112, 60, 93,237,185,233, 2, 42,110,198, 29,100, 18,183, 15,129, 15, +164, 34,140,107,180, 11,180,241,208,161, 67, 21, 73, 12,226, 12,182,200,196, 28, 0, 83,219, 9,126, 8, 54,138, 21, 43,246, 0, +233,202, 64,186,115,135,237, 7,146, 23, 1, 53,244, 65, 60, 43,110,145,158, 15,234,127, 32,203, 69, 16, 89,175, 94, 61,238,212, +165,173, 36,175, 42,144,180, 63, 35, 8,101, 57, 24,207,140,166, 13,224,164,144,178, 17,127, 56,192,143, 2,136,161, 46, 23, 4, +133, 72,206, 77, 46,165,209,191,168,222,236, 12,208,180,159, 18,196,194,133, 11, 19, 48, 91,178,211, 67,154,186,163, 70,141, 82, +192, 85,191,126,253, 20, 96, 69, 73, 22, 65, 22, 85,135, 4, 94, 80, 77, 43,119, 0,173,186,102,229,231,251,247,243,212, 92,216, +123,202,102,209,229,215,125,226,203, 33,155, 68,195,222,127,137,239,198,237, 16,221, 39, 7,136,166,125,150,137, 81,191,239, 17, + 91, 14,221, 16,131,103,110, 20, 25, 10,215, 90,104,133,102,138,188, 53, 22, 15,158,189, 93,124, 55, 97,159,168,253,253, 60,145, + 50, 79,245, 93,241, 51,150, 42,152, 56,203,135, 69, 82,229,173,182,103,218,146,157,193,123, 78,220, 22, 3,167,254, 43, 50, 20, +122,117,170,195, 50,153,226, 5,208, 94,170,114,198, 40,207, 75,166,246, 97,167,162, 29, 85,225, 41,147, 39, 15,123,254,244,233, +176,250,117,235,254,130,255, 5,173,130,162, 92, 57,114,252, 2,191, 56,195,134,253,242,139, 91,189,135,244,249,199,142, 26,165, +208,107,250,197, 23,191, 64, 50, 86, 84, 75,207, 12,104,229,204,145, 99,152,164, 11, 0, 87,159,241,203,165,241, 25,178,162, 95, +117, 69,154, 53,160, 65, 78, 81,226, 3, 31, 54,178, 16,142, 88,213,117, 21,201,129,150,149,102, 23, 42,142, 98, 63, 69,123, 44, +181, 84,139,255,213, 18, 45,218, 65, 65, 68,108, 11,104,193, 31,215,100,111,208,100,142,173, 2, 45,171,249, 12, 19,167, 94,126, +162, 16,198,240,220, 93,120,238,226,213,122, 71, 79, 93,106,185,255,240,217, 86, 59,247, 30,107,181, 97,235,254,150,255,172,221, + 84, 15, 18, 40,187,198,240,178, 52, 99, 81, 79, 10, 96,145,106, 56,249, 27, 54,123, 28,144, 61,170,138, 13, 88, 18,255,195, 15, + 63,124, 76, 58,218,157,136,116,251,176, 97,231, 33,177,110,221,122, 2, 59, 78,116,150,174,172, 85,186,228, 41, 88,174,206,173, +253,167,239, 9,134,131,103,239,139,235,119,158, 8,168,163, 21,144,197, 9,132,160,136,246, 90,150, 8,190,136,148, 10,134,255, + 74, 62,175, 99,199,164, 86, 53,121,240,248,121,197,175, 24,236,202,238, 24,208,140, 10, 0,124,196,205, 60, 27, 63,168,150, 5, +205,197, 54,242,234,141,168,220, 17,247, 13,165, 86, 4, 26, 0,144, 84,187,201, 29,150, 81,169, 78, 36,208,234,223,191, 63,243, + 70,169,156, 71, 31, 75,144,138,252, 73, 21,153, 75, 74,101,182,209, 33, 5, 29,226, 82,234, 3,149, 19,119, 35,122,186,102,177, + 78,169,130, 67, 36,238,224,211,187,114,124,245,213, 87,138,138, 46, 74,148, 40, 86,118,139,213,130, 36,243, 41,213,229, 52,174, +135,164,146,146, 39,121,194, 64, 65, 56,172,189,199,111, 82, 21, 71,233, 45,128, 81,127, 11, 12,111, 78, 94, 17,192,180,110,221, +154, 11, 18, 45,152,104, 8,169,110, 48,223, 3,136,176, 44,109, 61,209,196, 2,229, 16, 1,112,214,172, 89, 47, 89,248,182,143, +213,248,168,215, 35,204, 3,235,137, 82,194,186,117,235, 50,175,249, 52,223,232, 3, 91, 69,241,195, 15, 63, 48,159,150,236,169, + 16, 47, 43,198,157,239,177,120,112, 75,179,104, 4,143, 77, 73,202,142, 67,240,210, 23, 54,100,190,176,121,236, 6, 64,103,205, + 24, 30,126,178, 74,212,234,116,235,231,249, 71,197, 79, 51, 15,136, 31,166,236, 20, 95,245, 95, 46,154,247, 89, 42,198,252,177, + 79,236, 59,117, 91, 44,221,114, 73,148,171,253,221, 13,203,198,240,160, 89,161,209, 15,183,250,206, 57, 44,126,156,113, 80,116, + 27,245,183, 40, 87,183,203,141,106, 77,122,220,244, 91,185, 87,156,187,250, 64, 44,219,122, 89,148,170,213,238,149, 25,195,247, +134,225,122,145, 66,133,134, 29, 63,176,107,114,231,118,173, 38, 37, 4,142, 38, 80,137, 30, 45, 90, 83, 74,158,104,151, 5,149, + 93, 71,171,160, 72,210, 35, 32,234,245,195, 15,195, 36, 61, 74,182,232,247,234, 50, 36,100,239, 68,141,218,117,173,129,239, 43, +189,246,199,111,211, 16,158,249,148,116,161,158,172,202,231,229, 51,248, 28,188,177,180,163,184,178,168,189,248, 40, 67,148,187, +141, 18,249,188,103, 5, 16,170,190, 99,174,146,179,210, 41, 94,227, 56,223,211,216,157,210, 38,170,246, 96,143,163, 0, 46, 12, + 72, 10,208,130,138, 97,104,239,222,189,135, 98,192, 24, 10,207,223,156,116,185, 43,203,240,162, 31,173, 42,153,125,158,215,206, + 23,231, 42,196,243,147,189, 65,147, 31,171,146, 37,234,195,207,115,199,120,190,226,199,210,138, 49,188, 12, 82,162,101, 55,159, +175,113,125,168,179,182,132,238, 22,240, 96, 9, 31,210,133, 3,119, 23,194, 46,162, 6, 84,122, 53,104, 0, 79, 73, 22, 65,150, +218,189, 3, 87,215, 50,141,133,114,210,199,205,248, 22, 45, 90, 4,115, 18,162,189, 19,213,137, 77,155, 54,229, 96, 60, 2,193, +178,171, 3,213,183,162, 65,253,241, 72, 13,180,228, 78, 68, 2, 45,255,127,182,138, 57,115,252, 4,220, 10, 24, 1, 24,189,108, +191, 75, 73,153, 26,203, 16,100,113, 98,148, 32,107,236,216,177, 4, 90,150,212, 9,174, 15,196,133,186, 83,201,167, 4, 90,106, +213,228,150,128, 3,130, 18, 27, 24,198, 95, 53,226, 35, 38,228,145,225,144,104, 89,241,217,101,161, 10, 45, 69,249, 52,111,222, +188,119,168,106,163, 74,139,234, 34,164,210,250, 80,170, 1, 53,170, 34,157,193, 22,125,218,254,208, 56,186,177, 17,117, 72, 15, +247,145, 22,232,222,182,146, 3, 0,136,203,140,143,113,132, 59,229, 12, 47,216,243,108, 35, 48,160,145, 62, 34, 37, 48,136, 24, + 11,106, 58, 5,196, 48, 31,102,223,135,138,116,139, 84,229,161, 29,209,167,155, 86,125,153, 31,192,243, 48, 36, 52, 74,249,173, +168,239, 64,103, 7,191,239, 82, 95, 26, 73, 39,219, 81, 82,200,120,216,209,186,217, 36,159, 53, 1,138,118, 34,206,167,102,229, +113,189,183, 18,191, 60,108, 16,159, 19, 92, 2,144, 30,135, 84,149,126,195,190,211,161,159,239,243,207, 63, 87, 22, 45,249,243, +231,231, 2,200,146, 75, 6,184,223,104,128,177,163, 23, 22,107,190, 43, 87,174, 84,236,180, 40,197,130, 68,220, 23, 82,114,218, +111,245,130,154,183,129,197,242, 40,209,222,207, 83,205,191, 78,199,201, 79,250,206, 62, 36, 38,175, 56, 37,150,195, 38,139, 82, +172,173, 8, 75,183, 94, 18,237,251,205,120,146,182, 64, 13, 51, 27,207, 16,159, 76, 9,119, 16,117, 58, 77,126,218, 7, 52,103, +172, 58, 35,214,236,189, 42, 40,197,218,117,252, 22, 64,214, 37,209,174,247,212, 39,233, 11,126,108, 5,176,219, 41,138,165,184, + 4, 36,101,177, 9,225,163, 82,133, 39,157, 58,180,103,242,119,237,219, 15,163, 33, 59,159, 23,204,155,119, 16, 65,205,216,209, +163,135, 1,212, 84,178, 10,180, 20,122,229,202, 41,128, 72, 77, 47,103,246,236,253,248,140, 82, 50,208,171,166, 71,207,147, 68, + 11,171,169,164,106,186,116, 31,209, 54,141, 79, 66,236, 44, 84,236,203,150,254, 84, 69, 64, 26,183,218,106, 62, 85, 12,138, 44, + 64,203, 92,117,104, 80,235, 52,212, 44, 14,181, 15,197,189, 67,209, 65, 20,103,162, 4, 90, 88,133, 41, 32, 11,122,253,161,152, + 80,124, 25, 15, 65,107,216,169,103,128,237,117,154,216,191,252,110,185,244, 62,243,171,100,137,242,172, 81,161, 56,207,119, 14, +135,152, 18,128,139, 64,171, 99,199,142,227,194,152, 79, 75, 29,193, 67, 36, 43,198,231,118,191,161,166,185,132, 71,235,128,192, + 18, 21, 17,197, 97, 41, 13,223, 25,244, 28,150,114, 66,209,164,177,146,207,202,181,107,215, 86, 12,207, 93, 19, 28, 29,161,122, +186, 60,210,196, 78,168,203,180,129,185, 9, 39,166, 57, 58, 30, 83,252,107,113, 39, 98,202, 22,255,137, 57, 11,254, 84,156, 37, + 34,255, 90, 53,159, 71,154,116, 63, 16, 24, 24,168, 96, 45, 58, 86, 37,200,162,234,136, 42, 67, 26,246, 66,101, 28, 12,187, 46, +173,177,181, 71,154, 0,123, 55,168, 38,165,138, 51, 83,187, 99,226, 93, 87, 62,211,182, 57, 36,254, 90,179, 89, 96,133, 46, 48, +249,205,215, 48, 66, 77, 83,207, 70, 43,212,206, 66,244,175, 17, 38, 54, 90, 86,234, 40,204,109, 9,182, 78,155,216, 46, 40,201, + 34,200, 66,166,117,237,134,232,166,129,187,208, 56, 49, 19,112,128,231,187, 61,148,189, 38,128,173, 45, 96,128,248,156,232, 63, +247, 64,211, 7, 42,221, 3,204, 43, 84, 99, 30,141,188,179,100,201,114,142,241, 0,224,244,164,152, 90,126,214, 64,219,160,203, +133, 1, 8, 70,174, 74,184,168,232,136, 69,203, 38,220,191,209, 97,182,150,102, 45, 72, 59,119, 33,158,153,253, 81, 43,128,172, + 61,136, 87,195, 2, 77,187,117,172, 23,223,157, 79,212,243, 95,108,223, 46,219, 59,143,170,106,212,253, 12,248,191, 18,180,125, +131,221, 25, 85,138,234,203,168,125,190, 11, 63, 89, 13, 32, 17,236, 70,181, 33,237,177,104, 0, 79, 41, 23, 37, 89, 46,144,197, +197,156,199,124,170, 95,210, 25,105, 74,128,173, 66,213,218,221,232, 58,230, 31, 49,102,201, 81,241, 43,108,178,134, 64, 93, 72, + 73, 22, 65, 86, 88, 28,150,166,202, 87,253,207, 98,181,190,187,241,253,232,213, 98,130,255,113, 49,253,239,147,226,151,153,235, + 69,249, 58, 29,175,167, 43,248,241, 43,117, 88,250, 81, 6,159,145,240,103, 21, 76,213, 97,173, 34,105, 2,224,208, 46, 45,252, +141,196,171, 82,185,178, 2,150,190,253,230, 27, 55,248,242, 32, 41,114,215, 81, 54,184,168,249,184, 70, 13, 37,109, 75,248,185, + 34,189,102,176,247, 42, 87,166,140,242,172, 75,167, 78,195,224, 11, 40,167, 5,160,229,166,201,184, 52,164, 87,211,165,106,179, + 78, 6,159,220, 61, 63,201,168,168, 13,199,182, 44, 36, 10,189,239,227,251, 6, 3, 45,217, 84,195, 12, 12,217, 25, 42,194,104, +114, 0, 86,179,138, 84, 11, 43,161,161,232,112, 28,152,200,108, 91,157,197,149, 27,175,211, 44,130, 29, 12,229, 51, 69, 89, 95, + 57,115,148,224, 54,165, 19, 61,111, 86, 44,238, 99,168,127,198,133, 51,159, 97, 29,220, 34,116,114, 68,166,150,240,124, 63,220, +205,142,224,145, 42,198, 37,140, 75, 3, 87,166, 85, 21,202, 74, 62,147,210, 30,139,187, 16, 97,107,226, 73,146, 32,201,122,164, +137,250, 40,143,129,246,105,224, 85, 72,157, 78, 94, 16, 91, 33, 29, 34,112,153,187,240, 79, 49,102,220, 36,129, 29,133,180, 5, + 73,103,113, 48, 87,162, 1,172,124, 84,190,124,249,235, 4, 91,135, 14, 29, 10, 1,178, 96, 39, 34, 0, 58,105, 99,134, 93,204, +150, 38, 8, 37, 18, 12,252,107,209, 11,254,173, 59, 65,226, 20,220, 83,236, 59,116, 74,108,218,190, 79,172, 92,179, 73,204,246, +251,157,147, 61,119, 90,154,209,212,238, 58,164, 27, 7,245,100,158,209,194,174, 67, 43,117,100,183,157,170,105, 86,133,228,231, + 48,213,125, 32, 98,118, 28, 82, 3,240,122, 25, 0, 7,141,195,121,224,182,250,138,232,124,242, 91, 4,112,116, 72,250,137, 73, +129,101, 60, 61, 9,208,203,200,167,221,250,208,139, 31,209,249,252, 8,117, 73,208,244,131,133,204,114,188,238,135,198,188, 28, +247, 10, 54,235, 61, 43, 93, 56, 64,114,248, 29, 3,234,143,199,241,152,169, 11, 61,150,157,170,193,180, 5, 63, 89,156, 38,127, +141, 51,105, 11,212, 60,147, 1,238, 28, 44,168, 11, 77,105,194, 45,196, 18,208, 59,155,182,192,199,167, 51, 22,169,133, 35,120, + 42,154,109,254,136,208, 58,226,185,131, 60, 64, 90, 30,185, 67, 55, 11, 37, 18,250,228, 42, 10, 7,207, 85, 42, 86, 84,128,209, +231,159,126, 58, 44, 11, 60, 85,152, 0, 24,119, 62, 11, 98,127,139, 59,109,173, 90,195, 40,137,130,161,109,156,178,165, 75, 15, + 37,189,198, 13, 26, 12, 75, 11, 37,137, 93,160,245, 1,204, 45,212,116,147, 98, 71, 36,129, 86,143,143, 51, 40, 64,171, 79,221, +108, 4, 90, 95,188,193, 64, 43,204, 18, 45,109,255,163, 31, 21, 14,174, 52, 88,229,221,204,175,138,149, 70,232,117,154,216,209, +144,173, 98,230, 40,135,170,103,127,135,171,222, 58, 94,202,167,133,177,232,165, 78, 58, 51,232,122,129,206, 64,233,122,224,222, +189,123, 70, 42,193, 37,148, 62,112,117, 79,144, 69,187, 21,228,114,182, 42,167, 86,234,136, 59,207,166,192,126,227, 57,142, 59, + 25, 99,129, 17,166, 52,161, 2, 26, 4,131,227, 39, 84,199,112,171, 59,253, 22,193,153, 33,119, 56, 62,194, 74, 87, 79, 53, 97, + 74, 19,147,255,143,217,179,103,191, 14,231,162,138, 81, 47,125, 65,193,174,228, 57,182,249, 95,198,202,186,138, 78,190, 77,105, + 98, 82,152, 12,155,178, 39,147, 39, 79, 86,118,159,193,190, 68,145,184,193,187,249, 35, 24,252,234, 29, 81,162, 71,147,126,180, +134, 65, 13,127,153, 62,192, 52,249,136, 3,192,182, 3,182, 63, 23,241,220, 72,245,110,154, 79, 11,117,162,141,226,208, 12, 3, +211, 60, 36,113,248,233,240,211, 91, 28,112,183, 37, 61,160, 37, 15,145,142,243,238,187, 13, 8,142,128,128, 27,216, 5, 69,177, +162, 69,171, 83,170, 88, 49,166, 85,118, 28, 50,240, 25,233,193,246,171,137, 17, 61,141,234, 48,132, 68,139,239,222,125,231,157, +239, 75,149, 40, 49, 76,238, 56,228,179,143, 50, 70, 57,216,185,106, 26, 81, 58, 93,148, 99, 77,146,251,196,121,131,129,150,183, +234,223, 77,199,170,109,142,157,193, 39,178,208,180,202, 76, 59,101, 15, 11, 77, 44, 98, 20,192,180, 68, 21, 40,189,210, 94,106, +137, 22,227,206, 64, 96, 90,121,217,201,167,218,255,147,167, 60, 91,165,153, 23, 43,221, 21, 80,243, 92,133, 58,241, 34, 86,187, +126, 32,154,218,128,176, 85,154,185, 1,184,126,131, 42,232, 40, 84, 91,123, 65,127, 4,232, 37, 11, 15, 77,128,203, 98,160,183, + 22, 42,158, 91,176,189, 9, 4,205,185,160,167,149,100, 89,225, 39,118, 75,235, 26,145, 83, 90,192,119, 70,151,213,178, 91,109, + 71,140,231,208,180,195, 45,243,184, 14, 63,205,121,100, 39,134,195, 79,112,139,160, 68,239,188, 65, 9, 86,104,128, 30, 86, 80, +212, 12,234, 66,109, 90, 51,122,102, 64,139,239,169,214,212,210,173,158,250,133, 1,191, 5, 64,168,215, 70,194,172,138,179,211, +224,188, 16, 87,230,147, 99,185,148,110,121,129,172, 57, 9,167,179,152,243,200, 78, 12,135,159,118,184,101, 30,215,225,167, 57, +143,236,196,112,248,105,135, 91,230,113, 29,126,154,243,200, 78,140, 72,203,207,138, 89,125, 82, 86,205,228, 3,237, 92,152,175, +200, 82,246, 55, 1,104,201, 50,188, 52,128, 24, 89, 42,215,201,103,152,251,175,110, 66,135,159, 14, 63,189,197, 1,167, 45,121, +139,147, 47,232, 56,252,116,248,233, 45, 14, 68, 68, 91,138,204, 64, 75, 45,201, 34,200, 10,161,165, 32,179,244,130,157,202, 48, +162,225,233,185, 25,125,135,166,126,189,132,181,190, 28,126, 58,252,180,218, 6,156,190,105,204, 1,171, 60, 84,199,115,248,233, +240, 83,143, 3,111,115, 91,146,252,160,105,135, 94,208, 26,150,155,245,161,183,250,125, 68, 32, 94,135,166,119,155,148,195, 79, +135,159,222,226,128,211,150,188,197, 73, 71,250,228,180,165,183,179, 45,121,183,212, 47,151,154,215,118, 29,218,205,182,211, 89, +236,114,204,115,124,135,159, 14, 63,189,197, 1,167, 45,121,139,147, 14, 40,114,218,146,211,150,188,203, 1,135,154, 45, 14, 56, + 29,208, 22,187, 76, 35, 59,252, 52,101,145,173, 8, 14, 63,109,177,203, 52,178,195, 79, 83, 22,217,138,224,240,211, 22,187, 76, + 35, 59,252, 52,101,145,173, 8, 17,193, 79, 91, 25,120,205, 34, 75, 27,173,240,237, 58,252,249,231,159,163, 98, 43,126, 60, 56, +155,203, 3,239,208, 81,113,222,152,217,225,178,166, 21, 49,116,196,152,168,216, 50, 31, 15, 12,203,115,253,230,221,168,205, 91, +116, 13, 55,205, 48, 48,223, 52,159, 14, 77, 91, 28,112,248,105,139, 93,166,145, 29,126,154,178,200, 86, 4,135,159,182,216,101, + 26,217,225,167, 41,139,108, 69,120,155,249,105,139, 81,175, 89,100,185,203, 48,124,187, 13,225,160, 49, 42, 64, 86, 10,132,129, + 56,252, 85,241,110,141,115,172, 60, 1, 35,211, 6, 3,111,212, 60,146, 7,167, 0,248, 12,132,215, 97,133,230,239,203, 54,134, +139,166, 30,243,225,251, 8, 71, 68, 25, 94,134,249, 52, 73,231,169,158, 77,203, 30,134, 70,226,208, 12, 3,211,194, 82,239,225, +248,140, 83, 71,225, 96,158, 78, 82,135,159, 14, 63,189,197, 1,167, 45,121,139,147, 47,232, 68, 4, 63,189,155,195,151, 75,205, + 59, 54, 90, 9, 18, 36,136, 14, 15,219, 31, 2, 99,237,133,115,201, 50, 22,202, 96, 90, 17, 56,230, 36,122,140,152, 49, 63, 4, +200,218, 27, 39, 78, 92,175,208,132, 23,238, 10, 0,133,231,112,168, 41,207, 90,139,141, 60,239,130,103,243, 64,220, 55, 27,228, + 89, 55,159,140,239, 74,199, 51,203, 98,147, 30,233,146,190, 55,202,110,129,134, 54,138, 41, 63, 29,154,182, 56,224,240,211, 22, +187, 76, 35, 59,252, 52,101,145,173, 8, 14, 63,109,177,203, 52,178,195, 79, 83, 22,217,138, 16, 17,252,180,149,129, 72, 25,217, +223,223,159,199,179,232, 94,144, 98, 69,205,157, 59,247,135, 80,243,109,202,153, 51,231, 99, 28,107,178, 0,192,195,236, 8, 30, + 51, 62, 68,205,146, 45,199,135,169, 82,190,191,169, 64,166,148,143,113,220,201, 2,120,225, 14, 15,205,104, 0, 71, 35, 43, 87, +174,124,123,211,166, 77,130, 32, 9, 25, 72,136, 3,138, 47,242,176, 97,120, 12, 15, 54,203,144,250, 61,227, 51, 29,211,147, 14, +233,145, 46,233,243, 59,120, 22,205, 14, 61, 39,174,195, 1,135, 3, 14, 7, 28, 14, 56, 28,112, 56,224,153, 3,158,176,200,107, +204, 59, 41,209,242,116,202,135,143,143, 9,208, 42, 8, 53,218,254,142, 29, 59, 62,231,185,111, 0, 92,219, 1,140, 74,224, 89, +136,163,115,190,252,242, 75, 51, 27, 43, 53,159, 10,190, 23, 63,193,254, 25, 29,170, 62,127, 48,173,150,248, 32,101,242,237, 56, +231,174, 4, 0, 77, 8,154,141,155,183,182, 66, 51, 21, 36,110,123, 97, 71,246,240,214,173, 91,196, 71, 2,255, 9,180, 18,225, +248,148,139, 39, 79,158, 20,200, 43,129, 36, 85,149, 86,174,168,140,207,116, 76, 79, 58,164, 71,186,164,207,239,240,123,120,158, +202, 10, 49, 39,142,195, 1,135, 3, 14, 7, 28, 14, 56, 28,112, 56, 96,206,129, 72, 10,180,100,193,212, 42,196,208,133,213, 22, +174, 72,145, 34, 49, 1, 50, 74, 64,122,243,105,146, 36, 73,182,181,104,209, 66, 80,162, 51,122,244,232,103, 53,107,214,188, 80, +188,120,241,185, 89,179,102,109, 14, 85, 98, 62, 72,188,154, 0, 32,165, 52, 59,149, 61,111,254,194, 49, 19, 38, 76, 84, 34, 70, +140,152,159,198,139,247,222,182,110, 45, 62, 23,193,103,167,138,103, 19,242, 62,107, 90,173,200,133, 50,133,115,206,205,150, 62, + 85,243,119,162, 69,205, 23, 37, 74,148, 38,160, 77,116,104,118,210,123, 38, 28,214, 27,184, 98,197,138,224, 51,103,206,136,205, +155, 55, 43, 64, 43, 94,188,120,183,144, 54, 30,222,225, 92,229,139,148,112,241,144,105, 43,160,141,204,137,194,248, 76,247, 63, +246,174, 2,172,138,166, 11, 95, 27, 21, 37, 20, 68, 64, 64, 64, 4, 65,236, 86,236,238,238,252,236,238, 14,236,238,238,238,238, +238, 86,236,238, 86,196, 64, 64, 12,234,252,231, 93,185,252,151,235,141,189,120, 13,116,150,103,158,229,238,206,158,157,121,231, +236,206,187,231,156,153,193,245,144, 3,121,144, 11,249,184, 15,238,135,251,242, 57, 94, 0, 93,108, 2, 1,129,128, 64, 64, 32, + 32, 16, 16, 8,252, 40, 2,241,148,104,233,182,104, 41, 43,165, 90, 57, 38, 76,179,152, 96, 93,229,197,126, 63,177,155, 48,164, +119,239,222,225, 87,175, 94,165, 3, 7, 14, 68,142, 28, 57,146,124,125,125, 35, 42, 84,168, 16,148, 39, 79,158, 23,188,120,239, + 93, 38, 68,129,124,205, 89, 78,121,117,128, 60,203,196, 36,217, 85,123, 91,219, 79, 54,214, 86, 33, 35,250,117, 11,143,250,176, +143,200,127, 84,228, 87, 95, 59,122, 58,216, 43,162, 91, 73,199,160,242,217,108, 94,216,167, 73,121,151,227,182, 2,153,108,157, +101,121, 90,101,178,213, 41, 55,147, 29,186,114,229, 10,241, 72, 72,186,124,249, 50,249,249,249, 73, 68,139,175, 67,178,176,183, +183,127,241,246,237, 91,229,111,217, 68, 11,215,227, 58, 92, 15, 57,248,141, 13,242,113, 31,220, 15,247,197,253, 81,142, 31, 85, + 46,113,189, 64, 64, 32, 32, 16, 16, 8, 8, 4,254, 85, 4, 52,113,145,191, 6, 11,174, 92, 49, 84, 16,123,101,165,152, 48,229, +115,117,117,221,156, 35, 71,142,200,217,179,103,211,134, 13, 27,104,225,194,133,145, 83,167, 78,165,113,227,198, 73,105,226,196, +137, 81, 99,199,142,141,240,241,241,137,228,120,166, 87,108,245,170,164, 7,148,124, 89,211,155,109,206,231,153, 49,242,245,146, +250, 68,167, 26, 19,173, 41, 20, 25, 53,223,149, 34, 7,219,210,231,113, 89, 40,106,168, 83,212,139,169, 5, 35,170,231,119,141, + 76,147, 38,205, 43, 38,123, 58,101, 50,193,177, 1,209,185,121,243, 38, 61,121,242,132, 30, 61,122, 36, 17, 32, 21,162,101,238, +224,224,240,226,227,199,143,113, 34, 90,184, 14,215,115,189,204,149, 68, 11,242,113, 31,220, 15,247,141, 38, 90, 54,127,141, 66, +136,138, 8, 4, 4, 2, 2, 1,129,128, 64,224, 23, 35,160,137,139,252,226, 34,252,200,237, 84,231,209,146, 39,135, 93,134,112, +157,217, 50,209,242,229,224,239, 7, 53,106,212, 8, 5,201,154, 52,105, 18, 8,150, 68,186, 14, 29, 58, 20,206,238,196,207,236, + 62,188, 59,115,230, 76, 79, 72,174, 88,177,162,214, 24, 40, 11,203, 52, 9, 82, 37, 75,108,235,229,153,205,183, 97,113,239, 7, +131,170,187,135,134, 45,201, 69, 81,131, 29, 40,114,186, 51, 69,174, 43, 21, 73,183,199,135,143,106, 85,234,115, 70,167,140,119, +103, 47, 92, 35,201, 44, 93, 86,187, 76,156,103,178,149,151,173,110,254,123,247,238,141,122,255,254,189,100,133,138,142,209,130, +235,208,156,227,201, 94, 68, 68, 68, 16,143,148,132,235, 80,246,134,252,184, 14,215, 67, 14,111,146,235, 16,242,113, 31,220, 15, +247,197,253,101, 11, 21, 25, 5, 2, 2, 1,129,128, 64, 64, 32, 32, 16,248,219, 16, 48,124, 30,173,194,133, 11,131,104, 37,204, +150, 45, 27, 98,156, 10,112, 58, 51,121,242,100, 16,173,136, 57,115,230,208,178,101,203, 34,154, 53,107, 22,196,211, 29,236, 96, +235,151, 37, 16,115,118,118,214,233,150,203, 91,160, 96,130, 20,201, 77, 18,122,120,120,165,178, 74,155,182,128,117,218, 52,103, +194, 38,121, 19, 13,181,143,160, 5, 57,137,214,149,143, 24, 95, 55, 95, 80,146, 36, 73,119,176, 56, 73,102, 6, 59, 91,185,174, + 62, 59, 14,206,191, 60,116,232,208,143, 97, 97, 97, 18,209, 98, 43,155, 52,234, 16, 68, 9,191,153, 20, 61, 5, 47,147,217,186, + 86,200,143,235,162,137,150, 5,228,225, 55,228,227, 62,184, 31,203, 18,193,240, 50, 1, 21,217, 4, 2, 2, 1,129,128, 64, 64, + 32,240,151, 34, 16,247,121,180,216,125,135,121,168,202, 85,169, 82,229, 46, 7,193,211,170, 85,171,104,254,252,249,145,179,102, +205,162, 94,189,122,221,228, 81,130,245, 0, 90,245,234,213,229, 18, 34,133,169,105,234, 20, 41,146, 37, 41,215,179,148,219,221, +168,113,238, 20,185,163, 30,125, 88, 85, 63, 50,114, 73, 62,218,217,173,232, 77,158, 54, 66,146, 89,163,114, 37,217, 50,163, 27, + 46, 17,147,159, 41, 28,164,255, 14, 46, 63,142, 29, 3,209, 74,171, 70,180,220,100, 54,178,155, 26,209, 74, 11,121,144, 11,249, +184, 15,203, 17,211, 59,200, 4, 83,100, 19, 8, 8, 4, 4, 2, 2, 1,129,128, 64, 64, 3, 2, 38, 38, 38,246, 28,123, 53,145, + 3,224,195, 71,141, 26, 21,153, 37, 75,150, 39, 94, 94, 94, 75,186,118,237, 26,198,191,195, 96,233,170, 87,175,158,100, 37,226, + 88, 45,117, 98,164,113, 66,179,132, 9, 19,216, 91,166, 74, 49,241,249,192,220,225,143, 71, 20,140,116,119,205,248, 36,187,171, +195,146,245, 61, 10,133, 61, 31,145, 39,204,193,210,148,101,214,149,100, 22, 44, 88, 64,150, 76,213,162, 99, 66, 81, 38, 66, 79, +217,165,135, 9, 75, 21, 60, 15,214, 5,144, 36, 62,134, 9, 75,157, 52, 84, 83, 83, 57,157,144, 31,215,225,122, 92, 3,121,144, + 43, 38, 44,213,251,168,252,140,137,236,132, 76,189,176, 27,148, 65,224,105, 16, 92,122, 51, 11, 60,245, 66,100, 80, 6,129,167, + 65,112,233,205, 28, 95,240,212, 91,145, 63, 60,131,238,169, 29,180, 21,158,227,146, 26,230,202,149,235, 28,147,169, 47, 28, 20, +254,134,173, 67,125, 59,116,232,224,194,214,158,219,217,179,103, 15,100,235,206, 99, 38, 98,117,181, 92,175,177,113, 77, 83, 36, +107, 88, 42,139,237,185,193, 21,115,125,177,183, 78,243, 38,125,122,187,190, 29, 58,117,113, 73,111,157,246,118,110, 79,231,192, +106, 94,118,143,121,234, 7,131,100,234, 3,159, 73,146, 39, 39,115, 67,202,137,252,184, 78,159,108, 67,100,198, 81,150,242,178, +248,242,176,136,114,254, 96, 67,171, 93, 46,240, 20,120, 26, 11, 1,161, 75,198, 66,242,155, 28,129,167,113,241,140,207,210,212, +215, 56,148,183,230, 33,199, 94,217,179,235,112, 52, 91,116,214,241, 28, 82,231,107,213,170,149, 7, 40,240, 98,210, 9,221,221, +221,125, 56, 88,252, 12, 91,180,238,240, 50, 58,135, 13, 32, 27,246,166,166,169, 70,155,153,153,175, 99,249,231, 43, 86,107, 40, +201,108,219,177,115, 66,167,140, 46, 62, 28,243,117, 38,157, 85,154, 59,108, 53, 50, 68,230,143, 54,142,120, 88,126, 20,193,216, +215, 11, 60, 5,158,198, 66, 64,232,146,177,144, 20,196, 64,232,210,159,175, 75,198, 45,225,175,149, 22,103,162,101,205, 22, 45, + 75,142,153,114,229, 17,118, 38,170,101,254,239,191,255, 18, 20, 45, 90,212,148,173, 89,117, 92, 92, 92,210,112,210, 20, 79,165, + 73,177,173,153,152, 89,242, 82, 59,174, 71,143, 95,137, 37,179,126,235, 46, 9,242, 20, 46, 97,154, 42,181, 89, 29,182,152,165, +177, 77,159, 81,174,204, 31,133, 83, 60,128, 63,138,160, 32, 90,194,234, 40,190,238,141,251, 20, 9, 60, 5,158,198, 67, 32,190, +244,113,198,171,241,239,145, 20, 55,215,225, 15,150, 53,190, 52,174, 40,231, 15, 54,180,218,229, 2, 79,129,167,177, 16, 16,186, +100, 44, 36,133, 69, 75,232,210,159,175, 75,198, 45,225, 63, 34, 77, 40,182,113, 27, 90,224, 41,240, 52, 22, 2, 66,151,140,133, +164, 32, 48, 66,151,132, 46, 25, 23,129,248, 41, 77,167,235, 16, 15,137,166,100, 72, 85,181,201,208,117, 92,159,124, 33, 83,115, +187,196,181,189, 4,158, 2, 79,185, 58, 32,158, 77,237, 8,200,197, 80, 53,159,192, 83,224,169, 9,129,127, 89,151, 84, 67, 45, +126,148,127,232,123,190,126,213,249,184,197,104, 25,161,116,226, 75,199, 8, 32,170,136, 16,120, 10, 60,141,133,128,208, 37, 99, + 33, 41, 44, 90, 66,151,132, 46, 25, 23,129,248, 41, 77,185, 4,143,238,197,165,127, 66,221,196, 3,104, 92, 80, 5,158, 2,207, +239, 16,160,117,138, 68, 52,199, 35, 19,205,118, 47, 70,243,178,185,145,175, 66,235, 50, 88,114, 73,187, 36,115,154,151, 11, 45, +200, 92,136,230,100,207,100, 12,153,113,108, 58,161,243,113, 4, 78,203,101, 2, 79,129,167,177, 16,144,116, 41,125,161,246, 53, +108,139,116,122,109, 87,184,195,107, 11,215,226, 65,233,108,157, 34,140,117, 3, 33, 71, 30, 2,226,161,150,135,147,220, 92, 2, + 79,185, 72,201,203,247, 87,224, 73, 51,178,120,210,156, 44,219,104,174,135, 31,167,213, 52,203,203, 91, 70,245,117,214, 61, 90, +230,102, 73,230,236, 44, 43,104,182,135,215,143,202,148,113,189,166, 44,127, 69, 27,253,201,117,239,212,177, 29,149,240,201, 65, + 46,142,214, 84,182, 84,118,234,210,185, 3, 25, 88, 94,209, 70, 6, 2,166, 39,123,188,194, 51,125,193, 14,111,155,142, 63, 75, +237,102,221,146, 82,155,105, 87,137,167,103,218,199,117,108,200, 41,133,113,161, 17,210,100,189, 36,121, 90, 7, 44,139, 19,149, + 60,121,242,141,188,135,169,205,208, 45, 94, 41,161,161,149,251,155, 30,192, 63,160,238,182,209,122, 22, 21,173,119,234, 69,210, +165, 75,169,248,101, 49,152,167, 54, 57,196,171, 35,188, 70,226, 57,222, 14,225, 24, 11, 73,165,163,110,191, 84, 63,105,153,119, + 74,154,149,185,215,151,233,238, 23,119,181,183,121,246,113,170,219, 37,154,227,222,143, 22,102,214, 85, 70, 20, 95,107, 57, 37, +153,115, 60,187,127,154,230,126,113,121, 11,135,231, 33, 83, 88,230, 44,143, 62, 63, 34, 83, 5, 47,139,164, 73,147,238,230,223, + 86, 50,245,227,151,226, 41,179, 76,178,222,117, 63, 32, 75,121,233, 47,169,123,229,242,133,232,115,208, 33, 90,189,180, 23,189, +124, 56,135,202,148,204,249, 67, 68,139,103,120,206,147, 39,113,226,158, 89, 20,138,146, 92, 17, 67,151, 81,251,165,117,143, 47, +109,244, 39,151, 51,150, 69,203,165,104, 84,186,244,142,132, 37,250,154, 54,109, 74,142,142,142, 31,185,236,117,140, 80,126, 33, +194,192, 78,135,222,188,121, 67,235,214,173,139,224, 57,186, 66,185,227,234,199,215, 39, 53, 0,197, 95,242,242, 49,160, 60,218, +178,106, 44, 39, 79,252,122,146, 23,235,246,231,186,251,243, 94, 90,218, 7,155,182,227,106,194,227,117,221, 85,234,226,206,147, +224, 62,230,201,112,111,171,214,207, 58,123,141, 66,110,133,155, 12, 73,235, 85,173,152, 6, 80, 13,169,123, 82,232, 21,244, 11, +122,246,252,249,115,116, 28,154, 58, 15,109, 50,139,242,100,188, 79,253,252,252,194, 63,125,250, 20, 21,112,105, 37, 5, 94, 94, + 74,111,207,207,165, 75,123,103,135, 91, 88,152, 63, 97,121, 69,181, 52,188, 33,229,148,171,102,218, 73,209, 92,118,239,205,201, +178,251,124,191, 12,119, 22, 52, 76, 19,126,164,171,221, 3, 38, 73,251,152,124,101,214, 35, 92,187, 76,184, 12,231,100,217,121, +178,151,195,221,182, 85,115, 71,236,236,232,240,144,101,238,165, 25,238,250,214, 9,213, 91,247,132, 9, 19,246,231,182,137,100, +178, 53, 82,102,229,245,202,148, 41, 71, 53,155,144,169,130, 70,237,234,197,233,243,135,131,180, 99,227, 96, 38, 90,179,169, 92, +169, 31, 35, 90, 57, 19, 38,236, 22, 86,179,230,151,165,217,179,111, 97,178, 85, 85, 11,217, 2, 1,235,204, 75,186,237,226,125, +253, 31,124,222, 85, 47, 31,235,225,225,241,156, 15,116,137,131, 76,141,239,165,220,185,115, 23, 42, 81,162,196,144,156, 57,115, +198,229,189,164, 81,102, 92,159,205, 56,232,186,242,146, 95,165,243, 29,115,228,200, 17,217,163, 71, 15, 90,191,126, 61,109,223, +190,157,178,102,205,250,149, 11, 97,247, 3,101,143, 47,151,230,138, 46,168, 50, 86,203,112, 67, 82,109,103, 69,225, 6, 46,138, + 35,117,157, 21,193,245, 92, 20, 33,141, 93, 20,199,107, 57, 75, 95, 44,186, 54, 77,141, 75,216, 94,191,126, 77, 88,160,185, 79, +159, 62, 95,216,234,128, 7,163,156, 76, 52, 99,201,228,201, 79,207,179,213, 1,235, 15,198, 42, 11, 31, 59,207, 22,136,239,214, + 37,228, 5,178, 37,162,195,251, 24,146,195,247,141,145,137, 25,240,113, 30,123,213,242, 96,125, 67, 62,246,140,175, 83, 63, 94, +146,143, 61, 85, 63,174, 42, 83, 85, 14, 58,240,160,160, 32, 10, 9, 9, 33, 38, 27, 47,148,231,112,252,195,135, 15, 20, 28, 28, + 28,235,184, 26, 38, 58, 31, 22, 96,128, 58,163,238,106,101,151,142,171,215, 41, 58,207,119, 50, 85,176,211,134,105, 92,218, 93, + 89, 36,247,178,101,203,190,137,136,136, 32, 87, 87,215,215,170,229,244, 40,246,223,240, 51,119, 66,130, 90,246,153,189,214,218, +179,122, 54, 67,234,174,146,183, 28,244, 9,122, 5,253, 2,201,122,249,242,165, 33, 68,171,116,181,106,213, 2,195,194,194,162, + 34, 35, 35,163,184, 61,162, 14,250,186, 80,216, 18, 11, 10, 93,155,131,222, 29, 31,202,132,107, 78, 84,217,226,121, 2,181,180, +241,175,122,161, 41,104,157,103, 82,154,151,165, 69,228,108,143, 11, 75, 26,167, 13,244, 95,215,142, 38,213,176, 8, 9,155,233, +126,129,102,101,105, 75,139,157, 98, 77, 8, 44, 7, 79, 73,230,172,204,205, 33,115,104, 45,151, 15,235, 86, 45,165,238, 21,157, + 63,126,147,233,222, 58, 46, 50, 85,238,203,134,197, 36,111,167, 78,157, 74, 76,180,130,248,120, 50, 25,207,252, 47,195, 83, 70, + 89, 12,125,215,197,202,159,207, 78, 97, 95, 50, 83,162,179,185,108, 21,133,101,222, 75, 78,221,179, 70, 63,239,238,113,149,169, + 36, 90,213, 42,229,166,242,165,115,252,176,235,144, 45, 90,229, 64,178,162,106,215,142,212, 66,182, 64,178,250,142, 25, 51,198, +143,159, 49, 63,158,236,250, 8,255, 86,143, 43,148, 83,119,245, 42, 79, 97,153,132,119,139,179,179,243, 7, 3,101,106,125, 47, +149, 41, 83,102,248,195,135, 15,131, 6, 15, 30,188,150, 73,151, 33,239, 37,173, 50,245,180, 85, 92,234,174,175,249,127,165, 76, +123, 46, 76, 31,238, 19, 63,128,104,117,235,214, 13,239,223,218,250, 10,168,239, 60,211,134,100,156, 74,112,170,196,169, 20,167, +124,209,255,231,229, 61, 18,142,151, 86,219,231,133, 92,149,243,249,181,200,192,181,170,215,171,202,196,113,213,223,177,254, 87, + 41,183,114,212,161,250,254, 91, 22,128,161,186, 87,175,112, 61,103,133,111,167, 66,246,161, 55,182,173,164,144,167, 15,232,253, +205,139,116,113,222, 40,234,148,215, 58,180,161,139, 98,172, 62,128,212,206, 75, 68,235,196,137, 19,116,237,218, 53,137,112,220, +185,115,135,242,231,207,255,137, 95, 24, 7, 56,175,179, 33,242,184, 49,253, 15, 28, 56, 64,220,121,127, 96, 34, 49, 65,249,112, +129, 44,225, 30, 56,206,121,166,240,241, 68,144,203,203, 8,189,198,253, 85, 73,142,234,253,184,147,125,143,243,176, 56, 69, 31, + 79,132,235,121,125,199,144,115,231,206, 17, 19, 34,229,241,132,124,143, 9, 29, 59,118, 12, 97,203,135,234,113,157,197,103, 43, +206, 83,126,185,208,182,109,219,136, 23,168,142, 69,180,112,124,203,150, 45,186,136,150, 54,217, 9,185,238,227, 27, 55,110, 28, +252,232,209, 35,226,217,250, 99,202, 8, 76,216,132, 27,252,228,201, 19,226,117, 27,149,199,117,150, 17,215,159, 60,121,146,106, +214,172, 25,164,138, 41,142,159, 58,117, 74,121,124,188,134, 23,217,119,114,121,137,166, 54,168, 39,146,133,133,197, 72, 94,164, +251, 85, 64, 64,128,164, 3, 74,162,165,180,100,165,203, 90,181,219,156,117,167,206, 28,189,250, 54, 32,123,153,118,227,205,179, + 87, 51, 55, 64, 23,156,161, 63,197,138, 21,251,244,244,233, 83,137,196, 95,190,124, 89,210,179,187,119,239,106, 35, 90,234,226, + 83,115,125,159,127,249,242, 37, 10,137,203, 25,201, 31, 4,145, 55, 39,216, 18, 45, 74, 18,147, 2,183, 84,161, 87, 71, 71, 71, +153,165, 74,249,140, 5,164, 54,160,140, 70,205, 74, 51,189, 50, 32, 38,235,250, 96,199,155, 71,199,148, 15,167, 71, 7,105,101, +115,235,240, 35,221,236,239,113, 92,213, 6,154,235,233, 96,232, 13, 37,153,179, 61, 87, 94, 30,224,120,107,250,208,206,225,143, + 31, 63,166,158, 77,203, 71,236,237,100,127,159,173, 92,235,226, 34, 83,165, 12, 13,106,212,168, 17, 2, 93,228,133,233, 63, 38, + 74,148,232, 63, 67,203, 23, 95,243,131,100,149,118, 79,246,252,242,138,158, 81, 85,178,166,124,107, 0,217,210, 85,229,172,252, + 92,189, 89,178,100, 9,241, 59, 10, 31, 45,114,201, 86, 44,153, 32, 90,159, 62, 28,160,234,149,243,233,116, 25,214,173, 91,151, +216,178, 67,157, 58,117,210,231, 90, 76, 0, 75,150, 22,178, 37,145,172,113,227,198,249,133,135,135,251, 45, 94,188,216,175,106, +213,170,126,124,172,231, 15,182,237,212,177, 99,199, 18,203, 36,150, 73, 44, 19,101,156,166, 77,166,156,247,146,210,146,197,107, +253,118,219,188,121,243,153, 91,183,110, 5, 84,174, 92,121, 60,175,241,171,241,189, 36, 71,230, 15,214,241,167, 92,206,239, 60, +183,108,217,178, 45,231,103,242, 9, 91,163,190,122,122,122,126,230, 37,246, 30,177, 37,106, 9,135, 76, 24,212, 31,171, 20,176, + 64,225,194,133, 35,143, 28, 57, 66,252,204,163, 45,148,214, 30,157,117,208,197, 69, 64,172,250,246,237, 11, 15, 24, 97, 15, 98, +132,255,163, 9, 82,204,255,202, 99, 42,231, 36,242,165,252,173, 73, 6,206,105,184, 78,186, 70,211, 61, 84,229,169, 84, 72,221, +146, 21,123,186, 7, 84,142, 83, 49, 78, 71,212, 81,168,227,162, 40,196, 36,235,211,167,128,151,116,117, 84, 87, 58, 84, 34, 3, +157, 40,158,158,110,119,175, 65, 47, 87, 76,161,246, 57, 45, 67,107,187, 40, 74, 24,160, 1, 82, 39, 11,114,130,116,225,194, 5, +226,175, 5,130, 53,103,205,154, 53,145,220,153,127,226,198, 29,195,242,100, 5,209,129, 80, 65, 30,119,140, 52,114,228,200,207, +209,150, 42, 27, 16, 37, 28, 15, 12, 12, 36,254,202,249,204,191, 47,179, 76, 59, 38, 27, 79, 31, 60,120, 64, 54, 54, 54, 49, 36, + 71,181,236, 32, 82,252, 64, 41,137,147, 61,255,190,186,117,235,214, 48,200,122,246,236, 25, 49, 81, 2, 89,177,225,114, 94,100, +188,164,227, 47, 94,188, 80, 30,215, 11, 3,136, 22,187,163,136,151, 52,138, 85, 6,229,241, 93,187,118,197, 34, 96,122, 5,114, + 89,184,110,126,140,221, 87, 16,181,171, 87,175, 42, 73,162, 13, 19,155, 11,236, 58,147,142,223,188,121, 83, 54, 25,204,152, 49, +163, 68, 70,241,101, 56,103,206,156, 47, 74, 76,149,199,191,126,253, 10, 31,252, 23,198, 30, 47, 72, 27, 93,101,100,188, 95, 32, + 63,218,129,201,116, 8,136, 15, 44,122,216, 32, 15,215, 42, 45, 89, 45,122,207, 92,235,156,175,225,168, 61,103,159, 63, 91,176, +249,188,159, 85,214,106,229,101,212, 63, 5,244,133, 9,220,231, 99,199,142, 69,178, 37,138,208,145, 67,175,148, 58,118,229,202, + 21, 89, 68, 11,241, 87,103,206,156, 9,131, 37,139,221,219, 18,201,226, 20,161, 78,180, 64,186,222,236,106, 69, 59,230,117,249, +202,150, 25,196,108,253,242, 77, 26, 21, 56,215,163, 26,130,213,151, 52,182,122, 19,124, 97, 21,209,190, 46,116,127,184, 11, 13, + 46,159, 58, 56, 74, 10,140,207, 82,155,124,139, 37,150, 91, 56, 73,230, 60,207, 42,144, 57,182,142,211,219,139,126,231, 8, 47, +202, 89, 83,198, 81,167,210,246, 31, 37,153,179, 61,107, 26, 34, 83,245,222,220, 78,119,142, 31, 63, 78, 71,143, 30,165,161, 67, +135, 18, 19, 99,184, 96,127,104,147, 44,112,179,221,157,104, 62,143,184, 92,152,217,150, 14,203,175,239, 15,221,216,128,139, 65, +178,202,184, 39,123,246,230,226,102,162,119,119,233,213, 4, 47, 42,239,145,228, 71,201, 22, 72, 86, 0, 62,172, 94,189,122, 69, +147, 38, 77, 34,126, 30,227, 68,182, 36,162, 21,184, 95, 39,209,226, 15, 80,154, 60,121,178, 68,100, 10, 20, 40,160,143,104, 1, +157,239,200,150,135, 66, 81,141,143,247, 27, 63,126,124, 12,201,154, 57,115,166, 31, 63,159,126, 28,203,179,211, 0, 72,213,179, + 78, 99,153, 49, 36,139,101, 18,158,121, 39, 39,167,167,218,100,202,121, 47, 41, 45, 89, 3, 7, 14, 92,203,203,205,141,186,120, +241,226,179, 29, 59,118,248, 49,241,210,248, 94,146, 35,243, 7,234, 40, 93,202,175,205,196,156, 96,217, 65,226,175, 63, 2,113, + 69,194,115,158,132,147,100, 80,144,179,241,135,121,202, 66,133, 10,249, 53,106,212, 40, 20,100, 29,186,132,143, 83, 96, 57,100, +200, 16, 90,180,104, 17, 62,170, 63,242,123,251, 76,237,218,181,147,203,145, 25,157,199, 11, 22, 69, 24, 13, 86,174, 92, 9,235, +245, 14,185,215,234,226, 34,106,228, 70, 34, 88,128,228, 27, 44,255, 39, 82,170,191,181,253,175,141,164,105,146,163,126, 76,195, +253, 80, 61,253, 11, 72, 71, 87, 78,227,195,211,192, 89,113,240,218,166,197,116,125, 92, 79,218,231,157,152,142,230, 72, 66,103, +115, 37,161,203,121,146,210,147, 54,197,233, 76,199, 74,212,212, 53,193, 41,185, 64, 70, 23, 82,178,102,169,166, 27, 55,110, 72, +132, 5,157,100,151, 46, 93, 62,179, 75,240, 13,231,173,174, 79,174,146, 80, 29, 60,120,144, 96, 41, 97, 82, 20,197,214,170, 87, +204,210, 3,129, 62, 44, 51,248, 42,103, 2, 19,197, 95, 28,136,139,122,135,251,240,255, 26,137, 22,136, 20,136, 31, 95,255, 33, +115,230,204,111, 81,158,168,168, 40, 73, 9,209,233, 48,233, 8,100,182,255, 26,199,177, 97,143,123,168, 88,145,116, 22,153,243, + 61, 5,233, 64,103,195,228, 32,166, 12, 56,254,254,253,123, 66, 61,180,145, 64,117,193,112, 21,114,140,195,107,148, 13, 68,243, +244,233,211,180,115,231, 78,148, 61,144,191, 74, 94,163,222, 32, 57, 32, 29,135, 14, 29,146, 93, 70, 54,229, 75, 68,235,252,249, +243,146,101, 8,245,227,178,250,243,250,147, 31,112, 28,150, 61,148, 21,247,115,112,112,240, 87,119,219,170,150, 19, 86, 52,148, + 1,109,131, 47, 77,101,155,131,252,241,181, 18,209,178,242,174, 90,107,246,186,147,167,143, 92,126,243,218, 38, 71,205,193,131, +167,109,222,131,255,173,189,171,182,215,211,254,213,217, 37,250,102,198,140, 25,124,139,175,244,246,237, 91,137, 80,170,235, 22, +126, 71, 63,144, 58,197,113,199,127,152,235, 27,133,164, 36, 89, 32, 92,154,136,214,199,149,238,244,104, 91,135, 40,214, 63,109, +139,159,235, 83,221, 31, 58, 79,243,189,210,241, 72,192, 89,143,134, 59, 95, 95,211, 57,231, 87,122,117,145,104,126,118, 98,139, + 19, 13,173,104, 17,126,166,183,195,109, 38, 76,243,105,177,167, 78, 34,172, 90, 8, 73,230, 28,143, 25,247,135, 57, 95, 31,209, +174,202, 87,184,247, 55,108,216, 64,220,185, 80,203, 74, 57,195,143,247,200,112,135,173, 90,115, 13,145,169, 34,223,135,191,154, +131, 85,101,178, 62,133,240,249, 50,113, 5, 2,110, 76,154,239, 89, 66,178,222,205,241, 56,202,113,100, 75,153, 92,230,163,185, +185,208,225,252, 17,155,146,100,189,189,244,141,100,209,210,194, 68, 11,115,211,203,105,249,169,124, 22,147,184,146,173,172,252, +142,144, 72,150,191,191,191,212, 62,251,246,237,163,133, 11, 23,226, 99,202, 96,178,245,141,104,237,163,106, 85, 52, 91,180, 84, + 73, 22, 58,223, 74,149, 42, 17,119,206, 6,147,173,145,238,238, 55,218,214,175,127,159,159, 85, 63,254, 40,150, 44, 89, 32, 89, +249,242,229, 59,205,141, 21,215,128,233, 25, 19, 38, 76, 32,124, 96,177, 76,201,146, 5,146,197, 50, 17, 23,212, 65,155, 18,200, +121, 47,113, 76, 86,173, 77,155, 54,157,230,119,202,235,188,121,243, 14,158, 61,123,246, 30,252,207, 68, 75,227,123, 73,142,204, +184, 42, 37, 8, 21,167,228,156,204, 56, 89,114, 74,195,201,156,137,140, 5,183,143, 57,203, 53,139, 78, 24, 4,163, 43,100, 64, + 42, 2, 91,175, 50,112,157, 2, 55,110,220, 40,245, 99,136,167, 98, 34, 73,236,185,193,136, 65,242,245,245,149,244, 9, 31,197, +115,231,206, 37,182,226,189, 99,226, 42,231, 93, 98,194,253,207,205,213,171, 87, 19, 99, 71,246,246,246, 1,124, 59,167,232,122, + 15,228,143,127,180,117, 53,109, 56,232,226, 34,170,196, 10,239,115, 25, 4, 72, 39, 1, 83,202,208, 70,186, 52,157, 87,189,175, +202,255,168,142,210,154,165,189,137,117,177,200,250,206,138,119,111, 47,159,161, 19,165, 28,232, 68,206, 36,116, 62,119, 82,186, +150, 55, 41,221, 45,144,140,158,149,180,164,151,189,170, 19,199,110,225,133, 41,119,147, 26, 22,238, 28, 77, 9, 36, 7, 47, 15, +124,249,114,224,108,164, 62,161, 32, 70,144, 7,130,194, 22, 13,186,127,255, 62,177, 85,130,250,245,235,247, 21,199, 97,213, 0, + 75,199,113, 60,128,108,178, 14, 67,135,204, 10,160,145,104,129, 48, 33,174,135,191, 98,194, 96,101,131, 85, 7,229, 84, 90,223, + 6, 13, 26,244, 85,121, 28,101,133, 76, 88,145,228,186,229, 96, 81, 67,253, 64, 82, 84,201,158,242, 56, 44, 62,170, 4, 76, 87, +253, 81, 86, 88,199, 64,220, 80,103, 96, 6, 82,212,191,127,255,175,159, 63,127,150, 30,146, 75,151, 46,197,148, 93,110, 25,225, +210, 3,118,103,207,158,149, 72, 21, 98,156,238,221,187,135, 23,153,132, 41,238,133, 4,156,240,178, 87,113,179,126, 87, 92,180, + 15,242,160,125, 6, 12, 24, 32,237, 65,250, 80,102,174,167, 68,180,156,156,138,153, 20,169,217,103,214,185,187,161, 31, 75,213, +239,191,176,106,203,225, 75,241,127,222,202,157,217,244,239,171,117, 78, 40,232, 7,218, 50, 52, 52, 84, 34,211,218,116, 74,174, +235, 48, 89,178,100, 1, 32,128, 76, 34, 37, 75, 22, 18,199,104, 69,150,205, 97, 70,158,246, 73, 98,165,202,121, 44,232,225,230, +214, 24, 61,139, 23,201, 47,221,184,135, 75, 64, 11, 50,249, 48,233, 57,187,170,169,245,171,151,251, 39,176, 47,126,164, 68,178, +104,126, 54, 58, 54,192,155,250,150,181,252,192,228,227, 60, 91,160, 56,166, 65,255,200, 47, 73,230,124,183, 34,144, 57,179,161, +131,255,145,253,187, 37,130, 14, 23, 55, 92,243,179, 39,143,162,118, 37,108,130,153,200,156,227,251, 20,151, 35, 83, 21, 20,254, +112,218,207, 47,222, 40, 85,153,120,153,179,238,156,140, 11,120, 18,201,154, 46,145,172,173, 87, 7, 56, 94, 24, 81,201,252,237, +221,161, 25,207,113,157,215,210, 92,111, 99,144,173,226,108,129,123,192,101, 43, 18,151,242,225, 26,137,100,121, 36,123,250, 46, + 22,201,202, 69,180,204,135,104, 77,121,122, 57,191, 2,149,247, 76, 97, 40,217, 2,201,146, 62,174, 84, 73, 22,158,125,188,163, +208, 97,242, 51,103, 16,217, 2,209, 10, 13,220, 75,213, 52,184, 14,171, 87,175, 46, 89,178, 64,100, 22, 44, 88, 64, 76, 54,164, +119, 30,187,133,228, 16, 45,192,144, 0,150, 44,144,172,200,218,181,105,111,171, 86,129, 45,107,215,190,207,199,135,112,234,192, +100, 27, 35, 80,227, 66,178, 96,197,153, 57,113,226, 68,169,108, 35, 70,140, 64,121, 22,114, 26,197, 50,241,110,215, 74,178, 80, + 40, 57,239, 37, 38, 23, 38, 13, 26, 52,152,197,239,150,143, 28,126,177,176, 93,187,118, 75,241, 63,187,194,166,113,136,194,119, +239, 37, 57, 50,227,162, 75,108,185, 44,197, 33, 27, 89,163, 73, 86, 58,222,103,224,228,200,237,144,145, 61, 11,206,108,153,202, +200,239,210, 12, 44, 27,157,125, 58, 46, 95,122, 38, 75, 58,245,150, 45,136, 23,241,108, 43, 55, 16,104,196, 78,242,135, 43,158, +201, 88, 68, 11,122, 6, 43, 97,250,244,233, 79,200, 40,127,155,158, 61,123,210,225,195,135, 9, 46, 72,206,175,156,106,198,188, +116,233,210,146, 87, 40,154, 4,231,214, 36, 43, 46, 22, 45, 16, 37,117,210,165, 78,158,244,157,231,178, 72,164, 76, 83, 62, 25, +199,100,192,194, 89,116,249, 69, 65,180, 94, 30,220, 66,126,165,236,232, 34, 91,177,110,230, 75, 70, 15,152,100, 61, 47,108, 66, +239, 74,154, 83, 64,171,130,212,208,213,112,162, 5, 75,144,174,196, 62,113, 89, 68, 11,100, 67, 73,168, 64, 42, 64,122, 64, 86, +134, 13, 27, 38,145, 2, 16, 44,188,148,112, 47, 88, 59,166, 79,159, 30, 6, 43, 13, 91, 83, 52, 18, 45,182,134,249,195,250,194, +238,198, 48,228,199,245,183,111,223,150,226,200,144,248,129,254, 10,235, 27,228,193, 5,137, 4,194,197, 15,131,172,248, 39, 16, + 42, 88,212,240,245,160, 78,180,160,132,176, 34,105,179,182,169,183, 38, 8, 14,242,131, 72,226,229, 7,203,205,245,235,215,165, +186,227, 55,202, 13,146, 1,146,132,114,162,110,114, 52,194,205,205, 77, 34, 90,112,161, 66, 30, 18,238,193,238, 9, 9, 83,213, +227, 32, 92, 42,113,107,223,137, 71, 25,209, 30,248,194,225, 23, 2,220,195, 82, 66,185,208, 97,224,130, 31, 33, 90,168,151, 62, + 93,194,121, 60, 72,250,234,206,129,218, 1, 32,128,108, 21,140, 98,119, 76, 4,227, 23,118,255,206,157,176,173,214,214,116,111, +193,130, 40,198,247, 19,227, 26,202,199, 67, 57, 14, 44,148,243,132,253, 22,162, 53, 43,171, 5, 19,140,145, 1,227, 51, 93,153, + 82,223,254,115,148,255, 21,182,148, 20,146, 72, 22,173, 40, 78,225,107,171, 83,189, 60,102, 17, 55,125,157,175,179,149,103, 28, +143, 22, 76,163,175,238, 4,153,115, 60,135,191, 30,151,233, 74,207,218,185, 63, 99,100, 48,172,163,176,148,160,253,252, 88,207, +202,120, 91, 69, 94, 27,228,116,131,243,141,145, 35, 83,229,158,174,252,124,132,170,203,132,238,242, 23, 46,134,127,115, 72,143, +252,141,166,185, 38,147,200, 30,147,172,107,131, 28,253,134, 85,182, 14,189,186,176, 37,117, 40,156, 34,244,250,144,140,231,153, +108,173,163, 57, 89, 11,252,128,101,171, 24, 91,174, 63,206,159, 63,159,184,125,241, 17,233, 35,191,116,255,207, 89, 42, 83,162, + 29,199,103, 52,143,138,177,100, 45,200,193,237, 84,132,104,117, 57,162, 13, 53,137,182, 53,165, 11, 83,170,145,143, 75,146, 88, +131, 66,116,221,139, 9,235, 53, 88, 33, 52,145, 44,188,151,240, 46, 66,135,201,157,190,234, 96, 31,173, 34, 39,140, 31, 71,165, +138,231,160,208,247,123,169,184, 79, 22,226,223,239,149,153, 17, 91,163, 36, 89,112,245,130,116,225, 61,192, 29, 37, 97, 84,153, + 30, 76,202,242,179,191,156, 59,215, 51,140,229,206, 14,141, 26,221, 7,201, 2,217, 26,145, 57,243,205,104, 55,162,161, 83, 63, +212, 71,184, 66,169, 82,165,194, 48, 0, 9,238, 82, 88,178,163, 73,214, 60, 46,143,108,121,114,222, 75,134, 18, 45, 57, 50,227, +162, 71,220,199,185,117,237,218,181, 37,215,213,139, 95,191,246,156, 50,241,199,160, 55,127,176,102,155, 50,101,138,119,195,134, + 13,179, 50,169,193, 51,148,169, 73,147, 38,118,252,254, 46,197,255,103,212,117, 47,118,231,241,224, 76, 15,238,234,190,197,203, +226, 3, 8, 31, 62,170, 9,253, 41,140, 10,104,115, 14,243,120,197,242, 92,101,148,127, 2,158, 27,232, 32,231,221,198, 9,243, +239, 73,113,172,172,147, 23,113, 31,244,169,209,134, 14, 43,117,121,122, 98,180,116,197, 97,105, 61,135,123,196,133,104, 41,175, +249,118,121,108, 18,166, 38, 79, 89, 13,253,238, 67,109, 0, 54,114, 81, 28, 60, 61,166, 27, 61,234, 86,149,110,231, 79, 70,143, + 11,154,208,171, 34, 38, 20, 88, 52, 57,125,174,225, 68,167,203,218, 82,243, 56,184, 14,241,162,208,148,208,184, 21, 43, 86, 12, +149,235, 58, 4,121, 80, 37, 84,171, 86,173,138,226,151,250, 43, 86,250, 64, 28,135,197, 3,110, 46,142,137,138,226, 47, 29,127, + 38, 5,239, 96,165, 98, 51,168, 70,162, 5,194, 4,229,226,235, 63,240,255,175,153,240, 69,193,114, 3,114, 4,203, 14,228, 66, + 62,127, 57,194,189, 36,185,196,208,129, 48,105,144, 69, 98,248, 90,238,163,159, 18, 94,138,170, 86, 53, 28, 7, 33, 0, 81,212, +102,109, 83,111, 35,184,236, 80, 22,212, 25,215, 66, 46,202,170, 94, 70,148, 15, 56,200, 45, 35,187, 76, 37,162,133, 58,131,252, + 49, 49,146, 48,101,204, 36,215,161,242,248,218,181,107,165,227,186, 92,135, 24,172, 0,255, 63,204,207,245,235,215,151,220,135, + 76,118, 37, 43, 9,147, 78,169,131,177,246,170, 90, 61,174,174, 67,232, 9,244, 5,122,163, 77,167,112, 28, 15,139,190,151, 4, +127,205, 29,225,193, 25, 81,156, 34,249,203, 53,156, 73, 70, 40, 91, 30, 63,129,100,109, 74,149,138, 30, 44, 90, 20,197, 29,217, + 39, 38,238,161,220,246,159,217,138,240,133, 95, 30, 71,244,201, 53,246,121, 38, 58, 89,152, 76, 28,219,208,210,230,233,205,213, + 61,163,232,210, 60, 38, 89,222, 68,203,217,208,132, 14,124,103, 43, 90,214,163, 56,245, 46,155,230, 29,187, 23, 79,210,188,236, +217,245,149,129,221,134, 30,112,191, 45,111, 97,255,108,235,186,165, 81, 32,233,123,246,236,145,172,196,176,148,128, 92,143, 27, +210,131,186,149,177,121,207, 86,175, 19, 52,211, 83,175, 76,229, 61,217, 82, 56,143,221,187,225,248, 80,217,189,123,119,140, 76, +124,200,176,229, 57,130, 59,207, 85,250,202,167, 60,255, 45, 38,203,171, 24, 91,214,182,222, 28,156,209,111, 68, 21,171,208,208, + 27,219,137, 46,205,167,171,131, 50, 82,163, 92, 41,190, 92,236,239,120, 65, 10,220,159,233, 85, 48, 14,100,203, 7, 36, 11,101, +197,243,142, 47,121,214, 49,144,193,162,114,203,168,204,151,223, 70,225, 84,218, 45,209,203, 75, 3,157,191,185,117, 65,134, 87, +149,229, 54,170, 65,180,181, 49,249,175,108, 76, 21,179,166, 10, 44,224, 16,123,196,180,158,251,228,100,114,250, 6,229, 2, 9, + 86, 90,178,148, 36, 11,207, 21,191, 19,223,178,140,172,250,202, 59,105,226, 4,191, 38, 13,202,209,211,251,219,153,104,237,161, +235,126,211,169, 70,229, 28, 84,188, 88, 81,116,172,132,224,114, 16, 25, 30,109, 71,245,234,213,163,214,173, 91, 75,241, 89, 60, +162, 87,223,179, 84,150, 7, 9,249,241,115,228,199,175, 11, 63, 14,107,144, 18, 44, 89, 32, 89, 58, 70, 35,234, 42,114,125,184, +181, 48, 42, 27, 27, 66, 37, 84, 72,214, 28,190, 80, 54,201,194, 77,228,188,151,216, 69, 88,221, 16,215,161, 28,153,250,218, 68, +203,249, 4,252,174, 44,204,248, 55,229,119, 60, 43, 16, 21,224,247, 83, 65,142,129,202,199,109,148,159, 7, 39, 20,229,143,216, +162,124, 62, 39,187, 4,203,240,199, 65, 62, 57,120,240,187, 59, 31,187, 71,223,191,123,247,142, 96,201,199,199, 63,222,211, 32, + 74, 32, 87,240,138,128, 20,113,120,202, 91, 14,171, 80, 31,109,169,173, 42,109,248, 67, 95,122,103, 96, 95,167, 78, 29,242,241, +241, 33,111,111,239, 80, 38,174, 95,152, 8, 74,109,135, 65, 85,108, 49,198,164,166,178, 55,174,183,214,145,133,186,206,225, 6, + 50,175,213, 54,178,208,144, 81,135,202,229,119,148,123,121,245, 67, 48,124,219,156, 22,159, 94, 78,233, 69,254,205,243,211,155, +146, 22, 20, 84,202,140,190, 86,207, 64,129,213, 28,232,191, 76, 9, 62,198, 37, 24, 30,150, 3,213, 4,210,194,238,186,112, 86, + 18,131,130,225, 65,140,240,224,129,240,240, 48,210,143,172,144,248,146,179, 97, 51,167,116, 28,102,101,254, 26,251,200,249, 46, +243,113, 59, 38, 91, 79,113, 92, 27,209, 2, 25,129, 59, 46,154,148, 56, 49, 49,187,206,174,184, 16,229,212, 11,209,199,109,112, + 31, 54,145,178,113,236,163,164,144,184,159, 28, 68,249,122,137, 80, 65,129,163, 77,220,210,101, 56, 14,247, 23, 94,240,114,137, + 86,244,253, 80, 22,191,238,221,187, 75,101,196, 40, 78,213, 50,246,238,221,251, 35, 20, 27,228, 82,110, 25, 17,131, 6,140,224, +122,228, 47,215, 24, 76,213,142,135,224,190, 40,186,174,122,243, 3,250, 2, 95, 55,240,247,195,148,140,224, 72,116, 18,152,208, + 46, 58,158, 68,225, 81,180,197, 32, 76,235,240, 35,193,240,208, 27,232, 15,244, 72, 93,183,240, 27,207,154,190,246, 97,194,232, +203,113,120, 95, 25,171, 40,126, 17,124,102, 55,103, 40, 91,115, 66, 97,201, 2,201,130,101,235, 93, 64, 64, 24, 19,205, 80,110, +247, 47,172, 23, 65,252,178,240,213, 39,215,216,231, 57, 96, 61, 15, 2,214, 71, 86, 54,255,240,104,109, 87,182,144,148,103,146, + 85,236, 91, 7,206, 36,139, 14,245,161, 67,147,155, 80,209, 76, 38,225,223,102,118,247, 44,171,175, 12, 74,153,189, 42,216, 7, +237,218,186, 94, 50,253, 35, 38, 17,174, 99, 88, 52, 97, 21,222,176,114, 17,249,184,165,252, 38,115,142,167,220,233, 88, 20, 76, +180, 94,193,138, 9,153, 72, 74,153,176,190, 64, 31,152,200,196, 88, 81,244,150,115, 50, 7,190,207,206,178,254,150,111,198,243, + 35, 42, 71,147,172,171,203,136,230,177,103,133,227,159, 46,140, 41,204,238,184,228, 97,103,251, 56, 94,148, 98,182,102,187, 25, + 50,127, 79, 17,144, 44,144, 76, 4,152, 43, 73,230,138, 21, 43, 16,184, 15,178, 85, 92, 95,249,212,207,199,144,173,161,108,140, + 88,197,131,159,214, 87,103,146,213,136, 94,175,108, 68,149,188, 83,191, 55,144,100, 41,197, 75,100, 11,229, 66,135,166, 36, 89, +112,201,203, 37, 89, 16, 84,185, 98, 41,122,254,112,141,148,253,180, 0, 0,255,244, 73, 68, 65, 84, 55,109, 88, 61,138,138, 22, +114,167,165, 11, 58,147,223,137, 97, 84,163,106,121,201, 50, 6, 75, 56,220,253, 32, 89,134,212, 27,150, 44,144, 44,126,126,252, + 42, 84,168,224,199, 31,185,126,252,204,248, 49,134, 59, 97,201,210, 51,245,131,198, 91,193,146, 5,146,133,208, 3,150, 41, 13, + 38,194, 7, 31,166,246,225, 11, 12, 34, 89,184,129,156,247, 18, 7,195, 15,194,180, 14,114,131,225,245,200,188,107, 8,134, 26, +242,162,142,110,153, 50,101,170,193,100,165, 42, 91,178,170,240,179, 83,131,223,173, 85,153, 96,149, 97,194, 84,130,117,162, 34, +231,145, 99,117,138, 17,207,239,205,188,220, 15, 93,103,121, 8,105,137,148, 88, 44,111,252,145, 17, 49,122,244,232,199,236,146, +188,194,150,254, 28, 6,148, 61, 41,191, 19,143,115,127, 36,145, 53,188, 55,208, 78,248,208, 71,251,161, 47, 66,204, 51, 54,142, +167,139, 66, 83, 24, 32,251, 79,207, 26,119,139, 22,106,214,200, 85,225,219,214, 59,117,232,201,198, 5,232, 85,235, 34,228, 95, +207,147,142, 23, 75, 35,145,172,166,113,156,222, 1,100, 70,153, 96, 10,103, 18,240,145, 95,114, 6, 79,239, 0,242, 0, 66,192, +129,125,239,248, 37, 19, 51,189, 3,130,183, 65,130,248, 11,236, 29,147,172, 41, 92, 13,105, 52,134, 62,162, 5,121,106,164, 36, + 9, 91, 45,102,243,200,139,119,176,140, 64,110,116,107, 39,196,253,216,140,174,126, 92,167, 50,176,252,167,176, 18, 33,169,186, + 47,113, 28, 68, 11, 73,149,128,201,212, 44,148,101,188,134,178,196,169,140,236,191,151,200, 38,143, 72,137,133, 41,142,131, 84, + 70, 31,151, 53,189, 3,119,162,109,248, 97,126,129,196, 15,224, 72,140, 52,100, 75, 24,241,131,173, 28,146, 14,139, 86, 65,183, + 66,205,250, 91,123, 85,235,241, 35,211, 59, 64,127,160, 71,208, 39, 85,253,194,255,140,163,156,206, 34, 53,151,247, 25,172, 90, +220,214,225, 32, 89,236,222, 10,101, 43, 99, 40, 44, 89,111, 95,191, 14,227,227,159,152,208,126, 97, 11,218, 23,126,177,254,150, +233, 29,104,158,187, 27,220,102,247, 56,104,189, 75,209,148,159,175,140, 96,151,148, 68,178, 90,114,176, 98,111, 58, 59,183, 53, + 21,114, 54,137, 60,209,147, 3,226,231,120,108,146, 51, 37,131,180, 70,226,236, 44, 59,239, 12,117,190,222,212,199,238,243,130, + 89, 83,164, 56, 60, 88, 88,241, 81,176,115,243, 90, 42,228,154,242,155, 76,190,183, 28,153, 42,186, 91,152,219, 62, 4,174, 30, +196, 38, 42,101,242,192, 21,116,148,161,156, 79,214,168,101, 41,142,108,182, 87,245,136, 89, 30,199, 6,148, 73, 21,252,118,123, +111,162, 43, 75,190,145,172,197, 60, 61,206, 90,254,240,220,214,140, 78, 79,169, 77,133,157,147,134, 75, 1,242,115,189,100, 7, +219,115,135, 18, 4,221, 65,199,128,193, 42,112,109,194,234,134, 15, 35, 4,156,243,121,196,156,200, 30,197,169,172,191, 68,182, + 50, 39,125,121,137, 73, 32,109,105, 64, 1, 76,178, 42,123,167,126, 23, 71,146, 21, 67,182,216,165,244, 6,229, 2, 41, 2, 41, +198, 84, 15,124, 82,175, 37, 75, 41,160,114, 5,142, 21,251,122,137, 74, 20,245,230, 96,103,111, 42, 86, 56, 51, 61,191, 55,141, +242,229,206, 40,197, 98,225,125, 7,203,150,204,119, 80, 76, 54,184, 11, 97,201, 98, 75, 51, 62,196,118,243,111, 63,118,241, 43, +131,222,117, 77,253,160,245, 86,112, 23,162,115,102,153, 40,207, 11,196,251, 32,108, 32, 58,222,199,208, 34, 42,228,188,151,216, +162, 85,176,100,201,146,253,121,223, 67,206,244, 14,122,100,202,114,229,202,168, 8,250, 49,124, 60,192, 37,151, 39, 58,241,212, +101,210, 49,217, 35, 14,213,238,131,235,154,177,126, 47,224,190,238, 16,127, 0, 31,228,169, 87,224,138,109,204, 73,206,186,169, +234,197,198, 53,109, 56,237,229,126,233, 46, 91,178, 62,149, 43, 87, 78, 34,200,176, 74,130,104,161, 15,128,197, 43, 83,218,180, + 17, 83, 20,138, 55,108,146,108, 46,163,238,127,127, 22, 76, 88,202, 46,194, 35, 60,111, 86, 48,130,223, 91,100, 74,240, 67, 19, +150, 2,108,124, 57,242,188, 44, 31,217,101, 19,231, 9, 75,217,170,114, 30,110, 55,117,247,149,202,113,248,171, 99, 54,206,123, + 18,100,137, 21, 64,227,132,165,184, 14,231,177, 87,189,142, 21,175, 34, 31,123,174,126, 60,218,125,247, 84,253, 56, 95,171,113, +130, 56, 16, 42,188,200, 97,129, 99,226, 18,227,190, 84, 18, 48,124, 73,107,139, 31,211, 38, 83, 89, 78,109,101,209, 81, 70, 92, +250, 93, 57,101, 96,250, 67, 19,150,178,197,238, 53,130, 88,121,116, 74,236, 9, 75,163, 45, 91, 63, 58, 97, 41,244, 9,122, 5, +253,130,158, 33,113, 61, 53,117, 24,154,218,168,124,158, 60,121,222, 98,180, 33,127,129, 69,176,169,254, 11,191,208, 63,113, 28, + 72, 24,183,217,103, 38, 97, 95,249, 75,237, 11,235, 8,130,224, 53, 13,243,254,233, 19, 3, 74,238,179,185,158,133,217, 98,179, +227,230, 16,167, 27,205,242,155,126,241,155, 88, 81, 34, 89,167,103,183,164,130,206,201,190, 17,162,185, 89,118,209, 34,247,162, +136,105,210,240,134,138, 85, 78, 73, 38, 2,236,249,154,235,131,157,110,212,200,109,253,117,213,146,185, 82, 44,221,214,245, 43, +169,128, 75, 52,201,194, 12,241, 8,176,151, 33, 83,237,158, 18,217,130,101, 19, 50, 49, 34, 73, 38,201,138, 41,167, 42,209,234, + 87, 58, 85, 96,203,252,201,191, 52,200,153,236,107,181,172, 73,195,202,186, 37,141, 40,228,148, 56, 50,135,109,194, 40, 79,107, + 5,149,245, 72,241, 37,122, 36,162, 38,203,155,198, 54, 98,203, 27,166,155, 80,234,202,119,123, 46, 63,218, 92, 27,209,210,217, +238, 18,217,114, 55,121,121, 96, 88, 73,170,146, 61,245, 91,153, 36, 75,159, 46,229,228,103,245, 13,220,241, 24,133,200,101,147, + 67,178, 98,100, 86,173, 92,150, 30,223,219, 73,155,214,142,102,178,229, 73,203, 23,118,161, 51, 71,135, 80,165, 10, 37, 8, 68, + 6, 33, 7, 76, 52,228, 16,173, 88,229, 84, 90,180,216,245,236, 7,146,181,124,249,114, 63,118,113,194,162,181, 60, 90, 39,190, + 35, 91,152,228, 84, 77, 95, 98,201, 84, 90,180,224,206, 70,217, 88,166,228, 54,101,153, 32,115,114, 55, 93,120,186,107,123, 47, + 41, 45, 91,113,153,176, 84, 69,166, 33, 22, 45,125,237, 46,183,190,170,249,126,183, 76,124,196,250, 33,196, 3,161, 60,222, 54, + 54, 52, 42, 81, 34,122,150, 52, 41,189,224, 52, 91,161,120, 23,151, 74,253, 97,215,168,187, 13,127,204,194,101, 64,229, 52, 53, +174,228,106, 99,183,219, 87,182,114,132,114, 80,222, 63,181, 4, 15,191, 24, 79,194,181,135,164, 74,246, 84,143, 71,187, 63, 53, +193,252,187, 31, 22,185, 77,175,175,156,238,220,238,143,249, 11, 42,246, 18, 60,108,217,202, 84,184,233, 64,155,172, 85, 43,232, + 35, 6,122, 10,194,226,147,246,131,126, 65,207,224, 78, 53,128,104, 65,116, 25,126,129, 63, 95,186,116,233, 39,118,229,134,115, + 12, 67, 4, 91,119,194,217,194,241,149,131, 69,131,113, 14,121,180,148, 65, 95,221,229, 98,168,243, 37, 25, 29, 16, 46,145,173, + 43, 3,157,110, 86,241, 78, 25, 54,175,123, 89, 42,152, 81,141,100,105,159, 29,254,187,114, 74, 50,163,201,214,197, 1,142, 55, + 75,184,167,138, 24, 61,176, 27,147,172, 20,209,214,177,104,146,101,128, 76,117,178,197,216, 5, 99,142, 30,153, 36,235,187, 15, + 1, 90,224,225,200,100,112,249, 55, 18,165, 39,205,230,233, 45,102,120, 56,254,160, 46,201,109, 47,189,237, 14,178, 85,202,221, +228,154, 76,146,245, 93,221,181, 20, 36, 39, 91, 32,110,200, 36, 89,177,100,206,152, 49,157, 26,213, 43, 67,247,110,108,164,144, +183, 59,233,194,169, 73, 84,179,106, 46,246, 2,240,160, 77,142,213, 65, 92, 30,123, 10, 12, 38, 90,124,147,178,109,219,182,149, +172, 88,108, 13,149, 72, 22, 7,210,131, 16,169,186,176, 99,200, 22,150,235,193,178, 61,186,136, 22,159,171,207, 50, 37, 43, 22, + 44,172, 32, 89, 8,206,199,113,185, 13,196,249,244,181,145,198,247, 18, 44, 91,252,225, 54,144, 39, 48,141,203,123, 73,163, 76, + 61,101,214, 87, 78, 3,170, 28,147,245,119,203, 52,229,193, 21, 88,109, 3,150,173,200,169, 10, 69,224,188, 4, 9,252,145,230, + 42, 20, 1,194,162, 21,151, 38,253,255, 53,223, 53, 46,119,126,210,162,210,108,205, 16,139, 74, 27,142,237,239,126, 88,228,150, +248, 79, 41,167,109,180,158, 97, 26, 6, 77, 49,116,186,202,105,193, 22,140, 97, 28,247,112,130, 73,219, 91, 36,238,208, 78,240, + 87,217, 48, 6,193, 66, 7, 16,191,172,238,170,100,235,124, 63,199, 91, 53,114,152,126,142,101,201,138,203, 18, 60, 42,100,235, + 76, 95,199, 91,213,115, 90,124,147,169,180,100,197, 65,166, 58,217, 98,139, 35,166, 77,144,229, 46, 84,239, 28, 37,203,219, 34, + 55,103,105,178,214, 57, 30,117,181,166,217,238,149,224,222, 36, 95, 79, 77,235,168,254,178, 54,146,251,192,252, 46,210, 62,107, +214, 76,170, 94,141,167,153, 40,157,143,178,121,187,243,100,149,227,164, 56, 40,184,119, 17,155,133, 64,120, 25,117,208,132,103, + 89,126,246,150, 99,142,172,104, 75,150,166, 56, 65,144,173,146, 88,128, 26, 11, 81,235, 33, 90, 56, 93,159,101,194, 5,249, 53, +218,146,101, 8,201,146, 75, 92,101, 84, 55, 86, 22,161, 75, 50, 17,227,233,120, 38,243, 68,166,136,169,107, 32,243, 18,145, 77, + 38, 2, 66, 9,101, 2, 37, 51,155,192, 83, 38, 80, 50,179,201,197, 83, 57,251,178, 28,177,114,101,202,145,165,204,163, 85,230, +255,201, 22,230,143, 66,144,122,150,205,146,187, 80, 55, 33,210,217,233,196, 88,182,164,248, 46,200,244,216, 46,185, 11,127, 64, +166, 33,149,149,209,225,194,191,151,128,124, 21, 9,181, 38,221, 1,210,191,180,141,140, 93,247, 31,144,167,179,221,121,142, 64, + 98,171, 13,241, 44,232,196,238,115,194,111,153,247, 18,120,202, 4, 74,102,182,127, 25, 79,153, 16,137,108,170, 8,252,203, 10, + 35,234,110,220,103, 65,224,169, 5, 79,201,202, 35,173, 81,200,211, 30, 96, 57, 26,205,241, 83,234, 87,235,196, 51, 70,230, 28, +175,210,180,216, 56, 50,227,168, 14,162,221,227, 8,156,150,203, 4,158, 2, 79, 99, 33,240, 51,116,201, 88,101,251, 29,114,212, + 99,178,126,107,140,214,143, 2,240, 51, 26, 87,200,252,209, 86,137,125,189,192, 83,224,105, 44, 4,132, 46, 25, 11,201,111,114, + 4,158, 2, 79, 99, 33,240, 51,116,201, 88,101,251, 29,114,148,196, 74,125, 31,243,224, 1, 48,245,100, 72, 65, 53, 93,175,239, +152, 62,249,250,174,143, 75,153,255, 6,153, 24,157, 83,143, 83, 59, 78, 88,241,190, 79,116,210,135, 39, 2, 57, 13,173,191, 62, +153,134,202,147,243, 96, 10,153,134,181,147,104, 35,237, 8, 8, 93, 18,186, 36, 87, 7,196,115,244,107,159, 35,229,221,180,181, +143,190,246,248, 19,207,255, 81,163, 14,127, 20, 32, 57,157,181,161,247,136, 47, 50,101, 79, 18,105, 0, 0,191,167,238,164,200, +193,129, 54, 83,162,147,156, 9,241,126, 79, 57, 13, 0, 50, 58,171, 40,167,225,152,233,186, 66,224, 41,240, 52, 22, 2, 66,151, +140,133,228, 55, 57, 63, 3, 79,227,150,240, 31,145,246, 51, 26,226, 95,150, 89,253, 39,232,205,175,193,147,200,150,215, 65,200, + 31,157, 82, 40, 62, 41, 26, 50,201,250,246, 23,164,104,204,139, 20,167,224,196,179, 78, 74, 9,139,163,170,111,191,166,156, 63, + 14,176, 40,231,143, 99,168, 42, 65,224, 41,240, 52, 22, 2, 66,151,140,133,164, 32, 90,154,144,204, 21,125, 16,253, 23,172, 91, +154,250, 49,227,182,128,156,175,251, 20,105, 51,219,166,176,241,168,144,210,218,189, 39, 18,254,199, 49, 61, 37,145,245,176,164, +178,115, 79, 99,106,151,237, 32,246, 50,106,166, 87,166,183,187, 89,205, 50, 69, 50,108,206,234,145,170,154, 12,121,177,216,190, +185,185,147,121,122,151,156,173, 44, 50,100,157,110,227,146,171,167,165,165,171,180,200,102, 28,182,150,186,174,225, 53, 65, 19, +228,106,237,151,176, 64,183, 83,137, 43,251,250, 37, 41,230,123, 56, 49,126,215,174,189, 78,215, 18, 21, 26,235,142,118, 72,105, +157,185, 97, 58,215, 60,147, 29,179, 22, 59,149,165, 80,141,119,238, 5,107,188,179,114,206,235,151, 58, 67,206,201, 56,167,163, +173,190,151, 73,212, 23, 11, 78, 73,169, 68,137,125,138,174,138,179, 49, 68,171,155,226, 84,137, 18,138,253,209,103,145,163,175, +129, 68, 11,211, 45,192, 42,150,145,215,212,178, 54, 0, 87,189,237,110,128, 44,101, 86, 33, 51, 14,160,233,184, 68,224, 41,240, + 52, 22, 2, 66,151,140,133,164, 32, 90,154,144,212, 25,163,165, 17,122, 39,175, 34,231, 60,242,148,125,139,148, 57,119,153,183, +153,114,149,121,155,222, 53,207, 30,101,102,171,140,185,246,216,102, 41,241,214,198,163,196, 91,107,247,226,111,211,184, 21,127, +107,230,148,255,156,154, 48,173,138,109,106,237, 94,163,106,195,142, 43, 23,172,217,115,241,252,205, 87, 33, 72,248, 31,199,112, +238, 71, 95,188,166,118, 57,102, 21,175,246, 95,152,169, 93,246,153, 50,116, 75,239, 3, 88,162,176,253, 17,122, 61,149, 74, 22, +206,176, 95,134,188, 88, 68, 11, 36,171, 93,183, 1,179, 31, 62,122, 54,183, 68,205,118,179, 76,211,185,207, 73,101,155,117,180, +169,141,123, 49,133,194,215,144, 37, 14,212, 39,245,147,138, 2,130,229,218,105, 87, 34,115,199, 2, 86, 73, 77,211,118, 74,146, +194,226,100,210,148,150, 39,147, 91,102,232,234,152,183, 65,250, 82,125,252, 52,205, 12,174,149, 24,152,217,122,149,118,203, 93, + 62,120,240,172,125,225, 99, 87, 93,165,177,107,111,115,186, 67,157,199,108, 34,207,108,121,104,254,150, 75,212,212,119,115,184, +157, 87,169,224,148,156, 87, 22, 41,122,244,104,108, 12,209,122,240, 32, 31,147, 44, 19, 78, 54,209,201,228,249,115, 5, 47,232, +249, 45,199,195,135,138,113,178,100,114,166,114, 21,235,150,241,240,204,126, 38,181,153, 69, 95,243, 52, 86,189,237, 29,156,253, +211,166, 77,119,143, 79,101,136,209, 85, 43, 43, 83,254, 95,204,167, 20, 27, 84,189, 58, 47, 83,207, 85,179, 9,153,113, 0,237, + 71,223,117, 6,222, 82,180,145,129,128,233,201, 46,240, 52, 46,158,241, 89,154,186, 37, 75,255,168, 67, 16,172, 15, 31,195,104, +209,238,251, 82,122, 22, 16, 74,141, 59,143,193,188, 42,183,144,170,182,244,165, 43, 15,222,211,172, 45,183,104,230,230,155,116, +250, 70, 0, 89,100, 42,134, 85,227,245,190,120,147,219,120,230,109,222,105,200,198, 27, 79,130, 35, 54,239,247,187,215,109,224, +196,157, 72,248, 31,199,112, 14,121,180, 32,174, 87,177,147,219,185,218,231, 41, 81, 43,248,245,251, 79, 17, 89,242, 86, 8,196, +111,185, 15, 11,207,202,222,133,151, 87, 25,130,196,179,183,199,164,194,121,237,238,128,104, 21, 45, 96,119,214,210,206, 35,216, + 42, 99,206,192, 12, 30,249,143,155,217,123,106,179, 50,197,148,211,194, 33,235,180, 59,119,239,207,221,176,255,210,220,150,190, +171,231, 94,189,251,124,238,229, 91,143,230, 50, 17,156,249,141,108,201,222,122,171,231,180,183, 47,144, 40, 81, 50,211,242,137, + 77, 76,215,186,150,232, 28,182,234,240,115,186,247, 34,132,174, 61, 14,162,177, 27, 30,144, 83,161,102,225, 38,169,109, 48, 57, + 44,102, 50,215, 68,234,190,195,211,217,187,232,235,153, 91,190,145, 43,101, 82,146,172, 83,151, 31,209,204,109, 15,164,227,125, +231, 95, 36, 11,199,220, 47,180,147, 34,226, 5, 78,169,153, 66,113,163,135,162, 76,179, 11, 10,127,255, 17, 76,165,250, 42,222, +188,193, 66,212, 78,156, 48,137, 33,146,211,155, 55, 10, 27, 88,178,252,253, 21, 35,154,149, 81,248, 93,228, 32,127, 86,182,102, +156,148,139,164,106,108,247,114, 21,106, 94,152,187,124,127,248,230, 83,175,105,232,194, 11, 84,174,122, 11,202,153,191,196, 87, +158, 28,239,144,147,123,174,131, 94,249,203,127,176,115,116,251, 96,102, 97,117,193,220,220, 18,228, 75,117, 9, 21,189,186, 36, +187,101,254,159, 81,200,140, 3,104,130,108,104, 68, 64,232,146,208, 37, 99, 33, 16, 95,116,201, 88,245,141, 31,114, 64,180, 34, +121,141,184, 94, 51,142, 75,105,243,209,251,116,238,198, 43, 42, 95,191, 59,149,168,221,149,182, 30,127, 64,139,182, 95,167, 78, +147, 14, 81,199,137, 7,233,160,223, 19,217, 68,203,212,198,163,195,241,203, 79,222, 77,156,183,254,100, 10,107,247, 54, 41,211, +185,103, 69,194,255, 99,102,174,242, 59,228,119, 63,196,212, 38,139,111, 92,137, 86, 42,251,156,155,143,156,187,243,213,239,206, +187,144,185,235,142,189, 51,181,207,177, 65, 46,209, 2,193,226,101, 2, 38,176,105, 37, 86, 26, 51,162,207,188,210,133, 51,108, +115,176, 77,225,123,238,188, 31,125,250,252,133,238,220,123, 68,255,117,236,243,145, 45,125, 39, 83, 90,121,130, 60,168,110, 49, +138, 13,139, 86,131,150, 61,102,215,235, 53, 87, 34, 89, 44,123,238, 51,255,247,115,125,231,108,155, 11,203,150, 1, 26,129, 17, +134,170, 91,109, 43, 91,231, 81, 99,215, 92, 63,119,247, 89, 32,221,127, 17, 76,151,238,189,163,147, 55,222,208,177,107,111,232, +244,173,119,116,245, 97, 16, 29,190,250,150, 74, 14,190, 72,201,205,237, 94,241,197, 53,181,149, 83,121,220,217,219, 39, 98,219, +233, 87, 58, 73, 22,136,214,224, 69,231,201,210, 49,215, 87, 29, 68,139, 73, 22,211, 39, 41,249, 73,179, 1, 51,121,173,157, 45, +123,142,231,117, 27, 54,127,209, 99,208,132,144,214, 61, 70,133, 20, 44, 83,247, 69, 58, 71,143,231,201, 77, 45,107, 35,207, 13, +133,162, 78,244, 69,184,144,101, 72,155,198, 23, 69, 70, 23,247, 3, 97, 17,145,116,230, 86, 32,141,231, 50,245,154,176,157, 90, +245,158, 21, 53, 96,238,241, 79,221,198,111,167,145,203,175, 81,131,182,131,168, 84,249,186, 84,168, 68,213,243, 85,154,143, 77, +197,178,148,214,173,248,242,242, 17,229, 52,224, 33,145,145, 85,224, 41, 3, 36, 3,178, 8, 60, 13, 0, 75, 70,214,127, 25, 79, + 25,240,252,177, 89,116,143, 58,220,190,125,251,119, 51, 0,131,104,133,133, 71, 82,165,238,107,165,212,119,246, 41, 58,113,253, + 45,221,121, 22, 66,151,238, 7,210,162,189,143,168, 82,223, 93, 84,186,227, 74, 42,213, 97, 5,173,217,119, 93, 19,209,138,133, +200,132,209, 41,114, 77,158,108, 54,190,102,221, 60, 27,110, 62, 13,161,214,157, 42,239, 29, 51,198,124, 26,142,155,155,103, 55, +183,118,201,189, 44,103,209,170, 95,112, 46,125,166,252,159, 82,218,231, 88,136,227,134,192,154, 34, 93,150,170,141,218, 14, 8, +190,243, 44,232,115,238,118,123,207,158,190,241,214, 63, 87,137,122,254, 41,210,101,174, 42, 71, 14,172, 88, 32, 89,188,184,243, +132,231,207,159, 79,224,117,181, 38,240,154, 95, 19,218,183,174, 51,172,100, 33,251,221,118,182, 38,195,158,191,120, 77, 97,225, + 68,225, 17, 68, 97, 17, 81,180,112,197,230,136,180, 25,115,158, 97,249, 26, 99,161, 16,163,101,102,231, 53, 32,181, 93,246, 89, + 32, 90,254,239,130,231, 46,217,118,102,110,229,142, 51, 12, 37, 90,234, 85,232,253, 53, 44,162,207,200, 81, 99, 46, 52,106,210, +226,201,226, 53,187, 30, 30,190,240,146,118,159,123,193,233, 37, 29,190, 28, 64, 23,238, 5,210, 35,255, 80, 10,254, 20, 65,251, + 46,190,161, 4, 9, 18, 96, 9, 4,157,155,173, 91,129,175,129, 65, 33,244,236,205,103,218,126,234, 5,213,104,218,147,230,173, + 63, 65, 83, 55,222,162,225, 75,252,104,196,194, 19, 52,122,193, 1,106, 55,112, 14,165,182,207,254, 69,187, 48, 88,179,148, 68, +139,164, 17,147, 78, 78, 78, 23, 31, 60,245,167, 27,108,113, 59,112,233, 53,173, 56,248,132, 38,108,184, 67, 29,167,240, 2,177, + 22,182,108,200,146, 86,245, 45,167,129,104,169,223,198,132, 15, 96,202,138,221, 33,161, 97,145,135,175,188,165, 61,103, 94, 83, +173,255, 6,209,176,149, 55, 67,199,174,129, 53,142,173,114,107,110,211,232,213, 55,169, 90,221,246, 84,189,126, 39,106,216,117, +170, 15, 95,163,203,149,170, 15, 30,113, 94, 32, 32, 16, 16, 8, 8, 4,126, 2, 2,154,184,200, 79,184,205,239, 17,169,141,104, +221,120, 16, 64, 46, 85,167,144,239,130,147,180,112,207, 99,154,184,225, 46, 13, 90,114,131, 58,206,184, 68, 13,199,156,165, 10, + 3, 79,144, 87,227,149,148,161,194, 4, 26, 58,239, 48, 89,184,126,231, 58,140, 85, 33,144, 44, 38, 49, 52,108,184,219,139,153, +115,154, 73,123,252,198,113,182,162,236,154, 52,123,101, 84,177, 10, 13,232,210,221,183, 84,164, 92, 61,234, 55,102, 81,148,133, +115,254, 93,114, 81, 73,109,239,105,105,153, 49,247,155,199,254, 65, 97,109,167,158,187,237,222, 98,239,193,158,243,175,159, 88, +181,239,230, 13, 38, 4, 47,113, 94,159, 44, 37,209,122,250,244,169, 68,178,110,220,184, 49,225,202,149, 43, 19,170,148,243,188, + 2,215,161, 79,126,187,115,111,223, 7,211, 87, 38, 90,111,131,195,233, 22,147, 66, 16,153,114,181, 90,133,166,178,213,234, 70, + 84,164,178,205, 54,246,232,185, 27,115, 7,204,216, 54,119,220,146, 3,115,171,117,157, 53,215,218,171, 66, 44,215, 97, 42, 91, + 55,119,206,247, 56,149, 93,118,255,152,100,239,125, 94, 71,153,123, 71, 68, 70,245, 62,125,238,194,152,227,103, 47, 47,153, 49, +111,217,233,134,205,218, 60, 91,186,249,196,245,195,151, 95,133,159,187,253,142,142, 92,125, 67, 67, 86,220,165,178,131,206,211, +164,205, 15, 65,168, 53,173,249, 23,235, 22, 54,110, 5, 58,148,173,213, 54,226,225,139, 32,201, 74,246,249,107, 4,189,126, 23, + 74,215,239,191,166,189, 39,111,211,228,165, 7,168, 65,247,233,100,158, 49,127,184,169,109,206, 14, 58,136,150, 29,211, 38, 38, + 88, 82, 74,139,124,105,210,164, 41, 89,171, 94,195,215, 23,153,172,239, 58,247, 74, 34,236,163, 86,223, 34,247,124,149, 94,155, +152,152,149,140, 38, 90,105,163,201, 22, 8, 23,203,208,184,205,107,217,190,207,132, 5, 43,246, 71, 46,217,245,152, 86, 31,124, + 73,189,134,204,160,206, 67,151,210, 24, 38, 87,146,203,115,221, 55,215,231,168, 85, 55,168,117,159,153, 84,174,110, 7, 74,102, + 98, 42,214,217,210,247, 16,136,243, 2, 1,129,128, 64,224, 55, 32, 16,207,137,150,170, 69,235,251, 65,125,154, 42,167, 12,134, + 47, 82,169,217,215,203, 15, 62,208,130, 61,143,168,207,180,125, 84,189,253, 4, 42,211,124, 52, 85,234,177,142,137,214,113,170, + 60,228, 36,101,200, 93,251,107, 26,142,207,210, 16, 12, 31,211, 84, 85,171,218,102,104,215,202,110,226,184,177, 14,167, 26, 52, + 48, 13, 3,193,194, 30,191,113, 60,107,190, 34, 65,129,159,136,166,204, 89, 65,101,170, 55,163,137, 51,151, 18,126,219,122,248, + 4,202,109,111, 83,251,236,171,198, 47,216, 25,124,230,214,187,144, 28,237, 14, 94,206,213,249,248,233,252, 61, 79,239, 95,122, +240,229,197,250, 93,166,156, 79,149,222,107,169, 62, 89, 74,162,117,239,222, 61,137,100, 93,190,124,121,194,185,115,231, 64,180, + 46,130,104, 21, 43,104,119, 26, 68,235,197,187, 47,116,241,254, 7,218,117,222,159,182,157,121, 73,243, 55,156, 96, 55, 90,238, +227,218,228,195, 69,120,224,212,229,185,238, 85,134,204,101,183,232,108,245, 96,120,144, 44,183, 92,165, 95,247, 24,181,156,250, + 79,222, 36,165,142,195, 87, 17, 8,151, 46,162, 5,239,238,201,211,103,251, 28, 62,118,102,224,158,131,167, 70, 28, 58,117,109, +226,208,145,227,239,183,106,223,237,125,243, 73,151,168,112,167,157, 84,180,251, 65, 42,209,247, 20,141, 90,251, 64, 22,209,194, +253,152,108,117, 44, 94,181, 85,196,182, 19,143,168, 74,159, 29, 84,182,243, 90, 42,218,114, 33,101,175, 53,158, 10,214, 27, 69, +169, 50,228, 3,201,234,168, 15, 79, 77,231,211,219,218,207,159,181,116,107,228,230,147, 47,104,246,142, 7,212,172,223,226, 72, + 83,243,116,243, 13,144,149,130,131,223,215,157,186,241, 54,242,214,163, 47,180,246, 24,187, 57,153, 92,117, 31,187,133, 70, 51, +169,194,255, 18,209,194,158,211,193, 75,111,232,194,173,183, 52,101,205,133, 8,190,199, 18, 78, 41, 13,184,151,200, 42, 16, 16, + 8, 8, 4, 4, 2,191, 0,129,120, 78,180, 84, 17, 82,146,174,255, 31,211, 85, 57,119,118, 33, 62,120,249,145,150,236,123, 76, + 77,123,205,100, 23, 84, 56, 33, 72,190, 80,253,145, 84,126,192,113,170, 59,242, 12, 89,101, 46,174, 30, 4,255, 93,147, 84,171, +102,245, 95, 84,212,215,205,109,219,100,184, 1,146,165,220,240, 27,199,243, 22,202, 26,244, 62, 36,130, 30,248,127, 33,255,160, + 8, 58,125, 59,136,230,239,126, 76,169, 29,243,233,181,192,224,102, 41,172,178,228,200,152,189, 76, 96,120, 4, 83, 15,222,234, +141,189,112,173, 96,143, 51,199,139,244,185,176,167,230,232,155,219, 87, 29,123,125,198,218,181,192,115,228,211,165, 47, 74,162, +117,237,218, 53,137,100,157, 57,115,102,194,241,227,199, 39, 52,111, 92,101,120,233, 34, 25,182,186,101, 76,213,234, 26, 91,118, + 78,223,122, 79,155, 79,189,164, 57, 59, 31,210,104,118, 81, 45,217,125,147, 82,219,102, 13,214, 38,219, 52,189,151, 7,200, 21, +167,177, 32, 85,170,249,148, 36,171,203,240, 37,148,187,198, 96, 74,157, 33,247, 59,185, 22, 45,174,106,207, 51,103,206,246, 58, +121,234,108,159, 99, 39,206,244, 63,112,228,212,144, 57, 11,150,206, 45, 94,162,196,171,252,173,215, 83,161,142,219, 99,136,214, +192,101,119,101, 19, 45, 37,217, 42, 89,167,203,215,193, 11,206,145, 79,187, 53,148,187,233, 66,106, 63,122, 59,165,207, 86,229, +179,169,189,193, 36,203,194,193,193,193,215, 37, 83,166,227, 89,179,231,122,178, 97,255,101, 90,123,244, 41, 77,221,124,151, 99, +252,246, 83,218, 12, 89,158,164,176,204,112, 60,169,169,181, 47,223, 27,211, 53,104,221,246,157,190, 94,185, 70,189,230,244,248, +245, 23,138,226,230, 30,187,248, 70,196,136,229,215,162,148,129,251,107,142,248,211,192,137,171,169, 82,227,190, 52, 96,246, 81, + 30,180, 17, 74, 15,159, 5, 71, 13, 24, 54,245,181, 77,122,251,171,250,228,255,130,247,137,184,133, 64, 64, 32, 32, 16, 16, 8, +168, 33,240, 23, 16, 45, 37,193,210,108,209, 66, 5, 53, 85, 18, 68,235,232,197, 39,180,227,244,115,234, 53,101, 55, 85,105, 53, + 70, 34, 90,249,235,248, 82,185,254,199,169,230,176, 83,178,136,150,100,209,106, 99, 55,113,236, 88,135,147, 13, 27,164, 8, 5, + 25,194, 30,191,113,220, 61,103,193, 55, 1, 31,190,210,210,253, 79,168,199,220, 43, 84,186,239, 49,170,193,178,229, 18,173, 84, +246,217,231,173,223,115, 65,146,123,245, 81,112,112,161, 94,103, 79, 21,233,123,225, 96,185, 97,215,119, 87, 26,117,119,253,200, +141,254, 59, 26,244,154,119,200,212,198,115,134, 46,237,182,182,182,150, 98,180, 46, 94,188, 24, 67,178, 14, 30, 60, 56,161, 89, +163,202,195, 48,143,150,171,115,138, 22,187, 78, 63,102,146,240,156, 73,194,125,234,191,232, 58,181,155,118,145,198,172,188, 72, + 76,162, 52, 18, 45, 16, 41,123,247, 2,143, 29, 61, 11,251, 59,100, 41,236,159,222, 53,255, 99, 37,217, 82, 37, 89,121,235,140, + 36, 51,167, 2,175, 82,166,243, 40, 37,243, 9,236, 13,162,117,246,236,217,158,103,206,158,237, 5,194,117,252,228,169,190, 11, + 23, 45,153, 86,188,120,241, 23,249, 91,175,139, 69,180,186,205,191,101, 16,209, 66, 25, 80,102,118, 79,210, 99,118,143,142, 97, + 66,137,196, 46, 67, 89,228, 87,181, 14,105,211,166,237, 58, 99,198, 12,122,230, 31, 72,215, 30,125,160,253, 23,252,105,249,129, +199, 52,110, 29, 91,162,230, 94,166, 6, 99,206, 80,177,238,123,201,182, 80, 7, 74,146,220,188,171,174,250, 47, 91,182,215,186, + 92,229,218,116,229, 81,168, 68,180, 48,104,163,255,244, 61,212,123,218, 1,201,130,117,232,210,123,186,255, 60,136, 22,110, 60, + 67,221,135, 47,162,202, 77,122, 81,171, 46, 35, 46,123,122,231, 9,173, 88,163,129,250,128, 2,153, 80,139,108, 2, 1,129,128, + 64, 64, 32,240, 51, 17, 80,242,144,191,136,112,201,131, 43,115,238,178,111,231,109,242,163,253,231,159,210,180,173,247,169,114, +171,209, 49, 68,171, 44, 19,173,170,236, 58,148, 99,209,194,221, 38, 78,252, 22,163, 5,114, 5, 75, 22,246,248,141,227, 46,222, + 69,253, 95, 7,126,161,197,251,158, 80,183, 57, 87,168,100,159,163, 84,125,232, 73, 3,136, 86,206, 43,247,159,127,248,226,187, +226,246,227,194,189,206,157, 45, 62,224,210,209, 6, 19,111, 31,106, 59,239,209,190, 14, 11,158,111, 27,180, 38, 96,195,176,101, + 23,118,155,218,122,157,214, 85,115, 38, 4, 18,209, 58,125,250,244,132,163, 71,143, 78, 56,112,224,192,132, 93,187,118, 77,168, + 84,198, 93,138,209, 42, 86,208,254,216,188,173, 55,153, 32,220,145, 8, 33, 98,213,154,140, 59, 71,245,251,175, 99,119, 90,174, + 19,154,100,131,100, 29,243,187, 71,213,234, 52,163, 10, 53, 26,211,206, 19,119,201,218, 37,159, 68,182,188, 10, 87,253,248,254, +253,123, 2,201,178,206, 90,237,101, 74,155, 44, 19,229,181,140,148, 43,134,104,129,108,157, 58,125,186,247,150,237,187, 71,206, +156,183,100, 62, 19,173,231,234, 68,171,221,204, 27,113, 34, 90,129, 33, 97, 52,109,203,125, 42, 84,119, 8, 85,108, 53, 62, 78, + 68,203,213,213,117,254,181,107,215,233,249,219, 79,228,119,247, 61,237, 56,251,146, 22,236,126, 72, 35, 86,221,228,152,191,139, + 84,107,248, 41, 42,212,237, 16,101,170, 61,159,146,153,217,234,115, 35, 38,242,202,150,123,109,165,234, 13,104,217,198, 3,116, +247,229, 87,170,206, 65,240,237,134,174,166,225,203,175, 68,141,216,120, 63,236,203,215,240, 40, 16,196,189,231,222,210,140, 77, +119,168,211,176,229,148, 35,119,161,203, 94, 94,217,179, 25,128,175,200, 42, 16, 16, 8, 8, 4, 4, 2, 2, 1, 57, 8,232,142, +209,210, 37, 1, 68,107,223,249,231, 52,124,225, 49,218,118,250, 5, 53,238, 57,147, 78, 93,122, 64,133,234,125,115, 29, 86, 24, +112, 66, 54,209,194,232, 66,144, 42, 88,176,224, 46,196, 30,191,113, 28, 68,203,255,253, 23, 14,142,126, 76, 93,102, 95,166,226, +189,143, 82, 21, 38,113,114, 45, 90,166,182, 89, 3, 63,126, 14, 15,175,232,235,231,231,211,231,194,209,218,227,111, 31,238,188, +240,241,145, 97,235, 95, 29, 30,179, 37, 96,207,136,205,111, 55, 44, 61, 28,184,137,137,140, 78,107,140,146,104, 29, 62,124, 88, + 34, 89, 59,118,236,152,176,117,235,214, 9,149,203,102,145, 98,180,124,242,219, 94, 28,184,208, 79, 26, 16, 80,107,248,105, 42, +209,235, 40,181,155,122,129, 92,243,213,254,200, 51,219, 99,161,231,239, 54,199,172, 69, 63,188,226,186,157,187,243,158,142, 92, +121, 67,115,217,221,104,239, 89,244,171,119,225,154,159,199,175, 58, 79,141,152,172,205,157, 59,151, 82,218,120,242,132,175,185, +146,200,105,209,232, 60,189, 35, 34, 34,122, 30, 62,114,172,255,234,245, 91, 38,204, 89,184, 98,254,178, 85, 27,166,174,223,184, +101,148, 38,162,213,108,210,213, 56, 17, 45,140,172,124,252, 58, 84, 10, 46, 31,178,236, 70, 92,137,214,161, 55,239,131,232,225, +171,143,116,234,230, 91,218,116,226, 57,205,218,126,159, 6, 45,189, 78,173,166,248, 81,229,193, 39, 40, 79,167, 3,148,165,197, + 86, 38, 90,118,135,100, 98,224,105,157,206,246,202,146,237, 55,137,219, 94, 26, 93, 8, 2,172,140,209, 90,181,239,126,212,220, +157, 79,104,252,250,187,212,188,203, 68,106,208, 97,100, 36,203, 93,205, 9, 35, 22,197, 38, 16, 16, 8, 8, 4, 4, 2, 2,129, +223,143, 0,136,214,233,155,239,104,216,146,243,212,115,250, 17, 26,181,228, 36,181,246, 93, 69,205, 71, 31,162,178,253, 14, 83, +153,126, 71,201,138,103,133, 55,164,164,112, 35, 34,102, 11,123,229,117, 32, 90, 32, 35, 11,118, 63,162,206,179, 46, 83,177,158, + 71,168, 18,119,190,178,137,150, 93,142, 75, 87, 31,188,253,208,105,238,109,191,226, 3,175,238,109, 62,253,225,126,223,181,175, + 14,205,217,255,254,196,162,195,193,135,231, 31, 10,217, 50,122,229,197, 53, 28,136, 46,203,162,181,111,223, 62,137,100,109,222, +188,121,194,218,181,107, 39,212,171, 85,106,120,201,130,246,123, 50,164, 79, 49,188,213,184,163, 84,123,196, 25,118,155,158,150, + 72, 86,161,122, 67, 35,120,185,159, 11, 92, 23,141,211, 59,100,240, 44, 26,242, 36,224,147, 68,176,198,112,144,118,159, 5,215, +168, 94,167,137, 52, 99,219,125,170, 51,226, 52,213,242, 61, 70, 46,185, 43, 7,153,164,115,115, 54, 4, 71,190, 93,223, 19,103, + 47, 77, 95,187,105,215,252, 13,155,119,140, 59,118,252, 68, 95, 88,182,184,236, 3, 84,137, 22,176,172, 50,236, 2, 85, 30,122, + 1, 68,235,153, 33,247,128,235, 16, 46,221,169,209, 22,173,210,205,199,146, 89, 28, 92,135, 89,178,100,185, 4,151,243,237,167, +193,116,248, 74, 0,173, 62,252,148, 38,111,186,203, 88, 92,165,166,227,207,177, 46, 29,163,108,109,247,145, 87,235,189,148,204, +194,241,146,220, 50,154,153,155,207, 26, 60,110, 97, 68, 80,104, 4,189,124,251,133, 74,213,104, 71,205,250,204,161, 77, 39, 3, +152,212,125,161,241, 27,165, 81,135, 65,253,167,239,163,126,156, 88,174, 47,167, 2,114,229,139,124, 2, 1,129,128, 64, 64, 32, + 32, 16,144,129,128,234,204,240,223, 7,195,235, 18, 0,162,133,249,179,102,239,120, 72,131, 22, 95,162,150, 99, 14, 83,189,161, + 7,169,234,192,131, 84,170,247, 97, 42,222,235, 8, 97,249, 29, 45, 50,100, 79,188,230,226,237,227,255,226,221,103,154,183,235, + 17,117,156,121,137,124,122, 28,145, 70, 53,106, 32, 90, 26,101,166,178,245, 30, 55,124,250,250,199, 7,174,188,127, 88,114,200, +141,205,109,230, 60,222, 62, 98,115,192,158, 69,135, 63, 28, 94,113,252,227,158,237, 23,190,108, 47, 83,183,215,230,148,233,179, +140,210, 80,214, 24,153,176,104,125,250,244,233,187, 9, 75,125, 7,118,153,135, 96,120,123, 91,147,161, 3,166,110,167,254,243, +206, 82,221,126,107, 41, 83,254, 58, 31, 57, 62,236,124,242, 52,110,234,211, 16,196,200,204,144,197, 39,232, 34,187,203,166,108, +190, 71,189,153,100,181,154,114, 65,178,134,193, 61, 90,105,208, 9,202, 93,169, 83, 40, 7,191, 55,147,209,144,234,241, 69, 13, +221, 61,189, 7,237,222,189,167, 87, 64, 64, 64, 79,158,239,171, 39,143,144,140, 33, 90, 5,218,172,167, 82, 3,206, 81,141,145, + 23,201,171,234,112, 74,154,210, 34,148,239,209, 68,237, 62, 58,219, 8, 68,235, 43,207,167,134, 24, 45, 88,180,122,206,187,194, +113,100,122, 99,180,190,147,153, 39, 79,158, 59,112, 13, 95,121,248,129,246,250,249,115, 44,222, 99,105,158,171,174,115, 46, 83, +189, 81, 28,159,197,122, 4,146,133,148,220, 42,243, 29, 13, 88, 96,102,123, 77, 91,133,138,213,234,145,255,135,112,186,120,239, + 3, 21,244, 41,133,185,194,246, 55,104,215, 45, 50,244, 75, 36,193,125,184,231,220, 27, 46,251,183, 17,136,229, 27,244,228,249, + 80, 21, 46,209,130,100,235,167,140,182, 81,102, 17, 50, 13, 0, 75, 70, 86,129,167, 12,144, 12,200, 34,240, 52, 0, 44, 25, 89, + 5,158, 50, 64,250, 71,178,168,175,117, 40,191,218, 88,231, 16, 46,189,128, 15, 95,232, 9, 47,195,115,251, 89, 48,199,216, 4, +242,144,249,215,146,251,103,194,250, 59, 70, 33, 90,206, 89,125,252,159,243, 4,153,243,153,104,117, 96,183,156, 15, 91, 97,202, +246, 63, 70,169,190, 31,117,168, 81,177,211,166,205,156,202, 60, 67,142, 39,187, 79, 61,184,181,245,124,224,133,161,107,253,183, +141,220,242,118,211,146, 99, 31,183,239,190,242,101,207,196,213,103, 22,178, 53,235, 62,242,233, 34, 90,230,230,230, 93, 44, 45, + 45,135, 32,241,255, 49,169, 80, 30,219,251,210, 18, 60,249,237, 78,167,176,206,252,209, 52,125,214, 96,196,100,177,187,176, 61, +203,211,100,201,138, 41,167, 99,246,178,167,102,173, 57, 38,145,139,246,211, 47, 81,253,209,103, 37,183,104,109,182,102,229,175, + 61,228,171,165,115,254, 69, 50, 91, 68, 83, 32, 55,172,130,221, 10, 20, 40,216,115,247,238,221, 61, 31, 63,126,220,243,200,145, + 35, 3, 74,150, 44,249,188,238,152,203,148,167,217, 34, 74,153, 54, 35,166, 53,192, 32, 0, 77, 11, 46,235, 37, 90,136,171,154, +181,253, 33, 21,169, 55,148,138, 53, 30, 19, 23,162,149,176,104,209,162, 79,159,189,249, 68,231,217,125,138,233, 48,230,237,122, +136,137, 69, 25,143,139,210,160,135,130, 93, 15,197, 16,173,148,182,222,152, 84, 85,125,185, 32,109,229, 76,192,145,110,215,203, + 85,170, 69,117, 26,181,162,145, 83, 22,192, 53,108, 98,146, 34,197,156, 50,229,106, 6, 30,191,244, 66, 26,134,122,254, 86, 48, +237, 59,255,129,188, 11,150,199, 76,246, 74,203,161,120, 73,202, 84, 60,153,217, 4,158, 50,129,146,153, 77,224, 41, 19, 40,153, +217, 4,158, 50,129,146,153,237,103,224, 41,243,214,127,100, 54,221, 51,195,235, 42,178,131,103,145,115, 88, 80,218, 37, 71,233, +183, 78,217, 75,191,117,200, 90,234,173,189, 87,201,183,170, 11, 74,243, 40, 52,245,197,164, 13,254,186,119,242, 44,180,181,239, +200, 25, 17,235, 15, 92,167,217, 28,187,211,200,119, 23,185,148,234, 25,158, 42, 67,222, 77,106,229,211,218,184, 41,108,220,242, +164,182,203,246,168,211,160,217,167, 54, 28,190,115,232,248,205,224, 93,171,246,221, 90, 95,187,213,128, 77, 60,153,232,125,156, +215, 82, 87,189, 10,131,197,164, 65,180,176,184,180,204, 38,142,145,153, 34,173, 71,122,123,207, 18, 95,250, 76,217, 78,147, 54, +220,150,220,101,181,135,236, 37,207,210,237, 62,155,101,200,181, 82, 11, 81,211,116,155,198, 58,238,157,149,207,245, 98,130,213, +147, 93,157, 3, 74,148, 40,249, 60,141,115,129, 40, 62,182,150,147,114,189, 64, 77,151,235,172,123, 6,143, 2,103, 86,110, 59, + 17,254, 54,232, 43,173,227,145,150,101,219,205, 13, 51,115,204,139, 89,240,117,109,234, 50,109, 27, 53,105,246,242, 62, 79, 19, +114,226,250, 27,218,112,252, 25,205,216,122,143, 6, 46,185, 70, 45, 39,157,103,171,222,113,202,213, 97,127, 12,209,178,200, 92, +230, 37, 11, 87, 31, 30,171,171,156,137, 56,127, 43, 78, 85, 84, 11,149, 40,113,226,190,182,118, 14, 55,219,245,153, 26, 62,107, +205,105, 42, 94,174, 14,185,231, 40,178, 74, 37,143,222,118,151,217,214,170,217,132,204, 56,128,166,227, 18,129,167,192,211, 88, + 8, 8, 93, 50, 22,146,223,228,252, 12, 60,141, 91,194,127, 68,154,236,134,176,180,116, 77,109,147, 41,239, 52, 91,247, 66, 23, + 45, 50,230, 14, 48,207, 88,208,143, 45, 70, 19, 20,182,185, 82,168, 97,165, 83, 38, 44, 86, 28, 84, 62, 38,165,109,214, 51, 8, +124, 71, 76, 22,220,133, 90, 44, 89, 74,209,122,203,233,157,217,172, 22, 92,135,222,238,102,234,107, 5,106,107,202, 88, 50, 77, +211,185, 88,155, 59,229, 93,106,233, 92,192,223,204, 49,223, 59, 94,143,145, 45, 99, 30,213,248, 98,141,113, 93, 90,132, 98,201, + 25,125, 27,150,152,233, 21,157,180, 17, 75,217,196,192,202,202,211,148,151,228, 57, 99,227, 86,208,159,231, 33,243,183,204,152, +239, 12,142,233, 41,132, 58,158,249,125,135,141, 12,186,249, 36,136, 14, 93,126, 77, 43, 15, 61,161,137, 28, 59,213,107,254, 21, +106, 60,238, 44, 79,229,113,148,178,182,249,230, 54, 68, 74,151,239,191, 32,150,159,223,144,118,215, 81, 30, 39, 62,135,245, 36, + 65, 56,213, 39, 88,213,219,238,250,192,214,112, 94,200,140, 3,104, 58, 46, 17,120, 10, 60,141,133,128,208, 37, 99, 33,249, 77, +206,207,192,211,184, 37,252,181,210,148,174, 67,229, 93,213,127,255,180,210,252,140,134, 16, 50,141,219, 92,191, 2, 79,215, 76, +110,238,167, 51,123,100,245,115,243,204,126,197, 53, 75,174, 91, 78, 30,185,239,219,103,206,243, 36,157,115,174, 39,102,246,222, +247,147,219,100,185,149,220,202,237, 74,242, 52, 46,126, 38, 22, 25, 48, 96, 65,221, 10,247, 43,202,105, 12,100, 69, 57,141,129, +226,255,101, 8, 60, 5,158,198, 66, 64,232,146,177,144, 20, 68, 75, 19,146,234, 49, 90,130,104, 25,201, 90,162, 75,109,197, 67, +253,231, 63,212,162,141, 68, 27, 25, 11, 1,161, 75,198, 66,242,231,117,226,162,141,254,252, 54, 50,110, 9,127,173, 52,157, 49, + 90, 80, 62, 77,201,144, 34,106,147,161,235,184, 62,249, 66,166,230,118, 81,197, 5,174,196,234,156,212, 71, 18,106,194,150, 23, +118,214,216,206,127, 90, 27, 33,224,223,208,182, 23,186,164, 29, 1, 67,177,148,211, 25, 9,153,134,233,168,208, 79,161,159,154, + 16,248,151,159, 35, 37, 30,198,224, 31,250,158,175,191,254,188,156,151,182,161, 32, 8,153,134, 34,166, 59,191,192, 83,224,105, + 44, 4,132, 46, 25, 11, 73, 97,213, 17,186,244,111,234,146,113,107,253,107,165,197,125,212,225, 15,150, 83, 60, 44, 63, 8,160, +218,229, 2, 79,129,167,177, 16, 16,186,100, 44, 36, 5, 41,138,151,186,132, 1, 82,122, 6, 73,197,210,144,148, 86,158, 54, 72, +226,157, 28,131,192,207,104,119,227, 62,149,191, 71,154,209, 98,179,146, 36, 76,156,172, 87,202,212,105,111,152,154,167,125,174, +163, 46, 63,163, 33,254, 52,153, 9,220, 51,154,118, 42, 83,212,121,179,135, 75,138,106, 42, 88,232, 45,103, 74,107,247,197,233, + 51,229,127, 98,154,206,189,147,134,209,149,218, 76,205, 26,225,198,168,198, 84, 14,121, 78,164,182,207, 42,103,100,162,170, 12, +189,229,228,204, 38, 94, 94, 94, 5,145,240,191, 12,221,213, 43, 51,101, 58,247, 6, 25,220, 10, 28, 77,231,154,147, 23,250,206, + 92,219, 24, 50, 85,101,240, 58,146,105, 83, 57,228,222,192, 19,193,190, 79,101,155, 61, 40, 85,134,220, 71, 82, 91,121,234, 13, +176,119,168, 58, 42,203,208, 85, 87, 87, 97,175,169, 76,150,229,167,165, 30,178,250,206,200,180, 85,198,106,154,143, 13,151,232, +173,187,140,186,170,103,249,171,100, 58, 20,110, 96, 97, 91,172, 71, 90,153, 56,196,212,157,215, 12,189,150, 49,171,207,107,187, +204,249,175,202,188, 86,145,193,163,224, 5, 39,175,194,254, 25,220, 11,158, 55,228,217,148, 43,255,111,148,153,220,218,165, 96, +114, 75,199, 29, 38,150,142, 59, 77,210,184,148,144,129,133, 78,253,180,181,181, 77,193, 43, 67,148, 47, 80,160, 64,155, 82,165, + 74,117,205,153, 51,103,107, 39, 39,167,178, 44, 55,241,239,234, 59,248,253,211,207, 52,189,251, 23, 36,252,175,175,142,166,233, + 60, 70,240,123, 58,242, 91,242, 24,241,167,180,187,137,141,187, 19,151,127, 82,234,244, 94,103, 83,164,203, 28,107,122, 27, 57, +132,144,231,139, 44,107,109,109, 93, 93,153,240, 91, 31, 22, 63,185,238, 6,220,254,143,203,106, 84,139, 86,162, 36, 38, 41,207, + 52,107,223,251,147,127,192,123,234, 59,122, 33,153,152, 90, 92,215, 82,229,223,222, 65, 88,185,228, 59,111,147,169,160,191,106, +194, 49, 57, 74, 40,167, 25, 61, 50,166,104,185, 98,118,187, 71, 81,239, 55, 81,201, 66, 25,182, 24,162,132,252,128, 92, 62,118, +229, 37, 13,159,178,130,156,178,250, 4,242,116, 15,131,204, 28,178, 90, 24,250,242, 49,179,118,117, 73,227, 82,224,121,181, 30, + 43, 34,237,189,203, 5,240, 87, 87,118, 57,101,143,206,163,171,141,172, 51,101,202, 84,201,221,221,189, 25,175,197,216, 26, 9, +255,227, 24, 95,171,105,242, 83,229,109,117,182,123, 74,107,143,198, 11,150,173,227, 37,115, 66,121, 34,209,215, 84,187,213, 96, +146, 65,182,100,235,146,133,133,179,153,133, 83,238, 23,190,179,118, 69,156,189,245,150, 14, 92,244,167, 30,147,119, 69,165,115, +205,255, 78,141,108,125, 39,211,190, 84,239, 85,115,183, 95, 9,196, 94, 19,134,222,117, 38,214,156,185,245,230, 69,236,229,232, +188, 69,198,194,123,172, 61, 74,221,182,241, 44,115,219,214,171,204,109,123,239,178,183, 29,179,149,187,157, 49,123,185,219,246, + 89,124,246,200,108, 39,217,117,151, 41, 15,217, 98,201,228, 21, 24, 94,165,118, 46, 20,110,238, 82, 56, 60,141,107,145,112,171, + 76, 69,194,173, 51,251,132,219,184,251,132,167,207, 92, 68,238, 18, 91,250,202,105,238,237,102, 81,164,125,139, 42,247,178, 20, +109,246,202,161,104,215,249,142, 62,221,115,232, 41,115,140,204, 76, 57, 74,188,184,245,236, 35, 57,121, 21,249,154, 46,107,181, + 35,114,146,107,246,146, 95,191, 93, 83, 88,117,141, 83, 61,250,233, 94,134,167,134,121,205, 83,195,188,199, 51,153, 42,173,187, + 27,151, 81,223, 52, 44,223,201, 76,145,206,227, 63,238,152,231,200, 77,200,255, 35,239,165,196, 38,102,165,146,167,182,218,225, +149,183,212, 43,115, 43,135,109,137, 77,204,139,105,192, 86, 95, 27, 41,146, 91, 56,110, 62,113,237, 77,212,153,219, 31,200,194, +222, 93,142,142,234,148,201,196,170,225,201,147, 39,135,240,188,193, 82, 10, 15, 15, 31,178,114,229,202, 33,252, 46,209, 53, 85, +142,190,114,218, 51, 57, 40,148, 33, 67,134,186, 72,248,159,235,106, 47, 71,151, 76,109, 92,173,184, 77,194, 47,222,125, 77, 72, +166, 54,238,145,142, 69, 58,142,119, 46,217,111,168,166,148,161,112,135,137, 76,174,162,174, 61,122, 79, 72,124,109,132,138,101, + 75, 95, 57, 13,120, 36, 99,178,234,149,153, 60,157, 71,254,148,233, 60,214,149,170,211, 57,114,193,230,243,116,246,102, 0,153, +219,103, 61,105,104,223, 1,130,245,232,209,163,222, 79,158, 60,233,247,224,193,131,174,248,109, 64,129,191, 43,167,157,123,193, +147,246,238,133,159, 89,187,230, 25,204,114,212, 39,157,134,232, 68,230, 14,185, 6,155,103,204,247, 44,181, 99, 30, 93,229, 53, +160, 24,127, 97, 86,182,100,245,104,218,174,215,167, 43, 15, 62, 80,221,254, 27, 41,165,153, 85,128,161,141,251,131,176,232, 85, + 66, 85,249, 32, 88,151, 31, 6,211,189, 23,161, 82,186,120, 63,136,112, 76,223, 11,141, 21,225, 48,207,216,238,159, 38, 58,153, + 59,228, 12, 74,235, 82,192,223, 10,137,231,147,194,156, 82,158, 69, 27,172, 4,185, 2,201, 90, 58,179,237, 83, 87,135,228, 93, + 85,228,234, 45, 39,136,214,113, 94,222,232,192,165, 55,116,134, 23, 90,158,186,104, 43,121,230, 45,247, 41,165,141,251, 68, 13, + 75,250,124,215, 57,226, 64,138,244,153,115, 91,187, 21,126,211,110,226, 97,106, 54,249, 42,205,219,126,135, 26,182, 27,252,161, +104,197, 70,239, 29, 61,125, 94, 56,120, 21,221,107,154, 62,147,135, 1,109,148, 40, 85,170, 84,153,249, 43,180, 94,133, 10, 21, +154, 31, 58,116,168, 53,191, 28, 99, 37, 28,195, 57,228, 65, 94, 60, 60,250,240, 84, 61,239,154,173,232,217, 15, 31,191, 80,174, +178,255, 81,246,210, 45,105,214,230, 27,148,202,206,243,160,156,151,164, 28,221, 49,181,207, 49,173,219,232, 53,225, 88,234,167, + 34, 47,227, 84,155,151, 59, 90,184,231, 17,245,157,186, 35,202,202, 37,239, 17, 77,109, 4, 11, 22,200, 85,133,250, 93,200,255, +221, 71,194, 30,191, 85, 45, 91,174,229, 59,165,206, 91,179,207,203, 45,199,238, 68, 98,143,223,250, 58, 50,144,172, 3, 23,249, +133,126, 63,144,174,242,242, 67, 55,120, 46,177, 59,207, 67,232, 50, 63, 63,110,185,203,223,150, 83, 31,206,163, 79,151, 18,225, +107,214, 52, 93,230,205, 72,209, 95,182,234,109,162,126,171, 88, 50,205,156,139,132, 31,187,246,134,238, 60, 11, 33, 76, 44,251, +200,255, 35, 61,229,149, 32,142, 94,125, 67,174,121, 42, 97,101, 1, 57,155,182,114, 90, 87, 40,156,174,210,225, 25,197,102,124, + 57, 86,243,196,146, 49,181,222, 44,223,176,135, 38, 45, 63, 30,158,167,230,208,143, 14, 62,221, 14,100, 40,210, 69,219,151,116, +140, 76, 88,167, 28,189,124, 62, 58,101, 47, 79, 87, 31,125, 32,204,203,134, 37,157, 46,220, 11,148, 22,108, 63,115,251, 29,157, +149,210,123, 58,207,171, 87,156,227,125,182, 34,213, 9,215, 24, 98,209, 2,201, 58,118,237, 61,237,187,248,150,202,240,218,158, + 5,171,247,160,116,153, 11, 63,100, 92,171, 26,240, 28, 41, 64,176,222,135,132,209,244, 85, 71, 25,199,183, 60,135,220, 27,218, +127, 49,128,158,243, 10, 9, 99, 23, 31,164,237,103, 94,209,150, 83, 47,121,133,141, 23,116,147,215, 0, 69,126, 67,158, 35,213, +188,137, 77, 82, 15, 46, 85,171, 35, 77, 93,119,145,214, 28,121, 78,235, 14, 63,162, 86, 61, 70, 80,226,228,102, 61, 13,149,153, +220,220,126,187,146,104,153,219,186, 29,144,209,240, 58,245,179,114,229,202,221, 64,174,148, 68,235,243,231,207, 67, 78,159, 62, + 61,196,212,212,116,160, 33,120, 70,231, 77,201,239,157,186,252,209,215,249,249,243,231, 61, 34, 35, 35,165,132,255,231,207,159, +223, 25,231, 56, 95, 74, 45,114,165,114,226,221,202,239,222, 40, 16,112,164,148, 54, 30, 52,125,237,185,253,235,143,191,216,174, + 41,205,220,232,183, 15,121, 98,242,243,181,152,132, 58,250, 30,223,213,157,173, 66,165,211,165, 75, 87, 85, 83,178,176,117, 27, + 99,238,152,247, 45,247, 45,111, 44, 93, 56, 57,230,186,161,239, 29,162,122,158,203,157,213,220,193,251, 68,203,222, 83,104,239, +217,199, 76,252, 62,208,164,101, 71, 40, 71,137, 70, 97,166,214,134, 19, 87, 16,171,167, 79,159,246, 63,127,254,124,125, 38, 90, +221,127,148,104, 57,100, 41,228,143,245,108,167, 47,218,252,201,201,187,248, 43,219,204, 69,158,218,184, 21,126,154,142,147,149, +107,161,167,142,222, 37, 95,181, 26, 48,239, 19, 38,171,150,187,142,177, 12,253,251, 83,178, 24,205,101,168,224, 47,166,115,247, + 31, 61,165,166,195,119,127, 71,178, 76,205, 44,176,176,178,234,166,175,131,136,201,155,202,218,189, 32,155, 63,151,154,217,103, +219,104,238,144,125, 71,106, 59,239, 89, 41,210,102, 86,159, 29, 28,249,101,203, 68,102,144, 42,144,171,209,235, 30,198, 36, 57, + 68,203,194, 41,223,139,157,103, 95,210, 5, 94,163, 16,179,153,179,165,136, 95,148, 1,116,253,113, 16, 47, 35,243,142,234,180, +238, 31, 84,190,180,247, 1,247,140, 41,151,148, 44,236,180,199,209, 54,249, 56,190,157,242,225,147, 85, 78, 16,173,253,220, 9, +111, 56,254,130,182,158,126, 69,123,206,191,162, 93, 39,238,209,236, 21,123, 40, 95,201, 90,225,252,197,178, 48,185,173,167,131, + 10,160,177,234,158, 50,189,119, 57, 91,207, 18,239, 59, 78, 59, 77,165, 7,156,231,117, 13,253,168,215,162,123,180,237,236, 91, +126,113,127,162,167,111,190,210,225,243, 15, 40, 87,177, 26,111, 97,245,210,245,242, 81,158,203,152, 49, 99,157,206,157, 59, 55, +231, 47, 28,137, 92, 45, 90,177,118, 84,145,178,181,175, 59,103, 45, 18,156,209,171,112,112,129,146, 53,175,227, 24,206, 33, 79, +135, 14, 29,154,166, 79,159, 94,253,203, 84,103, 27,101,244,246, 57,251,138,173, 89,217, 75,181,160,172, 37, 90,144,239,226, 11, +134, 18,173, 4,246,246,246,201,185,204,170, 86, 6,252, 47, 37,158, 12,246,238,206,211,143,165,165,125,176,102,102,221,145,103, +104,192,146,235,180,145,103,164, 79,227,148, 19,147,161, 42,183,152,114,194, 93, 8, 75, 22, 72, 22, 54,236,241, 27,199,225, 38, +132, 5,171, 96,173, 30, 47, 7,140, 93, 64, 33,159,190, 82,255, 49, 11,168, 16,255,198,113,184, 19,181,181, 81,122,182,100, 93, + 98,146,213,145,151,149,234,179,240, 26, 13, 95,117,139, 23,211,190, 71,243,121,241,116,247,188, 21,126,136,104, 65, 55,248,107, +124,168,153,157,215,243,182,221,135,209,241,243,183,163,142, 95,188, 27,213,169,255, 4,178,112,200,246, 2,231,212,244, 71,235, +179,105,206, 86,172, 59,188,188, 22,150,134,106, 60,246,156,180, 12, 86,255,197,215,121,169,173, 0,202,156, 47,206, 68,203,178, +109, 53,215,198,151,151,149, 94,252,245,104,141, 83,103, 22,148,152,215,176,140, 67, 45,219, 60,205, 78, 96,249,174, 89,219, 31, +208,246,211, 47,105,214,134,243, 81,197,154,140, 39,219,188, 45,110, 90,103,175, 83, 77,215, 59,196,190, 64,237,228,214, 94,213, +238, 46,221,117, 77,194,177,197, 68, 63,105, 17,250, 1, 92,214,209,188,150,229,244,173,247,105,241,190, 39,210, 51, 53,117,213, +113,178,207, 81,235,152,162, 88, 49,117, 23,149,110,139, 22, 19,173,189, 23,222, 72,239,139, 54,227,246,211,208, 21, 55,169,255, +130, 75, 84,162,254, 0,210,178, 86,170,198,231, 29,196, 9, 36,139,159,243,243, 74,171, 22,254, 7,201, 82, 63, 54,100,206,190, + 56, 19, 45, 38, 89, 3,203, 54,232, 75, 35,151,156,163,225,179,119, 81,157,255,250,208,162, 45,231,233,232,141, 16,234, 61, 98, + 46,177,165,171,164, 38,253, 76,149, 62, 75,145,194,101,107, 63,169,215,162, 43,213,105,214,149,106, 53,237, 66, 53,155,116,161, + 50,213,154, 82,193,146,213, 40,127,137,170, 84,188,114, 99,170, 80,175, 35,149,175,219,129,202,214,110, 79, 57,139,215, 14,129, + 53,197,144,247, 60,187, 11, 59,190,120,241, 98,200,246,237,219,135,140, 31, 63,126, 72,147, 38, 77,134,240,135,218, 16,126,134, +187,232,232, 33, 53,181,145, 89,246,236,217,219,191,123,247,174, 7, 63,162, 49,233,203,151, 47, 61,130,131,131,123,240, 26,181, + 61,152, 52,244,240,246,246,198,178,104,102, 26,100,199,200, 76,109,227, 49, 43,157,107,110, 66,178,202, 92,242,190, 91,185,129, +147,116, 37, 43,247, 82,119, 45, 29,178,147,101,134,108,220, 78,153, 39,107,123,222,113, 28,100,229,225,195,135,189, 96, 37, 82, + 38,182, 26,245,235, 53,104,244,242,108, 69,235,125,218,125,238, 57,157,226, 15,235, 45,167, 94, 80, 90,231,124,129,186,202,169, +122,142,151,123,171, 88,166,102,219,240, 51,215, 95,208, 13,238,135, 38,173,185, 64,110, 5,106,127, 98,111,192,176,148,214, 94, +233,116, 96,169,181, 63, 82, 35, 90,221,140, 65,180,240,254,124,201,235, 22,135, 71, 68,209,199,207,225,132,165,215,238,189, 8, +145,150,239, 59,115,235, 29, 45,224,143,222,173,252,220, 27, 74,180, 88,108, 94, 78,149,176, 71,133, 84,127,171,252, 47,157, 87, +251,157,143,127,231,143,190,182,116,244, 30,249,144,148,191,181, 29, 71, 30, 92,159, 82, 69,102,121,254,223, 82, 3,222,218, 93, +135,172,252,164,122,129,250,111,117, 97, 22,105,109, 95,248,243,226,192, 77,134,237, 38, 83,115,235, 24,107, 86,186,244,246,111, +151,175,222, 64,102, 22,105, 30,235,105,240, 88,167,209, 17,164,178,243,222, 80,185,110,155,144, 93, 71,175,132, 60,122,241,254, +235,253,167,111,190,108,218,119, 38,164, 74,221,214,159,204, 50,120, 99, 17,104, 77, 38, 72, 89,183,145,233, 58,252, 78, 22,207, +128,254,226,212,205,119,188, 0,180, 31,181,156,236, 71, 25,188,203, 74, 86, 9,188,208,235,117, 24,250, 97,249,236, 14,207, 97, +201, 42, 86,192,254, 0,127,185,180, 98, 1, 88,115,208,160, 13, 68,107, 27,127,213,174, 56,248,148, 86, 31,126, 66,141,186, 77, +167,149, 59,206,127,251, 90,127, 26, 66, 75, 55, 29,199, 11,121,191, 38,161,201,109,220,242,218,120,148, 12,234, 52,227, 2,249, +244, 57, 75, 37,250,159,167, 86,211,111,210,152, 13, 79,104,253,201,119,180,211,239,131,148,118,156,127, 79, 75,118, 92, 35,254, +170,224, 78,221, 51,169,190, 2,242,131,214,152,191,110, 90,223,191,127,191, 89,131,255, 58,175, 46, 94,161,222,231,107,183, 31, + 82, 64,224, 39,122,244, 50,152,214,239,245,163,172,133, 42,127,174,214,176,237,170,203,151, 47,215,217,177, 99, 71,235, 52,105, +210,232, 90, 26,232,187, 91,194,117, 56,114,202, 18, 58,124,217,159,102,109,185, 73,185,202,119,144,227, 58,140, 37,167, 95,191, +126,105,216,245,224,150, 50,101, 74,188, 96, 98, 72, 22,255,159,200,204, 33,215,195,133, 59,110, 80, 27, 94,188, 27, 11, 86,119, +157,115,133,166,109,185, 79,219, 78, 61, 35,171,140,185,222,107,194, 64,151, 69, 11, 49, 89,112, 23,110, 57,118, 59, 18, 36, 11, + 27,246, 91,249, 55,142,227,188, 54, 92,237,178,150,189,125,237, 81,144, 68, 90,114,148,108,234,159, 41, 87,249,219,110,121, 42, +220, 6,201,202,232, 93, 92,142, 91, 70,163,104,214,139,190, 69,202,215,139, 92,181,121, 63, 61,125, 29, 28,133,117, 66, 47,177, +149,236,226,253, 15,244,224,213, 71,186,253, 52, 40,106,223,233,187, 84,181, 81,247, 72, 83,235, 44,190,250,218,221, 50,147, 79, + 56, 94,134, 13,199,156,149,214,159,236,203,164, 16,196,101, 7,235,167,123,254, 74,100,225,152,235,131,165, 83,174, 15,105,156, + 52,126,129,107, 20,159,198, 49,235, 69,231,172,133,190,212,169,152,235, 80,238,236, 54,136, 29, 76,131,140, 14, 69,187,109, 95, +115,228,153,180, 72,249, 84, 94,104,125,226,170,115,180,108,205,122, 58,177,125, 2, 85,168, 94, 63, 56,186, 61,181, 22, 57,173, +119,141,156,217,203,117,140, 56,112,225, 21,245, 95,116, 93, 42,235, 8, 38,176, 83, 55,223,103,203,229, 99, 90,203, 75, 69, 45, +219,125,131,220,138, 52,121,105,147,163,182,149,190,186,171,159,103,253, 44,205, 86,173,183,236, 58, 12,225,248,190,155,238, 5, +171,127,234, 56,102, 43,141, 98, 60,138,214,238, 25,197, 31, 64,165,228,200, 4,185,130, 37, 75,213, 82,133,255, 97,201, 82, 63, +182,242,208, 51, 77, 68, 75,235,109,146, 36, 79,221, 49,157,189,235,171, 98,229,235, 68,185,231,171, 66,181, 59,207,164,255,250, +205,161,228,230,214,203,146, 37, 51,115,177, 76,231,180,102,217,142,139,180,143, 9, 99, 90, 91,103,141, 86, 41, 46,195,220,251, +207, 2,121, 13,219,207,108,197, 12,149, 44, 54, 87, 31, 5, 75, 22,194,125,103, 30,208, 78,254,232, 59,196,107,218,238,187, 16, + 64, 59,207,249, 75,214,183, 53,135,159,178,139,202,123,153,182,130,217,103, 41,182,199, 57, 39,187,198, 57, 57,177,123,220, 49, + 91,217,219,206,158, 69,238,194,154, 5,178,181,127,255,254, 33,211,167, 79, 31, 50,117,234,212, 33,214, 25,115,223,179, 98,139, +175,149,123,201,219,105, 51,151,188, 13, 55,187, 46, 92,249,131,174,177, 58,201, 2,185,122,253,250,117,143,245,155,183, 15, 47, + 91,189,137, 95,166, 28,197, 63,184,240,186,185,169,211,185,110,211,215, 70, 25, 10,180,154, 51,101,197,137, 67,206,165,250, 96, +229, 8,157, 27,242,204, 92,127,254, 64,134,194,109,103,234,203,171, 36, 47,126,126,126, 13,148,169,105,155,238,147,189,124,234, +124, 60,112,225, 37,141, 89,123, 91, 90,239,118, 15, 91,220,217, 75,162,137,104,125,119, 11,184, 59,179, 21,169,242,225,222,115, +126,167,159,125, 69,141,134,238,163,244, 57,106, 28, 85,112,252,155,190,242,232, 58,175, 70,180, 12,117, 29,126, 39, 26, 22, 45, +188, 31,209,167,205,222,241,144, 38,111,188, 75,227,120, 61,100,124,232,182,156,124, 65, 90,223,183, 92,255,227,180,250,200, 83, +141, 68, 75, 23, 31, 1, 49,226, 27, 66,124, 12, 65, 82,249, 45,157,211,244,187,111,223,190,253, 84,175, 85,230, 83,230, 85,221, +171,202, 80,254, 31,125,125, 69,236,113,172, 96,193,130,171, 88, 30,194, 9,212, 55,237, 22, 45, 84, 76, 89, 57,213,255,181, 52, +142,107, 74,179,180,239, 62,127,141,148,190,242, 58,141,219, 65,169, 45,211,189, 78,151,222,238,237,133, 75, 87,105,239,153, 71, +100,145,198, 90, 91,188,214,119, 34, 83, 89,103, 46,196, 22,134,192, 37, 27, 15, 7,126, 13,143,140,188,251,242,203,135,205,167, +223, 63, 89,126,228,205,131,125,151, 63, 60,191,250,224,125, 80,131, 54,253,130, 82,217,120,245,210,166, 44,230, 25,243,156, 87, +186,247,164, 61,187,246, 44, 51,230, 85,143,193, 50, 88, 23, 65,180,246, 94,240,167,182,211, 46, 74, 29,143, 67,182,178,116,156, + 93, 43,131,151,221,240, 47, 91, 34,203,129,104,119,225,243,162,133,178,110,226,206,190,171,193, 55,224, 11, 64,180,208, 41,128, +225,119, 25,189,158,230,175, 59, 76,143, 95,135,242,215, 74,176,228,250, 56,126,237, 45,136,214,101, 77,178, 83,217,185,167, 73, +231,230,227,223,113,250, 57, 26,191,241, 17, 45, 59,244,146, 14, 92,102,235, 27, 47,158,124,248, 90,176, 68,178, 54, 48,225, 26, +191,233, 25, 13, 90,241,128,202,182,158, 22,238, 85,172,113, 84, 26,199, 60, 27,245, 60,120,141,207,156, 57,211,122,224,208,209, +163,138,150,171,243,249,227,231, 48,122,232, 31,202,110,148, 0, 90,206, 15,207,242, 3, 79,105,195,209, 39,228,146,179,236,231, +174,189, 7,142,138, 11,209,194,253,189, 11, 86, 12,189,250, 32,136,218,245, 29,143, 47, 68,213,224, 82, 57, 80, 38, 92,183,110, +157, 25,127, 37,218,180,106,213, 42, 15,191, 44, 10,240, 69,201, 56, 37,180,176,176,200, 90,160, 84,205,141,117, 58,140, 15, 91, +118,224, 9,141, 92,125,139,102,110,227, 78,227,172, 63, 13, 24,191, 36,204,222, 61,255, 6, 93, 55, 80,198,104,101, 40,221,119, +211,208,213,183, 70, 21,108,187,201, 26, 22, 43, 88,174,242,213,234, 19,203,162, 5, 11, 23,142,235, 8,140, 87,176,222,220,190, +197,166,244, 49,107,239, 80, 38,249,174, 66,189, 24,176, 94,220,250,244,133,191, 22, 3, 62,209,201, 27,239,104,221,177,231,252, +242,122,198, 86,209,215,116,142,117,103, 47,147,172,198,237, 7, 82,122,183,252,100,154,222, 75,215,128, 21,233, 94,105,221,124, +194, 31, 50, 65,107, 59,245, 34,245, 94,112,141,113,131,117,232, 1,109, 62,249,130,170, 55,233, 70,199,206,223, 37,212, 35,109, +198,220, 31,244, 22, 46, 58, 67,198, 92,149,233,236,213,199, 52,102,246, 70,178,206, 92,252, 35,127, 80,141, 74,109,239,105,201, +174,194,117, 75,246, 61,166,126,115, 79,147,239,180,181,180,123,211,116, 58,183,119, 10,173, 93,183,138,236,243,183,138,245,225, +167,237, 94, 86, 89,171,247,109, 51,100,133, 84, 62,188,139, 38,109,188,199, 11,149, 63,162, 85,135,159,209,166, 99, 79, 40, 95, +149, 78, 97,105,179, 86,203, 37,183,172,186,242, 97,160,137,153,109,214,221, 61,167,236,166, 49,171,175, 51,233,204,121, 72,142, + 92,144, 41,184, 11,213, 73, 21, 8,139,250, 49, 60, 87, 26, 92,135, 26,111,195, 94,133,169,125, 70,206,165, 67, 87, 3, 37,171, + 21,158,251,182,125,167, 82,178, 84,105,225,134,138,254, 40,181, 76, 93,177,110,171, 40,156, 47, 81,177,254, 71, 77,130, 82,216, +122,228, 44, 88,166, 78, 80,141, 38,157,169, 90,163,206, 84,165, 97, 39,170,220,160, 35,245, 26, 62,135,142, 48, 65,236, 62,108, + 30,149, 97, 43, 86,169, 90,237,169,100,205,118, 84,188,122, 91,202, 94,180,214, 75,126, 94,181, 6,200,187,240,135, 4,220,205, + 8,137,128, 53,116,215,121,127,202,156,167,252,151, 54, 93,250, 29,216,182,107,239,228,189,123,247,250,118,239,217,111,106,254, +226, 85,142,164,117, 43,254,181,207,194,171,212,121,230, 37,106, 50,238, 28,165, 97,178,165, 13, 87, 14,206, 47, 88,176,114,251, + 35,181,219,143, 62,211,184,211,216, 99,227,102,174, 94,124,238,226,245,161, 32, 89, 29,186, 13, 90,231, 93,160, 66,232,200, 25, + 27,163, 86,241,242, 94,124,255, 40,182,192, 63, 77,153,198, 65,231,252,130, 32, 79,155, 79, 5,108, 87, 18,173, 20, 54,238, 27, +241,190, 85, 77, 56,134, 50,169,231,213,243, 14,141,113,199,193, 37,215,184,117,183, 73, 32, 89,251,163, 73, 86, 29,182,176, 55, + 25,127,142,182,177, 85,135,195, 80,100, 17, 45,118, 91, 15, 92,183,235,148,228, 26,239, 49,247, 10,101,171,212, 55,202,210,181, +188, 61, 62, 90,241, 49,206,233, 49,246,108,221,170,165, 80,124,103,193,213, 90, 92, 85,162,117,239,222, 61,137,104,193,251, 97, +106,235,213,217, 34, 99,254, 53,150,206,249,110,164,201,152,239, 85, 26,153,125,106, 6, 21,162, 53,126,193, 46,178,114,206, 77, +171, 14, 61,165, 46,179, 47, 83,207, 9,155,249,253,145, 75,250,128, 67, 40,135, 38,139,150, 46, 62,162, 36, 75, 92, 25,137,108, + 97,175,250,191,210, 82,165,126, 76,219,111,109,249,245,201,137, 62,111, 39,231, 29, 16,147, 71,149,100,225,160, 14,139,150,187, +181,173,211,187, 83,103, 47,208,139,183,159,105, 28,127,141, 78,216,112,151, 38,173, 60, 77,183,239,222,151, 30,172,166,237,250, +190, 53, 49, 49,209,229,119,143,185, 47,204,207,233, 92,243,124, 56,113,249,217, 7,255,192,176, 79, 11, 15, 6,220,107, 63,239, +177,159, 50, 53, 28,113,228,218,160,233, 59,253, 55,238, 61, 31, 98,237,154,239,133,182, 74,129, 92,193, 13,129, 56,152,131,252, +245,133, 23, 47, 98,169, 12, 2, 65, 67,102, 75,167, 60,254,246, 89,203, 74,150, 44,144, 44, 51, 59,111, 42, 82,161,246,167,255, +187, 11, 51,238,207,157,205,121,219,132, 9, 19,250,178, 69, 71,206,132,161,223,221, 5, 15,244, 82,118,115,204, 96, 34, 80,241, +191, 81,244,248,101,144,132,237,109,142,147,193, 87, 37,190, 38,181, 17, 45, 8, 75,149,222,187,136,153, 83,222,219, 89,242, 87, +126,155,175, 84,221, 55,165,170, 54,125,219,173,223,168,224,117,219,142,126,245,187,199,166,229, 45,207,168,227,156, 59, 84,126, +208, 89,170, 58,248, 4,141, 92,123,159,220, 11, 84,131, 69, 71,171,133, 16, 22, 45, 16,173,188,197,170, 92,191,122,235,129, 20, +175,179,141,221,154,115,119, 62,164, 33,203,111, 82,107,182, 18,245,152,119,149, 90, 12,221, 72,174, 57,202, 92,143, 43,209, 98, +171,192,218,173, 71,111,209,220,245,199,152, 8,100, 57,134, 0,118, 3,218, 44, 1,187, 7,172,119,237,218,101,207,110, 3,183, + 69,139, 22, 21, 69, 60, 4, 95,111,195,129,183,117,130,130, 66,218,187,100, 47,249,172, 78,187,145, 95,103,172,229,248, 44,118, +163,116, 30, 56,229, 43,187, 9, 94, 96, 52,162,174,251, 40, 71, 29,230,106, 62,163,223,164, 77,215, 15,251,180, 95, 24,211,182, +136,201, 42,192,228, 10,150,173,124,181,122,107,139,209,138, 37, 30, 65,239,247, 95,124,148,220,100,153,217,146, 37,181,155, 93, +246,187,169,236,115,124, 64, 74,157, 33,199, 7,179, 12, 57, 63,112, 12,224, 7, 11, 78,150,142, 57, 53,197,108,104,208, 29,143, +155, 48,203,195,218,176,145, 99,124, 64, 42, 15, 95,121, 75,107,247, 94,162, 42,141,187,144,157,123, 1,106,209,125, 12,109, 58, +122,159,210, 56,230,188,167, 15, 91,107,247,162,225, 32,249,189,230, 95,165,225, 43,111, 73, 22,192, 37,251,159,240,243,244,146, +138,213,232, 72,157, 39, 29,144,220,114,252,226,252,160, 79,150,242,124,182, 98,245,104,239,137,155, 52,110,225,126, 10, 10,249, + 68,171,183, 30, 34,151,220,149,195, 45, 92,139,223,239, 63,126, 25, 45, 91, 50,141, 78,238,156, 64,115, 22,204,167, 97,243, 14, +210,250, 35, 79,200,193,167,171, 44,162,165, 80,248, 38, 76,151,173,218,201, 5, 91, 47,211, 82, 46, 39,190,158,241, 33, 0, 18, + 83,181,229, 72, 98,247,162, 65, 86, 86,125,117, 50, 73,231,230, 92,186, 94, 15, 94,240,254, 33,121, 22,170, 46,171,115, 4,113, + 58,192, 31, 40,234,164, 10, 49, 89,234,199,150,240,123, 64, 14,209, 74,154,210,162, 95,255,177,139, 36,130, 53,102,246,102,170, +211,126,156, 20,163,179,237,108, 0, 53,104, 55,152, 18,167, 76,141,137,137, 21,112, 39, 14,155,182,134, 14, 95,253, 64,118, 25, + 61, 47,233,171,159,242,124, 10,171, 44, 57, 26,180, 31,194,214,150,215, 28, 30, 49,136, 64,198,228, 94,139,124, 32, 90,136,145, + 27,198, 58, 52,112,201, 13,137,180,183,238, 53, 57,168, 83,159,209, 97,249, 74,215, 13,205,144,165,200,103,143, 2, 53, 66, 11, +215,238, 23,238, 93,190, 71, 72,153,126,199,168, 88,207, 35,146,215, 64, 23,209,114,204, 90,250,200,166,163,247,222,108, 61,253, +226,205,242,253, 15,158,143, 93,114,244, 94,203,158,211, 46, 22,168,240, 95, 64,157,230, 61,190,238, 62,251, 76,138, 77,155,202, +122, 59,157,211,160, 25,219, 35,211,187, 23,220,167,171,236,234,228, 9,239,218,195,151, 3,194, 56,238, 47,252,196,141,183, 95, + 89,151, 62, 41,223,191,113, 37, 90, 49, 36,203,239,155, 37, 11, 97, 12, 77,199,159,167,214, 83, 47,208,122,254, 56,226, 88, 95, + 57,186,148,208,197,187,216,243, 23,111, 66,105,225,222,199, 18,166,153,124, 90,115,191,152,231, 99,217,186, 93,105,192,164,181, + 82,223, 55,123,245, 17,201,205,107,110,239,245,146,227,181,106,200,105, 55, 85,162,117,241,242,229, 30, 22, 25,178,109,243,224, + 62, 98,224,180,173, 81, 11,182, 94,160,237,167,240, 14,120, 65,136, 77,150, 35, 15, 68, 43, 50,138,164, 15,242, 52,142,217,208, +127,113, 12,242,107,201,189,111,233,240,237,247,178, 3,143,249,253,114, 79,167, 69, 75,157,151,224,222,234, 86, 41, 77,191,229, +228,129,168,111,226, 36,203, 88,140,149, 76,211,113, 28, 83,183,104, 69,255,214,246,177,161,234, 62,252, 63,100,178, 92,135, 73, +147,122, 88,217, 58, 5, 94,186,122,139, 6, 47,189, 65,165,251, 28,147,204,244,120,233, 44, 99, 64, 87,239,185, 74, 13, 91,245, +120,159,210,212,244, 50, 75,134,101, 65,231,150,194,198, 45, 79, 58,151, 60, 31,246,156,126,240,254,206,243,207, 31, 6,175,121, +126, 85,149,100,149,104, 49,245, 92, 42, 91,207,119,204,170, 87, 88,185,228, 57,151,154,215,194,211, 38, 16, 68,107,195,241,231, +212,128, 77,177,141,249,171,168,217,132,243, 70, 33, 90,105, 92,242,191, 56,124,229, 91, 76,150, 31,147,158, 82,213,154,132,170, +186, 11,203,149, 43,215,183, 75,151, 46,125, 16, 24,206,202, 42,135,104, 37,102, 50, 48,130,205,223, 15,121,104,243, 91,236, 45, +211, 57,190,158,185,245, 46,141, 95,127,151,138,213, 27,196, 36,235,147,228,219,126,192,228,230,248, 85,127,218,126,242,137, 78, +162,165, 17, 19, 87,215,100,214, 46,121,123,119,232, 63, 41,120,244,250, 71, 84, 97, 48, 72,214,113, 38, 89, 15,168,100,179,241, + 81, 28,104,223, 84, 87,227, 40,137,150, 99,150, 66,193,254,239, 66, 37,151, 1, 72,194, 32,110,247,150,147,252,168,194,192, 19, + 84,184,251, 97,234, 56,237, 12,241, 87, 78,112, 92,137, 22,143,226,169,219,174,223,100,201, 12,222,127,210,122, 74,151, 41,223, + 35,254, 26, 43,174, 79,119, 84,206, 39,202,154, 53,171, 59,147,194, 44, 97, 97, 97,121, 46, 92,184, 80,142,135,144,215,190,126, +253,122,211,136,136,136,102,193,193, 31,155,214,105,218,113, 51, 91,206, 30,243,180, 0, 79,108, 92,114,207,150, 77,230, 60,125, +147,150,105, 55,107,247,210,189, 55,223, 98,175,224,223,202,251,202, 24,117, 24,171, 10,232,120, 16, 0, 15, 83,186, 71,190, 74, +223,136,150,173,247, 71,232, 44,130,207, 79,179,123,250, 60, 7,114,227, 67, 97, 53, 91, 99,224,158,147,131, 1,191,176,174,127, +248, 24, 38, 17, 11, 60,131, 32, 90, 91,143,221, 34,103,239,226,212,113,224,116,218,198,186, 3,162,212,111,209, 53, 74,101,155, + 85,235,243,163,188,151,141, 71,241,112,148, 19, 86, 43,238,100,216, 50,230, 47,197, 81,128, 40,148,174,211,153,250,207, 62, 34, +221,131, 93,175,159,248, 26,233,101,146, 36, 73, 18,157,100,198,187,104, 93,186,247,244, 61,109, 62,124,155,220, 43, 14,163, 78, + 35,215,209,167,207, 95,105,215,161,115,228,150,171, 52,205,156, 51,157,186,142,223, 74,195,151, 93,145,226,173, 96,141,114,240, +233,242, 89, 78,253,145, 39,189, 71, 13,199,220,149, 58,127,218,117,238, 37, 47, 84,254, 84, 34,156,157,134, 45, 37, 43,175,106, + 83,228,202,144,155, 15, 49,164,181,218, 12, 35, 16, 34,215, 60,229,101,117, 58, 32, 78,123,153,176,168,199, 99,173, 63,246,226, +187, 99,112,121,234, 35, 90, 28,216,222,183,187,239,116,137,100,245, 31,179,136, 92,115,149,137,104, 50,112, 45,199, 77,213,165, + 46,163, 86,209,108,118,195,155,167,115,218,135, 0,248,246,125,198,127,203,199,164, 44,145, 73,234, 70,178,235,105,235,185,120, +225,150, 11, 18,193,158,177,238, 28,165,178,241, 92, 44,247, 90,228,131,190, 99, 96,130, 42,209,106,217,107,234,187, 71,108, 21, + 63,115,235, 61, 33, 84, 98,230,182,251,252,177,118,133, 92,138,119, 14,150, 75,180,120, 84,246,167,119, 65, 95,194,107, 14,216, +249,160,219,156, 75, 55,122, 79,217,253,168,112,213,206, 95, 22,174, 63, 22,121, 4, 31, 24,236, 25,192,199,193, 64,118, 81,193, +122,130,247,106, 90,215, 66, 26, 45,121,202,250,104, 34, 90,120,223,183, 99, 47, 70, 95,126,110,224,226,141, 43,209,122,252,248, +113,127,117, 75, 22,194, 24, 64,178,218, 48,201, 66, 25,241,188,167,203,164,159,104,165, 72,231, 94,121,210,188,117,244,240, 85, + 40,141,101,203, 56,194, 16, 10,215,236, 75, 13,187, 76,166,175,225, 17, 82,106,210,125, 26, 29,187, 30, 40,165,173,199, 30,160, +220, 79,228,180, 27,136, 22,202,234, 59, 98, 92,223, 2,165,235, 6, 14,156,186, 41, 2, 1,246, 75,247, 63,150, 44, 79,125, 24, +135,110,108, 65,195,224, 47, 57,242, 64,180,216, 59, 37,189, 43,182,159,126, 74, 7, 47,190,148,234,217,137,173,150,179,182,222, +166, 21,251, 31, 72, 70, 26,144, 78,109, 22, 45,213,251,168,242, 19, 53,215,225,119, 36, 73,159, 37,138,229,198, 88,194,162,243, + 74, 49, 95, 26,142,107,149,173,150, 95, 29, 18,237,139, 74,235, 35, 90, 73,147,154,102,177,178,205, 24,116,241,202, 77,238,108, +175, 83,161,174, 71,104,202,166, 7, 52, 98,193, 33,142,199,178,122,107,110,145,246,133,101,218,116,215, 83,164, 48, 29,202,119, +213, 27, 3,148, 34,189,123, 46,107,231, 60, 31, 54, 28,188,249,246,194,195,143,111, 7,174,122,126, 69,149,100,181,153,125,239, + 2, 72, 22, 98,144,228, 52, 44,155, 55,223,231,106, 48,131,114, 53,152, 78, 57,234, 77,165,236,117, 38, 83,122,175, 50, 31, 49, + 50, 16,137, 71,119, 4, 65, 73,164,196,129,241, 72, 60,242, 76,175,107, 49, 45, 19, 45, 4, 49,227,171,140,211, 43, 85,119, 97, +190,156,153, 54,118,234,212,169, 15, 15, 81,110, 13,235,143, 12,162,149,200,198,198,230,194,140, 25, 51, 62,179, 5, 70,138,241, +225, 81, 56, 52, 99,230,204,200,108,121,139,210,176,229,215,169, 76,211,145,116,239,217, 7,122,204,163,189,206,223,124, 69,219, +142,223,167, 21,123,110, 25, 78,180,162, 65,179,117, 47,114,166,197,232, 67, 84,221, 23,150, 44, 38, 89,205, 39, 68,105, 24, 62, +254, 29,196, 74,162,229,224, 81, 48, 24,241, 0,112,199,224,193,110, 62,241,188,228, 91,207,214,118, 31,101,111,183,159,254, 27, +127,226,135,136, 22,223, 56,129,169,173,231,170,230, 61, 38, 75,157,215,216, 21,126,228, 85,184, 86,132,134, 64, 91, 93,106,144, +204,195,195, 35,255,165, 75,151, 10, 49,158, 62, 12,107, 77, 78,141, 57,213,229,212, 60, 36, 36,164, 13,147, 47,140, 66, 66,108, +144,190,225,249,210,125,156,138, 53, 51,201, 82,176,114,231, 86,189,198,208,201,171, 79, 8,251, 44,249,171, 78,181, 46,217, 69, + 10, 54,133,155, 16, 49, 89,106, 1,240, 90,203,232,224, 89,108, 15,226,177, 60,153,100,185, 68,199,100,177, 11,237, 35,220,208, + 37,251, 28,165,106,190,167, 36,183, 9,130,207,215,112,220, 2,199, 64,125,144,163,247,252, 34,189,246, 38,232, 11, 19,140,103, + 52, 39, 58, 22, 98, 55,187, 13, 15, 94,121, 67,139, 24,207, 22,108, 33, 40,208,229, 16,127,120,156, 99,139,161,247, 3,125, 50, +121,228,106,160, 75,158,202,145,110,249,170, 68,122, 20,168, 74,181, 57,160,186, 68,157,110, 84,174, 65, 15,170,216,180, 47,141, + 90,124,130,182, 50,169,227, 57,172, 62,177,187, 70, 26, 8,193, 50,117,142,178,201, 90,164, 14,189,230,120, 78,196, 27, 58,151, + 25, 44,165,224, 79,145, 20, 17, 73,148, 57,127, 13,234, 48,229, 20, 19,193,235,146,235, 15,241, 90,139,249,107,157,221,138, 26, + 99,232, 80,126, 7, 7,135,146,220,158, 85, 29, 29, 29, 99, 8, 57, 91,174, 26,117, 26,190,156, 45,123,175,105,244,194, 3,100, +147,157,227, 86, 84,130,223,153,140, 23, 40, 81,162, 68, 25,182,128,230,211,135,129,142,243, 9, 56, 94,107,221,164, 21,199, 49, + 58, 13,174,238,249,114,100,129, 56, 61,103, 11,245,152, 69, 7, 37,236, 54, 49,121,225, 81,109, 76,102, 67,104,240,172,125,146, + 5, 14,186, 15,146,133, 32, 97, 93, 68,139, 45, 85,101, 91,116, 25, 42,145,167,193,147, 86,144, 73,170, 52,203,210,102,240,184, +208,109,210, 94,106,214,127, 17,229, 96,178,213,119,198, 97,114,246, 44,240,185, 99,191, 9, 82,190,209,179, 55, 81, 74, 11,155, +165,114,117, 31, 46, 82,159,202, 45,194, 80,198, 69, 59,111, 75,157,101,254,114,205,195,112, 92, 78,125,145, 71, 19,209,106,209, +115,202,187, 91, 79, 63,210, 46,254,104,131,245, 30,174,175,234, 67, 79, 81,198,162,157,131,100, 19,173, 44,133, 63,135,133, 69, + 80,235,222,147, 35, 74,212,236, 30,222,162,219,184,136, 83, 87,159, 73, 46,206,117, 76,178, 96,109, 29,200, 31,131,176,184,215, + 31,125, 70,122,167, 90,102, 44, 16,170,171,220,154,136, 22, 62,126, 48,104, 5,174,126,124,196,196,149,104,245, 25, 50,102, 57, +220,133,251,216,146, 53,118,221,109, 41, 86, 20, 70, 0,184,230, 65,178,112,143, 21, 7,159, 48,209, 42,168,215,162,101,102,151, +117,255,195, 23,129, 92,215, 55,146, 23, 9,198,142,255,134,109,166,190, 19, 54, 82,145,154, 61,165, 52,126,209, 1,137,100, 45, +222,247,140,177, 61,141,114,203, 34, 70, 32, 90,215,111,222, 28,100,235,238, 19,112,226,202, 11, 30, 21,251,154, 58, 50, 41,194, +251, 30, 33, 51,221,185,173, 16,151,204,229,148, 37, 15, 68, 43,244, 75,132,100,101, 70, 91, 43,137, 33,100,130,100, 34, 70,171, +116,223, 99, 28,130,115,253,135,136, 22,218, 85,157,120,225,208,183,195,255,183, 84,225,183,166, 24,173,232,107,191,179,146,169, +202, 80,202, 82,221,171,200,211, 20,167,169,157,104,233, 82,196,164,166,150,158,214,182,206,193, 23, 46,131,108,252,159,100,141, + 95,113,134, 99,177,108,158,242,181,234, 19, 64,234,124, 30, 49,191, 83, 90,238, 72, 22,111,187, 24,112,252, 70,176,127,255,149, +207, 98,145, 44, 16,174,150,147,175, 93, 66, 16,170,220, 7, 27, 49, 89,240,117, 99, 4, 7, 72,214,174,115,175,216,141,249,230, +219, 87, 57, 7, 27,122, 84, 30, 33, 29, 67,220, 0, 30, 34, 12,249,151,163, 52, 32, 90,232, 12,235,182, 29, 16,172,238, 46,236, +216,177, 99, 95,144,172,221,187,119,183,190,122,245,106,107, 38, 81, 58, 45, 90,124,222,119,246,236,217,159, 36,134,165,182, 77, +157, 54,131,202,214,239, 78,141,250,175,164, 9, 11,119,115,124,214, 59, 58,116,254, 33, 49, 70,180,112,219,149, 56, 19, 45,126, +105,143, 44,223,122, 50,141, 92,243,128, 74,201, 36, 89,192, 92, 73,180,178, 23,174,116,125,245,206,243, 52,127,215, 67, 41,158, + 0, 15,135, 87,235,189,148,169,249,110, 42,205,230,254,210,237, 23, 27,228, 58,228,249,136,170,177, 53,109, 15, 91,173,234,168, +182, 45, 15,155,238,157,187,116,227,240,161, 75,206, 83,143,169,135,120,168,117, 22,189, 65,172, 42,215,131, 60,153,178,187,176, + 44, 19,216, 82, 76,182,202,177, 53,171, 10, 67, 92,159,127,183,201,147, 39, 15, 72, 22, 58, 9,101,176,188, 86,181, 42,210,124, +157,149, 79,187, 5, 77, 75,183,153,181, 23,228,106,245,246, 99, 82, 75, 97,143,223,165,219,206,220, 87,184,237,130, 22,249, 90, +174, 74,151,174,204,248,148,125, 22, 93, 30,104, 91,217, 55, 78,129,168,169,236,178,125,132, 37, 11,157, 13,176,197, 75, 8, 65, +221,203,185, 99,227, 24,134, 15,114,116,159, 95,164, 87, 95,190,251, 36,141, 94,156,200, 1,167,190,236,214,237,201, 47,197,134, + 60, 98,176,194,128, 19, 84,172,215, 81,202,223,229, 32, 91,122,207, 16,187,152, 31,202,145,169,204,131,192,247,227,126,247,168, +203,228, 67, 52, 96,206, 49, 26,179,244, 20,205,217,112,129, 93,147,111, 36,162,197,241,113,173, 97,201,229,252, 58,137,150,103, +161, 90, 52,131, 71,221,129, 96,221,121,142,233, 34, 62, 75,255, 15,227,145,113,153,242, 85,163, 50,109,230,190,234,196, 49,134, + 8,148,133,187, 18,238, 63,118, 29,106,141, 39, 99,139, 48, 8,116, 57,158,199,173,129,157,157, 93,109, 38, 94,181,144,236,179, + 20,249,232,145,183, 28,101,240, 42, 22,225,226,158,189,169,155,155, 91, 53,164,204,153, 51, 87, 45, 92,184,112,109, 92,195, 68, +171,178, 33, 24,168,228, 77,200, 22,133,233, 93,135,206,147, 44, 28,141, 59,141, 36,158,104, 88,214,164,142, 32, 78, 32, 89,234, + 22, 45,144, 44,245, 99, 61,167,236,210, 73,180, 82,167,177,219,191,147,173,191, 19, 22,237,161,228,102,233, 48,199, 91,194, 68, +201, 83,215,107,210,115, 22, 13, 93,114,145,154,246,156, 66, 57,138, 84,148, 44, 93, 74,146,149,202, 34,221,114,228,147, 91,239, + 20,214,238,131,125,103,110,231, 78,242, 17,199, 98,213, 97,143,197, 61,234, 54,126, 51,225,184, 92, 25, 32, 90,120,207,158,224, + 80, 18,140,210,222,205,150,209,182,253,166, 7, 33,208, 94,157,104,101, 42,209, 37, 4, 3, 25, 58,207, 66, 39,172, 59, 70,203, + 53,123,241,135,175, 3,222, 17,115, 45,122, 31, 18,206,225, 21, 31,233, 40,199,176,194,253,134, 14, 29, 22,119, 88,138,240,225, +130,206,188,193,144, 29,148,214,173,200, 99, 93,229,214, 68,180,164,233, 54,216, 85, 6, 82,140,129, 32,113, 33, 90, 22,182,153, +198,178, 53,247,211, 62,191, 23, 18,201, 66,224,187, 68,178,216, 82,214, 53,154,100, 33, 12, 3,100, 36,189,155,110,162,133,120, +169,206,253,198,210,187,224,175,146,213,118, 10, 15, 30,193,135, 73,143,185, 23,248,185, 60, 65,107, 15,220,149,166, 13, 89,188, +255, 25,213, 28,118,154, 92,234, 44,165,140,149, 38, 24, 68,180, 90,119, 25,116,106,240,244,173,225, 24, 9,137, 17,199,173, 56, +104,189,221,148, 51, 84,172,193,160, 79,153,242, 84, 9,176,113, 43,248, 58,157,235,119,115, 79,106,132, 54, 67,150,194,175,130, + 66,195,165,186,217,230,172, 45,245,187,248,152,194,168,107, 16, 45,155,236,181, 36,107, 22, 44,154,152,187, 79,174, 94, 33, 31, + 63,199,113, 29,117,136,235, 48,114, 80,117,148,161,250,200, 69,125,163, 17, 85,207, 67, 94, 18, 45,101,215,236, 58,212, 86,209, +148, 22,214,222, 76,178, 66,252, 46, 95,143, 69,178,198, 45, 63, 19,101,102, 97, 13,179,164,187, 33, 32,165,180,206,236,157,134, + 59,145, 41, 43, 79,248,239,190, 24,248,188,239,242,103,151, 85, 45, 89,255,255,255,145,159,141,123,177, 0,115,199,156,147,172, +172, 60, 77,245,221, 3,241, 88, 32, 89,255,177, 91, 43, 91,237,137,236,234,122, 37,117, 92,248,106, 0, 27,119,171, 56, 84, 34, + 90,120,153, 15, 89,118, 67, 82, 82, 57, 68,203,202, 53,255,139, 6, 29, 99,143, 46,132,187, 16,150,172,229,203,151,183,134,203, + 12,214, 44, 14,200,110,205, 47,125,157, 68, 11,110, 66, 88,176,212, 55,127,127,127,186,121,243, 38,185,186,103,227,145, 83, 87, +164, 57,123, 70,205,217,201, 83, 60,220,161, 35, 23, 30,211,178,157, 87,227, 68,180, 76,109, 60, 58,148,108,208,159, 70, 73,238, +194,113,176,100,181,212,135,163,242,188,146,104, 33, 24, 62, 75,254,138,159, 87, 29,124,196, 15,201, 69,202,213, 97, 63,121,183, +217, 39,145,172,250, 35, 79,144,141,123,241, 79,134, 4,195,187,231, 46, 29,178,243,244, 35, 42, 81,181, 89, 24, 2,249, 85,203, +195,195,150, 43, 84,111, 53,130,221, 13, 55,201, 37, 87,149, 47,114,203, 26,157, 47, 65,234,212,169, 93,123,246,236, 89,153, 73, +150,114,200,110,243, 49, 99,198, 52,226,227,153,228,144, 44,200, 65,224, 59, 98,178,224, 46,132, 37, 75,117,195,111, 28,199,121, +228,179, 46,214,187,218,220,237,215,158, 88,151,236, 87,205,192,178, 74,217, 83, 51,209,130,187, 16, 47, 30,152,212, 97, 49,196, + 23,244, 82,184,230,100,198, 64,113, 7,112,229,201,235,143,210,151, 60, 72, 74,239, 5, 87,165, 23,121, 53,126,217,150,235,127, +130,124, 56,238,165, 64,215, 67, 84,107,248, 41, 16,173, 71,134,148, 19,238, 75,140,124,133,108, 88, 53,208,249,128,100, 97, 68, +163, 61, 19, 45,144,172, 27, 55,110,232, 37, 90, 89, 10,214,164,137, 75, 14, 74,228, 10,163,217, 48,178, 13,255, 15,152,186,141, + 92,243, 86, 37,158,176,180,113,166, 82,189, 55, 86,236,176,224,109,159,249, 23, 56,160,253, 14,136,214, 93,109,101,229,121,151, +106,241,188,109, 77,217,245,222, 28,228, 73,153, 48,210, 12, 29,121,150,188,101, 2, 85,143,135,134,134,150,207,145, 35, 71, 19, + 76,104,105,101,101, 37,197, 46, 25,176, 37, 64,156, 11,143,162,186, 53,144,227,201,208,153, 13,156,176,130,221,176,158, 75,228, +202, 0,209,194,180, 45,223, 5,190,179, 37, 75,253,216, 76,118,207,235,178,104, 21, 44, 89, 61,100,199,185, 55, 84,170,122,243, + 40,133,133,133, 50,158, 49, 65,210,148,105,238, 54,235, 49,129, 7, 67,188,100,107,230, 7,137,100,249, 78, 94, 73,169,204,211, +109,231,114,202, 38, 89, 10, 79,207,164,110,121,202,191,195,212, 24,157,134, 45,199,123,231,106,235, 65, 75, 37, 11,138, 83,142, +114,239,112, 94, 78,189, 53,141, 58,172,223,162,235, 91, 16,163, 24,162,197,157, 44, 62, 50,108,115,215,123, 39,119,212, 97, 90, + 7,207,177,107, 54,237,140,252, 18, 22, 37,145,246, 99, 32, 89,108,121,195, 64, 23, 30,160, 36, 89,138, 32,179, 96,183, 67,212, +156, 73, 77,254,186,190,145, 76,136, 39,232, 42,179, 58,209, 98,252, 79,243,136,202,107, 72,108, 69,186,150, 42,189,215, 53, 28, +131, 12, 67, 98,180,204, 29,115, 7,238, 57,199, 36, 43,122,116, 33,172, 67,112, 71, 98,244, 51,136, 37, 62,138,240,188,195,154, +105,171,135,104,165, 76,151,121,237,229,219, 79,165,184, 93,196, 61,129, 84, 98,160, 74, 31,142,211,106,199, 22,167,246,211, 47, + 81,237,161, 39, 40,103,179, 21,148,177,236, 16,114, 41, 63,148,242,182, 92, 43,155,104,165,177,202,208,161, 97,219,129,161,112, + 23,250,114,223, 8, 28,155, 13,223, 69,118,158, 37, 94,167,113,200,213, 89,203,124,142, 90, 97,117,244, 44,114,229,169,127, 48, +173,229,120,185, 19, 87, 95, 51,217,170,245, 45,229,248,150, 38,173,191, 37, 61,231,205,198, 28, 39, 51,167,252, 87,228,232,212, + 95,157, 39,185,153,213,243, 75, 87,174, 75,126,111,196,100,193, 93, 56,110,249,233,200,212,230,210,244, 13, 6,145, 44, 0, 5, +203, 69,135,225,171,143,239,184,240, 97,127,175, 37,207,230,182,156,241,112,154,182, 84, 99,208,129,197, 25,114, 84,189,195, 47, +181, 47, 28,167, 21,202, 95, 84, 67,180,129,109,233, 92, 32, 48, 71,221,201, 18,201,242,174, 57,158,188,106,140,165, 44,213, 70, + 75,150, 44,183, 74,195, 40, 19, 43,158,115,217,193,228, 80,122, 0,217,151,232, 75,182, 69,251, 16, 95,163,215, 98,230, 85,180, +254,180,114, 42,163, 11,149,238, 66, 85,146,197, 83, 32,180,126,255,254,125,107,254,170,214, 73,180,248,252, 27,117,146,197, 4, +141,184,195, 34,142, 45, 34, 23,183, 44,212,141, 31,194,158,243, 46, 83,221, 94,203,168,120,195,225, 84,172,190, 47, 85,106, 61, +209, 96,162,197, 36,171,125,137,250,253, 36,146, 85,172, 78,111, 38, 89,238,152,122, 66,246,134,192,254,227,199,143, 75, 36,178, +124,173,230,155, 50,230, 40,251,185,209,224, 77,212,105,198, 57,106, 57,241, 52,149,237,184, 76, 34, 89,197, 42, 54,220, 4,178, +185,121,243,230,214,230,230,230,122, 99,212, 28,179, 22,125,136, 0,219,249,107,246,243, 84, 14, 30,135, 77,173, 51,183,131,155, + 48,133,117,230,182, 24, 45, 51,116,230,102,137,208,219,184, 23,125, 41,187,176,223, 50, 74,214, 42, 44, 29,113,237,218,181, 26, +112, 27,222,189,123,183,121,116,199,138,142, 70,175, 53, 11, 66, 48,186, 80,213,162,181,106,219, 55,139,214, 42, 21,139, 86,254, +150,115,219,217,150, 26,220,188,100,205, 54, 17,152,103, 11,123,235,226,125,107, 90, 21,243,213,251, 65,160, 90, 39,158, 43,238, + 35,130, 87,149,243, 63,193,188,142, 56, 56,196,113, 89,203, 36, 90,220, 1,108, 90,190,249,136, 52,209,237,204,237,247,165, 47, + 70,184, 32,171,240, 23,125, 25,118,241,214, 96,194,133,169, 26, 10,183, 89,197, 86, 66,119,125,147,193,198,130,220,210, 41, 39, +230, 12,250,104,233,144,227, 99, 26,199,236, 95, 56,190,237, 75, 58,151, 92,188,207,245,133, 71,115,189, 6,201,130,251,144, 47, +210,105,209, 2,153, 66,128, 61,166, 73, 81,186, 14, 31,190,250, 68, 31, 62,134,147,115,238, 42, 82,208,187, 75,193,182,214, 25, + 10,119,105,239,144,191,249,201,182, 29, 59,124,206, 87,162, 26,222, 47,186,182,100,172,163,213,124,124,124, 26, 6, 4, 4, 84, + 0,177,242,202, 87,246,174, 91,142,226,239, 61,243,149,189,167, 36, 90,172,195,149,217,205,216,144,173,201, 69, 89,152,182,175, +207,152,251,124,155,210,193,227, 13,207,147,245,209,198, 37,207,245,130,165,235, 7,118, 29, 60,149,142, 94,121,197, 35,189, 2, +105,248,212, 85,148,218,206,107, 13, 95, 32,155,188,128, 56,193, 50,242, 93,224, 59,127,237,171, 31, 3,169,213, 69,180, 50,184, +102,187,188,150, 71,149,118, 31,181,140,146,166, 48, 31,164, 80, 88,153, 38, 50, 49,155, 83,177,201, 64, 42, 82,111, 8, 21, 46, +223,136,170,212,111, 75, 94,185,125, 66,147, 36, 55, 3,193,144, 93, 78,233,253,204, 75, 98, 53,235, 57, 77,178, 42,194, 26,131, + 14,214,171, 72,157, 79, 32,241, 85,218, 72, 22,146,250, 6, 62,151, 49,217, 29,220,243, 62,156,177,100,115,196,134, 35,247, 37, + 98,212,137,227, 59, 11, 53,158, 18,110,102,111,136,165,213, 51, 41, 47,191, 20,242,240, 89,128, 68, 58, 48, 79, 26,158,153, 33, +203,152, 28, 48,137,193,156,121,136, 29,173,202,243,192,213, 29,180,147, 44, 50,230,227,248, 44,221,228,208,161, 72,135,105,243, + 54, 95,221, 39,119,122, 7,228,197, 53,250,112,224, 17,235,129,167,249,185, 68,220, 48,230,121, 3, 33,194,251, 29,241,146, 74, +146, 5,203, 20,136,150, 93,102,221, 22, 45, 38, 90, 1, 55,159,240,200, 82, 30,193,185,130, 63,122,166,109,190, 67, 67, 57,166, +177,221,196, 99, 84,185,251, 90,202, 83,127, 42,101,174,232, 75, 57,235, 77,163,170,253,118, 81,227,145,135,201,171, 84, 91,182, + 66,102,214, 59, 13, 5,234,145,218,218,121,198,212,165,251, 34, 97, 45,195, 7, 95,183, 89, 23,200,214,195,231, 77, 42,219,204, +152,136,218,224,141,103,134,159,176,237,192,249, 40, 60,243, 51,120,212,242, 65,158,130,101,215,217, 23,180,249,196, 51,158, 68, +247,177,244,142, 7, 38,197, 91,206,137, 74,149, 33,143, 78, 34,108,240,205,227,227, 5, 41, 82, 91, 73,243, 97, 88,103,173,198, + 74,253,138,198, 44, 57, 21,153, 42,181, 5, 92, 16,134,144,172, 88,147,206, 53,159,249,160,126,171,121, 15, 26, 54,156,126,191, +174,156, 84,125,228,217, 38, 85, 6, 29,106,161,112,114, 82, 93, 95, 47,150, 76, 88,180, 52,185, 11, 97,182,198, 80, 88, 4,102, + 30,225,160,118,144, 44, 30, 81, 34,153,179,217, 20,170,107,102,248,152,181, 11,191, 77, 70,154,113,127,193,188, 30,219, 71,140, + 24,209,151,135, 38,183, 6, 9, 97,114,132,121,166, 36,146,197, 16,105, 35, 90, 49,229,132, 69, 75, 25,155,197,179, 24, 19, 15, +163, 37,150, 69,107,215,174,165, 53,107,214, 16, 79,143, 17, 94,176,214, 0,106, 59,233,148,100,133,195,215,202, 64, 86,122, 60, +148,106,163, 14,117, 78,180, 40,145,172,122, 28, 79, 35,145,172, 62, 32, 89,114,102,170,141, 37, 19,211, 35,176, 85,171,209,160, + 65,131, 90, 40,167,121,112,203, 93,238, 58, 79,172, 23,140,224,119,140, 52,132, 37,107,219,182,109,173,187,118,237,218, 18,121, +113,141,154,142,127, 87, 78,144,229,158,163, 87, 73, 35, 24,215,236,185, 68, 3,216, 58, 80,167,205, 32,234, 57,122, 41,205, 90, +119, 70, 26, 16, 80,174,195, 2,212, 87,219,156, 54,186,234, 46,185, 16, 61, 61, 61,107,114,155,212,199,200, 67,252,230,164,143, +100,125, 39, 19, 49, 90, 30, 5,171,246, 81,141,209,242,204, 95,109, 22, 98,180,250, 46,190, 60, 8,150,172,216,147,154, 94,123, +130,227, 42,245,215, 59,161, 46,136,214,218,163,252,226,225,132, 23, 28, 98,117, 86,240, 30,216,164,115,209, 56,170,239, 59,153, +230,230,217,205,217, 74, 60,182, 64,153,250, 95,103,174, 62, 74,139,120,184,116, 27,238,112,154,176,149,172,219,220,171, 84,119, +200, 30,178,207, 85, 35,156,117, 96,154,150,145,150,122,203, 25, 93,167,214,111,222,188,105, 13,119,225,209,163, 71, 37, 75, 22, +126, 67,239, 53, 16,173, 88, 50,205, 29,114, 31,255,175,231, 36, 58,195, 83, 60, 96,250,146,108,213, 71, 73,115, 53,189, 9, 10, + 35,167,156,149,148,163, 11, 51,116,169,231,250,223,157,245,149,118, 93, 90, 85,243,102,165, 10,197,102,171,145, 4, 77,229, 76, +192, 68,218,135, 45,201, 77,121, 46, 55, 88, 49, 99,172, 91,248,191,123,247,238,181,121,244,115,179,100,201,146,105, 11,109,248, + 78, 38,147,172, 0,148,237, 10,175, 34,129, 73, 70, 17, 71,117,131, 59,184,197,235, 15, 82,161,114,245,165, 73, 33,245, 12,155, +255, 78, 38,136, 19,172, 46,234,164,106, 17,199,162,169, 31, 67,199,171,129,104,197,200, 68, 64, 59,176,156,187,227, 62, 53,239, + 61,141,156,178,228,143,172,213,118, 36, 13, 89,228, 71, 21, 91,142,165,164,169,210,140, 97,220,226,188, 14, 41,123, 27, 78, 79, + 88,115,149,227,188, 14,226, 67, 8,109,160,192,190,237,152,221,212,109, 6,135,138, 56,230,146, 44, 59, 90, 54,157,186, 84,216, +167, 88,223,242, 53,155, 93,241,202, 91, 54,192,201,203, 39,152,173, 30,175, 51,231, 44,126,217,222,193,169,175, 33, 50, 83, 90, +102, 44,147,187,104,141,176, 83, 87,158, 72,174, 73,144,211,174,115, 46, 75,238,241, 90,188,250, 67, 11,182, 28, 65,239,211,185, + 23, 11, 75,145, 86, 90, 38, 76,125,139, 41,103,244,218,133, 81,169,108, 60,162,210,186,151,189,161,109,249, 29,229,113,228, 65, + 94,110, 35, 78,186,215, 58, 76,195,147,144,110, 63,243,146,167,148,121, 37,141,216,195,115,142,129, 30,203, 57, 38,107, 25,147, +108,140, 52,199, 64, 21,184,215,236, 50, 23,210, 57, 97, 41, 98,173, 6,207,220, 77,255, 13, 90, 69,245,123, 47,165,234, 93, 22, + 82,197,246,243,168,114,167,133,212,100,200, 38,234, 57,227, 4,141, 88,121,141, 58, 78,216, 67, 57,203,181, 35,246, 14, 28,215, + 50,207,155,198, 54,226, 80,158,131,235, 15, 92,147,230,179,195, 92,116,229,154, 14,251,106,229,156,183,143, 76,206,242,253,123, +158, 39, 25,119,206, 94,236,229,209,139,143,165,153, 8, 86,241,188,107,248,144,132, 71, 9, 9,211,121, 52,240,221,205, 68, 56, +255, 11, 45, 19,146,203,188,245, 95,146, 45,169,137,233,221,245,187,206, 68, 96,126,154, 81,139,142,135,165, 72,101,134,128, 90, + 67, 72, 22,144,144,251, 50, 55, 4,181,239,136,214,119,238, 66,182,100, 97, 72,169,170,187,208,182, 88,111,137,100,141,231,201, +211,116, 17, 45,213,181, 11,139, 22,176,223,203, 95,207, 77,147, 39, 79,222,133,173, 54,141,145, 48, 57, 39,220,107,152, 60,143, + 95,244, 82, 98,107, 74,172,184,163,232,202,196,148, 19, 49, 90, 60, 73,223,103,184, 15,121,153, 3,226,105, 9,136, 99,188,104, +211,166, 77,196,243, 64,133,113,236,201, 40,184,247,120,125,190,167, 5,107, 15,160,118,147, 79,177,117,139, 95,122,252, 5, 36, +151,104,225,139,179,120,189,190, 81, 32, 89,197,235,246,141, 98, 98,211, 70, 38,168,154,218, 40, 41,215, 57, 63,215,177,225,196, +137, 19, 37,194,133, 4, 11, 22,210,208,161, 67, 91, 69,215, 27,139, 76,107,114, 41,104,144,153, 43, 9,155,228,121,126,171, 9, +212,127,238,113, 41,214, 96, 6,143, 62, 26,198,230,234,166, 35,246, 83,161,250, 35,200,220, 46,219, 14, 5,143,154, 52,244,101, +206,238, 33,199, 92,185,114, 21,231,184,156,142,188, 4,199, 66,222,183,231, 99, 69, 57, 70,203, 57,154,108, 25,212, 65,128,108, + 33, 86, 11,238, 66,236,241, 27, 2, 16,155, 5,183,161,210,162, 85, 10, 22, 45,118, 31,170,197,106,233,213,121,243, 12, 57,238, + 34,232, 29, 9, 49, 89,112, 23,194,146, 5,146,101,227,154,231,134,174, 14, 66,253, 92,114, 91,175, 12,236, 34, 89, 82,168, 82, +203,200,254,179, 14, 80,239, 57,103,201,187,108,123,158, 84, 51,243, 26, 29,171, 1, 24,242,108,182,230,229, 77,190, 35, 89,114, +136, 22,136, 9, 91,165, 91,154, 57, 23,122,211,172,219,120, 58,113,241, 1,181, 24,184,156, 58,143, 90, 79,142,217, 43, 80,221, + 18, 14,181,111,172, 42,183, 60,228, 80,245,195,139, 7,230,246, 77,153, 50, 41, 8,187,186,245, 73, 43,158,236, 70,116,231, 4, +235,101, 11,190,174, 53, 63, 71, 45, 56, 46,171, 97,138, 20,210,226,238,186,172,140, 26,137, 22, 72,214,230, 83,175,217, 82,217, +137, 90,116, 30,132,213, 25,130,208,169,170,187,186,229,234, 39,136, 19, 70,195,169,199, 99, 33,174, 78,253, 24,226,236,116, 17, + 45,232,113,146,148,150,139,235,117, 24, 69, 99, 87, 93,165, 97, 75, 47,210,192, 5,231,169, 90,219,113, 28,179,101,131, 85, 41, +228,110, 26,241,244,246,169,243, 30,239,198, 34, 53,187,113, 12, 90,102,111, 8,195, 62, 79,197,142,212,137,135,230,187,230,173, + 5,151,190,182, 1, 37, 58,117,158, 7, 35,116,100,125, 25,194,239, 62,105,118,120,126,167, 12,233,223,191,255, 16, 30,212,208, + 81, 71,161, 53,202, 52,229, 69,174,109,221, 11,127,236, 50,116, 94,228,180, 53,103,121,218, 25, 38, 8, 43,175, 83,195, 33,219, +169, 96,189,225,145,220,129,127,100, 66,166,173, 60,210,113,172, 83,200, 88,243,232,186,111,107, 23,242, 12,249, 81,179, 55, 94, +220,167,109, 9, 30,156, 67, 30,185,107, 29, 90, 56,230,190,151,222,221,231,157,125,150,162,239,236, 61,125,222,101,240, 44,250, + 45,121,125,219,243,178,104,156,124,222, 57,242,222, 54, 83, 62, 77, 83,175,196,148, 31, 68,235, 17,143, 54,196,100,194,151,238, +189,163, 35,151, 94,208, 22,158,178, 5, 31,167,173,250,207,161,220,101,154, 18, 79,234,125, 31, 22, 44, 94, 9,162,152,161,120, +242, 7,244,227,195,151, 48,245,196, 29,142,245,188,199,171, 64, 84, 14, 50,192, 93,168, 17,103, 46,115,214,244,110, 5,158, 55, +234, 60,230,227,180,181, 23,248, 35, 16, 19,151,222,166,182,227, 15, 82,238,170, 61, 67,204, 29,242, 60, 71, 30,185, 10, 27,143, +243,201, 49,116, 40,220,147, 36, 53,185, 97,146,220,244,126,210,100, 38,152,132,212, 80,146,101,200,203,220, 16, 44, 99, 53,110, + 26,231,188,231,149, 35, 12,149,163, 11,121,164, 97, 48, 70, 23, 34, 22, 75,153,224, 46, 4,193, 66,210, 16,216, 23, 35, 83,117, +237, 66,199,244, 38,195,185, 96, 6,207,248, 30, 93, 25,213,114, 74,163, 14, 57,110,232,243,217,179,103,137, 23, 88,165,101,203, +150, 81,155, 54,109,194,248,248, 69,206, 31,189, 68, 72,174, 36, 74,194, 85,168,246, 64,106, 63, 69, 26, 61,114, 89, 5, 28,173, + 47, 52, 76,162, 56, 98,245, 61, 2,217,130, 59,206, 0, 64,117,189, 36, 83,176,101,160, 24,199,196,212,227,185,170,154, 79,158, + 60,185,181,171,171,107, 99, 51, 51, 51,140,184,208, 21, 8,174, 85, 38, 38, 59,100, 18, 48,198,222,171,228, 37,175, 18,205, 62, +218,121,149,186,194,110,155,113,112,221,232, 41,179,198,243,108,189,114,101,146, 53,144,211, 58,254,255, 50,239,111,243,254, 52, +239,231,113,106,239,229,229,165,171,253,180,222, 19,110, 68,105, 30, 45,222,171,151, 43, 93,241, 62, 85, 97,217,194, 94, 67,153, +245,213,195,128,166,137,201,170, 87, 38, 94, 92, 60, 31,217,134, 84, 54, 89,182, 98,250, 20, 25, 55,209, 43, 19, 50,162,167,112, + 80, 13,240,140,249,159,117, 67,125,122, 7, 45, 50,255, 79,184,170,180,158, 64, 29,134,175,165,226,101, 43,210,231,195, 53,142, +111,159, 80,120,130,171, 93,114, 76, 56,139, 37,149, 52,109,250,202,137,193, 14,176,176, 33, 6, 11, 83, 78,100,231,189,190, 17, +166,223, 19,173,111,174,195, 0,198,240,125, 74, 43,247,190,209, 75, 23,233,147,163, 90,222,239,100,130, 56,193,205, 53,112,230, + 94,201,122, 1, 75, 22, 72, 22,214,100,236, 62,105,167,100,145,193, 7, 7, 72, 22,172,242,122,136, 22,238,149, 32,137,137,121, +179, 76, 57, 75,221, 45, 88,169, 85,120,198,108,197, 47, 39, 74,110,166,107, 97,102,217,120,178,245,106, 80,230,124,213,130, 82, +217,101,157,168,122, 17, 38,202,116,202, 89,245,131,169,157,103, 92,214, 37,148, 68,229,205,155,183, 58,135, 92, 12,226,112,137, + 33, 60,129,231,144,133, 11, 23, 14,169, 88,177,226, 32,142,157,171,166, 67, 79,117,180,187,107, 50,115, 91,239,169, 60, 82,246, + 62,191,235, 63, 51,185,250,108,149,169,240,131,212,182, 89,103, 40,236, 11,104,211, 35,220, 74,146,137,117, 10,249,121,249,255, + 90,135, 60,183, 19,143,128,156,171,109, 9, 30,156,195,252, 79,114,215, 58,148,241,236,233,203, 18, 83,119,132, 88,240, 7,234, + 51,190,255, 93,196,101,114, 58,195,233, 48,127, 72,175, 71, 44,174,158,143, 41,157,250,137,147,188,114, 74, 32, 12, 16,112,195, + 98,186, 38,219,204, 5, 63,232, 43,156,202,121, 29,109, 84, 44,177,165, 99,142,255,210,187, 23,217,203,125,241, 61, 43, 87, 41, +237,229,169,109,120,225,116,249, 19,170, 26, 80,150, 63, 49, 43,150, 16,148, 69,182,126,180,240,250, 94,146,113,145,255, 83,101, +122,184,164,168, 86,166,168,243,102, 87,135,148, 48,107,171,174, 93,104,104, 89,213,203, 9,178,229,203, 86,162, 7, 76, 92, 2, +224, 78,196,111, 22,170, 97,241,223, 24,194,133,217,126, 87,202, 81,108,140,132, 74,235,156,251, 16,199,227, 52, 51,176,160,114, +240, 52,231, 78,181,100,116,220,147,185, 12,249,114,100,202, 16, 19, 43,139, 86,153, 74,139, 22,239,235,115,106,199,169, 38, 39, +159,184, 90,180,112, 87,140, 66, 84,206, 12,175, 94, 80,251,218,147,146,247, 91,162,117,212,225, 47,173,187,161, 32,202,209,165, +159, 39, 51,154,112,101, 44,228, 95,179, 66,206, 7, 62,217,172,203,240,189, 52, 45,204,173,183,131, 80,205,144, 52,105, 82,204, + 19,213, 58,122, 47,167,248,191,164,141, 48,157, 10,200,147,220,164, 97,250,149, 95, 82, 78, 57,128,233,201,163,175,156,137,178, +101,203, 86,156,159,199,102,252, 17,212,129, 93,252,205,120, 77, 85, 31,205,239,190,152, 59,233,147, 25,151, 98,255,159,192,240, +122,133,188,110, 97, 20,146,218,218,133, 26,229, 34,143,150,252, 63,181,156,113,169,164,150,107, 52,150,211,202, 57,207,157,244, + 60,197, 4, 70, 63, 50,201, 10,180,113,201,123,199,128,123,254,140,186, 27,112,123,145, 85,137,192,207,104, 8, 33,211,184,250, + 37,240, 20,120, 26, 11, 1, 67,116, 73,110,176,182, 33, 50,229,214, 67,200,148,139,148,188,124,241, 18, 79, 88, 45,117, 44,186, +254, 93,205,181,228,143,151,117,151,215,172,122,115,253,140,186,235,189,233, 31,156, 65,147,229,255,151, 20,247,103, 52,132,144, +105,220,166, 19,120, 10, 60,141,133,128,208, 37, 99, 33,249, 77,142,192, 83,224,105, 44, 4,226,139, 46, 25,171,190,127,156, 28, + 52,128,166,100, 72, 65,181,201,208,117, 92,159,124, 33, 83,115,187,196,181,189, 4,158, 2, 79,185, 58, 32,158, 77,237, 8,200, +197, 80, 53,159,192, 83,224,169, 9,129,127, 89,151,148,120,196,181, 63,211,247, 76,253,142,243,234, 22, 45,196,104,253,146, 45, +190,176,104, 81, 78,227,170,131,192, 83,224,105, 44, 4,132, 46, 25, 11, 73, 97, 37, 19,186,244,231,235,146,113, 75,248,123,165, +253,146, 64,120, 97,250, 54,126, 35,139, 23,133,113, 49, 21,120, 10, 60,141,133,128,208, 37, 99, 33, 41, 8,225,191,172, 75,198, +213,162,223, 43, 77, 16, 45, 53,252,255,101,197, 22,117, 55,238,195, 40,240, 20,120, 26, 11, 1,161, 75,198, 66, 82,144,183,248, +162, 75,198,109,241, 95, 43, 77,184, 14,245,224, 29, 95,148, 80,148,211,184, 15,142,192, 83,224,105, 44, 4,132, 46, 25, 11, 73, + 65,138,254,101, 93, 50,174, 22,253, 35,210,254,101,133, 17,117, 55,174,146, 11, 60, 5,158,198, 66, 64,232,146,177,144, 20,164, + 72,232,146,113,117, 41, 62, 75, 83,186, 10,149, 19,149, 10,215,161,112, 29,198, 32, 32, 94, 20,198,125,180, 5,158, 2, 79, 99, + 33, 32,116,201, 88, 72, 10, 66, 24, 95,116,201,184, 45,254,107,165,169, 19,171,216,191,121,253, 41,229, 2,175, 10,213,255,127, +109, 25,197,221, 4, 2, 2, 1,129,128, 64, 64, 32, 32, 16,248, 87, 17,136,231, 92, 68,213,146, 5,146, 21,123,122, 7, 84, 78, + 89, 65, 65,180,254, 85, 21, 23,245, 22, 8, 8, 4, 4, 2, 2, 1,129,192,239, 67,224,175,230, 34,170, 36, 75, 16,173,223,167, +100,226,206, 2, 1,129,128, 64, 64, 32, 32, 16,248, 87, 17,248,171,185, 72, 60, 55,215,253,171, 58, 41,234, 45, 16, 16, 8, 8, + 4, 4, 2, 2,129,191, 6,129,191,154,139,252,213,149,251,107, 84, 80, 84, 68, 32, 32, 16, 16, 8, 8, 4, 4, 2,127, 47, 2, +241,156,139,232,142,209,250,123,155, 77,212, 76, 32, 32, 16, 16, 8, 8, 4, 4, 2, 2, 1,129,192, 79, 71, 64,247,168,195,159, +126,123,113, 3,129,128, 64, 64, 32, 32, 16, 16, 8, 8, 4, 4, 2,127, 47, 2,234, 51,195,255,178,121,180,254, 94, 72, 69,205, + 4, 2, 2, 1,129,128, 64, 64, 32, 32, 16, 16, 8,252,102, 4,226,203, 36,105,162,156,198, 85, 20,129,167,192,211, 88, 8, 8, + 93, 50, 22,146,223,228, 8, 60, 5,158,198, 66,224,103,232,146,177,202,246, 59,228, 40, 99,180,112,239,239,231,209,250,137, 37, +250, 25, 13, 33,100, 26,183,193, 4,158, 2, 79, 99, 33, 32,116,201, 88, 72, 10, 82, 36,116,233,223,212, 37,227,214,250,215, 74, + 83,186, 10,213,247, 63,189, 20,226, 97, 49, 46,196, 2, 79,129,167,177, 16, 16,186,100, 44, 36, 5, 41, 18,186, 36,116,201,184, + 8,196, 79,105,191, 45, 24, 94, 60,128,198, 85, 24,129,167,192,211, 88, 8, 8, 93, 50, 22,146,130,104, 9, 93, 18,186,100, 92, + 4,132, 52,131, 16, 16, 15,160, 65,112,233,205, 44,240,212, 11,145, 65, 25, 4,158, 6,193,165, 55,179,192, 83, 47, 68, 6,101, + 16,120, 26, 4,151,222,204, 2, 79,189, 16, 25,148,225,103,224,105, 80, 1, 68,102,241,149,247, 51,148, 80,200, 52,238,147, 37, +240, 20,120, 26, 11, 1,161, 75,198, 66, 82,244, 29,255,178, 46, 25, 87,139,254, 32,105,104, 84, 77,201,144, 34,106,147,161,235, +184, 62,249, 66,166,230,118,137,107,123, 9, 60, 5,158,114,117, 64, 60,155,218, 17,144,139,161,106, 62,129,167,192, 83, 19, 2, +255,178, 46, 41,241,136,107,127,166,239,153,250, 29,231,149,163, 14, 85,103,136,255, 37,229,248,151,153,185,168,187,113, 85, 76, +224, 41,240, 52, 22, 2, 66,151,140,133,164,176, 62, 9, 93, 50,174, 46,197,103,105,191,124,180,161, 42, 91, 53, 54,112, 66,177, +141,139,168,192, 83,224,105, 44, 4,132, 46, 25, 11, 73, 65, 96,132, 46,253,155,186,100,220, 90,255, 90,105,191,109,102,120,241, +176, 24,183,161, 5,158, 2, 79, 99, 33, 32,116,201, 88, 72, 10, 82, 36,116, 73,232,146,113, 17, 16,210, 12, 66, 64, 60,128, 6, +193,165, 55,179,192, 83, 47, 68, 6,101, 16,120, 26, 4,151,222,204, 2, 79,189, 16, 25,148, 65,224,105, 16, 92,122, 51, 11, 60, +245, 66,100, 80,134,159,129,167, 65, 5,248,195, 50,139,121,180,244, 52,200,207, 80, 24, 33,211,184, 79,129,192, 83,224,105, 44, + 4,132, 46, 25, 11, 73, 97,205, 19,186,100, 92, 93,138,207,210,196,204,240,130,104,105, 69, 64,188, 40,140,251,104, 11, 60, 5, +158,198, 66, 64,232,146,177,144, 20,132, 48,190,232,146,113, 91,252,215, 74,211, 31,163,181,125,251,118,250,181,101, 18,119, 19, + 8, 8, 4, 4, 2, 2, 1,129,128, 64, 64, 32,240,127, 4,254, 90, 46,162,172,216, 95, 91, 65,161,197, 2, 1,129,128, 64, 64, + 32, 32, 16, 16, 8,252,209, 8,196,115, 46,162, 58,127, 22,172, 91,248,253, 61,131, 20, 68,235,143,214, 65, 81, 56,129,128, 64, + 64, 32, 32, 16, 16, 8,252,181, 8,196,115,162,165, 59, 24, 62,158, 87,238,175, 85, 58, 81, 49,129,128, 64, 64, 32, 32, 16, 16, + 8,252, 43, 8,196,115, 46, 34, 98,180,254, 21, 69, 21,245, 20, 8, 8, 4, 4, 2, 2, 1,129, 64,124, 69, 64,120,214,226,107, +203,137,114, 11, 4, 4, 2, 2, 1,129,128, 64, 64, 32, 32, 16,248,121, 8,232,183,104,253,188,123, 11,201, 2, 1,129,128, 64, + 64, 32, 32, 16, 16, 8, 8, 4,254, 9, 4,212, 99,181,254,137, 74,139, 74, 10, 4, 4, 2, 2, 1,129,128, 64, 64, 32, 32, 16, +248,217, 8,252, 22,146, 21, 95, 38, 73, 19,229, 52,174,250, 9, 60, 5,158,198, 66, 64,232,146,177,144,252, 38, 71,224, 41,240, + 52, 22, 2, 63, 67,151,140, 85,182,223, 33,231,183,185, 14,127, 70, 67, 8,153,198, 85, 33,129,167,192,211, 88, 8, 8, 93, 50, + 22,146,130, 20, 9, 93,250, 55,117,201,184,181,254, 71,164,137,135,197,184, 13, 45,240, 20,120, 26, 11, 1,161, 75,198, 66, 82, +144, 34,161, 75, 66,151,140,139, 64,252,148, 38, 22,149,214,211,110,226, 69, 97, 92,197, 22,120, 10, 60,141,133,128,208, 37, 99, + 33, 41, 8,161,208,165, 63, 95,151,140, 91,194, 95, 43, 77, 44, 42, 45,136,150, 86, 4,196,203,199,184, 15,163,192, 83,224,105, + 44, 4,132, 46, 25, 11, 73, 65, 50,227,139, 46, 25,183,197,127,173, 52, 17,163, 37,136,150, 32, 90, 26, 16,136, 47, 47, 31, 81, + 78,227,190, 48, 5,158, 2, 79, 99, 33, 32,116,201, 88, 72,254,229,114,160, 40,154,146, 33,213,214, 38, 67,215,113,125,242,133, + 76,205,237, 18,215,246, 18,120, 10, 60,229,234,128,120, 54,181, 35, 32, 23, 67,213,124, 2, 79,129,167, 38, 4,254,101, 93, 82, +226, 17,215,254, 76,223, 51,245, 39,156,255,101, 83, 61, 8,182,111,220,230, 22,120, 10, 60,141,133,128,208, 37, 99, 33, 41,220, + 82, 66,151,132, 46, 25, 23,129,191, 67,154, 32, 90,106,237, 40, 94, 20,198, 85,108,129,167,192,211, 88, 8, 8, 93, 50, 22,146, +130, 16, 10, 93,250,243,117,201,184, 37,252,181,210, 68,140,150, 30,188,197, 3,104, 92,133, 20,120, 10, 60,141,133,128,208, 37, + 99, 33, 41,136,150,208,165, 63, 95,151,140, 91,194,127, 68,154, 80,108,227, 54,180,192, 83,224,105, 44, 4,132, 46, 25, 11, 73, + 65, 96,132, 46, 9, 93, 50, 46, 2,241, 83,154, 45, 23, 27, 86, 45,229, 62,215,175,170,134,120, 0,141,139,180,192, 83,224,105, + 44, 4,132, 46, 25, 11, 73, 65,180,132, 46, 9, 93, 50, 46, 2,241, 83,154,152, 71, 75,184, 14,181, 34, 32, 94,146,198,125,168, + 5,158, 2, 79, 99, 33, 32,116,201, 88, 72, 10, 50, 28, 95,116,201,184, 45,254,107,165,233,142,209,218,190,125, 59, 69,167, 98, +191,182, 92,226,110, 2, 1,129,128, 64, 64, 32, 32, 16, 16, 8, 8, 4, 20,138,191,154,139,160,114,104,100,229, 94, 52,184, 64, + 64, 32, 32, 16, 16, 8, 8, 4, 4, 2, 2,129, 95,137,192, 95,205, 69,254,106, 22,249, 43,181, 68,220, 75, 32, 32, 16, 16, 8, + 8, 4, 4, 2, 2,129, 56, 33,240, 87,115, 17, 97,201,138,147, 78,136,139, 4, 2, 2, 1,129,128, 64, 64, 32, 32, 16, 48, 18, + 2,241,156,139,168,143, 58,140, 61, 97,105, 60,175,156,145,154, 88,136, 17, 8, 8, 4, 4, 2, 2, 1,129,128, 64,224,119, 33, + 16,207,185,136,250,168,195,223, 5,163,184,175, 64, 64, 32, 32, 16, 16, 8, 8, 4, 4, 2, 2,129,191, 14,129,223, 54, 51,252, + 95,135,164,168,144, 64, 64, 32, 32, 16, 16, 8, 8, 4, 4, 2, 2, 1,129,128, 64, 64, 32, 32, 16, 16, 8, 8, 4, 4, 2, 2, + 1,129,192,175, 67, 64,213,170,245,203,238, 26, 95, 38, 73, 19,229, 52,174, 74, 8, 60, 5,158,198, 66, 64,232,146,177,144,252, + 38, 71,224, 41,240, 52, 22, 2, 63, 67,151,140, 85,182,223, 33, 39,118,240,251,183,229,120,126,201,246, 51, 26, 66,200, 52,110, +211, 9, 60, 5,158,198, 66, 64,232,146,177,144, 20,164, 72,232,210,191,169, 75,198,173,245,175,149, 38,136,150, 30,188,197, 67, +109, 92,133, 20,120, 10, 60,141,133,128,208, 37, 99, 33, 41,200,155,208,165, 63, 95,151,140, 91,194, 95, 47, 77,184, 14,117, 96, + 46, 30, 64,227, 42,164,192, 83,224,105, 44, 4,132, 46, 25, 11, 73, 65,180,132, 46,253,249,186,100,220, 18,254, 35,210,132, 98, + 27,183,161, 5,158, 2, 79, 99, 33, 32,116,201, 88, 72, 10, 2, 35,116, 73,232,146,113, 17,136,159,210,126, 89, 76,150, 58, 60, +226, 1, 52,174,194, 8, 60, 5,158,198, 66, 64,232,146,177,144, 20, 68, 75,232,146,208, 37,227, 34, 16, 63,165,233,156,176, 20, + 15,137,166,100, 72, 85,181,201,208,117, 92,159,124, 33, 83,115,187,196,181,189, 4,158, 2, 79,185, 58, 32,158, 77,237, 8,200, +197, 80, 53,159,192, 83,224,169, 9,129,127, 89,151,148,120,196,181, 63,211,247, 76,253,142,243,191,109,194, 82,241,165, 99,220, +230, 22,120, 10, 60,141,133,128,208, 37, 99, 33, 41, 44, 90, 66,151,132, 46, 25, 23, 1, 33,205, 32, 4,196, 3,104, 16, 92,122, + 51, 11, 60,245, 66,100, 80, 6,129,167, 65,112,233,205, 44,240,212, 11,145, 65, 25, 4,158, 6,193,165, 55,179,192, 83, 47, 68, + 6,101,248, 25,120, 26, 84,128,191, 49,179,117,226,196,137,251,167, 72,145, 98, 22,167,185,252,255, 4,174,164,165,158,138,126, +215, 16,166,166,166,157,211,167, 79,127,147,211, 51, 71, 71,199,157,169, 83,167,236,234,106,162, 40,202,114,146,200, 4, 77, 87, +227, 38,100, 25, 30,156,186,114, 25,111, 36, 79,158,252, 17,255,191, 28,191, 57, 89,233,144,175, 87, 97,134,219, 41,106, 93,237, + 82,109, 51,246,106,114, 42,217,216,216, 28,227, 99,101,213,142,235,149,169,173, 60,245, 83, 42, 74,215, 54, 85, 60, 65,194,255, + 42,249, 12,146,153, 58,117,234,198,182,182,182,167,210,166, 77,251,156,247, 39, 24,143,218, 26,238,169, 75,102, 58,174,219,120, + 7, 7,135,219,118,118,118, 83,248, 90,172, 78, 46,103, 51,168,156,114, 4,114, 30,189, 50,125, 76, 20, 62, 5, 76, 20, 1, 5, +147, 41,130, 11, 39, 83,204,226,125,153, 50, 10, 69,202, 56,182,123, 17,190,110,189,153,153,217, 69,214,245,237,252,127, 77, 78, +208,175,154,248,141,227, 56,207, 9,249, 84, 55,189,229,140,150, 51,158,247,207, 57,141,138,254,221,137,113, 14,206,158, 61,251, + 35, 78,139,221,220,220,154,200,109,247,148, 41, 83,150,225,107, 55,240,243,244,168, 96,193,130,239,236,237,237,111,101,200,144, + 97,137,137,137, 73,241, 56,214, 93,102,147,124,151, 77, 78,221, 13,149, 45,100, 26,138,152,238,252, 2, 79,129,167,177, 16,248, + 25,186,100,172,178,197, 59, 57, 85,184,196,163, 57, 77,191,124,249,178, 31, 17, 73, 9,255,243,177, 89,156,198,232,232, 4, 99, + 53, 4,119,248, 67, 71,140, 24,241,249,229,203,151, 20, 16, 16, 64,183,111,223,166,201, 3,251, 68,149, 75,147,152, 92,173, 45, + 67,153, 12,220,115,202,144, 97,117,214, 84, 9,251,176,204, 76, 90,144,210,214,184,150, 76,174,206, 12, 28, 56, 48,228,216,177, + 99, 33, 95,191,126, 13,137,138,138, 10,121,241,226, 69,200,254,253,251, 67, 10, 23, 46, 28,194,242,186,113, 74,164, 65,174, 94, +133, 25,102,167, 56, 66, 11, 7, 17,246,170,215,103,201,146,229, 58,223,135,106,213,170,245,133,143,219,203,237, 28, 53,213,141, + 47, 78,158,213, 76, 97, 81, 59,149,194, 63, 98,201,112,162,153, 61, 9,100, 43, 46, 50,211,165, 75,183,165,115,231,206, 65,207, +159, 63,167, 47, 95,190,208,147, 39, 79,168, 77,155, 54, 31,248,248, 10,181,123,107,171,123,218,108,217,178,249,159, 58,117, 42, + 42, 48, 48,144, 14, 31, 62, 28,229,237,237,237,207,215,202, 33, 91,177,100,242, 61,231, 49, 81,219,105, 72,226,107, 22,200, 44, +103, 76,182,252, 38,138, 39, 97,126,135,136,206,237,165,173,181, 10,210,228, 60, 25,168,102,154,100,129, 69,146, 41, 58, 21, 83, + 40, 18, 27,208,238,117,138, 21, 43,246,241,202,149, 43,145,111,223,190,165,235,215,175, 71,181,106,213,234, 51, 95,127, 13,123, +252,198,113,156, 71, 62, 62,222,210,128, 54, 2, 89, 91,228,235,235,203,143, 17, 17, 63, 15,196,196,138, 74,150, 44, 73, 33, 33, + 33, 56,244,136,211,226,136,136,136,102,114,100,154,155,155, 55,230,118, 14, 9, 13, 13,149,228, 97,131, 62,162,205,166, 79,159, +254,145, 63,104,118,178, 28, 77, 31, 25,122,117, 62, 14,111, 42, 33, 51, 14,160,233,184, 68,224, 41,240, 52, 22, 2,241, 69,151, +140, 85,223,223, 33, 7,125,163,106,156,150,156,190, 82, 42,103,131, 62,125,250, 40, 73,213,174, 34, 69,138,156,109,214,172,153, + 31, 18,255,127,152,207,239, 57,127,254,188, 95,239,222,189, 65,186, 26,232,233,200, 44, 11, 21, 42, 20,248,234,213, 43,202,156, + 57, 51,101,204,152,145,240, 63,182,115,117,114,211, 1, 79, 5, 61, 61,186,139,246,110, 90, 79,173,108, 19,147,143,173,121,184, +109,250,244,111,173,172,172, 70,178,220, 4,122, 58,157, 26,158,158,158,193,215,174, 93, 11,185,115,231, 78,200,208,161, 67, 67, +184,227, 10, 97,162, 16, 82,179,102,205,144,105,211,166,133,132,133,133,133, 44, 88,176, 32,132, 45, 17,215, 88,150, 58,217,210, +171,132,218,136, 22, 91, 55,166, 50,233,164,123,247,238, 17,203,133,149, 66,185,169,203, 52,183,176,176, 40,111,105,105,217, 13, +123,206,100,142,140,153, 21,138, 84, 57,204, 21,142,157,114,184,102,217,222,160,116,166,233,165,243,230,174,157, 58, 97, 96,248, +140,158, 68,181, 28,227, 68,180,208,249,118,237,218, 53, 24, 4, 11, 29, 48, 58,112,236,131,131,131,169, 65,131, 6, 65,108,217, +170,161,175, 19,103,220,135, 31, 61,122, 52, 2,109,196,123,218,185,115, 39,205,156, 57, 51,138, 9,208, 36, 25, 26, 28,171,238, +220,217,239,219,187,119,175,223,133, 11, 23,252,206,156, 57,227, 23, 30, 30,238,199,237, 33,165,237,219,183,251,109,220,184,209, +111,205,154, 53,126, 76,142,165,196,229,246,115,113,113,217,173,118, 31,189,109,148,207, 68,241,244,235,177,173, 68,147, 58,208, +135,177,237, 40,176,123, 69,122,221,166, 40,205,202,155,129,138,166, 80,108, 83,211, 35,136,215, 40, 51, 73,146, 36, 71, 30, 61, +122, 20,213,175, 95,191,175, 94, 94, 94, 31, 90,180,104,241, 25, 88, 98,195, 30,191,113, 28,231, 31, 62,124, 24,197, 58,176, 95, + 31,158, 42,231,199, 40, 73,214,145, 35, 71, 98,200, 17,254, 65, 59,177,222, 74, 22, 45,103,103,231,134,250,100,166, 74,149,170, + 90,223,190,125, 37,118,166,190, 49,198, 82,123,163,124,252,172,189, 96, 89,105, 13,197, 83, 70, 59,171,103,209,219, 70, 66,166, + 65, 8, 8, 60, 13,130, 75,111,102,129,167, 94,136, 12,202,240, 51,240, 52,168, 0,127, 88,230, 56,205, 12, 95, 26, 4, 10,214, +171, 1, 3, 6,128, 72,193,178,149,148, 83,170,232, 4, 11, 65,125,126,209, 75,121, 64,200,162,243,168,214, 93,181, 33,170,172, + 91,183, 46,108,202,148, 41,196,238, 40,226,206,151,166, 78,157, 42,125,125,191,218,190, 66, 34, 90, 55,250, 55,149,250,139,219, + 35, 59, 74,191,239,207, 30, 70,141, 26, 53, 10,101,215,136, 42,137, 83,111,220, 52,185,115,231, 14,254,244,233, 83,200,146, 37, + 75, 66, 56,239, 57, 46,128, 23,167, 36,209, 29, 43,202,219,132, 59,198,160,171, 87,175,134,172, 90,181, 10,150,173,161, 50, 59, + 29, 88,213, 74,176,187,179,102, 95,251, 36,119, 96,209,234,107,163,184,194,199,188, 57, 89, 71,203,176,227,186, 75,229,102,247, +205, 81, 45,157,163, 57,147,190, 62, 76, 2,135,112, 7, 56,132, 9,199, 16,119,119,247,126, 85, 93,108, 11,110,110, 80, 38,215, +135, 97,237,114,209,196,238,217, 38, 84,200, 87,122,117,189,226, 13,154, 59, 91, 29,107,145, 46,121,104, 93,243, 68,193,113,113, + 29,178,235,232, 12, 44, 88, 74,114,133, 14, 23,150,173, 7, 15, 30, 16, 91,251,136, 45,135, 7,244,117,226,220, 62,215, 33, 99, +246,228,201, 84,203, 59, 11, 21,181, 72, 77,197, 44, 83, 83,158, 84,201, 63,122, 42, 20,121,244, 40,248,119, 68,235,226,197,139, +208, 15, 41,177, 53, 72, 74,239,223,191,143, 57,134,227, 31, 62,124,144, 18,200,150,171,171,171,193, 68,171,112,114, 69,225,252, +201, 21,239, 10,154, 40, 62, 85,177,183,122,209,206,197, 42,242,116,131,130,244,190, 67, 73,154,146,203,158, 96,217,146,217,238, + 85,146, 37, 75,134, 15,137,158,156, 64,202,155,150, 47, 95, 94, 50, 25, 97,143,223,209,199,187, 70,147, 44, 16,103,229,166,235, +229,147,144, 93,130, 31, 33, 7,150, 44,190,224, 36,126,195,162,133, 4,215, 97,180,108,117,120, 53,202,204,148, 41,211,109,214, +251, 24, 2, 8, 43, 22, 91,112,233,254,253,251,196, 31, 29,116,238,220, 57, 98,194, 72,107,215,174,141,100,114,191, 67,102,221, +245, 52,173,206,211, 63,227,197, 43,100,254, 72,139,124,127,173,192, 83,224,105, 44, 4,126,134, 46, 25,171,108,191, 67,142,254, + 81,135,108, 89,192,139, 95,117, 27, 11,107, 21,136, 20, 31,212, 53, 17, 87,107, 16,177,104, 87, 34, 92,140, 26, 55,238,252, 23, +192, 85,216,180,105, 83,242,240,240,144, 18, 91,198,136, 59, 86, 10,185,123, 85, 34, 86,231,234,230,145, 58,141,224, 27, 23,164, +223,126,141, 10,209,165, 75,151,136,227, 77,246,234, 64,109,219,137, 19, 39, 2, 86,172, 88,241,138,243, 32, 30, 11, 4,171, 0, +167,169,236, 74, 92,196,123,184, 11, 51,114,178,100, 75,218, 59, 38, 31, 33,236,230, 3,217,114,212, 33,179, 24,151,239, 30, 91, +192,232,245,235,215,244,238,221, 59, 26, 87,216,157, 64,180, 70,228,201, 24, 53,123,246,236, 47, 61,123,246,252,152, 38, 77, 26, +196,238,216,177,188, 8,148,187,104,209,162,112,173,125,183,193,130, 5,146,245,249,243,231, 33,220, 25, 14, 97,121, 67,182,110, +222, 60,164,156,183,123, 83,144, 44,144,173, 10,246,150, 53, 39,149,205,219,246,121,191,150,181, 6, 20,242,186,241,121, 76,151, + 67,117, 92,108, 84, 45,100,178, 21,199,218,218,250, 37, 44, 47,124,193,119, 9,150, 55,118,225,170,186, 35, 53,202,229,186, 13, +232, 90,191, 94,100,141,140,246,116,111,202, 64, 10,223,183,138,194,119, 46,161,187, 99,187, 83,213,244, 86, 65, 5,146, 38,236, + 43,183, 64,176,104,193,146,197,249, 99,136, 22, 72,150, 38,162, 21, 20, 20, 36, 17, 45, 38, 32,234, 68, 75,238,237, 98,242, 21, + 72,166,112, 45,150, 34,209,185, 11, 77,125, 40,160, 93, 73, 42,111,158, 4, 49,123,113,221,234,243,133, 32, 95,141, 12, 20, 0, + 87,225, 24, 37,161, 26, 59,118,172,164,227,248,205,199,113, 46,174,155, 57,187,173, 31,180,108,217, 50,130,173,185,175,217, 53, + 30,120,246,236, 89,130,149, 12,214,199,245,235,215, 19,127, 88, 72, 4, 27,207, 93,165, 74,149, 2,249, 70,197,226,122, 51,113, +157, 64, 64, 32, 32, 16,248, 21, 8,104,224, 34,191,226,182, 63,255, 30,202,138,169, 84,208,156,239, 58,141,211, 46, 78,232, 96, +176, 37,200,150, 72, 81,167,100,138,196,151,144,240, 63,142, 69,159,171,202,123,184,102,166,114, 74,175,169,196, 28,159,115, 23, +113, 45, 28,211, 66, 5, 10, 20,144, 82,241,226,197,165, 88,146,192, 59, 87,105,119, 22, 5, 29,171,158, 77,178,194,188,190,230, + 71,219, 60, 20,116,176,170, 55,249,251,251, 19,187,171, 30,104, 65, 33, 71,221,186,117,111,178,203,229, 58, 91,105,208,137, 39, +227,180,252,191,255,254, 11, 57,121,242,228,145,200,200,200,241,252,101,223,150, 99,139,218,243,113, 54,196, 40, 42,140, 25, 51, + 38,132,235, 9,162, 5,171,132,166,205,155, 59,165, 80,184, 94, 64, 86,216,165, 69,176, 88,245,202,156, 38, 10, 68,107, 96,214, +244,145, 51,102,204, 8,222,188,121,243,251,229,203,151, 7, 48,185,122,166,180,104, 49,153, 68, 80,252,119, 27,220,133, 76, 30, + 36,146, 5,194,197,241, 78, 82,178, 73,147,166, 15,220,134, 30,201, 21,249,151,215, 44,222,154,173, 90,205,218,231,116, 25,176, +186, 78,169,119, 31,134,181,191,229,157, 92, 10,226, 55,120,227,114,156,126,246,236, 25,241, 61, 9, 22, 15, 38, 47, 4,236,223, +188,121, 35,117,196,106, 22, 45,141,242,157, 21,138,194,149, 51,216, 68,133,239, 93, 73, 52,161, 29, 81,235,124, 68,173,242, 18, + 13,107, 68,254, 51, 7, 82, 78, 91,155, 47,102,169, 83,191,103, 18, 57,143, 5,184,233, 42, 36,136, 22,220,133, 74, 75, 22,231, +141, 33, 93,140,137,100,197, 2,193,226,118,246, 99,151,153,223,252,249,243,141, 66,180, 80,166,194, 41, 20,185, 70,231,117,161, + 15,189,170, 82, 71,103, 75,202,155, 74,145, 70, 71, 89, 75,178,219,112, 29,147, 76, 16,251, 14,156, 76,177,199,111, 28,231,255, + 75, 26,220, 24, 76,178,148,174, 66,165,123, 15,191, 89, 14, 98, 27,149, 91,123, 38,191,219, 19, 38, 76, 56,159, 15, 84,228, 84, +158,219,168,148,158,123, 53, 95,180,104,209,245, 57,115,230, 92,231,124, 5, 57,185,194, 53,207, 86, 93,154, 56,113, 34,177,254, + 75, 31, 49,183,110,221, 34,142,179,163,133, 11, 23, 18,187,205,209, 86, 98, 19, 8, 8, 4, 4, 2,127, 36, 2, 26,184,200, 31, + 89, 78, 45,133,210,237, 58, 84,175, 28,187,223,166,248,241,198,238,140,125, 44, 80,250,234, 6,177,242,245,201,249, 49,120,197, + 68,250, 48,207,151,250,228,202,252, 49,154,108,225,116,194, 60,121,242,156,192, 53, 60,210, 9,163,168,190,219,152,104,221, 65, +103, 95,163, 70, 13,184, 95,168, 66,133, 10,196,241, 83,146,181,232,233,197,179,180, 62,179,130,118,148,115,151, 92, 31,247,206, + 28,167, 85,110, 10,218, 82,214, 93,114,131,112, 7,124, 95, 75,197,186,115,160,251,145, 81,163, 70, 29,228,243,181, 57,229, 97, +139, 25, 2,131, 67,134, 13, 27,182,187,156,155,243,226,122, 22, 73,222, 52, 72,107,242,218, 35,137, 98, 10,159, 79,201,247, 14, + 97, 75, 74, 72,130, 4, 9, 52, 90, 76,216, 10,118, 2,177, 50,236,234,130, 37,237,106,180, 92,151,161,182,138,163,146,235, 48, +189,226, 50, 31,235,194,238,202,219,220,161, 61,231,125, 24, 58,178,199,143, 31,163,243,212,104,209,131, 69,139,243, 12,102, 55, +206, 16,182, 54, 12,153, 48, 97,194, 88,182, 64,236,226, 56,168,211,105,205, 83,251,142, 41,157,167, 11, 77,232,209, 26,100,203, + 43,185, 98,194,253, 62,205,232, 80,203,106, 95, 61, 82, 72,157,174,193, 27,143, 54,172,215,186,117,235, 96,224,205,196, 78,114, + 23, 34,206, 10,174, 36,198, 61,152,221, 98,112, 3,235,220,138, 36, 79,188,249,246,228, 1, 68, 19,219, 19, 53,244,136, 73,159, +235,185,211,232, 14,255,209,105,174, 51, 72, 50,199, 94, 69,241,104, 55,184,188, 56,220, 76,243, 6,162,133,120, 44,109,238, 66, +118,109, 30, 98,162,181,157,227,178, 54,177,206,109, 98, 82,176,157,221, 98, 24,209,247,195,155, 79, 82, 69,214,209, 5,220,232, +195,192,250,212, 57,179,181, 46,162, 85,167, 94,189,122, 1, 28,147, 22,204,245, 66, 92,223,123,142,101,187,143, 61,126,227, 56, +206,115,129, 84, 71, 3,234, 45,159,210, 85, 8, 75, 22,220,131,209,150, 44,232, 34, 92,239,157,248,247,241,142, 29, 59,250,241, + 71,129, 31,235,190, 31,147,248,109,236, 82, 31,194,164,172,178, 30,225,139, 56,255,245, 42, 85,170,128,104, 57, 33, 47, 91,108, +223,140, 28, 57,146,118,239,222, 77, 28, 76, 79, 32,219,104,115, 88,184, 14, 30, 60, 72, 28,211,133,188, 98, 19, 8, 8, 4, 4, + 2,127, 36, 2,127, 9,209,210, 60, 67,188,122,229,248,235,122, 25,226,174,152, 8,193,242,128,184, 44, 5,172, 88, 65,203,198, + 19,117, 45, 69, 65,109, 10,211,165,110,181, 8,199,162, 91, 43,105,237,218,181,165, 88, 45, 92,171,169, 5,153,104,205, 65,220, + 8, 58, 2, 14,200,150, 18, 19, 36, 41, 32,254,234,145,253,180,216, 85, 65,107, 75,186,209,141, 27, 55,232,204,182,245, 52,223, + 69, 65, 27,106, 23, 38, 38, 82,176,192,104,115, 29, 78, 96,130,179,174, 78,157, 58,171,249,158,136,153, 90,200,191, 67, 58,117, +234, 4,139, 85,147,154,166,138,151,116,122, 39,209,140,238, 84,205, 52,193,107, 62,150,132,221, 44, 8, 30, 14,225, 78,231,161, +166,114, 50, 17,147,162,158,121, 36, 87, 20,159, 79,173,204,163, 33, 24,222,156, 73,217,126, 14,136,150, 12, 21,236,194, 1,209, +130,101, 65,211,102,206, 49, 71,125,152, 64, 12, 25,207, 27, 91, 30, 30,178,101,233, 25, 19,194, 75,167, 78,158, 60,231,153,217, +237, 4,200,150,123, 74, 69,214,226, 54,166,123,162, 38,244,160,241,165,114,147, 91,170,239, 2,152,191,147,157, 63, 73,162,150, +197,147, 39,190,224, 99,146,240, 37,239,253,242, 38, 73,244, 31, 50, 49, 57, 93,215,164, 73,147, 96,144, 44, 4,235,115,192, 57, + 85,171, 86, 45,152,143,195,157,170,119, 43,152, 44,209,179, 79, 91,230, 17,181, 45, 24, 67,178,190,214,119,167, 35,213,189,233, +250,181,171,146,181, 4,214, 70,180, 31, 91, 81,162, 56, 0, 95,125,148, 96,204, 61,148, 68, 75,131,187,240, 12, 8, 22,167,101, +236,226,154,149, 53,107,214, 73,121,243,230,157, 52,110,220,184, 89,140,215,116,189,133,212,159, 33, 97, 17, 19,197,146, 99,109, + 42,209,135, 17,255, 81,149, 52,201, 49,157,130,198,141,201,233, 94, 38,253, 33, 28, 59,245,174, 97,195,134,111, 48,106, 21,122, +130, 61,126,227, 56,206,179,222,108,213,127,219,255,231, 80,139,201, 82,181, 98,245, 96,203, 86,204, 40, 94, 12, 6,224,248, 69, + 63,198, 97, 27,223,119,200,224,193,131,117, 17,173,148, 76,218,174,112,217,174,163,220,209,119, 99,206,159,251, 43,158, 31,108, +248, 88, 64, 76, 30, 8, 22,187,213, 37, 75, 38,199,128,105,116,109, 27, 82, 31,145, 87, 32, 32, 16, 16, 8,252, 44, 4,254, 2, +162,165, 30,167, 21, 27, 42, 85,191,168,146,104,129, 60,113,174, 24,162,245,126, 74, 79,122,223,178, 0, 93,168,229, 77,155,106, + 23,140, 69,180, 64,202,116, 17, 45,150, 83, 97,238,220,185,225,123,246,236,161,246,237,219, 75,137,173, 33,146,197,106,247,228, +225, 52,221, 89, 65,235,219,214, 38,196,153,236, 26,221,143,214,212, 44, 72, 71,150,206, 33,254, 98,255,156, 52,105,210,234,154, + 26,150, 45, 51, 83,217, 18, 48, 35, 87,174, 92, 83,248,124, 34,238,236,159,163,143,225,192,119, 16,173,132, 53, 76, 21,175,105, + 70, 15,105,244, 94,213,148, 10,116, 50,150, 21, 43, 86, 12, 97,130,128,243, 11, 53,201,100,247,202, 21,182,190, 72, 29, 20,255, + 15,171, 23, 2,191,147,246, 79,175, 56,126,113, 72, 43,234,109,163, 56,203,191,203,176, 59,112, 23,130,249,249,254,180,101,203, + 22, 88,191,190,242,113,213,145, 98,234,226,165, 81,135,236,134,218,202,193,240,119, 63,126,252,120, 9,110, 51,144,143,181,107, +214,156,131,101,139, 47, 72,208, 53,151, 91, 8, 77,236, 65, 77,221, 51,232,141, 39, 42,154, 44,209,246, 41, 37,115, 5,135,204, + 31, 74,116,100, 35,133, 76,235, 69, 19, 10,103, 9, 42,150, 60,209, 22,220,156,203, 95,155,203,117,132, 99,182,158,113, 39,123, +136, 73,130, 94, 75, 22,174, 75,148, 40, 81,165,156, 25,157, 66, 95, 44, 28, 77,212,166,128, 68,180, 62,212,201, 76,247,170,184, +208,172,166, 85, 99, 72, 22, 98,128,208,134, 72, 44, 27,214, 30,141, 27,136, 22, 70, 23,242, 73, 41,169,184, 11,183, 51,137,158, +207,238,194,209, 60, 56,160, 47,231,233,194, 3, 38,186,108,218,180,169, 47,143,148, 27,240, 35, 15,115,190,148,138,116, 69, 83, + 36,216,184,170,126,201,224,144,233,189,163,118, 52, 46, 77,133, 77, 20,195,117,200,172,204,109, 3,203,104, 23, 78,165,153,188, + 7, 64,151,176,199,111, 78,237,184,253, 14,241,222, 80, 43,227, 24, 4,190,171,196,101, 73, 69,128, 37, 11,207, 11,147, 74, 63, +214,215,115,236, 54, 28,194,135,235,243,126, 44, 99, 2, 87,183, 86, 11, 33,159, 43,198, 4,255,236,129, 3, 7, 46,243,255,192, +169,107,187,118,237,174, 47, 93,186, 52,128,201,234,103,190,254, 37, 91, 4,223,193,138,137,196,238, 69,105,207,207,135,222,216, +188, 31,193, 92, 92, 43, 16, 16, 8, 8, 4,126, 20,129,191, 54, 70, 75, 9,140,178,130,236, 50, 25,199,150, 33, 63,142,163, 58, +195,231, 98, 92,135, 61,188, 50,134,156,106, 85,150, 54, 84,205, 77, 13,211,167,138,229, 58,204,151, 47,223, 33,118,141,249,177, +149,103,166, 22,160,205,120,228, 93, 16, 92,133,236, 30,145, 70, 28,226,127,196,146,172,108, 85,147, 22, 87,202, 77,187,215, 44, +163, 5, 51,167, 83,187, 98,185,169,108,174,172,225, 14, 25, 50,188,225,206, 13,157,142,198,141, 71, 3, 14,102,162, 51, 40,103, +206,156,253, 57, 67, 34,118, 7,238,100, 55, 84, 72,169, 82,165, 64,164, 82,151, 73,174,168, 91, 43, 85,130,215,176,108,213,254, + 54,241,231,112,142,171, 82,198,104,181,213, 34,182, 8,187, 31,195,209, 49, 34,166,137, 99,186, 16,192, 31, 53,160, 82,177,240, +169, 61,219,211,188, 62,157,137,131,225,165, 32, 99,140,152,156, 55,111, 30,113, 80,114,216,232,209,163,175,178,181, 8, 49,106, + 58, 55, 38,177, 59,224, 70, 3,193,186,123,247,174, 31,199,106,249,113,135,233,199,157,224,126,107, 11,139, 85,206,182, 54,212, +179, 84, 65,202,156, 50,209, 26, 93,130, 10, 36, 73,212,100, 90,153, 60,193,116,116, 19, 15, 97,107, 44, 5,189,211,194,225, 20, +190, 96, 8, 13,207,237,250, 33,119,162, 68,141,245,149, 69,203,249,242, 62, 62, 62, 33,199,143, 31,167,166,149,203,209,219, 62, +181,201,191,102, 38,186, 90,209,153, 14,150,116,160,209,133, 51,209,137, 19,199,165, 0,107, 16,204,213,171, 87, 19,207, 93,166, +215,162,197,228, 41,134,104, 33, 38, 11,238, 66, 78,203, 64,178,216,229,213,133,201, 70,163,201,147, 39, 87, 99, 43,103, 53,198, +188, 17, 19, 67, 57, 43,161,103, 96,247,235,100, 78, 79, 57, 77,231, 0, 61,215,130, 73, 20,121, 10, 38, 87,244,110,224,148,246, +200,205,209,221,110,132, 46, 27,243,228,202,128,255,222, 85,178, 74,126, 59,151, 66,145,194, 0, 76, 16,155, 8,226,165,139, 60, +203, 17,151, 24, 46, 67,108,216, 43, 47,224,255,165, 15, 19,236,149,207,152, 28, 97,209,121, 90,178, 5,108, 37,147,171, 13,252, +123, 22,239, 47,115, 12,220,117,182,188,193, 53,232, 18,157,199,149, 7,116,188,227, 1, 45, 52,107,214, 44,226,152, 66,226,231, + 26, 68, 81,108, 2, 1,129,128, 64,224,143, 70, 32,158,146, 45,238, 98,164, 77, 57,159,150,222,121,180, 28, 56, 51, 2,103,247, +112, 66,160, 59, 54, 93,193,240,232,148, 96,253, 65, 48,175,141,182, 22,100,146,209, 11, 36, 6,177, 35,112, 57, 97,100, 84,183, +255,154, 70,150,201,100, 23,149,201,206,230, 35, 91, 94,110,219, 90,165, 89,156, 51,165, 52, 82, 48,131, 12, 77,104,202,193,190, +173, 89, 38,220,101,184,239,127,220,241,135,236,219,183, 47,132,173, 50, 24, 17,136,169, 29,176, 33, 30,166, 9, 91,199, 66, 56, +192, 61, 4, 29, 16,255,214,213,233,214,230, 64,253,247,187,118,237,146, 44, 86,234, 27, 38, 91,133, 21, 7, 35,189, 88, 78, 99, + 38,118,135,121,228,227, 97,158, 91, 12, 29,159,206,141, 9, 65, 63, 30, 73,121, 30,164,116,199,142, 29,126, 43, 87,174,244,107, +219,182,237, 21,238,112, 63,113, 60, 85, 20, 98,107, 46,113,124,152,135,187, 59, 70,165, 57,105, 19,198,110,219,179, 65, 11,134, +211,231, 17,205,232,115,117, 7,137,104, 5, 79,234, 69,254, 29, 75,211,237, 14, 21,168, 68,242, 68,167,244,149, 69,211,121,182, +234, 96,110, 52,105, 14, 38, 88,172,154, 48,217, 58,213,178, 52,113,192, 27, 45, 43,230, 76,147,202,102,167,114,197,124,164,206, + 27,238, 72,182,172, 68,113,157,244,198,104,241, 20, 3, 18,209,226,118,145, 2,223, 89,254,182,167, 79,159,206,228,182,232,195, + 86,152,134, 76, 86, 75,150,112,118,234, 83, 42,181,201,237,210,102,201,239,185,167, 74,137,249,186, 84,231, 79,139, 85, 92,115, +198, 38,147,171,107, 48,187,196,162, 48,104,129, 93,164, 81,158,238,153, 63, 79,172, 91,126,195,195, 5, 99, 54,124,222,181,116, + 79,232,150,121, 39,214, 53,175,124,185,120,202,132, 75, 11,154,198, 76,199, 17, 23, 88,112, 13,116,124, 51, 39,229,168, 67, 12, +166,216,162,242, 91,147, 92,105,114, 82, 13, 22,173,132,106, 68,203,160, 50,113, 12,101,247,173, 91,183,250,114,108,220, 56,142, + 27, 91,192, 22,194, 29, 76,178, 46,179, 16, 76,156, 10,204,176, 58, 66, 21,182,102, 6,176,245, 20,147,205, 98, 66,221, 96,182, + 12, 27, 58, 98,210,160,114,137,204, 2, 1,129,128, 64,224, 31, 70, 64, 61, 54, 75,142,177, 64, 49, 18, 83, 54, 68,207,161,213, + 78, 7,120,173, 49, 5, 4,166,130,224, 60,170, 49, 40, 26, 47,225,121,135, 54,193,109,200,115,105,133,176, 5,104, 83,146, 68, +137, 90, 58,240,200, 48,206, 28,151,161,238, 62,108,161,170,198, 22,178, 74,124,125,126, 78, 73,120,196,221, 11, 38,113, 33, 76, +124,164,217,224,153, 4,188,198,196,165, 28,184, 30,194, 95,253, 33,221,187,119,135,181, 75,142, 11, 45, 57,231,235,192,238,201, + 77, 28,215,117,121, 96,213,146,225,227, 58,183,164,166,110,214,184,126, 6, 39, 88,218, 44,112, 79,118,177, 30,224,216,152, 61, +124,159,185, 50,148,204,142,137,197, 65, 38,132,231, 49, 81,103,175, 94,189,206, 51, 1,125, 6,146,197,211, 63, 16, 91,186,164, + 32,115, 38, 97,145, 76,122,180,198, 41,249,152, 36,122, 73,123, 87,104,156,194,225,233,128, 70, 84, 56, 89, 66,173,241, 72,186, +202,200, 86,194,119, 8,162, 7, 17,134, 91,119,195,134, 13, 84,190, 80, 62, 90,211,182, 38,173,248,175, 26,141, 47,159,143,242, +167, 78,254, 49,125,234, 84,231, 57, 62,232,181,220, 81,135,152,132, 84, 57,186,144, 9,128, 31, 19,172,141,140,215, 36, 38, 12, + 93, 96,201, 2,201, 26, 85,174,208,167,208,253,235, 40,120,237, 12,234,155, 59,243,103,149,193, 22,223, 21,217, 62,109,154,229, + 71,120,182,122, 37, 9, 6, 65,221,188,105, 19,213,173, 80,230,242,135,221,171,230, 31, 27,210,113,117,247,220,153, 55,243,220, + 90, 32, 72, 90, 9,155, 82,112, 46,142,135, 43,106,150,112,102, 69,199, 52, 47,125,204, 19,206, 40,144, 58,214,242, 82,117,217, +234,118,159,239,245,146, 9, 33, 6,102,172,192, 94,229,119,115, 45,152,198,140, 56, 84, 25,105, 8, 61, 31,204,177,138,146, 69, + 11, 46, 68, 92,155,195, 84, 97, 85,204, 60,225,252,170,174, 54,111,177,199,111, 77, 50,157,146, 42,220,125,172, 83, 30,171,230, +102, 27, 92,220,222,252,232,138,197, 11,199,177, 59, 28,241,113,208,149,225,172, 75,199,234,215,175,127,125,217,178,101,215, 89, +231,195, 48, 24,130, 39, 88,253,200,131, 84,116,185, 77,101,168,173,200, 34, 16, 16, 8, 8, 4, 4, 2, 58, 16, 80,183,100,201, + 34, 90, 85, 48, 9, 41, 58,131,232,185,180, 52,185,162,170,130,136, 33, 79,244,236,240,234, 19,152,105,154,208,204,151,103, 24, + 39,126,241,195,250, 21,151, 77, 85,102,250,234,213,171, 23, 96, 11, 73, 94, 38,110,121, 89, 24, 44, 87, 14, 76,174,238,179,165, + 40, 4,147,152, 34,206,134, 59,225, 16, 38,130, 33,108,165, 2, 73, 82,126,245,171,222, 91,239,196,107,136,209, 58, 55,240, 63, +194, 94,173,208,141,120,152,253, 46, 14, 60,222,198, 49, 81,189, 85,206,233,146,233,192,214,187,193,176, 30,113, 89,251,243,254, + 37,226,194, 64,178,224,146,131, 5, 2, 35, 25,249,248, 51,181,123,197,200, 44,149, 34,241,233,247,227, 58, 80,212,162,145,244, +117, 90, 63,137,112, 5, 78,238, 75,111,102, 13,165,115,173,202, 81,241,228,137, 78,202, 4, 55, 86, 57, 65,156,216,205, 23,197, +110, 77,130,249,150, 9, 31, 6, 6,144,187,157,237,151, 2,201, 18,250,251,152, 36,222, 19,151, 9, 75, 65,180, 96,201,226, 32, +109, 63, 38,174,126,236,106,222,200,174,233, 73,136,201,130,187, 16,150, 44,144, 44,234, 85,129,168, 67, 17,186,215,178,184,106, + 12, 32,170, 18,123, 18, 84, 27,155,103,202,217,218, 57,222, 77,138, 65, 66, 92, 93,122, 43,171,160,162, 41, 18,181,230,120,172, + 98,133,121, 57, 35, 61, 24,196,200, 44, 97,158,112,241,233, 89,163, 35, 63,237, 90, 70,171,154, 86,136, 40,110,145, 80,213, 5, +190, 6,164,138,173, 66, 15,177,103,242,249, 20,123,142, 75,148,126,243, 61, 48, 24, 67,185,197,200, 84, 11,132,199, 32, 4,144, +172, 14,202, 32,120,236,249,183, 52,137, 42,147,171, 37,103,230,142,143,250,178, 99, 9,173,107, 81, 41, 18,191, 53,201, 44, 97, +145,120,219,133, 69,147,233,235,158, 21,180,169,115,195,200, 34,233,205,142, 48, 9, 28,223,165, 75,151,141,172, 51, 87,216, 2, +123,157, 9,242,117, 94,126,231, 58,175,123,120,156,137,215,101,254, 88,208,228,126,215,171,243, 50,245,199,160,231, 72,200, 52, + 8, 1,209, 70, 6,193,165, 55,179,192, 83, 47, 68, 6,101,248, 25,120, 26, 84,128,191, 37,115, 3, 16,168,104,107,213, 14,182, +196,236,226, 81,121,126, 72, 60, 55, 21,102, 65,223, 6,171,215,160, 65,131,208, 97,232, 91,130, 71,137,137, 49,137, 22,100,230, +229, 14,214,145,201, 14, 92,141,152,177, 29, 27, 8, 87, 23,182,158,157,224,209,107, 33, 28, 55,134,121,184, 48, 27,188, 54,159, +169, 94,133,209,178, 4, 79, 5, 30, 29,182,131, 9,196, 22,238, 52,225, 54, 84, 13, 96,214, 43, 83, 9, 8, 44, 87, 60, 8, 32, + 18, 83, 68,128,216,192,138,196,228, 67,147, 69, 43, 70,102,190,164,137,234,141,204,155,233,195,231,105,221,233,109,219, 98,148, + 52, 81, 34, 10,152, 49,132,174, 52, 46, 64,109, 29,204, 62,228, 73,148,168,174, 76, 37, 84, 47,167, 27, 91, 5, 67,121, 90,131, +168,109,219,182, 17,147,108, 76,175,129,117,254,138,201,148,135,108,177, 73, 17, 7,195, 51,233,149,150,214, 65, 98, 43, 36, 92, +166,219, 38, 77,154, 52,147,221,199,125, 56,190,173, 33,220,133, 31,230, 12,166,200,214,249,233, 69,173,204,116,176,176,181, 78, +162,197, 68,117, 2,187, 13, 35,225,226,228, 24, 55,226, 25,255,137,219, 32,202, 58,109,218, 57,113, 41,103,101, 23,235, 15, 95, +214, 76, 38,170,237, 68, 47,170, 56,147,143, 89, 66,140, 82, 85,110,188, 54,181, 98, 19,167,121,106,150, 44,204, 53,135,227,170, + 11,138,199,212, 29, 11, 68, 51, 17,195,146, 58, 24,216,160, 92,246,105, 49, 31,219,198,101,199,188,115,112,207, 75,150,220,202, +206,214,129,159,215, 78,149,238,255,188,178, 19, 21, 78,157,224,189,202,253, 99,100, 86,117,183, 15, 13, 91,135,124, 25,233,121, +231, 10, 84,202, 42,249,123,142,215, 26,202,115,143,173,100, 66,124,142, 73,215, 5,190, 14,107,144,214,139,126, 14,180,193, 33, + 91, 63,227,130,167, 1,215,232,203, 42,202,169, 15, 33,195,206, 11, 60, 13,195, 75, 95,110,129,167, 62,132,254,157,243,234, 35, + 14,245,198,104,169, 66, 3, 69,130, 75,112, 54,199, 67,197, 12, 71,199,255,124, 12,157, 26,230,142,210,230,138,211,164,132, 3, +163, 45, 90,114,220,108,154,154, 72, 93,102,114, 30,117,152,130, 93,119, 24, 29,169,169, 98,122,221, 70,124,157,222,135, 69, 19, +209,226, 78,109, 10,187, 35, 55,242,168,174,117, 28,123,164, 30, 52,173, 87,166, 74,229,156,216,250,241,158,201, 71, 20,172, 72, + 28, 92, 30,201, 35,199,208,209, 58,169, 1, 16, 75, 38,143, 58, 92,223, 51,139,125,208,249,198,108, 1,234, 82,149,142, 53, 42, + 78,173,237, 83, 5, 21, 77,158,104,173, 1,186,173,169,156,110, 28,156,191,136, 9,106, 16, 91,233, 48,151, 90, 33, 3,228, 33, +107, 44,153, 24,197,138,145,135,170,137, 45,144, 27,153, 44,205, 96,139,222, 64,182,162,181,113, 77,158,108,114, 23,119,187,207, +151,171,123,210,126, 38, 89,141,172,146,169,187, 14,213,203,105,203, 36,250, 45,147, 54,137, 16, 34, 86,140, 71, 42, 6,105,192, + 76, 87,209,255,111,209,178, 72,180,118,125,205, 2, 81,254,149,236,105, 76,150,212, 81, 37, 44, 19, 45,214,114, 33,226,156,182, +112,210, 54,225,109,140, 76, 30,249, 55,135, 73,213, 98,142,209,130, 44,229,135, 72, 25, 94,139,115, 8, 31, 31,130, 61, 31, 47, +135,251, 20, 53, 79,184,124, 69,181, 60,145, 47, 42,218,209,232, 44,169, 34,241, 91,229,254, 49, 50, 75,165, 73,188,121, 75,203, + 74, 81, 47, 91, 22,166,193,110,166,145, 5,210,152, 28, 96,139, 21, 70, 74,194,226,156,143, 19, 38,237,149,179, 25,162,159,114, +228,125,215,238,114, 47,210,147, 79,148,211, 72, 64, 70,139, 17,120, 10, 60,141,133,192,207,208, 37, 99,149,237, 79,144, 35,203, +117,168, 94,208,244,108,121, 89,196,147, 74,174,115,114,114, 90,199,195,249, 17,172,140,160,121, 89, 29,153, 74, 38, 87,142, 79, + 9,226,142, 60, 71, 28,145,208,212,184,233, 88,150, 61, 39,245,133,115,229,222, 66,175,194, 12,179, 85,116,188,211,187,238, 37, +236, 85,132,230, 99, 11, 7,136,166,166, 33,255,122,101,170, 21,206, 9,150, 45,184, 11,163, 99,179,156, 52, 20,254, 59,153,108, +185,106,200,129,239, 39, 11, 37, 75,248,170, 68,242,196, 39,242, 38, 74,164,201,178,104,104, 27,201,197, 77, 91, 62, 67,235, 14, + 57,186, 6, 91,104,235,196,165, 81,135,140,215, 11,140, 58,228, 76,154, 48,147, 85,247, 28, 41, 20,182, 37, 45, 18,109, 46,148, + 58,193,199,146,230,137, 54,228, 73,169,125, 80,135, 1, 58,159,139,173,108,205,152, 84, 53,227,121,228,106, 71, 95, 7,226,159, + 13,243,100,241,241,202,202, 25,224, 49, 29, 69,113,139, 68, 43, 11,155, 37, 8,196, 30,191, 85,238, 19,131, 39,202, 89,130, 73, + 33,242,113, 76,217, 74, 71, 19,105,121,169,184,108,113,105, 35,125,247, 17, 50,245, 33,100,216,121,129,167, 97,120,233,203, 45, +240,212,135,144, 97,231,127, 6,158,134,149,224,207,206, 29, 39,162, 21,151, 42,253,140,134, 16, 50,227,210, 18,218,175, 17,120, + 10, 60,141,133,128,208, 37, 99, 33,249, 77,142,192, 83,224,105, 44, 4,226,139, 46, 25,171,190,191, 67,206, 15,185, 14,127,164, +192,241,165,113, 69, 57,127,164,149,191,191, 86,224, 41,240, 52, 22, 2, 66,151,140,133,164, 32,111, 66,151,254,124, 93, 50,110, + 9,255, 32,105, 80, 62, 77,201,144, 34,106,147,161,235,184, 62,249, 66,166,230,118,137,107,123, 9, 60, 5,158,114,117, 64, 60, +155,186, 45,192,114,113, 84,230, 19,120, 10, 60, 53, 33, 96,168, 30,201, 33,138,241, 69,166, 18,143,184,246,103,250,158,169,127, +234,188, 28,197, 48, 20, 16, 33,211, 80,196,116,231, 23,120, 10, 60,141,133,128,208, 37, 99, 33, 41,172, 79, 66,151,254, 77, 93, + 50,110,173,255, 17,105,226, 97, 49,110, 67, 11, 60, 5,158,198, 66, 64,232,146,177,144, 20,164, 72,232,146,208, 37,227, 34, 16, + 63,165, 25,182, 4, 79,226,124, 35,252, 21,185,124, 9, 9,255,243,108,152, 9,117, 37,158,180, 10,243, 12, 97,193,218, 39,209, +255,171,154, 5,165,255, 89,206, 62,150,231,135,132,255,245,202, 84,203,175,130,123,204, 67,205, 50, 18,105, 40,107, 34, 28,151, +147, 52,201,252, 25,229,140, 47, 50,141,168,219,241,238,197,155, 36,255,255,117, 30,255,235,211, 31,245,252,154,116, 73, 53, 79, +202, 34, 99,222,100,175,191,168,159,174,100,234, 51,246,141,242,185,147,174,253,255, 22,131,167,161,207,102, 6, 91,219, 50, 60, +178,241, 9, 18,254,255, 85, 58,111,128, 46,229,225,188, 91, 57, 29, 81, 73, 83, 52,149,211, 0,153,250,178,198, 59,253,212, 87, + 33, 3,206,139,186, 27, 0,150,140,172, 2, 79, 25, 32,253, 35, 89, 12, 92,130,135, 9,150,223, 19,162, 35,119,136,137,214,112, +114,169, 62,119,181,122,114, 44, 55,122, 83,106,187,108, 15, 44,172,157, 2,249, 37, 30,179, 20, 74, 52,225,250,142,104,129, 96, +177, 76,191,163,119, 73, 34, 91, 60, 47,132,133, 73,210,164, 35, 44, 45, 45, 79,241, 44,241, 33, 72,210,255,124, 12,231,212,243, +107, 35, 90,232,152,148,101, 77,148,119, 56,121, 84,159,219,205,173,234,236,190, 41,210,103,219,157, 32,177,201,126,158, 92,171, +154,175, 66,145, 84, 83,199,169,241,101,174, 90,206,236,125, 47, 50,113, 44,157, 50,121,242,222,246,118,118, 59,184,158,143,120, +254,167,199, 86,188, 48,116,210,196,137,123,227,156,130,243,168,214, 75,175, 76,150, 95,155,203,195,179, 87, 54, 52, 75,149,106, + 33,215,249, 54, 18,254,199, 49,156,147, 83,119,245, 60,250,136,171, 44,153,198,123, 26,226,223,203,135,245,232,193, 27,162, 27, + 47,137, 76, 10,142,162,108, 13,151,174, 65,114, 47,213,245,136, 93,134,140, 95,144, 50,151,232,124, 68,121, 60,121,161,209, 49, +249, 37,114,164,129, 20,225,184, 82,102,222,150,107,104,195,185,240,161, 72,173,122, 79, 94,235,236,226, 22,130,132,255,149,199, +145, 71,153, 95,151, 76,253,207,230,216,141,102, 25, 11, 95, 51,177,116,126,206,243,179,197, 44,214, 9,178, 37, 71, 63,121,158, + 20, 75,158, 69,117, 80,226, 68,137,246,243, 82, 73,239,177, 54,104,146,196,137,247,225, 24,206, 25, 89,151,150,171,175, 37, 26, + 77,184,190,127,135,252,203,250, 41,234,110, 12, 4,226,223,123,201, 24,181,254, 38, 35,190,212,221,120, 53,254,245,146, 12, 92, +130,135, 59, 8,144, 44,223,237, 68,165,186,110,167,117,231,163,118,168,166,218, 45,135, 92,243,246,206, 22,137, 25,185,177, 46, + 30,207,106, 30,243,174,212, 69,180, 64,178, 88,166,159,194,185,246, 93, 94, 83,239,237,236,217,179,195,121,233, 26,194, 82, 42, + 95,191,126, 37,204,140,206, 51, 92,135,227, 28,242,196,228,135, 37, 76, 67, 71, 6,242,132, 14, 73, 89,214,236, 77, 86,196,116, +102,110,238, 94,111,121,109, 61,194, 2,201, 37, 74,148,120,195,157,196, 48,158,152, 40,163, 42,225,210,214,233,224,190,255, 77, + 56,125,195,220,218,225,107,199,142, 29,131,148,179,164,243,108,222,116,252,248,113,226,245,249,104,248,240,225, 81,149, 42, 85, + 10, 78,102,154,230,235,236,117,167,111, 72,245,210, 82, 78, 28,143,169,139, 71,171, 27,188, 70,224,157,102,205,154,125,218,189, +123,183,180,158, 32, 18,254,231, 53,233, 62,225,156,130,243,232,171,123, 44,153, 44,223, 68,161, 40,146, 62, 93,186,185, 60,171, +251, 41, 38,131, 79,145,240, 63,142,225,156,122,126,141,117, 55,158, 98,198,151,135,250,255,229,100, 61, 2,201, 90,199, 83,242, + 86,238,187, 55, 70,231, 51,186,184,125,229, 73,105, 9,203,252,216,103,112,140, 88,119, 54, 66,122, 22,144, 71,153, 95, 23, 41, + 82,230, 73, 90, 96, 36,121, 86, 30, 55,212,220, 33,207,190, 84,169,205, 34,148, 15, 76,106, 51,179, 8, 28,195, 57,182, 98,201, +146,169,235,217,108,222, 99,234,197, 82,165,203,134, 97, 9, 37, 60, 83,231,206,157,139,121, 54,117, 17,173, 24,125,115,169,123, +151,243,189,228,245, 39,233, 34, 47,110,126,239,222, 61,226, 5,208,165, 61,175,190, 64,188, 78,229, 75, 5,231,209,171,159,242, +117, 41, 59,103,125,209,188,117,103,218,176,235,184, 84, 86, 65,180, 98,192,139,127,207,145,252,118,215,151, 83,212, 93, 31, 66, +134,157,143, 47,120, 26, 86,171, 63, 39,183,225,115,102,193, 61,145, 52,255, 72,137,100,165, 46, 58, 62, 80,213,154,101,238, 90, +234, 18,147, 4,105,225, 99, 44, 60, 12,210,129, 5,115,121,145,100, 98,146,240, 89,175,235,208,165,254,157,204, 30, 94, 17, 79, +159, 62, 37, 44,120,139,151,247,132, 9, 19,136,215,102,163, 45, 91,182, 16,142, 35,185,185,123, 70, 40, 56,175,210,213,168,141, +104,161,172,176,186,129,100,165, 44, 50, 54,208,189,250,156,158,176,104, 37, 76,106,250, 18,242,158, 61,123, 70, 88,112,248,245, +235,215,196,147, 68, 70, 37, 78,150,118,178,146,108,105,146,169,116,243,165,181,207, 18,122,225,194, 5, 90,178,100, 9,229,207, +159,159,120, 22,114,226, 53,250,136, 23,170, 38, 94, 68,154,120,217, 33,105, 61,194,185,115,231, 82, 82, 51,251, 80, 93,229,140, +113, 29,186, 53,187,101,149, 46,125,196,177, 99,199, 98, 44,128,234, 95,243,135, 14, 29,138, 66, 30, 5,231,149, 37, 51,115,139, +155,105,237,221,131,120, 33,225,247,232, 92,121, 45,193, 24,145,104, 35,116,150, 76, 8,223, 33,143,130,243,234,146,105, 68,157, +141, 47, 15,117, 76, 57, 85,221,124,169,139,142,123,167,180, 92,217,218, 59,126, 5,201,194, 7, 5, 47,139, 68,102, 25,114,221, +197,185, 84, 69,199,190,213,231,230, 83,149,153,216,189,201,123, 37,129,193,179,162,220,240,252, 40, 9, 12,242,232,147,169,235, +217,180,244,168,124, 22,171, 46, 96,221, 76, 44, 80,142, 53, 51,241,108,214,171, 87, 47,138,159,205,247,122, 93,135, 76,160,138, + 20,241,137,130, 94, 67,111,248,121, 33, 94,223,145,234,212,169, 35,213, 29,207, 18, 82,249,242, 21,162, 64,182,140,160, 75, 88, +126,104, 81,191, 33, 99,233,214,179,143, 4,178, 37,136, 86,172,167, 48,222, 61, 71,255,242, 59, 68,212,221,136, 8,196, 63, 81, + 74,107,150,246,146, 99,217,151,232, 84, 12,185,224,134, 2,185,194,151, 59,246, 74,183,148, 25, 91,132,114,230,204, 25,142, 14, + 28, 86,172,246,237,219,127,156, 58,117,234, 33, 94,159,111,125, 68, 88,216, 2, 59, 91,219, 9,200,171,233, 78, 56,238,164, 80, +152,167, 76,153, 50,224,201,147, 39,180,115,231, 78,169, 19, 88,177, 98, 5,237,218,181,139,246,239,223, 47,237,209, 9,241,250, +137,210,226,202,108,217, 10,192, 53, 58,100, 74,177, 88, 32, 87,112,191,192,109,136,223,150, 10, 69, 22, 46,103, 36,175,163, 71, +188, 68, 11, 45, 93,186, 84,146,249,230,205, 27, 74,108, 98, 26,160,129,104,197, 20, 89, 89, 87,182, 6, 5,160,158, 14, 14, 14, +196, 75,156, 16, 91,136,200,221,221,157,120, 33,100,170, 80,161, 2, 53,108,216, 80, 34, 91,200,147, 60,121,242,152, 56, 54,109, +117,231, 40,185, 20, 92,159, 39,126,126, 88,197, 72,243,198,235, 1, 74,101,220,179,103, 15,234,254, 4,215,232,194, 51,133, 66, +145, 59, 91,182,108, 1,184, 6,157, 43,112,189,122,245, 42,221,188,121, 83,250, 31,242,148, 27,240,100,178, 24,128,107,180,201, +140,127,186,109,188, 18,107,139,201,114,180,177,169,192, 75, 7,125,194,250,147,207,159, 63,151,136, 55, 43,248, 72,245,252, 90, +218, 93,210, 79, 94, 19,167,108,145, 34, 69, 34,149, 4, 6,235, 71,150, 43, 87,142, 9, 75,121, 26, 50,100, 72, 12,129, 97,189, +138, 68, 94,125,250,169,233,217, 52, 87, 40, 28, 43, 87,174,252, 9,122, 0, 11, 41,175, 75,250,140, 93,209,141, 76, 21, 10, 47, +126,168, 77,148,122,173, 77, 63,225, 18, 4, 17, 68, 25, 55,110,220, 72,188,250, 67, 0, 95,223,156,159,121, 23, 36,252,207,171, + 66, 4,224, 60, 72,167,163,163,227, 75, 92,243, 3,186, 20,139,100,129,108,113,217, 56, 96, 65,178,104, 97,217, 39,177, 9, 4, + 4, 2,255, 24, 2,234, 92,228,175,170, 62, 42,135, 10, 41,247,218,136, 86,146, 68,137, 86,195, 93,248,242,229, 75,106,221,186, +117,208,145, 67,135, 22, 93,185,116,105,222,205,235,215,231, 69, 70, 68,204,211, 71,180, 82,152,152, 12,225, 47,238,112, 88, 94, + 64,178, 64,182,120, 65,104,201, 29,119,230,204, 25,130, 5, 9,132,104,239,222,189,210, 61,134, 13, 27, 22,134,107,244, 17, 45, + 88,176, 64,180,176, 79,162, 80,180,203,155, 55,111, 40,172, 89,248,162, 7,121,219,180,105,147,180,232, 48, 58, 74, 51,203,116, +239,245,117,100,184, 31, 19,172,183,176,132,193,101,210,171, 87, 47,170, 89,179,166, 68,178,202,150, 45, 75,125,250,244,161,101, +203,150, 73,150, 55,184, 38,121, 77,192,215,250, 58,178,100,137, 19,247,234,214,173,219, 23, 93, 36,235,197,139, 23,196,107, 54, + 74,169,121,243,230, 95,112,141,182,186,167, 81, 40,236,120,173,197, 23,112,187,194,122,177,112,225, 66,154, 50,101, 10,141, 29, + 59,150,198,143, 31, 79, 51,102,204,144,234, 12, 75,158,114, 3,190,188, 64,244, 43, 92,251, 87, 41,176, 17, 42,163,141,104,225, + 56, 71,144,167, 52, 73,150,236, 40,175,239, 41, 89, 71,199,140, 25, 67,108,185,237,169,122,141, 54,162,229,174, 80,164, 81, 39, + 48,172,163, 45,172, 20, 10, 87, 36,252,175, 78, 96,112, 13,100,107, 35, 69,154,136, 22,179,150,137,112,195,243, 2,231,228,236, +236,124,207, 83,161, 48, 85,234,164,234, 94,155, 76,196, 95, 65,127, 96,201, 2,201,226,178,217,168, 95,143, 99, 32,235,176,240, +225,153,194, 53, 6, 18, 45,213,192,247, 87, 74,119, 97, 52,201, 90,196,101,195, 90,141, 88,227, 81,185, 56,188, 17, 90, 86,136, + 16, 8, 8, 4,226, 11, 2,234, 92, 36,190,148, 59,186,156,186,221,135,114, 45, 90,220, 73,223, 15, 8, 8, 32, 88,138,152, 48, +237, 3,201,226,206,103, 30,127, 65,207, 99,139,150, 94,162,197,139, 11, 31, 7,201,130,133, 9,150, 44, 16,161, 19, 39, 78, 72, +214, 49,188,224,175, 93,187, 38,185, 19,177, 71,167,134,175,103, 92, 35,135,104, 77, 88,126, 97,146,185,181,211,253, 37, 75, 22, +115, 76,201, 67,186,116,233,146, 68,220, 16,163, 2, 34,119,250,244,105, 66, 71,148, 44,149,245, 35, 57, 68,139,215,166,139, 97, + 40,136,209, 9, 14, 14,150, 98,201,144, 64, 94, 96, 33, 98, 75,158,228,242,148, 99,209,226, 0,250, 35, 32,147,154, 54, 16, 37, + 16, 75, 16, 44,224, 1,235, 30,199,170, 17,174,209, 86,119, 14,208,239,194,184, 73,177, 62,161,161,161,132,152, 26, 38,114, 84, +189,122,245, 79, 5, 11, 22, 12,102,139,201,199,182,109,219,126,226, 14, 81,114, 83, 34, 94, 13, 24,183,108,217, 50, 60,121,178, +100,221,227,153, 2,255,244,226,234, 34, 90, 56,199,214, 69, 51,179,212,169,253,208,238,104, 47,118,199, 69, 70, 91, 7, 37,171, +149, 54,162,197,132,108,176, 42,129,113, 84, 40,210,171,223, 11,199, 84, 9, 12,174, 49,148,104,241,218,161,199, 81, 46, 88,163, +184, 48, 53, 52,145, 44, 29,207, 81, 66, 14,124,223,135,103, 6, 22, 54, 88,175,180, 93,143,115,208,121,232, 28, 2,228, 13, 36, + 90,223, 5,190,131,108, 49,118, 32, 89, 26, 45,225, 63,189,225,197, 13, 4, 2, 2,129, 63, 6,129,120,110,209, 82, 95,130, 39, + 54,241,146,107,209,242,246,246,254,130,151, 57, 58,142, 35,135, 15, 47,191,195, 36,235, 33,147,172, 23,207,158,201, 34, 90, 76, + 72,130,241,130,102,119,163,100,181, 58,121,242,164, 68,132,240,130, 7,201, 0,201, 66,224, 45,220, 94,248, 31, 22, 30, 92,163, +143,104,217,229,107, 55, 57,119,158,188, 95,224, 50, 3, 33,194, 87,253,187,119,111, 37, 11,214,245,235,215, 37,121,236,238,136, + 98, 87, 39, 89,186,150, 89, 35,135,104,177, 21,194, 95,149, 20,193, 69,136, 96,125,148, 21,101, 71, 92, 13, 91,220,136, 23,200, + 38, 30, 49,169,215,117,200, 86,175, 32, 77,110, 67, 85,146, 5, 60,208, 22, 43, 87,174,164,254,253,251, 67,174,214,186,115, 80, +242, 49, 92,171,220,142, 30, 61, 10,203, 90, 56,119,132, 85,184,117,147, 32,225,255, 68,137, 18,133,131,176, 2, 3,184, 81, 33, +151, 59,229,179,127,204,147,245,135, 20, 68, 31,209,194,121, 87,133,194,138, 23,176,190,143,216, 68,196, 42, 49,241,186,232, 27, + 61,162, 85, 43,209, 82, 33, 48,176, 94,105,187, 15,206,169, 17, 24,131, 44, 90,236,134, 12,194,179,133,184, 42, 94, 89,221,214, + 80,162,133,145,133,112, 57, 34,254,208,140, 93,133,218,174,199, 57,196,104, 98,203,158, 61, 59,172,195,134, 16,164,236,140,147, +122,224,251, 43, 65,178,254,144,135, 64, 20, 67, 32,240,155, 17,248,235, 45, 90,192, 87,159,235,144,227, 62, 36,162,133,128, 91, +182, 16, 45,127,252,240,161, 68,178, 56, 70, 72, 54,209, 66,220,208,188,121,243, 8, 35,248,224,118,187,114,229,138, 68,178,224, +162, 3,145, 1,185, 66, 71, 6,146,132, 36,135,104, 37,183,112,186, 48,103,206, 28,122,248,240, 33,199, 56, 5, 72,214, 27,116, + 58, 72,176, 64, 33,110, 41,179,187,215,167, 74,245,187,110,131,123, 49, 46, 68, 11,113, 80, 32,109,112,117,194, 37, 7, 11, 18, + 98,109, 16, 36, 44,135,104,113,158,143,112,183,128, 68, 65, 22, 54,148, 13,117, 69,253, 65,178, 96, 33, 3,137, 69,252, 14, 91, + 76, 32,247,163,182,142, 76,157,104, 65, 30,151, 45,170, 84,169, 82, 1,112,253, 32,225,127,150, 25, 5, 23, 39,240,238,220,185, + 51,177,149,139,204,204,204,206,253,230,231,233,143,187,189, 28,162,133, 60, 60,130,211,135,221,186, 81,208, 49,232, 49, 19,164, +102,186, 44, 90,170, 4, 6,174, 66,109,247,193, 57, 53, 2, 99, 16,209, 98,157, 9,194, 64,136, 1, 3, 6,196,137,104,101,201, +146,229, 61,200, 56, 2,223, 13, 32, 90,129, 6, 16, 45, 57,129,239,127,156, 94,136, 2, 9, 4, 4, 2,191, 14,129,120, 78,180, + 12, 3, 10, 47, 79, 77,113, 32, 86, 86, 86,247, 65, 18, 16, 91,181,110,221,186,125,236,238,154,247,142, 73, 86, 72,112,176,172, + 24, 45,184, 1, 65,168, 16, 55,133, 88, 47,144, 44,184, 8,241, 37,141,151, 60,220,103, 8,180, 69,130, 85, 10,174, 69, 57,174, +195,164, 41, 82,191,135,181, 8,174, 66, 36, 16,174,192,192,247,146,139,167, 71,143, 30,145,252,134,159,150,177,228,208, 97,202, + 56, 46, 99, 18,173,209,163, 71,203, 34, 90,108, 9, 57,137, 50,162,174, 32,133,136,243,106,213,170, 21, 53,104,208,128,106,212, +168, 33,197,126, 21, 43, 86, 76, 10,144,238,217,179, 39,166,143, 32, 92,163,173, 35,131,235,144, 93,145, 49,211, 4,104,114, 73, + 34,150, 6, 22, 66,184,122, 57,166,142,218,180,105,131,123, 68, 36, 75,146,164,155, 97, 26,241,247,231,150, 75,180,144,143,245, +105, 1,220,221,176,160,242,255,235,116, 17, 45, 85, 2, 99, 0,209, 2,129, 49,136,104,241,168,194,227, 32,127,176, 90,198,197, +117,200,110,192,253,112,173, 67,159, 13,112, 29,238,151, 73,180, 68,224,251,223,255, 8,137, 26, 10, 4,254,117, 4,116,187, 14, +213,209,209, 70,180, 56, 24,126, 13, 70,196, 33, 70,137, 93,102, 65, 47,158, 63, 95, 4,146, 21,246,229,203, 60,138,140,212, 27, +163,133,192,118,204,157,229,239,239, 79,155, 55,111,150, 44, 57,120,185,195,226,130, 99,239,222,189,147, 8, 22, 58, 12, 4, 29, +119,234,212,233,171,156, 96,248,196,201, 76,223, 32,254, 8, 73, 73,182, 96, 13,195,168, 64,158,176,180, 30, 58, 45,213,128,249, +223, 65,180,184, 30,195,134, 14, 29, 26, 6, 66,132,249,141, 80, 95,116,212, 60,213,131,228, 46, 68,204, 26,207,215, 69,156,135, +198,141, 27, 7, 2,134,129, 0,195,180,117,100,202, 96,120,144, 41, 88,198, 96,205, 0,118,112,113,162,125, 16,151, 54,107,214, + 44,226,121,192,136,167,126,160, 38, 77,154, 32,192, 30, 83,112, 4,136, 96,248,239,223, 7,134, 16, 45, 30, 25, 88, 30, 83,146, + 0,103,182, 44, 74,163, 88,181,185, 14, 85, 9,140, 1,174, 67, 16, 24,131,136, 22,130,225,161,251,208,123, 46, 83,156,130,225, + 49,162, 18, 22,101, 4,231,107, 11,134,207,148, 41,147,220, 96,120,213,192,247, 39, 34,240,253, 95,239,131, 68,253, 5, 2, 2, +129, 88, 8,104, 35, 90,236, 82,200,232,229,229, 21, 6,171, 22,130,130,217,133, 24,194,177, 65,135,158, 61,121, 98,240,244, 14, +184, 30, 36, 3,193,241, 74, 75,214,251,247,239, 37,194, 16, 25, 25, 41, 5,200, 99, 42, 8, 39, 25,211, 59, 36, 72,156,252, 0, + 2,193,217, 66, 22, 5,242, 2,194, 5, 34,195, 83, 36,248,207,229, 88, 37,116, 90,152,250, 1, 22, 45, 76, 5, 33,147,104,189, + 82,181, 18,105,114, 29, 34,112, 56, 58, 70,235,149, 50,166, 69, 75,135,155, 16, 67,225,185, 62,111,225,126, 4,161,132, 37, 15, +238, 66, 88, 7, 65,178, 16,159, 3,146,133,184, 47,196,217, 32,175,174,225,243,184, 31,130,177,121,110,175, 55, 32,172,136, 25, + 2,158,108,105,148, 8,219,192,129, 3,169,107,215,174,146,171, 16,163, 38, 27, 55,110,140,216,172, 64, 49,189,131,230,135, 93, +149,104, 57,165, 79, 95,150, 7,126, 60,103, 11,238, 75,252,175, 78,194, 48,241, 45, 15, 42,144, 72, 73,241,226,197, 35,125, 49, +155,191,134, 13,215, 33,176, 93,149,192, 56,106, 9,134, 87, 37, 48,113, 10,134,231,233, 29,120, 98,222, 80, 12, 86,129, 94,241, +140,240, 79, 13,157,222, 1,147,145,226, 89,196,192, 17,148, 71,125,122, 7, 28, 3,153,195,135,144,140,233, 29, 68,224,187,232, + 87, 4, 2, 2, 1,129,128, 54, 4,148,147,128,126,155,176,116,220,119, 19,150, 98,170, 3,124,205,131, 24, 97, 58, 6, 16, 5, + 88,101,228, 78, 88,154, 41,179, 71, 4, 92,104,112, 17, 42,131,223,209, 65, 32,166, 10, 27, 2,228,173,109,108,101, 77, 88,138, +206,140,199,132,167,230,206,105, 40,143, 20, 12,101,139,153, 36, 19,157, 32, 38, 45,133, 37, 11,228, 10,147,153, 98, 82, 83, 76, +110, 26,189,126,163,170,197, 32,102, 98, 64,229,228,162,142, 94,197, 62,160, 83, 81,110,168, 43, 72, 28,220,153,136,181,194,244, + 14, 72, 8, 30, 78, 97,237,249, 65,214,228,162, 60,201,163, 29,207, 46,142,120, 41,200,226,201, 73,105,205,154, 53,132, 50, 79, +156, 56, 81,178,100,193,165,152,214,218,134,235,174,123, 66,200,152, 73, 80,121, 18,210, 52,182,110,193,101,202,148, 9, 90,187, +118,173, 52, 7, 23, 92,179,104, 19,144, 64,158,109, 30, 22,138, 16, 83, 75,251, 16, 49, 97,233,119, 26, 31,211,238,170,100, 10, + 3, 33,148,147,126,178,251, 54,156,173, 69,195,147, 43, 20,133,153, 96, 57,131,100,241,239,133, 32,179,176,196,242,252,106, 79, +212,172, 79,177,100, 98,170, 6,117, 2,163, 62,189,131, 58,129,209, 48,189,131,170,126, 74, 19,244,106,122, 54, 49, 97, 41, 98, +180,160,251,112,197, 67, 63, 49, 0, 4,243,190,201,157,176,180, 66,133,138, 81,208,117, 88, 74, 65,254, 17, 55,134,132,255,113, + 12, 36,171, 82,165,202,114, 38, 44,197, 20, 13,152, 15,235, 8, 39,105, 66, 55,222, 63,231,100, 72,240, 60, 26, 76, 76,218,105, +220,174, 74,224, 41,240, 52, 22, 2, 63, 67,151,140, 85,182,120, 32, 71,101,253, 64,109, 75,240,184,101,118,143,196,228,162,136, +135,130, 37, 5, 36, 9,110, 43,174,157,254,245,212,120,198,119, 76, 70, 58, 98,196,136, 48, 4,196,131,180, 33, 65, 78,151, 46, + 93,190,194,146,133, 89,225,245,173, 33,168,110,105, 96, 11,144, 29,191,197,231,229,206,157, 59, 18,129,229,102, 22,214,111,148, +235,200,129,100, 97, 73, 33, 44, 95,130,217,183,181,117,142,202,117,220, 54,158,120,113,217,198,209,227, 19,207, 73, 21,130, 14, + 21,110, 57,116, 52,176,148, 97, 10, 6, 30, 57, 25, 85,178,100,201,160,228, 22,118,159,246,156,123,113, 89,185,134,163, 74,235, +170, 46,239,242,255,117, 30,121,105, 33, 88,171,184, 3, 12, 91,188,120,177, 52, 65, 43,246,176,142,177,139, 15,117,151,150, 31, +210, 87,119,245,245,230,162,151,224,153,199,150,152,243, 22, 22, 22,175,184, 99,245,103, 11,214, 69,222, 47, 86, 46,193,163, 87, +166,241, 84,243,103, 60,128, 63, 85,166,170, 46, 49,134,239,149,163, 65, 65,182, 65,134, 65,128, 27, 53,106, 68,117,235,214,149, + 98,222,160,247,209,147,151, 78,215, 69,180,112, 14,147,144, 86,172, 88, 49, 82, 31,129,225, 9, 71,181, 77, 88,170,170, 75, 49, +107,123,106,122, 54,177, 4, 79,222,252, 5,195, 64,182,225,150,199,210, 78,202,103, 83,214, 90,135, 76,240, 97,173,194,199,132, +242,195, 71, 57,133, 8,142,225, 28, 62, 2, 12,212,165, 35,209, 68, 11,164,203,208,237,167,182,187,161,133,209,145, 95,148,211, +136, 96, 10,130,109, 92, 48,227, 17,158, 70,175,248, 47, 20,200,179, 0, 73,155,250,154,135, 90,138,160,178,126, 32,150,226,209, +184,168,116,153,255, 47, 42,109,157, 46, 93, 20, 72, 22,130,189,117, 17, 45,213,245,209,156,216, 37,136,248, 43, 4,187, 99,100, + 33, 18,254,199, 49,156,147,179, 54,159,182,184, 26, 11,158, 13,155, 23,148,222,149, 34,157,215,126, 88,180,224, 54,196,130,211, + 32, 89, 88,144, 87, 31,209,250,127, 57, 7, 95, 96,146, 82,140, 23,124,238, 99,111,107,187,219,218,218,250, 33,151,241, 97, 90, + 75,203,221,201,147, 38,237,131,115,138, 92,131, 47,232, 93,247, 77,117,173,195,232, 5,181,181,213, 93,185,160,182,161, 50,149, +174, 75,109,123, 57,120, 26, 81, 33,227, 93,167,163,170, 75,118, 86, 86,181, 88, 31, 63, 49,241,145,220,176, 32, 85,112,205,194, + 74,132,145,177, 24,197,138,160,113, 38,180,183, 49,229,131, 62,162,165, 36, 91,250, 8,140,234,172,240, 58, 62, 4, 98,214,246, +212,250,108,150,251,255,162,210,246, 25, 28, 34,149,207,166,172,181, 14, 89, 63,149,139, 74, 35,190,140,167,112, 8,196, 52, 14, +234,139, 74,235,213,207,216,202,180, 53,154,104,197,101,198,247,120,167, 75,255,242,115, 36,234,110, 20, 4,254,101,157, 55, 10, +128,191, 73,136,114,222, 44,245,189,230,226,192,181,166, 92,115, 45,218,205,150, 80, 87, 71, 30,189,190, 33, 44, 89, 79,244,174, +117,200, 47,114,184,189,244, 17,131, 24,215, 88,116,126,149,146,106,116,247,104, 35, 93,202,227, 26,234,164,211,117,168,116, 5, + 26,163,156,234,117,249, 83,101, 26, 81, 57,227,221,139, 66,147,254,192, 66,202,250,220,157, 73,198, 41, 38, 73,111, 96, 41,229, + 56, 40, 76, 57,114,159,221,127,157,225,178, 86, 94, 39, 71, 63,225, 18, 68,252,149, 58,129,193, 49,165,187, 80,181, 28,154,100, + 26,250,108, 98,125, 67, 16, 44, 36,189,107, 29, 26,241,217, 84,211, 37, 4,198,199,117,198,247,120,167, 75,255,242,115, 36,234, +110, 20, 4,254,101,157, 55, 10,128,191, 73,136,186, 37,203,240,133,166,227, 88,240,127, 89, 97, 68,221,227,168, 52, 90, 46,251, + 19,240, 4, 57, 55,211, 83,173, 63,161,156,114,144, 23,229,148,131,146,252, 60, 2, 79,249, 88,201,201, 41,240,148,131,146,252, + 60,241, 5, 79,249, 53, 18, 57, 99, 16,136, 47,141, 43,202,105, 92,165, 21,120, 10, 60,141,133,128,208, 37, 99, 33,249, 77,142, +192, 83,224,105, 44, 4,126,134, 46, 25,171,108,191, 67,142,210,162,165, 58,159, 86, 44, 50, 4,192,212,147, 33, 5,213,116,189, +190, 99,250,228,235,187, 62, 46,101, 22, 50,191,111,103, 93,152,136, 54,210,142,128,208, 37,161, 75,114,117,224, 79,124,142,170, +197,225,157, 47,183,190,170,249,254,196,186,139,190, 35,246,179,251, 59,218, 72,121, 79,109, 58,165,175, 76,127,226,121,121,177, + 89, 63,161,228, 63,131,241, 10,153,198,109, 40,129,167,192,211, 88, 8, 8, 93, 50, 22,146,194,250, 36,116,233,223,212, 37,227, +214,250,215, 74,211,105,209,250,153, 69, 17, 15,139,113,209, 21,120, 10, 60,141,133,128,208, 37, 53, 36,125,125, 21, 9,121, 76, +114, 2, 34, 95,222,175, 75, 68, 84,155,147, 34,129, 76,192, 53,226, 89,187,182,230, 25,254, 59, 53,180, 76, 45, 67,174,104, 35, + 25, 32, 25,144, 69,224,105, 0, 88, 50,178,254, 12, 60,101,220, 86,100, 81, 71,224,103, 52,196,223, 36,211, 49,125,250,244,123, + 56,237,101,224,120,210,112,189,219,223, 84,119,189,149, 85,203,240,219,234,206,147,150,150,226,133,184, 75,201, 44,240,111, 43, +167,204,242, 41,179,197,148,211, 43,147,162,134,103,102,197,160,152,228,166,104,162, 77,150, 39,159, 83,205,139,107, 85,242,202, +169,123,194, 10,165, 29,102, 35,241,117,114, 38, 47,149, 35, 83,189,184,238, 60, 21,203, 99, 30,105,249,156,231, 68,171,172,161, + 46, 49, 50,121,194,225, 68, 72, 13,106,165, 25,216,165, 77,150,143, 93,218,120,126,109,217,212,193,191, 81,109,203,219, 77, 27, + 88,237,106,211, 52,125,191, 54, 45,236,178, 41,243,169,239,117,213, 61,171,155,162, 66,221, 26, 94,115,114,121, 39,239,121,248, +112,177,196,244,172,118,242,251, 39, 93,172, 91, 53, 78,179,185,103,231, 92,145, 77,234,166,217,210,162, 69,218, 84, 58,218, 45, + 46,117,215,167, 6,191, 84,230, 40,110,227,161, 73,146,120, 14, 75,148,168,234,176,196,137, 27, 12,231, 52, 44, 97,194,122,188, +207, 51, 65,161,136, 83,221, 89,102, 26, 95,133,162,196, 72, 19,147,102, 44,179, 47,203,234, 51,202,196,164,233, 80,133,162,248, +104,133,130,103,247,209,186,105,173,123,124,147,137,250,162,222,127,106,221,245, 41,161, 56, 31,141, 64,170, 84,169,206,115,231, +130, 73, 47, 99,146,165,165,165, 63, 18,119, 60, 82,226, 57,165, 98, 18, 47, 87,130,115,231, 13,236, 28, 49,130, 11,126,205,163, +209, 9,255,255,200,168, 46,179,164, 73,147, 14,231,114,156, 50, 49, 49, 9, 65,194,255, 56,166, 71,174,174,151, 15,143,190, 87, + 52, 96, 60, 22, 48, 30, 15,121, 2,208, 71,252,255, 66, 28,227,132,115,218, 54, 93, 50, 83,112, 7, 48,153, 23, 28,126,205,139, + 0,223,224, 73, 37,163,220,221,221, 95, 51,134,147, 89, 24,175,146, 19, 39,153,113,213, 93, 93,229,204,196, 36,240,156,131,131, +195,133,104,252,204,240, 63,151,253, 28,255,206, 20,135,114,154,242, 53,165, 25,191,254,220, 9,238,141, 94,230,230, 57,235,210, + 94,110,163,254, 56,199, 9,121, 52,109,191,180,131, 80, 41, 64,106, 46,231, 43,214,245, 87,124,236,175,180, 66,128, 56, 81,216, +205, 85,202,132,223,218,218, 86, 79, 94,189,109, 84,178,152,109,181,185, 51, 90,206, 69,194,255, 50,148, 86,175, 76, 53, 25,238, +188,114,197,187, 79,159, 62, 73, 43, 87,212,170, 85, 43,152,159, 91,238,127, 99,109,223, 17,173,118,205, 51,189, 11,251,244,140, +194, 63,191,144,210,215,208,167,244,224,206, 65,218,186,126, 24,141, 24, 92,142, 26,215,178, 60,213,176,118,186,172,114,137,150, +167,171,162,242,128,254, 53,230, 70, 70, 92,157, 91,183,150,215,204,105,211,242,165,190,119, 49,135,213,153,253,217, 10,247,235, + 81, 48, 10,247, 56,180,119, 6, 53,175,103,117, 78, 7,217, 50,180,238, 50,224,252,101,193,240, 9,134, 36, 75,230, 52, 52,113, +226,118,195,147, 36,169, 58,218,194,194,115,116,186,116, 78, 72, 99,211,166,117, 25,150, 36, 73, 57,233, 92,226,196, 57, 13,120, +222, 19,140, 72,156,184,224,172, 44, 89,250,189,191,115,167, 95,248,231,207,131,120,126,182, 33, 72,248, 31,199,102,185,187,247, +243, 85, 40,242, 11,153,223, 33,160, 73,151,126, 6,158,114,116, 80,228, 81, 34, 0,146,133,117, 7,149, 91, 84, 84, 20,133,135, +135, 75, 11, 24,227, 37,134, 89,210,149, 11, 25, 99, 89, 14, 44,167,195, 95,145,254,218, 94,104, 42,199,241, 21,139, 70, 95,201, +235,196,133, 97,230,109, 44, 32, 13,185,123,247,238,165, 92,185,114,133,241,185, 85,156,202,112,210,244,197,171,237,229, 83,142, +103,155,127,139, 69,171, 49, 35, 54,228, 97,241,102, 76, 48, 57,127,254,252,112,156, 99,121,229, 12,120, 0,145,213,155,137,213, + 29, 94,130,228, 19,102, 1,199,132,172, 88,131, 17, 75,230,240,210, 54,159,112, 14,121, 12,144,153,128, 73, 70, 51,123,123,251, + 23,243,230,205,251, 2, 28,207,156, 57,115, 11,216, 97, 45,197, 25, 51,102,124,193, 57,228, 97,153,154, 92, 22,223,213,157,203, +112, 94, 73,134,245, 17, 97, 3,201,112, 78,103,103,231,123,188, 72,113, 36, 47, 80, 29,198, 68, 99, 43,210,189,123,247, 34,120, +249,160, 72, 44, 92,204,101, 52,228, 37,153,157, 9,213, 99, 94, 40, 60,132, 39, 1,141,194,204,253, 88,138, 8,139, 95, 99,249, + 38, 94, 46, 40,138, 39, 8,253,200,228, 24,243,177,101,215,128,169,174, 78,167, 16,147,161, 57,140,221, 41, 94, 18,231, 41, 18, +254,199, 49,150, 83, 72,199, 83,173,183, 35, 99, 89, 75, 23, 46, 92, 24, 49,106,212,168,112,198,122,169,140, 55,132, 94,153, 50, +100,168,103,249,169, 50,149,228,105,197, 18,223, 85, 93,218,151, 91,197,191,241, 97,162, 73,255, 18,224, 28,242, 32, 47,136,153, + 26, 41,251,174,156, 21, 75,101, 24, 95,173,162,203,226,178, 37,108, 91,230,203,103,153,186,106, 69,151,213, 33,239,182,250, 34, +225,127, 28,195, 57,228, 65, 94, 3,219,221,157,219,249,177,183,183,247, 27, 94,126,235,106,146, 36, 73,218,129,100,225,189,116, +237,218, 53,105, 29, 81,232, 87,190,124,249,130,147, 37, 75,166,106,217,250,142,104, 53,172,105, 57,152,173, 76, 17, 32, 85, 83, +198,214,165, 69,115,219,211,177, 67,243, 41,224,229,101,137,120,221,184,188,141,122,117,201, 29, 86,191,166,249,208,214,173,115, + 37, 81, 18, 46,149,242,254,223, 66,232,174, 40,166, 36, 89,216,103,203,146,112,116,222,156,137, 7,148, 41,110, 50,106,202,200, +156,147,122,117,204,248, 0, 36, 75,149,108,105,113, 37,254,212,118,143,131, 30,106,187, 68,189,156, 9,152, 72,101, 99, 43, 86, +221, 89, 25, 50, 88, 76,180,179, 51, 31,147, 50,165,247,168,164, 73, 11, 34,141, 76,153, 50,215, 36, 75,203,244,107,243,231, 79, +206,100,171, 28,147, 45, 31, 25,237, 14,153,205,252,102,204,232,195,139,225, 14, 9,190,119,175,223,173,201,147,187, 31,174, 86, +173,203,241,122,245, 58, 63, 89,186,180,203,231,103,207,250,242,185,193,199, 71,142,236, 51, 50,105,210, 70, 66,102, 44, 4, 52, +181,145,177,241, 52,162, 74,197, 75, 81,202, 96,120,213, 88, 45,221, 21, 65,231, 13,146,133, 37, 98, 54,108,216, 64, 91,182,108, +145, 94, 92,251,246,237,147,214,232,195, 11,140, 73,130, 68, 62,120, 49,103,105, 13, 52, 25, 68,171, 38, 91, 72, 94, 97, 41, 15, +144, 12, 77, 27, 8, 29,102,225,230,165,111, 48,243, 54,172, 8, 53,213, 74,170,233,229, 83,194,195,195, 35, 20, 75,229,220,185, +115,135, 22, 45, 90, 68, 19, 38, 76,144,214,103, 67,185,113, 28,137,173, 70,161, 44,171,132,140, 7, 16, 89,242,112, 71, 29,202, +139,102, 71, 5, 7, 7, 75,245, 84,110, 32,132, 88,138,135,113,136, 66, 30,228,149, 33, 51, 55,215,253, 70,135, 14, 29, 62, 96, + 57, 31,108, 60,227,248, 11,158,109, 60, 10, 68, 11, 9,139, 77,163,156, 29, 59,118, 12, 98,185, 55, 88,102,110,125,117, 71, 59, +129,244, 98,123,245,234,149, 84,111, 44, 31,131,181,250,128, 35,126,131,112,130,204,202, 37,195,188, 12, 80,233, 28, 57,114, 60, +133, 69, 64,185,241,146, 67,143,184,253, 95, 67, 14,202,136,245, 40, 51,103,206,252,148,137,145, 38,151,218,119,109,196,132,229, + 34, 48,196,114, 67,220,241,145,171,171, 43,241,130,216, 84,184,112, 97,105,189, 72, 44,130,141,197,144,153, 20, 19,119,138, 23, +101,224,137, 44, 57, 96, 93,227,165,139,222, 99,113,114,213, 15, 3,204,134,142,197,197, 43, 85,170,244, 46,218, 2,151, 67,166, + 76,213,108, 57, 75,149, 42,197, 48,188, 39, 44, 6,206, 58,246,158, 79,106, 35,151,202,235,226, 93,231,168, 36, 90, 32, 80, 55, +174,239,158, 59,110, 76,235,177, 37,139, 37,170,245,254,189,167, 3,125,241,116, 69,194,255, 56,134,115,200,131,188,114,136, 22, + 8, 84,104,224, 86,223,221,219, 6, 78,235,214,169,212,198, 19, 7,166,111,248, 26,114,108, 5, 18,254,199, 49,156, 67, 30,228, + 53,160,141,248,113,118,127,133,101,130,176, 8, 61,214, 74,229, 37,189, 62,243,243,250,245,210,165, 75,180,114,229, 74, 26, 62, +124, 56,245,232,209,131, 6, 13, 26, 68,137, 18, 37,194, 58,139,223,181,145,170,133,106,242,228,106,230,203,231, 54,202,185,112, + 86,229,242, 11,103, 20,233, 53,176,187,235,202,118,205,109,111, 15, 29, 80,138,158,220, 63, 78,159, 67, 30,211,194, 57,237, 8, +100, 75, 39,209,202,172, 24, 16, 26,122,126,238,251,247,231,230,222, 98,172,110, 95,223, 61,255,214,245, 45, 75,111, 94, 89,189, +241,210,233,153,135, 30, 92,104, 63,165,123, 59,231,167, 50,200, 86,188,211, 37, 0, 60, 44,105, 82, 23,118,233,213, 92, 91,171, + 86, 82, 38, 85, 30, 35,146, 36,241, 25,109,106,154,113, 70,250,244,214, 83, 44, 44,172,198,167, 76,105, 55,194,196, 36, 15, 8, +215,161,129, 3, 19, 51,217, 42, 53, 60, 81,162,188,186,222,117, 44,175,192,165,185,115,123,115, 91, 15,185, 56,120,112,143,189, + 69,139,182,123, 52,110, 92,221,224, 61,123,170, 34, 61,159, 53,171,246,165, 22, 45,154,189, 88,186,180,125,228,215,175, 3,143, + 12, 30,220,107,152, 66,193,115, 10,107, 39, 27,218,100, 62, 92,189,186, 86,163, 50,101,198,101, 72,147,230,188, 67,234,212, 23, +219,148, 43,183, 32,240,205, 27,223, 31,145,105,204,114,110,247,241,233,176,164, 69,139, 14,215,150, 46,149,234,111,204,186,255, + 72, 57,227, 37, 53, 50,110,161,213, 39, 40,141,253,155, 45, 10,197, 96, 85,224,228,171,188,175,146,104,201, 33, 89, 88, 32, 25, + 68,139, 59, 52,117,139,150,122, 53,158,130, 72,225,197,168,111, 3, 89,192,130,213, 44,224,169, 30, 44, 82, 99,109, 68, 44,143, + 2, 34,232,235,235, 43, 45,168,140,181,222,246,239,223, 47,237, 65, 22, 33,235,246,237,219,132, 53, 22, 89,158, 62, 23,144, 9, +231,123,162, 36, 87, 32,148, 47, 95,190,140, 41, 50, 44,102,176,112,193, 10,133, 69,156,145,151,101,242,138, 60,218, 55,182,230, +188,228, 50,156,101, 33, 71,152, 16, 28, 99,203,208,233, 5, 11, 22, 28,159, 52,105,210,229,193,131, 7,223, 96, 75,207,221, 38, + 77,154, 60,172, 81,163,198, 51,118,119,188,230,133,128,223,179, 59, 45, 72,159, 30, 40,219, 9,132, 18,139,105,131, 88, 97, 3, + 17, 6, 38, 32,172,216,208, 70, 40,175,140, 54, 82,240, 34,199,119, 65,132, 65,170,128, 25,112, 4, 89, 3,145, 65,221, 81,103, + 46,187,180, 54, 37, 91, 20,238,234, 43, 35,206,115,190, 0,144, 31,158, 97, 29, 68, 10,139, 49,131,248, 82,129, 2, 5,164, 69, +143, 27, 52,104, 64,140,131,164, 71, 60,243,186, 62, 61,130,200,156,217,178,101, 11, 64,157, 64, 42, 81, 87, 44,141,131,122,226, +127, 85, 34,143, 58, 48,177, 67,187,235, 35, 73,170, 85, 73,200,101,188, 13, 66, 13, 2, 11, 29, 0, 73,228,178,221,230, 76,114, + 98,139,228,192,242, 71,228, 81,137,187, 26, 14, 34,117,255,246,210, 97, 91,215,215, 26,190,119,173,231,240, 55,183, 10,246, 64, +194,255, 56,134,115,200,227,233,174,152,196,215,169, 91,180,190,171, 15,172, 85, 32, 82, 95, 2, 15,204, 8,120,182,101,253,208, +254, 69, 31, 53,174,147,246, 19, 18,254,199, 49,156, 67, 30,228,149, 9,136, 43,147,252, 0,180, 43,116, 10, 27,116, 19, 31, 42, + 76,180, 62,181,107,215, 46,168,111,223,190,212,180,105, 83,170, 82,165, 10, 85,173, 90, 21,239,145,199,154,100,171, 18,173,195, +139,125, 77,222, 60, 93,109, 27, 20,176,220, 53, 60,112,128, 79,248,135,190,101, 34, 2, 71, 54,217,182,186,230,164,182,205,237, + 95,239,219, 49,153,190,124,124, 66,189,187,230, 13, 83,186, 17, 53,201,204,226,166, 40,169,180,104, 13,234, 95,115,110,118,207, +132, 99,139,228, 75, 60,180, 82,185,228, 83,199, 15, 45, 61, 38,242,237,204,246, 31, 30,245, 31,163,137,108,233,137,217,146, 9, +207,239,203, 54, 68,161, 72, 10,151,224, 2, 55,183, 84, 32, 89, 83,108,108,188,217,188, 88, 58,226,242,101,179, 26,165, 74,197, +178,146, 14, 74,152,208,206, 55, 73,146,188,171,171, 87,151,174, 25,171, 80, 88,107, 42, 57,119, 74,150, 83, 93, 93,251,193,146, +117,113,208,160,238,236,107,109,198, 50, 43,106, 74, 79, 39, 78,172,251,122,205,154,214,236, 74,236, 55, 33, 93,186,190,218, 98, +182, 52,201, 28,217,165, 75, 55,175, 76,153,118,122,102,201, 18,186,116,233, 82,201,245,140,119, 42,222,161,174, 46, 46,159,125, +138, 20, 57, 83,223,204,108,166, 33, 50, 81, 70,174,123, 37,174,251,180, 76,206,206, 55, 76, 83,166,252,132,228,230,224,112,187, + 97,137, 18,203,191,134,134,246, 55,164,156,237,254,199,222, 85,192, 71,113,124,225,195,221, 37,184,134,224,238, 78,161, 88,139, + 83, 92,139, 22, 45,110,109,113, 47,110, 45,238,238, 4, 9, 26, 92,131,187, 59, 4, 8, 26, 2,201, 1,121,255,239,219,102,243, +191, 92,238,110,247,146, 64, 75,187,251,251,205,239,246,118,103,223,206,188,153,157,249,230,189, 55,239, 21, 42, 52, 54,105,146, + 36, 47,178,186,185,249, 67,235,244,209, 5, 90,164, 90,229,203, 79,121,180,123,119,109,214,253,217,170, 85, 97,170, 59,203,233, +115,232, 80,205,198, 85,171,254, 94, 34,127,254, 53,185,179,103, 63,151, 38,117,234,103, 41,147, 39,127,158, 45, 99,198,171,223, +127,247,221,254,111,226,196, 89,129, 15,212,229,115,246, 46, 91, 88,228,115,190, 47,130,105, 91,239, 58,228,255,255, 31, 4, 89, +214, 47,228, 4, 78, 80,180,113,227,198, 96, 73,150,167,167,103,176, 36,139, 42, 63, 74,178, 56,177, 1, 52, 40, 65,151,117, 76, +226,138,148,140,210, 16,198,143, 35,152,178, 62, 24, 92,122,237,218,181, 50,116,232, 80, 69,165,132,114, 57,156,116, 33, 81, 25, + 56,125,250,244, 15,148,104, 16,100, 17,108,237,222,189, 59, 68, 57, 9,178, 40,133, 34, 88, 2, 93, 51,159,113,196,224,168, 81, +163,246,234,222,189,187,191, 90,182, 85,171, 86, 41,160, 67, 61, 56,168,119,237,218, 85, 46, 94,188,168,164, 31,127,252,209,159, +207, 56,162, 9,155, 36,165,238,234, 1,192,114, 25,193,137,159, 67,133, 22, 64, 80,100,157,160,154,124,129,114, 82,221,233,240, +160,186,144,245, 34, 63,185,146, 39,208, 98,249,200, 71,242,132,131, 4,249,204,246, 33, 96,112,212, 70,136,105, 55, 24,128,231, + 72,187,118,237,238, 81, 77,204,128,223,236, 3,228, 43,105, 61,124,248, 80, 1,174,252,229, 68,182,105,211, 38,169, 90,181,234, + 61,168,123,247,103,200,144, 1, 99,151,253, 3,182, 93, 62,228, 33, 7, 46, 74, 24,154, 52,105, 34,229,202,149, 83, 38, 66,210, + 39,160,103,249,168,154,141, 29, 59,246, 19,141,106,167,196, 68,251,144,234, 97,214, 13,170, 61,153, 52,105,146,140, 25, 51, 70, +169, 47, 84,176,178,108,217, 50,133, 7,234,193,254, 74, 91, 43,208, 77,169,197, 83,222, 7, 95,187, 67, 69,172,136, 93,201, 91, +130, 75, 6,104, 6, 40,124, 11, 21, 85,119, 61, 52,190,194, 60,145, 40,181, 34,160,186,119,161,197,194,137,163, 42,120,254,216, + 52,151, 15, 19,207,121,141,247,152, 7,117,211,181, 27,143,170, 65, 74,173, 8,168,122,117,118,125,127,251,210,104,121,247, 98, +145,220, 58, 93, 91,102,142, 75, 27,216,188,126, 50, 63,222, 99, 30,230,213,195,179,108,217,210,111, 59,186,167,149, 28, 63, 48, + 76, 54,173, 27, 43,187,118,121, 40, 38, 2, 28,143, 56,182,224, 91,242,133,164,244, 45, 2,121, 83,162,201,254,196, 49, 4, 81, +142, 66, 31,150, 64,107,235,214, 41, 49,188,111, 44, 74,254,234,201,210, 76,230, 87, 99, 10,125,120,222,167,226,169,125,173,154, + 7,248, 76,239,243,242,246,144,159, 9,182,238,222,216, 47,144, 80, 73,211, 31, 18, 31,226,179,246,202, 27,108,163,245,233,220, +204, 70,245,115,205,246,220,154, 58,205,129, 61, 89,138, 62,191, 53,164,226,244,177,117, 39,236,220,208,123,253,131,139,125,103, + 88,131,173,230, 13,147,236,214,203, 91, 61,188,250,210,121, 0,152,242,194, 38,235,123,170, 11, 41,201,194, 4, 94,200, 99,214, +172, 72,163, 97,123, 11, 73, 87,118,166, 17,136, 15,170,150,107, 80,244,232, 57,134, 71,138,148, 17,134,237, 69, 6, 71,142,108, + 83,130,135,129,165,252,139,203,151,251,191,185,117,107,192, 78, 72,178, 8, 10,210,166, 78,125, 45,121,178,100, 47, 1, 52,148, +148,210,197,229,101,170,148, 41,149,148,218,197,229, 85,250,116,233,222,164, 75,157,250, 77,202,196,137,185, 48, 10,117, 88,211, +204,147, 37,139, 59,199,143, 27, 55,110, 40, 99,158,245,193,177,139,125,171,119,239,222,146,196,100, 90,171,135, 38,203,137,186, + 55,203,144, 38,205,149,218,181,107,191, 63,114,228,136,162, 85, 96,226,121,173,154, 53,253,179,186,186,222, 89, 59,106, 20, 54, +188,154,108,169, 79, 77,150,229,220, 2, 73, 22, 65, 22,251,185,122,112,254,109,223,190,253,251, 36,137, 19,191,152,254,203, 47, + 29,239, 13, 31,222,200,124,247,110,215,171,171, 86,245,208, 67, 83,229, 39,203,154, 59,107, 86,207, 78, 29, 58, 60,195,252, 27, + 72, 33, 3,181, 67, 84,193,115,236,195,184, 26, 88,166, 84,169,151,137,163, 68, 9, 75,188, 82,221,221,208, 22, 22,209,253,240, + 63, 61,163, 5,138, 44,167,150,149, 19, 56, 39, 91, 85, 93,232, 8,100,113,242,164,122, 13, 18, 0, 45, 73,132, 2, 54, 56,153, +170, 73, 85,249,176,131,207,156, 57, 83,122,244,232, 33,125,251,246, 85, 38, 99, 2, 46,148,199, 33, 77, 6,162, 38, 13,174, 64, + 40,201, 98, 57, 15, 30, 60,168,208,167,234,136, 29, 69,237, 48,151, 47, 95,150,195,135, 15, 11,159,113,212, 38,184,239, 73, 9, +134,122,112, 34, 87, 15, 78,236, 4, 54, 4, 10,124, 15,165, 61, 84,119,241, 25, 71, 52, 45,129, 22, 84,125,111, 80, 14,111, 2, + 1,124,220,151,172, 65, 22,192,224, 59,168,195,124,131, 38, 8,135,221,135,237, 52,118,236, 88, 5, 96, 48,253,252,243,207,193, +231,252,223,166, 77, 27, 5,128,140, 30, 61, 90, 9,132,236,168,141, 0,178,142, 83,218, 8,201,205,115, 14, 54,139, 22, 45,146, +110,221,186, 41, 52, 41,105, 34,192,162, 90,182, 87,175, 94,202,117,242,186,109,219,182,207,216, 71,138, 20, 41,114,196, 81, 65, + 97, 67, 19,140,122,216,175,216, 95, 8,148,152,200, 7, 74, 39,104,183, 69,117,175,150, 68, 11,247,187,162,125, 21,228, 75,213, +209,196,137, 19, 5,192, 88, 48,152,189, 43, 81,162,196,155, 42, 85,170,188,253,233,167,159,222, 65, 69,173,140,152, 44, 59,129, + 22,120,241, 1,210, 52, 61, 32, 41, 57,212,154,207, 84,112, 77,160, 69,144,197,186,179, 47, 96, 37, 73,233,152,205,213,247, 63, +253, 91,215, 42, 31, 85,132,148, 94, 17, 88,253,220,177,220,135,139,103,183, 11, 19,207,121,141,247,152, 71,139, 14,238, 71,166, +177, 59,237,176,168, 34,164,244,138, 32, 75, 2,209,108, 72,102,223,237,114,243, 68, 41,153, 48,212, 37,144,247,152,135,121,131, + 12,228, 29, 74, 12,203,150,202,118,254,252,225,250,242,242,233,122,241,125,177, 83,246,237,158, 34,227,198, 14, 84,218,104,253, +250,245,130, 5,140,224,155,120, 91,160, 64,129,119,142, 64, 22,235, 96, 9,180,102,206,108, 23,237,246,233,249, 9, 95, 60, 90, +149,206,231,206,196,236,109,154,102, 28,251,231,180,159, 60,239, 92,223,120,240,221,227,169,125, 40,217, 26,212,175,156, 98, 91, + 53,229,247, 70,194,221,136,142,248,128, 93,135, 85,105, 8, 95,180, 96,156,126,143, 79,185, 38,219,191,219,181, 64,211,250,105, +126,159, 53,163,251,158, 59,215, 55, 31,218,190,190,215, 6,107,201,214,128,158, 37, 62,181,108,233, 88, 58,174,131,247,127, 91, + 22,216,101,213, 29,157, 56,113, 86,216,100,229, 27, 29, 47, 94,122, 72,115,170, 14,137, 20, 41, 49, 1, 22,164, 93,241,149, 20, + 35,134,235,244,156, 57,211,226,211, 76, 58, 41,115,230,248,195, 98,198, 44, 55, 36,114,228,132, 0,105, 63,217, 42, 56,119,216, +209,216,253,234, 31,127,244,188, 13,169, 13, 65, 1, 65,150,106, 50,193,177,138, 18,119, 74,177,173,237,134, 83, 37, 75,246, 74, + 15,205,184,177, 99,223,231, 88,193,177,157, 18,114,235,131, 11, 85,154,204,112, 97, 13,213,197, 35, 61, 52, 41,201, 34,200,194, +130,237,147, 45,240,198,113, 16, 11,196, 79, 89, 51,103,190, 51, 52,102, 76, 91, 54,101, 38,203,186, 47,104,211,166, 19, 37, 89, +161, 10,135, 11, 0,129,129, 24,219,223,183,174, 90,117,244,155,125,251, 90, 61, 63,119,174,251,168,152, 49,155,232, 41,167, 42, + 25, 4, 56,125,206,186, 83, 83,193,177, 56, 72,203,165,156, 67, 82,172,152,203,196,209,161,101, 9, 79,231,179,133, 69,194, 67, +239, 11, 63,107,233, 17, 94, 61, 15, 93, 4, 75, 52,201, 9,156,147, 32,109,178, 84,240, 66,240,193, 9, 75, 85,209, 80,146,197, +149, 36, 12,166,149, 14, 30, 22,160,165, 2, 46, 76,216, 2,251, 37,101,194, 84,129, 22,165, 18, 90, 64, 11,147,238, 27, 78,182, +176, 33, 82,164, 86,180,243,225,202,131,210, 29,126, 20, 4, 89, 4,130, 84, 39,241,156, 96,129,207, 56,106, 0, 12,206,175, 89, + 55, 30,252, 64, 32, 49, 83,206, 85,144, 69,186, 80,239, 41, 18, 29,218,130,140, 31, 63, 94, 32,125,114, 72, 83, 5, 90, 4, 50, + 0, 89, 39,169,242, 32,216,152, 49, 99,198, 61, 78, 16, 42,216,162, 10, 48,115,230,204, 79,135, 12, 25,162,174,196, 29,246, 21, +238,254, 84, 37,131, 28,120, 8,174, 56,232,240,224,224, 64,144,197, 15,154, 7,219,211, 81, 27,193,168,120, 5,192,227, 39,130, + 83, 72,152,158,240,195,162,237, 11,233,242,151,109, 77,176,202,126, 64, 73, 39, 86,119, 79, 41, 65, 3, 40,166,113,252,114,189, + 64,147,101, 97,253, 73,143,237,196,118, 35,136, 97,157, 97, 20, 79, 94, 58, 4,215,120,215,126, 75,105, 40, 7, 1,180,217, 7, +188,159, 6,207,148, 50, 48, 85,135, 93,206, 7, 2,107,182, 61,118,119,202,128, 1, 3, 4,146,218, 99, 90, 31, 31,108,233,182, + 64,226, 24,188,172, 85, 37, 90, 4,129, 76,144, 54,126,130, 4,115,139, 22,157,175,241, 62,237,177,168, 42,164, 20,139, 0, 75, + 61,120,206,107,188,199, 60, 90,117,163,251, 6,238, 44,164,209, 59,237,177,168, 42,164, 36, 43, 24,104,249, 29,149,215,119,190, +151, 77,139,210, 9,239, 49, 15,243,242,153, 32,215, 15,118, 95, 1,201,228,240,163,123, 90, 4,222,185, 52, 72, 1, 90, 76, 87, +206,175,148,158, 61, 90, 40,223, 42,191, 71, 46,218,160, 90, 14,192,198, 18,120, 17,176,127, 88,239, 34, 60,124,120, 66,172,123, + 87,230,166,170, 94, 41,245, 47, 83, 39,117,220,122,253,242,250,221, 51,167,119,220,115,241,104,155,166, 84, 35,210,102,139, 82, + 45,207, 29, 51,164, 93,115,151,126, 90,126,182, 92, 93, 77, 49,188,188,218, 69,187,233, 85, 48, 65,165,242, 81,127,157, 50,161, +245,246,171, 23, 54,236, 34,216, 90, 56,163,233, 8,241,249,163,195,205,147,157, 39, 13,232,158,229,114,239,159, 11,126,106,219, + 50,201, 6, 45,222,254,147,239, 83, 5, 56, 35, 93,186, 68,176,127, 42,127,105,196,136,140, 84, 23,194,136, 61, 55, 0,150,178, +155, 26,253, 41,210,167, 15, 31, 70,157, 90,176, 96, 44,174, 41,128,122, 68,148, 40, 21, 49, 43, 69,195, 51, 61,113, 45,212, 78, +110,186, 48,192,115,131, 14,212,171,247, 51,109,136, 8, 12, 40,197, 98,223, 36,176,166,148,157, 90, 12, 46,124, 57,246, 83,226, +195,133, 27, 23, 88,169,147, 39,183, 57, 46, 91,211, 84,129, 22, 37, 57,156,227,104, 34,193, 57,141,139,120,154, 12,112, 78, 82, +237, 72, 81, 17, 46,180, 66, 29,214, 52,169, 46,132, 84,245,189, 45,144,197, 49,154,160,142, 99, 96,165, 74,149, 2,138, 71,141, +186, 90,139, 38,109,178,168, 46,180, 5,180,248, 14, 10, 43,178,184,186, 6,180,173, 84,105,130,191,183,119, 55,236,208,180,169, +101,177,197, 79,242, 52, 99,134, 12, 47, 57, 87,176, 76,228, 1, 55, 43, 49,241,156,115, 40,109,126, 99, 69,139,246,238, 75,244, +191,175, 92,178,101, 59,152,180,138, 92,137, 38, 85, 38,114, 2,231, 10, 65, 15,200,162, 68,130, 96, 39, 60, 64,139,146, 23,107, +160,197, 14,174, 7,104,177,156,216,197,167,116, 10,170,187,248,161, 17, 12,169, 64,144,224,138,106, 41, 2, 66, 38, 45,160,133, +137,254, 45, 59, 23, 87,198,180, 1,162, 52,136, 32,133, 52, 72,151, 96,142,106, 9,170,171,168,154,160, 20,142,207,232, 1, 26, + 0,123,199, 9, 96, 8,178,152, 56, 32, 64, 13,247,128, 64,139, 43,137, 92,185,114, 61,109,218,180, 41, 13,123,117, 3, 45,174, + 66, 56,200, 16, 12, 81,186,197,131, 34,101,218,172, 80,138,197,131,109, 68,112,162,209, 70,177,220,220,220,198, 67, 58,181, 27, + 59, 14, 23,195,253,196, 93,214,159,182, 10, 28, 24,152,184,145,129,125, 34, 99,198,140,119, 48,225, 45, 5, 40,220, 13, 96, 50, + 30,117,143,165,167,254,234, 32, 65,186, 52, 48,231, 0, 73, 64, 77,169, 20,213,145,216,221,231, 52,208, 34, 77,208, 9,132,225, +250, 83,168, 48,149,196,115,172,196, 2,105,184,207,126, 65, 85, 47,164, 92,148, 70,209, 53,133,221, 3, 0,170, 60, 6,213, 55, +148,102,177,190,228, 25,121, 73, 80, 77, 48,207,182,230, 68, 14,155,175,151, 32, 98,107, 99,197,151, 24,135, 62,219, 59, 62, 39, +208,162,186,144,146, 44, 51, 64, 86,192,179,190,138, 68, 43, 44, 64,139,125,173, 76,201,204,143,207, 30,106, 36, 7,118, 13, 18, +159,167,103,148,110,117,225,244, 82,105,210,184,182, 2,168, 97,243,168, 44,218, 32,105,230, 6, 6,187,135, 53,208, 26, 60,184, + 94,244,226,133,227,252, 60,113,124,199, 13, 87, 46,110,217, 52,117, 98,199,173,109, 91,100, 26, 67, 53,226,135,231,253, 42,209, + 64,222, 99,211, 56,241,126,112, 82, 90, 52, 78,186,149,206, 77,181, 26, 3,170,241,200,133,242, 70,235, 60,225,247, 54,107, 47, +157, 91,189,121,242,132, 86,219,155,254,144,230,247, 39, 80, 35,142,252,173,220, 40,175,195,211,118, 79, 26,147,127,220,158,141, + 57, 75,210,207,150, 22,189,127,242,125, 0,173, 46,115,178,102,141, 7,208,244,237,227,165, 75, 21,117, 24, 84,136,249, 38,155, + 76, 49,208, 68,217,145,202, 16,108, 13,138, 26,181,208,170,191, 22, 68,166, 33, 81,162, 84,224,125, 60,219, 25,219, 78,227, 88, +215, 79, 5, 6, 71,154, 55,239,242,102,231, 78, 5,104, 81, 85, 72,112, 97, 9,178,212,177,159, 99,170,170,101, 73,227,226,226, + 16,104,169, 52, 45,129, 22,193,150,154, 40, 0, 96, 95,162, 20,159, 64,139, 26, 12, 45,160,165,210,164, 77, 22, 23,122,214, 7, +199, 21,206, 73,156,167, 56,110,115,158,203,144, 48,225,109, 71, 64, 75,165,153, 58,101,202, 7, 92, 8, 91, 30,228, 3, 23,174, + 4,110, 20, 92, 64,218,231,191,114,238,220, 17, 90, 64,203,146,159, 42,208,226,184,199, 49,143,115, 19,129, 38,233,170,227, 31, +235, 31, 55,122,116,135, 2,133,240,246, 77, 91, 88, 36,188, 52,191,240,243,182, 65,150,189, 66, 16,104, 81,146,161,170,225, 84, + 73, 22, 37, 26,150, 0,134, 19, 56, 39, 98, 2, 17, 76,184, 78,171, 14, 85,137,150, 45,160,197, 85,169, 22,208,162, 26,144,229, +225, 7,183,107,215, 46,165,243,178,140, 68,247,148,100,176,243,169,122,113, 74,120, 8, 18,180, 84,135,168,251, 33,126,104,156, +164,255,252,243, 79,174, 56,168, 34, 83, 12,182, 97,172, 46, 80, 77, 9, 84, 97,180, 79, 82, 86, 58,220,221,196,103,180,128, 6, + 58,238, 67, 72, 71,124, 85,144,165,254,162,238,247, 40,150,134,241,238,171,138, 21, 43,190,131,141,148, 2, 56,244,168, 14,233, +203,140, 43, 13,214,149,171, 47, 2, 45,214,147, 32,139,192,144,116,248,225, 48, 17,144,234,104, 35,203,106, 20,129, 11,142, 27, +108, 99,138,143,249,161,193, 53,131, 20, 42, 84,232, 6, 50, 89,239, 18,114,216,159,173,109,212,236, 1, 45, 2, 67, 45,137, 22, + 85,135,144,170,217, 92,217,169, 3, 16,251, 46, 37, 81, 4,203,228, 39,236, 24,104, 19,246, 17,246, 85,221, 28, 20, 52, 58, 64, +218, 61, 85,173,201, 65,135,131, 24, 87,120, 28, 96,233,214,131, 54, 26,216, 21,170, 12,188, 65,174, 40,162,127,225, 15,249,179, +190,238,115,170, 14,105,147, 69,112, 69, 73, 22,127,119,173,113, 13,147,234, 48,136, 1,197,154, 55,200,233,191,123,251, 68,121, +247,246,153, 2,182, 40,217, 90,189,124, 8,190,203, 74, 2,213,187, 2,180,176, 19,154,238, 98,116, 1, 45,244,143,168,185,178, + 70,238, 48,118, 84,251, 21,151, 47,108, 93, 67,176, 69,201,150,207,157,233,217, 21,155, 45, 24,200,115, 55,226,212,113,141, 21, +245, 97,135,150,153,110,208,131,188, 45,226,193, 27, 12,224,224, 53,119, 54, 83,251,223, 71,183, 91,126,233,252,150,149, 4, 91, +149,202, 69,253,229,144,103,150,124,135,247,187, 21,169, 86, 57,214,164,203,231, 86,174,174, 80, 54,250,136, 7,151,179, 37,161, + 83,211,207,218,192,159,153, 56,236,179,154,195,103, 86,154, 81,177, 98,149,160, 19, 80,190,110, 80,172, 88,105,160, 30, 76,171, +190,154, 54, 90, 84, 31,242,127,175,244,233,163,143,136, 22,173, 18, 37, 89,148,104,217, 42,158,170, 62,123,176,108, 89,183,199, +179,103,255,160, 2, 45, 2, 22, 85,146, 69,144, 69, 77,139, 10,178, 56,238,115, 12, 0,208,122,165,135,166, 94,160, 69,141,131, +150,234, 80, 45, 39,141,222, 57,247, 88, 30, 92, 20,171, 32,139,101,167,109, 42,199,168,216, 49, 99,190,215, 83,206, 86,181,107, +143,248,161,110,221,191, 84, 22, 56, 84,144,165,218, 40,210, 92, 6,192, 45,208, 5, 11,140, 33, 49, 99, 54,211, 67, 83, 85, 29, + 82,162,165,210,165,100,139,243, 42,231, 84,110,124,226,216,207,185, 4,170, 67,155,252,252,204,221,234,107, 33,175, 79,117,104, + 89, 27, 78,224, 68,180, 4, 66, 90, 32,139,249,216,129,116, 76,226,222,156,188, 44,109,180, 28, 1, 45,170,105,180,128, 22, 13, +219,233, 59,139, 82, 34,138,145, 41,113,162,216,151, 32,137,215, 8, 56, 8, 60, 40, 70,230,187,177, 58, 9,208, 50,134,199,125, +104,177,134, 40,138,122,126,204,156, 88,185,138,160,196,137,136,155, 43,144,210,165, 75, 43,170, 46, 2, 27, 0, 48, 26,216,195, + 49,177,253,131,110, 45, 0,254,174, 88,131, 44,254,135,234,204, 12, 85,228, 91, 72,144,158, 17, 20, 48, 17,112,232, 5, 90, 44, + 3, 85,132, 76, 48,204, 87,158,229, 71, 65, 53, 28,236,150, 20, 32,200,178, 14, 26, 52, 72, 79, 27,133,168, 4, 36,108, 87, 40, + 5, 36,136,227,166, 2, 26,113, 66,218,101,211,192,212, 81,253, 35, 18,104,225, 61,138, 49, 60, 7, 82, 2,124,213, 46,131,171, + 47,130, 66, 74, 7,161,146, 85,218,141, 19, 46,118,115, 42,124,129, 31, 44,138,252,237, 26,195, 99, 82, 30, 10,192,251,193,122, + 87, 44,251, 18,129, 48,109,241,126,249,229, 23,101, 55, 27,109, 8, 33,205,244, 71,187, 99, 23,249,191,230,248,172,198,240, 52, +124,167, 77, 22,165, 88, 76, 60,119,198, 24,222, 26,188, 12, 29,210,233,230,131,187, 94, 66,176,117,252,224,136, 96, 53, 98,135, +118, 53,165, 86,173, 90,210,160, 65, 3,182,185,195, 13, 37, 57,179, 68,105,153,195, 45,242, 32,254, 18,100,141, 25, 73, 64,180, +117, 57,193, 22, 37, 91, 84, 35,190,120,180, 40, 29, 13,228, 95, 63,157,227, 74,215, 15, 35, 7,127,167, 0,173,174, 63,101,123, +106, 23,104, 5, 57,129,133,235,140, 25,160,181,236,210,185,109,203, 8,182, 10,229,139,214,137,106,196,235,176,217,218,183, 33, + 85,218, 82,197,162, 14,190,116,126,195,194, 34,249,162, 14,240,114,175, 30,219, 30,189,175,165,135,193, 70,171,204,200,216,177, +203,140,140, 31, 63, 3, 0, 84, 46,181,220,195, 98,196,200, 72, 41,214,160,104,209, 10,192, 0,222, 77, 85, 27, 98, 7, 95,134, +193, 9, 18,228, 86, 12,229,163, 68,169, 97,171,158,131,105, 12, 15,103,164,239, 31, 61,234,119,182, 93,187, 22, 4, 6, 52,122, +231,194,145,130, 0, 21,100,169,102, 34, 4, 89, 28,247,185,184, 76,147, 50,165, 77,137,166, 53, 77,189, 64,139,210,119,172,172, +184,203, 60,212, 17,138,166, 21,208, 34,120, 97,217, 40, 12, 32,200, 90,185,114,165,178,144,103, 2,208,162,155, 32, 77,154,180, +251, 74,157, 34,197, 35,186, 22,226,252,196,121,141,139,108,210, 84,231, 39,154,251, 84, 40, 95, 62, 0,187, 63,108,206, 73,182, +248,169, 74,180, 28, 1, 45,106,118, 98, 71,143,238, 80, 66,252,181,244,211,127, 76, 57, 9,180, 8, 80,136,144,185, 82, 80,165, + 68, 68,206, 68,228, 84, 83, 81,146,197, 73,142,147, 29, 39, 39, 78,166, 26, 21,184,207,206, 79, 26,252, 56, 44, 1,151,165, 68, +171,127,255,254,193, 96, 1,244,238,107,208, 12,118,239,192,213, 12, 59, 27, 65,129, 42,201, 82,203,200,242,241,125,116, 5, 1, +122, 90,187,155, 18, 34,159, 15, 85, 91,252, 96,233,118,128, 54, 62, 52,250,166,193,125,159, 62,125, 20,213, 33,119, 70, 18,188, + 48, 47,104, 38,116, 84, 78, 12,248,143, 96, 72,125, 14,171,151,211,176, 35, 57,135,103, 47,193,160,252, 26, 0,192,109,128,161, + 7,152,176, 3,160,214,123, 2, 85,220,147,242,229,203,251, 84,168, 80,225, 37,164, 47, 54,109, 1, 44,223, 67, 39,164,170, 77, + 22,121, 75,144,101,105,147,197, 50,170, 54, 2,252,213,209, 70, 33,170, 1,163,240, 43,148, 12, 17,192,178,205,104, 15,245, 57, +129, 22,193,162,150, 68, 43,168,128, 5,104,176,206,114, 81,162,199,118,231,238, 80, 74,220,184,250,162, 1, 63, 85,133,148, 64, + 53,107,214,140,182, 89, 84,245, 57,116,239, 0, 48,124,215,114,119,169, 58,232,176,191,179,222,116,233, 65,192, 74,233, 24,236, +180, 4,174, 57,216,246, 54, 7,221,127,204,135,172,163, 32, 97,114,239, 0,199,165, 74, 40, 30, 7,225,122,248,234,136,116,239, +160,250,251, 82,193,203,229, 11,219, 87, 13, 29,210,241,102,195, 31,178,250,159, 62,208, 64,238, 92, 26, 44, 79,239,207,147,121, +127,182,151, 98,197,138,209,141, 8,141,150,109,238, 54, 84,217, 66,144,245,201,124, 97,121,174,172,166, 63, 85,144,197, 95,130, + 46,170, 17,105,179,117,243,230,204, 4,222, 55,254, 72, 78,215, 15,139,231, 53, 40, 48,168,255, 55, 10,208,234,217, 37, 63, 36, + 11,182,119, 95,170,101,157, 58,190,169, 2,178, 8,182, 40,217, 90,133,157,138, 80, 55, 70,165,129,124,163,250,185,255,164,235, + 7,250,217,202,157, 53,242,104, 24,206, 43,225,122, 80, 54, 93, 59, 58,117, 52,237, 23,207, 2, 23, 13,241,104,167, 53,191,108, +217,152,195, 99,197, 42,170, 74,181, 88, 16,170, 10,103,194, 22, 75, 45, 20,236, 13, 98, 65, 45, 88, 2,190,181, 98, 2,100,213, + 1,216,202, 98, 7,108,252,229,222, 65,100,224,227,197,139, 59, 60,152, 60,185,126,234, 84,169, 94,114,238,177, 4, 89,156, 87, + 84,144,197, 69, 24,199, 65,228,179, 57,134, 2,108,132,160, 25, 47,102,204,135,252,222, 57,215,217, 83, 29,114, 44,229, 98, 11, +141, 67,103,205,182, 64, 81, 8,154,116,225,192,133, 41, 15,150,133, 26, 6,210,231,162,141, 32,139,246,132,180,113,229,152,146, + 52,113,226,163,122,104,178,238,139, 71,141,106,147,194,197,229, 29, 23,255,164,105, 9,178, 56, 63,113,195, 14, 23,218, 9, 17, +201, 68, 47,205,143, 65, 54, 90,142,128, 22,237,127, 99,198,136,161, 57, 39,125,241, 78,247,207,122,161,165, 84, 75,187,100,156, +192, 9,180,244,128, 44,117,114,178, 49,137, 91,111,215,109, 14, 9,201, 59,110, 23, 37, 80, 35,120,163,241, 34, 1, 16,129, 22, + 37, 16,220,234, 79, 9, 13, 60, 60,115, 18, 35,202,183,142,187,102,211, 97, 41, 36, 28,126, 84, 23, 82, 84,171, 26,191,243, 29, +180, 29,227,193,247,192,166,136,118, 84,122, 29,150, 86,134,122,240, 45, 39, 88,138, 79,105,155,179, 98,197, 10, 69,125, 68, 67, +120,170, 12,153,192, 39,150,177,178, 13,142, 90,151,179, 16, 28,176, 94, 4,168,122, 77, 67,114,242, 64,221,217, 1,209,108, 32, + 12,119, 95,193, 3,189, 98, 15, 0,135,158,175, 49, 73,232,114, 88,202,118,226, 71, 76, 94,178,189,248,129,241, 96,221, 9,188, +200, 79, 30, 78,180, 81,136,170,192, 73,231, 21,174, 20,105,180, 78,219, 52,242, 2,246, 89, 90, 18,173, 80,109,132,190,241,216, + 82,132,110, 75,117, 72,208, 26,100,163, 69, 55, 12,214,135,173,118,207,143,250,159,132,106,247, 53, 7, 46,242,148, 42,100, 14, + 54,180,113, 35, 24, 2,112,245,133,159,179, 51, 32,166,233,176, 20,237,237,105,203,145, 46, 37,163,172, 59, 55, 62, 16,200,114, +199, 37,193, 55, 7, 73,208,182,222,109,250,213, 57,153,252, 90, 28,150,218, 3, 47,104,219, 98, 5,243,166,120,236,177,174,102, + 32,119, 35, 46,158, 85, 89, 96, 4, 79, 96,109, 15,100, 5,183,145, 10,180,166,142,107,170, 72,178, 84,144, 69, 53, 34,237,183, + 6, 15, 46, 23,149,187, 17, 87,173, 26, 28,157,238, 31, 70,143,254, 54, 65,183,142,185,253, 25,162,167, 91,199, 60, 31, 25,136, + 58,168,163,134,104,119,181,172,167,143,205, 93, 70,176, 69,112,168,130, 82, 6,154, 38,168,250, 4,215, 15,244,179, 69,167,166, +170,223,173,250,216,165, 72, 3,122, 91, 52,181, 71,109, 93, 57, 62,123,255,132, 10,176, 12,220, 53,148,153, 92,185,114, 12, 24, +194,151, 36,128,162, 13,150, 90, 58, 74,179,144,210, 16,100, 17,108,241, 62,129, 22, 22,150,150,246,110, 33,202, 73,231,162, 39, +166, 78,237, 3,196,242,235,179,149, 43,219,210,133,131, 58, 63,113,124, 34,200, 34,232,224,194, 88, 5, 89, 28,111,172,230, 36, +187, 52,179,167, 77,123,140,106, 65,106,102,248,189,115,188, 35,224,162,201, 8,199,126,106, 87, 40, 37,175, 92,185, 50,181, 44, +140, 92,162, 30,118,105, 54, 42, 87,110, 9, 93, 56,112,145, 79, 73, 59,129, 17, 65, 22, 23,132, 4, 89,212, 52,112,174, 43, 82, +184,176, 63,163, 26,232,161,201,186, 63,132,163,214, 30,245,235,255, 6,159,132, 1, 92, 96,178,172,156, 75, 56, 62,145, 46,199, + 80,150, 23,115,200, 71,208, 84,109,222, 28,242,147, 52, 51,166, 79,239, 80,117, 72,219, 84,208,180, 20,166,124,142,190,164,171, + 19,255, 67, 51, 57,118, 88,106,171,208,156,192,217,105, 41,154,100,135,102,162,154,139,157,152,147, 17,165, 88,236,148,150, 59, + 42,116, 0, 45,190,138,198,158,211,224,168,242, 35,119,219,241, 3,161, 74,138, 82, 34, 54, 36, 1, 23,222,205, 14, 50, 45, 40, +175,158, 9,151,121,202,211, 25, 41, 38, 88, 51, 87, 57,236,216, 76,236,136,144,110, 4, 4, 73,178,236, 25, 47,219,235, 48, 85, + 40,173,234,216,177,163,153, 82, 12,118, 96, 78,176,116,128,216,176, 97, 67,210,116, 54,172, 79, 36, 60,211, 18,245,123, 8,195, +239, 0,130, 22,130, 3,168,162,188, 9, 10, 32, 37, 11, 64, 29, 30, 98,183, 92, 75,212, 71, 87, 8, 30,122,227, 87,109,208, 88, + 95, 2, 12,213,191, 20,219,137, 42,174, 48,180, 81, 48,207,225,188,244, 58, 7, 8, 58, 23,133,161,188, 2,100,130,194,239, 56, +234,235,161,248, 9,181,232, 38,170,160,213,131,146, 70, 26, 89,210,102,142, 6,246, 4, 71,148, 26,214,175, 95,159,147,228, 38, + 27,196, 29,125,212, 12,193, 51, 19,233, 4,163, 9, 64,122,200,248,156,167, 96,248, 62, 15,116,116,135,224,129, 33,252,183,120, +255, 27, 85, 34,168,150,149,252,101,217,217, 94,148,106,114, 80,163,235, 17,128,208, 87,160,111,237, 25,255,115, 12, 62,159,149, +230,215, 18,130,199, 17,120, 65, 59,196,130,131,223,225,185,178, 39, 59,159, 44, 89,156,109,248,239,104,103,100, 40,160,117,230, +232,156,229, 4, 91,148,108, 81,141,104, 47,136,116, 80, 0,234, 1,157, 90,185,249, 52,169,155,228, 23,123,147,163,117, 76, 72, +107, 47,250, 12, 56,173,130, 43,122,144,103, 76, 68,254,167, 75, 8,123, 52, 35,104,114,249,172,125, 41,168,140,145,232,230, 1, +182, 85, 69,118, 15, 24, 16,149,170, 66, 26,188, 35,125,195,112, 59,240, 2, 95, 5,106,197, 60, 4, 95, 84, 41,194,174,171, 81, + 16, 16,179, 28,243,172,203,169,132,224,217, 59,120,112,159, 79,239,223, 15,160,159, 44,206, 77,150, 32,139, 99,138, 37,200,210, + 2, 90, 28, 99, 85,154,190,207,159,255,214,184,118,237,181,121,243,228,241,163, 20,138, 99, 39, 77, 80,184, 73,135, 54, 84, 4, + 92,137,226,199,247,197, 51, 93,145,130,165,114, 56,183, 91,206, 15,126,126,191,184,102,202,116, 31, 0, 77,217,148, 67,186, 28, +235,184,113,139,115, 29,165,247, 48, 19, 9,196,120,197, 88,178,186,235, 78, 63, 89,111,247,239,111,217,239,135, 31,134,194,240, +253, 29, 84,143,129,180, 33, 85, 37, 89, 20, 0,112,129, 13,173, 20,119, 8,166, 15,106, 19,135,252, 36,205,236,110,110,207, 84, +223,131, 92,152, 83,112, 65, 96, 72, 0, 71,233, 61,105,226, 27,179,148,230,125,142,190, 20, 65,221,252,111, 33,227, 60,208, 98, +128,104, 78,226, 76,116,114,201,196, 29,107,106,162, 61, 22, 19,193,149,154, 0, 32,156, 9, 42,205,129,112, 21, 84,100,129,156, +188,169,226,193, 78,174, 64, 92, 91,169,119,144,180,193,202,248,180,191,162,177, 59,119, 22, 50,241, 60,200, 38,203,145,186,208, + 81,135, 73, 16, 68,243, 32, 58,217, 59, 38,208, 60, 24, 68,211, 81, 0,108, 71, 52, 99, 3, 8, 76, 4,136,121,138,143, 46, 16, + 62,185, 30,128,175, 79,177, 90,112, 58,168, 52,140,240,149,118,250, 76,109,100,130, 19, 83,119,130, 75,170, 99,169,166,163,212, + 17,128,203, 93,163, 27,219,170,123, 50, 0,180, 11,176, 27,123, 75, 85, 36, 7, 73, 14,138, 92, 61, 18, 12, 99, 64, 11, 44, 91, +182,236,107, 0,209, 11,160,157,204, 73,160, 21,214,175, 42, 84, 57, 1,182,202, 65, 53,250, 24,126,217,252,184, 66, 38,232, 82, +253,244, 80, 82, 74,105, 36, 60,143,251, 6, 5,153, 46,247,119,149, 51,172, 21,182, 53,137,127, 45, 65,165,181,192,139, 19, 60, + 9, 5,180,168, 62, 84, 19,165, 92,142,128,150,229, 61,187, 64, 11, 42, 85, 69,181,106,153,172,212,172,170, 83, 83,134,235, 33, +200,226,127,171, 58,124,142,137,236, 75,209,140, 4, 96,245, 45, 64, 84,171,225,113,227,230,164,177, 59,165, 87,248, 85,130,198, +171, 82,172,161,145, 35,215,239, 21, 37, 10, 55, 0,164,214, 81,119, 37, 8,242,196,116,233,250,167, 79,147,230, 13,129, 21, 5, + 0, 84, 33, 82,115,193, 5,166,181,234,223,145, 68, 75, 5,133, 42,205, 27, 27, 55,246, 60,187,123,247, 47,223, 85,170,180, 19, + 54,184, 31,184, 8, 36, 24, 74,159, 54,237, 7, 72, 7,230, 35,191,173, 57,196, 22, 63,131,203,185,126,252,248,161, 89, 50,103, +190,143,141, 83,102, 53,156, 29, 77, 16,168,134, 44, 89,162, 4,189,187,123, 57, 91,119,150,243,249,197,139, 61,253,159, 61,235, +177,121,229,202,161,216,137,248,180, 84,201,146,102, 46,178, 41,201,162, 42,146,118,164, 88,176, 82,250,164,110,214,112, 88, 78, +210, 28,220,187,247,226,194,144,174,209,221, 14,199, 62,106, 68, 8,188, 8,226, 96,155,250, 30,115,205, 99, 8, 1,106,218,235, +243, 78,124,127,255,230,172,206,169, 14, 35,136, 19,122, 62,234,194,120, 23, 37, 24, 76, 60,215, 58,244,208,212,162, 97,125,255, +239,162,153, 30,157,119, 59,140,222, 61, 80, 32,117,229,225,168,236,127, 71, 57,163,226,227,155, 5,207,238, 23, 1,148, 46,230, +206,157,123, 22, 10, 24,202,215,141,142, 65,146, 89,248,209,151,193, 0,208, 7,106,186,173,168,251, 93, 72,160,238, 2,212,111, + 5,128,237,195,123, 22, 3,195,223,217, 70, 44,103, 85,148,113, 45, 22, 19,231, 49, 88, 63, 0,144,125,128,114,158, 7, 64,166, + 87,104, 74, 29,236,121, 5,255, 59,218,200,217,254,206,252,193,229,204,149,197, 84,199, 17, 32,176, 36,110, 97,207,165,128, 8, + 62,235,228,192, 27,153,126,178,130,124,101,105,186, 70,176, 44,167,245,187,245,216,136,217, 97, 76,112,221, 85, 99,120,130, 43, + 53,105, 73,180,244, 0, 45,189, 13,146, 11, 1,168, 33, 69,251,133, 97,123,108, 60,243,213,245, 37,235, 58, 0, 88,165,128, 51, +210,154, 80,253,245,162, 67, 82, 72,144,218,224,188,175,149, 77,150, 46,233,189, 74,155,118, 95,169,224,241, 61, 77,242,228,175, +145,124,211,186,184,248,166, 75,145,226, 53, 13,223,105,147,229, 96,241,111,151,159,164, 57, 24, 90, 17,168, 60, 91,162,124,253, + 58, 68,141, 58, 34, 93,164, 72,219,177,226, 91, 3,195,206,236, 14,218, 83,147, 38,118, 92,254, 88, 44, 70,140,141,153, 48,222, +197,137, 21,235, 61,210,187, 20, 16, 74, 64, 16,208, 25,116,157,174, 59,203,201,157,152,116,123,193,196, 50,231, 54,153, 6,194, + 38,235, 6,213,133, 88, 4,190, 39,200,162,132, 94,207,183,105, 89,247, 22, 81,163,142,203, 28, 61,250,241,180,137, 19,223,114, + 73,146,228, 41,104, 62, 64, 57, 15,131,206, 31, 72, 89,116,142,243,122,187,191,145, 47,130, 56,240,213, 15, 20,225,224,131, 81, +247,112, 48,239,223, 56,233,132,131, 29, 70, 95, 10, 7,243,140,190, 20,130, 3,127, 91, 95, 98, 24, 30, 75,227,120,141, 38,253, +219,202,233,100, 87,251,167,149,147, 54, 89, 92,180, 91, 47, 4,255,105,229,116,146,205, 95,101,118,231,124,106,133,163,138, 95, + 75,227, 26,229, 12, 71, 35, 27, 19,217, 63, 99, 34,115,178, 9,141, 62,239, 36,195, 12, 96, 96,151, 3, 70, 95, 50,250, 82,196, +114,224,223, 65, 45, 4,208,226, 71, 98, 43, 57, 83, 85,123, 52, 28, 93,215,162,111,208,180,221, 46, 97,109, 47,131,159, 6, 63, +245,246, 1,227,219,180,207, 1,189, 60,180,204,103,240,211,224,167, 45, 14,252,151,251,146,202,143,176,206,103, 90,223,212,223, +113,223,121,135,165, 17, 84, 74, 99,165, 19, 65,140, 12, 34, 99,240,211,224,103, 68,113,192,232, 75, 17,197,201,191,232, 24,252, + 52,248, 25, 81, 28,248, 47,247,165,136,226,225,127,138,206,215,220, 97, 82,160,165,152,244, 28,182,242,126,205,117,215, 83,103, + 71,121,254,109,117,119,166, 47,124,137,186,167, 1,243,153,244, 30,204,155,202, 42,243,151, 40,167,222,242,253,151,250,146, 51, + 60, 49,218,200, 25,110,105,231, 53,248,169,205, 35,103,114,124, 14,126, 58,243,126, 35,111, 16, 7,108, 53,132,222, 73,203, 94, + 62, 61,141,171,247, 29,106, 67, 89,211, 28, 21, 41,146,233, 19, 19, 50, 32, 74,132,195,195, 94, 94, 61,229,180, 38,156, 26, 46, + 50,186,194,169,235, 18,184,123,224,142, 20, 23, 39, 39,199,172,112,143, 48,153, 78, 52,153,120,142,231,179,106,148, 95,111, 57, +185, 59,166, 61,220, 90,236,225, 46, 60,236,110,217,131,255, 63, 33, 57,181,107,198,162, 44,220,201,195,240, 53,195,144,242,233, +248, 98,130,203,233,146,187,214,202,228,185,107,157, 65, 58,151, 52, 79,141,172,252,229,127, 94,215, 65,199, 50,139,158,186, 59, +211, 23, 72, 91, 15, 77, 39,139, 25,130,166,179,229,153,128, 6, 10,180,209,151, 63,119, 57,157,173,163,189,252, 70, 57, 35,138, +147,127,209, 49,248,105,240, 51,162, 56,240, 57,250, 82, 68,149,237,235,165,131,237,238, 63, 96,146,221,137,180,131,231, 58,106, + 18, 86, 0,227,104, 50,209,106, 92,203,103,199,233, 40,163,245,224,147,130,147,146,234,172, 18,231,129,216,218, 63, 5,117, 30, +101,157,120,157,247, 45,242, 18,152,169, 82, 48,173,114, 90, 23, 45, 5, 66,197,172,130,111, 24,119,132,212,113,135, 35, 62,119, + 4,116, 94,129, 76,150,146, 8,187, 52,177, 5,183,113,209, 98, 37,189,246, 30, 56,122,245,202,181,219, 15, 47, 92,190,121,123, +211,182, 93,199,243,228,205,119,140,247, 28,240,193,154,166, 2,168,176, 53,120, 15,182, 8,223,231, 47,254,119,128,255,148,141, +136,117,117, 27,206, 75,189, 17, 95,236,229,222,189,123, 31,180,110,221,250, 90,164, 72,145,232,150,195,122,155,190, 53, 77, 91, + 18,152,129,112, 86,187, 13, 33, 51, 60,224,222, 98,132, 85,249,108,229, 15,166, 73, 80,245,228,149, 89,152,112,174,252, 6,157, +159,209,217,222,106, 54,173, 54, 10,213, 23, 0, 52, 45,221,112,124,105, 73,102,168,242,160, 34,106,236,198,194, 56,159, 26,148, +120,206, 35,101,172,152, 49, 35,170,127,234, 97,173, 22, 63,245,208,176,206, 99,208, 12, 11,215,236, 63, 99,240,211,224,103, 68, +113,224,115,244,165,136, 42,219,223, 65,167, 96,208, 75, 57,103,211, 94,203, 90,139,160,175, 76, 12, 81, 2,231,112, 94, 76, 56, +231, 4,172,117, 88, 54, 68,168, 73, 2,206, 74,119, 84,175, 94,221,221, 50,241,154, 3,240,194,247, 57,106, 92,229, 29,102,179, +191,130,125, 72, 7,161,109,214, 2, 32,117, 77,147, 38, 77, 98, 7,133,181, 91,206,200,145, 35, 5,110,218,180,105, 7,194, 49, +184, 91, 39, 94,231,125,103,128, 86, 75,147, 41,102,195,152, 49,203, 53, 7,248,105, 18, 45, 90, 39,166, 22,177, 98, 53,202,158, + 48,225,132,251,119,239,110, 65, 96,100,119,196,214,115, 71, 88, 5,119,208,223, 4, 9, 87, 39,139,114,219,171,123,182,226, 37, + 74,157,120,253,198,247,253,189,219,119, 95,252,214,117,192,142,158, 61, 6,175,159, 62,111,213,150,131,199,206, 30,201,145, 35, +247, 17,208,208, 12, 71,130, 60, 4, 76, 27, 16, 98,230, 38,130,158, 62, 64,144,238,231,240, 10,124, 27,206,246, 30,194,105,233, + 27, 4, 43, 13, 24, 48, 96,128,153,158,242,225,180,211, 12,239,198, 1,240,144,127, 22,207,208, 91,178,229, 97, 89,206, 96,224, + 27, 57,114,228,241,136, 79, 24,151, 9, 0,110,184, 10,180, 32,121, 27,171, 94,103, 30, 59,210,196,208, 18,173, 60,181,222, 41, + 0, 11,191,150, 18, 45,244,205,161,244,129,101, 39, 89, 6,129,214, 26, 40, 66,244, 89,244, 83,169, 81,163,198,113,244,167, 62, + 0,158,127,106,149,211, 78,127,203, 6, 7,179,119,224, 67, 44, 68, 24,163,228,249,234,148,204, 81,166,249,160,164,185,106,149, +179,241,156, 90,206, 16,229, 65,223, 99, 20,133,254, 65,249,103,194,161,172, 23, 19,254, 35,164, 28,246,210, 39, 72, 80, 15, 64, + 43,216, 27,127,144, 84, 43,172, 11, 1,173,111, 93,235,219,212,243,188,173, 60, 90,109, 20, 22,186, 6,205,176,112,205,254, 51, + 6, 63, 13,126, 70, 44, 7,190, 78,106,234, 46, 67,235, 95,231,106,131,137,235, 48, 65, 22, 66,144, 16,104,209,137,153,214, 97, + 13, 96,130, 65,137, 61, 0,163, 1, 94,180, 6,115, 78, 68,129, 42,208, 82,223, 1, 47,223,238,101,202,148,225,196, 91,220, 78, +129,109, 73,222, 2,249, 60,164, 45,151, 44, 36, 89, 43, 8,182,240,127,133,122,141,247,153,143,239, 5,109, 75, 53, 99,168,193, +167, 30,194,130, 52,141, 17,163,189,231,236,217,173,125,159, 60,105,143, 25,176, 51,211,173,139, 23,187,252,212,178,229,113,120, + 37, 62,123,245,236,217,221,136,171,231,142,112, 10,238, 0, 57,238, 80, 33,210, 35,177,122,216, 28,208,160, 38,156,177,123,239, +161,203,247,110,223,123,126,245,204,249, 71,131, 59,246,222, 52,164,223,136, 53,191,141,152,186,112,209,138,173,171, 22, 46, 95, +187,145,121,116,212,189, 43,226,122, 93, 71,220,192, 0,132,134, 48, 35, 28,141,185,113,227,198,102,120, 5, 54,187,187,187,191, + 71,104, 7,243,204,153, 51,205,136,249,104,238,212,169,147,185, 78,157, 58,102,120,122,191,129, 56, 93,246, 34, 2, 88, 3,131, + 64, 56,123,244, 68, 32,109, 15,196,178,244,168, 88,177,162,199,183,223,126,235, 81,171, 86, 45, 15, 72,243, 60, 16, 7,210,211, + 25,224,170, 74,182,248,107, 89, 55, 2, 44,132,139,122, 4, 32,247, 8,222,220, 31,193, 19,253, 35,132,147, 80, 18,239,105,241, +211,138, 79,163,170, 87,175, 22, 72,144,133,128,213, 47,224, 37,222, 11,193,198,207,186,185,101, 9, 11,128,201,134, 88,105,207, +232,189, 26, 81, 16,158, 88,190, 39,239,183,173,135,189,124,237,251,186,215,208, 63, 86, 38,207, 89, 59,175, 85, 25,172,129, 43, +251, 38, 99, 57, 62, 70,120, 41, 47,244,197, 90,200, 63,247,250,245,235, 94, 76, 56,159, 3,105,107,114,120,218,223,131, 54,242, +142, 28, 41,146,178,232,208,234,159, 90, 31,179,142,251,198,132,171,131, 73, 78,100, 49,248,233, 4,179,116,100, 53,248,169,131, + 73, 78,100,249, 28,252,116,226,245,255,184,172,214,146,172,144,126,180, 48,137,138,154, 28, 21, 29, 3,250, 58,132, 75,241,194, + 68,204,193,125,157,179,213,132,180, 98, 26, 7,124, 78,166, 8,237,114,189,124,249,242,238,182, 18,239,169,224,133,207, 56,249, +158,209,124, 7, 19,202,120,237,167,159,126,114,135,116,198, 29,129,171,169,138, 91,139, 64,156,170,170,197, 33, 89,170, 5, 9, +250, 8,168,212,140, 60, 15, 2, 90, 33,174, 49, 31,243, 59, 34, 88, 23, 94,117,123,230,200,241,147,223,179,103,237,223,223,191, +223,230,222,234,213, 13,111, 78,157, 90,215,227,183,223,154, 55,172, 82,101,245, 5,136,176, 16, 83,226,236,198,249,243,207,205, +153, 54,109, 23, 2, 22,187,247,234,213,107, 19,188,252,182,209,170, 63, 64,212,129, 11,151,110,220,251,165, 75,255,109, 99,122, +252,186,229,143, 81,147,221,231,204, 90,178, 97,222, 82,247, 21, 75,215,120, 44, 58,122,242, 2,129,214, 1, 45, 58,240,206,126, + 2,225, 23, 30, 1, 8,153, 17, 18,199,140, 80, 17,102, 76,230,102,134,143,128, 4, 43, 0,113, 40,205,136,241,103, 46, 82,164, +136, 25,128,201, 12,126,154, 1,200, 94,131,246, 27, 59,180, 21,224,171, 34, 18,182, 41,226, 80,122, 66, 98,231,113,247,238, 93, +143, 83,167, 78,121, 32,216,183, 7, 2, 98, 43, 9, 18, 51, 71, 64, 43,212, 43, 28, 1, 45,132,230,120,132,246,186, 98, 67,170, +101, 41,209,210, 98,137, 9,146,208, 60, 8,242,125, 22,146,188,179,136,245,229, 5,201,158, 23,226,149,157,173, 81,163,186, 61, +160, 21, 76, 19,239,110,143,126,241,144, 9, 30,240, 71, 48,176, 54,131,125,243, 80,129,150, 42,201,114,201, 93,179,251,230,157, +135,143, 62,122,226,243,180,112,213, 14,191, 39,204, 87, 43,161,189,194,193, 62,206, 21, 65,212, 55,157, 61,123,214,235,193,131, + 7, 94,136,195,233, 5, 73,155, 23, 64,171,146, 16, 51,211, 11,224,213, 11,223,180, 34,225, 2,224, 58, 6,169, 97, 30,205,202, + 26, 25, 12, 14, 24, 28, 48, 56,240, 55,114, 64, 47, 22,249, 27,139, 24,190, 87,179,130, 90, 20, 48, 81,204,130,132, 0, 88,195, +139, 64,139,161, 88,156, 62, 0, 28,126,131,202,105, 7,130,243,186,103,204,152,209,218, 54,199,196,107,188,199, 60,204,235,244, + 11,254,122, 64,181,157,137,130, 16, 42, 5, 17,252,119, 46,130, 55,187,175, 89,179,134,210,168,222,122,104,218, 3, 85,182,128, +150,245, 53,107,250, 8, 96, 22,155,146, 44,130,172, 23,199,143, 55, 29,215,160, 65,199, 44, 25, 50, 92,206,128,104,233, 69,139, + 20,121,217,187, 71,143,123, 55,207,157, 59,121,253,226,197,147, 71, 15, 30, 60, 51, 17,147,250,208, 33, 67,182, 98,146,103,148, +248, 36, 90,229,133, 45,213,230,115, 23,175, 95, 31, 61,246,207, 77,183,174,223,186,179, 98,241,154,173, 91,119,236,219,242,196, +231,229, 29,207,131,167,214, 28, 61,113,110, 53,243,104,209,129, 74,203, 23, 82, 52, 95, 74,170,240,107, 70,232, 29, 51, 38,112, + 51,164,129,230, 82,165, 74,249, 55,106,212,200,220,181,107, 87, 51,164, 81,102, 76,222,230, 98,197,138,153,161, 58,188, 6, 53, +224, 25,123,180,161, 98,155,171,130,107,196,118,188,213,178,101, 75,143,230,205,155,123, 32,134,152, 7,164, 47, 30,176,251,242, + 64,172, 71, 15, 72,206, 60, 64,223, 3,113, 6,111, 5, 1,101,205,141, 8,142,128, 22, 84,176,214,210, 43,173,234, 91,223,143, + 12,160,212, 28, 11,129,163,115,230,204,241, 66,192,107,175, 63,254,248,195, 11, 0,216, 11,177,196,188, 16,200,245, 5, 37, 93, +142, 54, 76, 48,120, 56,236,237, 4,101, 17,240,202, 23,182,109, 74,108, 54, 30,232,231,138, 68, 75,149,100,245, 28, 60,125,165, +107,241, 38, 35,111,220,121,112,127,251,190, 19, 94,201,114,215,178, 12, 46, 28,170,236,148, 88, 81,205, 78, 9, 22, 2,214,122, + 65,122,231,197,111,147,255,175, 92,185,226, 5,224,170,128,172, 97,195,134,241, 91,173,225,108,229,141,252, 6, 7, 12, 14, 24, + 28,248, 59, 56,160, 7,139,252, 29,229,210,241, 78, 85,162,101, 63,222,161,158,202, 69, 4,208,226, 4, 81,169, 82,165,245, 4, + 39,136,136,238, 78,137,129, 90, 1,158,243, 26,239, 49, 15,243,234,168,156,102, 22,128,173,236, 42,221,130, 5, 11, 46,212,124, + 0, 25, 34, 18,104, 53,141, 25,179,180,231,159,127,182, 54, 63,122,212,118,116,253,250,157,146, 37, 77,234,135,168,232, 1, 8, +130,106, 70,224, 78,243,209, 35, 71, 2,218,181,105,243,220,115,203, 22,175, 25,147, 39,123,149, 45, 80,224, 72,214,228,201, 23, +163, 24, 25,245,148, 21, 6,218, 3, 86,175,219,124,250,240,241,115,167,230, 45,217,176,206,247,237,251,215,254,254, 1,111,206, + 93,190,177,251,234,205,251,187,254,156, 61,111, 19,243,104,209,130, 26,244, 44,212,172, 15,160,194, 51, 83,122, 5,201, 8, 1, +150, 25, 18, 29, 51,164,140,175, 9,186,160,238, 83,174, 21, 42, 84,200,140,137,222, 12, 16,187, 31,116, 17,210,204,254,129,119, +103, 0,208,203,170,218, 97,161,157,115, 67,229,165, 72,177,186,116,233,226,193,255,234, 61,254, 50, 63,168,105,186, 47,112, 4, +180,176,169, 32,204, 64, 11,253, 37,125,230,204,153, 23,206,154, 53,211, 11, 18, 56, 47, 0,127, 69, 58, 4,155, 53,175, 37, 75, +150, 40,231,160, 79, 0,195,141, 0,118, 93,128, 0,104,121, 19,104, 81,138, 53,127,254,124,193, 70, 2, 37,125,250,244, 73, 16, + 59, 82, 1, 90,201,242,212,252,193,125,231,161, 35, 15,189,159, 61, 73,145,191,238,192,105,243,215,123,240, 60,121,158,154, 29, +181,218, 11, 64,208, 13, 64,112, 37,108,230,188, 32,113,244,154, 52,105,146, 2,176,176, 72,241, 66,127,247, 2,112, 61,150, 33, + 67,134,159,181,232, 24,247, 13, 14, 24, 28, 48, 56,240, 79,225,128, 30, 44,242, 79, 41,171, 85, 57,180,109,179,244, 84, 46, 34, +128, 22, 11,134,137,181, 29, 36, 2,238,187,118,237,114,135, 10,101,130, 90, 88,158,243, 26,239, 49, 79, 68, 49, 19,147, 77, 6, + 72, 81, 20, 0, 7,144,176, 74, 15, 93, 11,160, 21,108,143, 69,219, 44,107, 27, 45,139,107,118,221, 64, 52,143, 27,183,193,139, +187,119,219,123,111,222,220, 48,115,186,116,215,183,123,120, 4,124,248,240,193,252,206,207,207, 12,155, 55,179,207,179,103,230, + 85,176,139,106,222,168,209,237, 38,213,171, 47, 56,176,114,101,171,102,113,227,194,164, 75,247, 17, 55,153, 75, 10,207,243,151, +174, 93, 63,126,234,226,190, 85,107,183,236,217,179,239,208,177, 71,143,159, 29, 59,119,241,202, 97, 24, 94,239, 5,165,120, 58, +168, 13,106,218,180,233, 25,128, 32, 69, 45, 88,162, 68, 9, 5,100,209, 70, 11,170, 51, 26,194,251, 67,117,230,255,195, 15, 63, +248, 3,116,221,133,250,234, 48,118, 29, 30, 7,221, 24, 58,104, 7,103, 65,112,234,158,136, 8,239, 1,208,225,177,117,235, 86, + 15,254,119,230,121, 53,175, 35,160,245,252,249,115,107,213,161, 46,149, 33,193,126,185,114,229, 14, 31, 61,122,212, 11, 42, 78, + 69, 53,119,243,230, 13,175,115,231,206,122, 65, 5,173, 72,140, 0,158, 20,169, 22,218,190,161,163,114,131,239,222,144, 50, 9, +158, 19,240, 80,249, 5,192, 86, 36, 92,120, 86, 1, 90, 25, 50,148,139, 89,185,113,223, 25,175,223,248,189,173,213,114,192,220, +166,157,135, 45,228,121,233, 90, 93,161,138, 30,172, 39,232,178, 9,224, 52, 58,232,149,132,180, 80,145, 98, 65, 58,232,133,122, +100,193,247, 20, 31,215, 99, 3, 56,182,163, 36, 23, 18,226,176,237,130, 9, 75,227, 24,207, 24, 28, 48, 56, 96,112, 32, 12, 28, +208,131, 69,194, 64,246, 75, 60, 18,126,137, 22, 37, 13,144,120,248,163,180, 84, 49, 10,207, 57,144,135,165,244,176, 87, 73, 0, +192,179, 22,246, 57,238,152,212, 9,170,138, 50,241,156,215,120,143,121,194, 66,219,214, 51, 88,249,183,152, 54,109,154, 59,236, +143,220,113,254,171, 30,186, 42,208,178,181,219,208,214, 53, 75, 91, 46,107,250,141,163, 69,235, 0, 49, 70,167,251,243,231,215, + 65, 52,116, 63, 74,178, 8,178,252, 33,205,186,119,247,174,249,192,254,253,102,216, 39,153, 11, 21, 40,224,115,102,197,138, 58, +175,175, 93,107,196,103,244,148,211, 34, 79,134,114,229, 43,158,122,248,248,217,229,237,158,135, 55, 29, 61,113,118,235,139,151, +175, 79,127, 83,190, 34,141,163,179,232,164, 21, 3,192,233,232,119,223,125,119, 28,147,246, 93,252,154,139, 23, 47,254, 30,118, +110,102,203,148, 56,113, 98, 51, 84,130, 55, 65,147,224, 50,150, 78,218, 74, 54, 96,222,132,176,239,218, 12,251, 34,143, 3, 7, + 14, 40, 54, 90, 53,107,214,220,204,235,206,208, 97, 94, 45,160, 5,163,245, 71, 0,115,143,206,157, 59,167, 91,186, 5, 80, 50, +137,234, 65,216,244, 1, 84, 93, 83,128,214,147, 39, 79,188,158, 61,123,230,101, 54,155, 21,245, 28, 64,232, 33,244,215, 38, 40, +130, 45, 31, 98,193,213, 72,152, 48, 33, 93, 97,200,242,229,203, 5, 0, 86,176,137, 64, 73,215,174, 93, 19,108,114,136, 48,160, +133, 62, 93, 31, 60, 69,145,143,121,209,110,107,213,170, 85, 94,248,134, 54,161, 79, 54,134,250,119, 43, 85,158,171, 87,175,246, +130, 20,205,161,228,209, 89,254, 27,249, 13, 14, 24, 28, 48, 56, 16,209, 28,248,138,129, 86,248, 88,129,201,167, 12,156,104,238, + 32,192, 82, 15,158, 67,226, 65,231,149, 97,218,121, 0,154,205,160,234,112,135,113,189, 59,212, 79, 51,152,120,206,107,188, 23, +190, 18,255,255,105, 76,136,223, 97,146,219, 68, 0,247,219,111,191,113, 23,223, 55,122,104, 71,164, 68, 43, 24,104, 45, 90, 84, + 39, 81,194,132,126,111,223,190, 53, 51,193, 32,220, 12,233,150,121,217,178,101,230,121,115,231,154,179,101,205,250,196,255,248, +241, 42,222,231,207, 55,128,219, 7, 58, 3,117,234,128, 81,250,250,107,215,111, 31, 62,121,246,234,138, 43, 55,238,174,184,121, +231,238, 46, 94,115,138, 8,220, 79, 32,255, 72, 2, 41, 0, 5, 74,178,204,144, 62,153,247,237,219,103, 6, 80, 85,118, 28,130, +230, 3, 11,154,241, 96,104,189, 48,126,252,248,195,245,188, 7,109,219,100,209,162, 69, 10,192,194, 14, 60,143,195,135, 15,123, + 64,130,233,193,235,122,158,183,204,227, 8,104, 1, 24,133, 73,162, 5, 48,178, 7,155, 27, 20,245, 32, 19,193, 11,193, 22,212, +125, 94, 99,199,142, 61, 65,215, 17, 80, 9,234,138, 24, 0,158,120, 99, 67,129, 96,167,166, 64,141,167,168, 15,167, 78,157, 42, +144,218,210, 45,131, 2,180,146,231,170, 89, 59,172,170, 67, 62, 79,201, 47,164,101, 10,192, 2,168,243,194, 38, 6, 69,221, 9, +190,122,141, 26, 53, 74,145,194,113, 3, 75,144, 4,238, 71,103,121,108,228, 55, 56, 96,112,192,224,128,193,129,207,200, 1, 76, + 58,137, 48,177,140,228,174, 38, 24,147, 83, 50, 18, 2,104,113,117,255,251,239,191,123, 65,245, 51,193, 89,123, 42,228,143,131, +213,246, 10, 2, 32,184, 10,216,193,196,115, 94,227,189, 48, 84, 43,132,243, 72,148, 59, 31,118, 24, 14,131,237,138, 34, 37,163, +187, 4, 24, 32,143,135, 90, 40,170, 30,218, 17,105,163, 69, 53,224,139, 7, 15,218,189,218,183,175, 1, 85,135,144,112, 4,248, +248,248,152, 33,209, 49, 47, 7,200, 66,217,204,224,177,127,174,172, 89,143,125,188,113,163,234,209, 69,139, 26, 66,221,168,199, + 33,108,136,170,228,112, 75,119,169, 65,221,202,239,107,124, 95,198,183, 76,201, 60, 47,203,151, 43,248, 54,123,150,180,151,244, +212,215, 50, 15,128,211, 78,164,187, 0, 10, 47, 97,239, 99,198,238, 71, 69,125,248,235,175,191,154, 33, 25, 49, 3, 36, 60,229, +125, 38, 0, 36,111, 0, 19,127,228, 37, 16,119,120,192, 62, 46, 90,201,146, 37, 87, 17,100, 1, 80, 19, 92,253, 9,233,145,135, +167,167,167, 7,140,197, 87,241,190, 22, 13,189, 64, 11,118, 81,186,165, 88,150, 52,209,111,118, 17, 96,169,118, 89, 60, 71, 91, +121,193,181, 3, 85,133, 53,157, 41, 31,248,243,112,242,228,201,130,246, 21, 72,132,223, 99,131,129, 76,159, 62, 93,102,204,152, + 33,144, 10, 42, 64, 43,247, 55,173,126,163, 91, 7,103,141,225,249, 44, 85,134, 80,225, 30, 34,200,194,110, 80, 47,216,205,109, +163,138, 16, 0,246,216,134, 13, 27,188,208,191, 20,187, 50,228, 57, 74,245, 33, 30,137,226, 76,249,141,188, 6, 7, 12, 14, 24, + 28, 48, 56,240, 25, 57, 0,144, 85, 31,170,193, 99,152, 92,189, 48, 65,120, 97,101,238, 5, 7,136,102,130, 45, 38,168,246,204, + 84,169,208,175, 22, 86,232, 94, 5, 10, 20, 56, 78, 21,157, 51, 69,194,224, 95, 23,147,131,226,202,129,137,231,188,230, 12,141, +160,188,170, 83,204, 64,120, 65, 63, 12,195,237, 37, 52,126,135,253,143, 98,151, 69,155, 47,128,172,113,180, 87,209, 75, 59, 34, +129, 86,163,168, 81, 75,109,159, 58,181,181,249,197,139,118, 83, 58,118,108,159, 56, 81, 34,191,137, 19, 38, 4,120,108,219,102, +158, 51,123,182,185, 77,235,214, 1, 80, 41,250,174,159, 50,165,209, 71,111,239, 26, 19,106,212,104,209, 32, 90,180, 98,122,203, +202,124,144,108,148,107,223,182,169,248,250,190,144,167, 79,238,202,166,117,211,101,193,156, 65, 82,188, 72, 46,225, 61,103,104, + 65, 98,117, 31, 18, 17, 51,252,121,153,193, 63,101,231, 33, 29,148,246,235,215, 79, 1,133,144,148, 40, 70,252, 76, 0, 77,102, + 24, 96,155,245, 0, 45, 72, 19,203,193, 69,130, 34,197, 2, 24,216, 8, 30, 39,229, 47,237,181,250,244,233,227,161, 87,218,168, +214,197,145, 68, 11,125, 51, 76, 64, 11,101,154,209,185,115,103,130,148, 19,180,211,218,182,109,155, 34,205,130, 61,218, 94,103, +129, 10,212,235,237,209, 31, 31, 50,193,192,127, 4,119, 26,194, 53,138, 0,100, 10,248,165, 74,180, 74,228, 40,221,114, 64,242, + 92,181,122,234,117,239,160,214, 31,101,138, 7, 73,153,215,153, 51,103,188,176,251,211, 11, 54, 88,138,235, 18, 44, 84, 50, 97, +135,231, 12,180,155, 7,126,255,228,127,103,218,223,200,107,112,192,224,128,193, 1,131, 3, 78,115, 64,181, 43,215,239, 25,158, +158,223,225,224,209, 11,246, 36, 94,144,104,208, 23,207, 9, 76, 66,125, 8, 86, 0,192, 98,224,183, 43,189,100,159, 60,121, 82, +177, 93,129,221,145, 45,111,241, 14,213,138,152,128,210, 90,121,129, 39, 80, 74,171, 81, 61,107,154,161,156, 98,170,158,220,231, +205,155,231,142, 50,110, 4,120,251, 25, 54, 64, 84,137,217, 59, 66,149, 51, 2,128, 86, 48,205,150, 80,199,209,189,195,243,251, +247,219,190,187,121,179,209,159,189,122,181,118,205,144,225,106,146,196,137,223,194, 96,218, 55,107,230,204,231, 87, 77,158,220, +216,255,238,221,106,167, 87,172,168,135, 93,138,109,186,216, 54, 48,119,200, 79, 55,215,116, 50,117,194,175, 50,126,116, 47,233, +217,249, 7, 37,185,102, 74,163,229,182, 35, 20, 77,128,130,243, 52,214, 70,242,165,147, 82, 26,196,247,236,217, 83, 1, 90, 19, + 38, 76, 48, 67, 42,101,222,184,113,163,146,134, 14, 29,106,134,219, 12,107,160,101,179,156,232, 55, 19, 1,202, 61,160, 42,245, + 0,109, 84, 81,217,221,217, 5,224,205, 3, 52, 60,120,223,153, 54,114, 4,180,188,189,189,245, 0,173, 80,229,164,221, 33,250, + 75,183,252,249,243, 31,225, 2,131,139, 9, 2, 45, 92,219,162,243,179,115,212, 70,217, 0,122,159, 64, 74, 40,216,133, 25,194, + 97,169, 42,217,210,225,176, 52,184, 24, 4, 90, 4, 88, 84, 21,194,185, 44,193,160,158, 13, 15,234,243, 97, 82,249, 59,249,109, +234,100,153,195,108, 70, 57, 35,130,139,255,167, 97,240,211,224,103, 68,113,224,115,244,165,136, 42,219,223, 65,199,121,207,240, +152, 0,119, 16,100,193,190,196, 11, 43,241, 99, 0, 94,214,222,170, 57, 73,102,227, 61,130,172, 32,223, 90, 59,173,106,167,213, + 16, 33, 28, 90, 6,121,175,214,178,127,209, 4, 90,240, 3,181, 3, 70,220,244, 4,255,147, 78,149,166, 35,160, 21,214, 93,135, + 33,104, 34,216, 96,166,206, 25, 50,252,244,244,218,181, 31, 63,190,120,209,196,255,226,197, 26,126,167, 78, 85,245,191,112,161, +178,220,185, 83,149,146, 44,130,172,150,137, 18,253, 84,199,100,178,140,167,103,201, 82,187,252, 12,150,104,189,121, 46, 79,188, +239,200,198,181,211,100,254,236,129,122, 36, 90,118,105, 2,244,222, 37,208,130,186,203, 12,219, 34, 51,124, 95,153, 33,145, 50, + 3,180, 62,133,234,235, 49, 19, 36,159,207,186,119,239,174, 11,104, 85,169, 82,101, 21,108,189, 20, 47,240, 80,235, 42,174, 43, +248,219,160, 65, 3, 15,168,186, 60,160,214,117,199, 37,123, 6,230,193,229, 12, 14, 42,173, 29,130, 71,107,167,161,221,186,115, +135, 30,250,207,112,248, 12, 59, 1, 99,122, 2, 45, 15,157, 95,174, 86,159,207, 6,199,176,119,224, 77, 63,100, 8,158, 92, 53, + 75,100, 47,211,226,215, 20,185,107,126,103,227, 61, 54,105,170, 64,235,200,145, 35, 94, 48,134, 55,128,150,206, 6, 66, 54,173, + 54,210, 79,201, 0, 48,228,128,193,207,176,244, 24,251,207,252,151,249, 25,177,156,252,178,212,172,253,103,105,123, 78, 8, 10, + 32,189, 3, 96,106, 55,206,237,186, 26,208, 8, 52,173,167,195, 56, 10, 32,109,139, 77,182,104, 6,171, 14, 97,196, 61, 63,200, +251,187, 51,246, 40,118,129, 86, 56,118, 29,134,162, 9, 95, 0, 25,154,197,140,217,118, 89,247,238, 63, 94,218,177,163, 25,118, + 23, 54,126,118,225, 66,195, 99,139, 23, 55,162,186,144,146, 44, 7, 32, 75,115, 64,115,205,156,198,163, 74,197, 98,210,185,125, + 93, 37,241,156,215,194, 33,133,200, 15, 53,226, 61, 0,170, 71, 80, 21, 63,130,113,252, 35,168,188, 30, 81,226,101, 65, 51, 53, +108,145,246, 67, 66, 99,233,192,214,102,187, 3, 12, 54,134,100,116, 45,192, 89,136, 14,136, 62,214,168,116,233,210,107, 96,235, +231,200, 93, 66, 48,205, 47, 24, 84,218, 68, 31,108, 72, 19,144,122,232,252,102,245,244,121,157,164,130,179,217,164, 73, 41, 45, +237,175,104, 4,143,157,155, 39, 52,164,182,214,239,252, 98,229,116,182,178, 78, 46,214,194, 66,254,191, 92,247, 74, 97, 97, 88, + 56,198,144,176,190,238,191,220, 70,255,229,186, 59,236, 47, 48, 18, 47,130, 84, 45, 40,241, 92,253,111,121, 94,209, 34, 15,243, +170,255,139,144,184,197, 51,193,215,109, 92, 83,223, 97, 73,171, 40,242, 57,229,202, 40,172,157,223,217,231,244,118,152, 16,134, +236, 97,252,168,157,161,161, 57,233, 0, 20,180,165,250, 80,111, 98,126, 61, 19, 4, 85,130,176,217, 42,222, 44, 86,172,122,220, +141,200,221,133, 52,124,167, 77,150, 29,117,161, 37, 89, 93,252,116,115,115, 83,236,232,116, 54,150, 46,154, 58,105,169,217, 62, + 43,205, 96,137, 86,238, 90,231,146,230,169,145, 21,192,235,156,101, 80,105, 39,202,250, 89,203,233, 68, 57,180,178,218, 45, 39, + 36,202,157, 16,135,241, 40, 22, 60,221,180,136,232,233,159, 78,210,208,252,142,194, 73,143,143,127,245,109, 20, 14, 30,124,142, +186, 27, 64, 43, 28, 13, 98,227,209,207,209, 70,255,101,154,118, 91, 71, 5, 67, 65,115, 27, 55,230, 41, 96,232, 47,236, 20,242, + 92,205,163,222,179,248,101,230,224,103,244, 62,203,124, 48,157,233,143,103,203, 59,209,125,180, 37, 90, 78, 16,115,148,245,191, +220, 97,140,186, 71, 80, 39, 10, 34, 99,240,211, 14, 63,245,238,164, 53,128, 86, 48, 7,140,190,100,124,155, 17,197, 1,163, 47, + 69, 20, 39, 53,232, 56, 2, 85,142, 64,151, 21,176, 10, 5,180,108,128,177, 96,224,102, 11,148,125,161,234, 58,245, 26,163, 19, + 58,197, 46,205,204, 6, 63, 53, 89,228, 84, 6,131,159, 78,177, 75, 51,179,193, 79, 77, 22, 57,149,193,224,167, 83,236,210,204, +108,240, 83,147, 69, 78,101,248, 28,252,180, 91,128,207, 5,180, 84,186,150,128,203, 90,210,101, 33,209,114, 84,103,235,221,134, + 33, 36, 90,124,208, 86,114,134,227,246,104, 56,186,174, 69,223,160,105,187, 93,194,218, 94, 6, 63, 13,126,234,237, 3,198,183, +105,159, 3,122,121,104,153,207,224,167,193, 79, 91, 28,248, 47,247, 37,149, 31,186,231,179,136, 0, 90,182, 84,140,142,174, 57, + 41,209,114,126,215,161,214,200,160,243,254,231, 64,188, 6, 77,157,204,215,153,205,224,167, 78, 70,233,204,102,240, 83, 39,163, +116,102, 51,248,169,147, 81, 58,179, 25,252,212,201, 40,157,217, 12,126,234,100, 84,120,179,217,177,209,170, 74,219, 41, 74,156, + 44,164, 78,223,218, 2,101,106,158,176,216,104, 89,171, 31,237,212,197, 82,130,165,238, 64, 12,111,181,117, 61,111,116, 66, 93, +108,210,157,201,224,167,110, 86,233,202,104,240, 83, 23,155,116,103, 50,248,169,155, 85,186, 50, 26,252,212,197, 38,221,153, 12, +126,234,102,149,174,140,159,131,159, 14, 95,108, 99,215, 97, 12, 92,227,110, 64,203,157,136,209,236,236, 70,180,222, 73,232,204, +174,195, 16, 59, 23,117,113,231, 11,102,250, 28, 13,241, 69,104,230, 79, 25,121, 88,173, 34, 41, 61,152,106, 22, 78,225, 81,163, + 96,114, 37, 85, 43,144, 76, 73,223,231, 79,186, 77, 73,121, 19,111,251, 46, 79,162,109,121, 93, 76,195,172,248,234, 84, 57,179, +165, 54, 37, 41,235, 26,107,113,233,204, 49,239, 4,165, 5,185, 19,152, 18, 57, 67, 51, 71, 10, 83,206,130,169, 76, 11,242,167, + 52,157, 97,226, 57,175,105,180,183,222,114, 70,202,157,220,212,190, 80,134, 56,158,223,230, 79,251,176, 64,250,152,123,114, 37, + 55, 49, 30,163, 45,191, 87,154, 52, 93, 19,155,138,103, 74,100,114, 71,218,146, 53,137, 73,207, 78, 14, 77,154, 97,232,215, 6, +205, 48, 48,205,193, 35, 6, 63, 13,126, 70, 20, 7, 62,107, 95,194, 68, 28, 37, 60,201,162,146,193,229, 4,189, 72,225, 73,182, +104, 70, 20, 51, 65,231,179,242, 51, 2,203,105,144,194,196,218, 33,151,139,233, 9,146, 55,207,117,112, 36, 68,227,230, 74,101, +170, 88, 56,109,148,187, 72, 15, 64,163, 65,206,100,166, 20,182, 18,239, 49, 15,210, 61, 62,227, 12,216,200,157,198, 84, 53,127, +170,200, 62,121, 83, 70,122, 13, 58, 83, 80,206,138,197,211,152, 98, 57, 11, 54, 8,176,184,245, 96,247,140,174,226,119,120,170, +188, 61, 48, 81,222,238, 27,203, 75,178,115, 66, 51,241,221,254,171,188,217,214, 87,222,108,233,169, 92,171,154, 59,193, 86,103, +202,105,153,151, 32,171, 74, 62,151,135,247, 79,184, 7, 6,190,188, 45, 31,159, 93,149,243,155,167,124,172,144, 35,225,125, 43, +176,101,247, 99,201,151,202,212,166,102,201,236, 87,247,238,220,118,227,218,165,139,222, 87,206,158,124,224,185,126,209,249,218, +197, 51, 92,230, 61, 39, 38,199, 72, 4, 80,249,210,197,216, 83, 34,107,146, 7,121,211, 68, 83, 0, 85,158,212, 81, 55,110, 95, + 62,237,190,249,249,237, 87,239,111, 31,126,243,230,230,225,167,179, 71,116,185,149, 39, 85, 20, 58, 25,141,236,108,221, 1,176, +214,155,221,219, 5,202,182, 14,146, 35,101, 84, 45, 95, 95, 36,111,179,238, 57, 93, 76,141, 81,190, 63,181, 18,243,217,224,129, +174,193, 39,135,139,105,110,206,228,166, 67,160,209, 13,239,113,113,182, 47,233,248, 78,180,178,232, 42,167, 22, 17,103,219,200, + 73,122,118,219, 40, 12,116, 44, 31, 49,234, 30, 78, 6, 26,237, 30,204, 1, 75, 80, 20, 10,104, 69,138, 20,105,159, 94,240,165, + 23,104, 33, 95, 9,189,224,203, 0, 90, 17,219,209,191, 90,106, 0, 46,207,229,205, 61,145,151, 55, 4,231, 62, 58, 42, 18, 98, +144, 4,112,122, 36,239,158,137,188,121, 40,179,250,214,148,169, 61,106,202,196, 46, 85,101, 92,135,111,101, 76,219,178, 50,226, +199,226, 50,180,105, 33, 25,210, 32,151,136,223, 83,145, 23, 55,164, 80,154, 40,143,156, 25, 40, 10,164,142,236, 19,120,115,167, +200,165,213,178,180, 75, 1, 25,213, 32,139,148,207, 26,251, 41,202,219,218, 6, 32, 80, 73,135, 26,204, 9,180,118,255,209, 85, +126,252, 54,211, 61, 85,146,213,226,155,244,119, 9,178,154,149, 73,125,151,146, 44,166, 38, 37, 83,222,217, 49,162, 90,184,128, + 22, 37, 89,119, 15,175, 10,252,116,123,183,152, 55,183,151,119, 27,219,200,235,179, 27,100,215,140,206,159,202,101,137,185, 64, +235, 3,204,238, 98,202, 85,187, 84,206,203,111, 94,189,242,127,116,247,234,235,249, 35,235,122,205, 31, 88,247,136,199,172,129, + 94, 23,246,174,187, 84,179,104,218, 75,204, 99,167,189, 44,235, 30, 25, 96, 98,147,251,252,113,247,222, 61,185,250,242,237,141, + 3,111,158,157,217,250,104,100,215, 58,222, 27,230,141,241,125,127,113, 99,192,253, 63, 42,155,175,142, 41,100, 62,255,123,105, +243,173, 77, 67, 3, 38,247,109,122, 21,188,237,234, 76, 27, 49,111,250,132, 38,119, 21,104,101,115,137,106, 29, 81,192, 86, 81, +109, 78,184, 4, 88,230,155,123,228,253,254,209,242,206,115,152,188,219,245,155,248,109,239, 39,126, 91,123,136,159,123, 23,121, +187,177,189,188, 93,215, 74,152, 47,172, 64, 11,207, 62,120,124,245,120,224,233,189, 27, 62, 52,175, 86,228, 9, 64,215,252,156, +127, 73,225,172, 1,166, 30,176,145, 45,115,210, 40,119,210, 37,138, 18,194, 51,124,133,108, 49, 75, 54, 43, 28,107, 80,153, 44, +177,203,133,181,156, 58,190, 71, 3,192,252,197, 1, 3,188, 57,217, 89, 52,178,127,117,252,180, 5,168, 8,180, 80, 79,174,155, + 53,165, 93,206, 0, 45,228,165,202, 74, 83,218,165, 49,206,247,198,253,171, 65,137,231,206, 30,182,218,136,225,238,232,196,147, + 73, 43,244,157,238, 49,217,217,130,253,139,242, 91,251,205, 10,155, 31, 45, 76,168,239,228,245, 29,145, 89,185, 9,180,222,233, + 96, 80,136,198, 45,148, 54,202, 75,121,255, 66,228,249, 85,121,186,111,186,200,149,117, 34,231, 23,139,156,252, 83,228,232, 4, +145, 3, 67, 69,246,244,147,167, 75, 26, 2,204,221, 18, 57, 62, 69,242,165,142,252,194,234, 61, 14, 63,106, 5,104, 93, 92, 45, +178,182,158, 60, 89, 80, 91,100, 67, 99,121,183,188,182, 76,106,158,157,101, 94, 97,167,204,161,104, 82, 93,232,119,120,154, 16, +100,169,207, 80, 85,232,187,227, 55, 33,192, 82,175, 81,146,245,122, 93, 59,169,156, 59,126,152, 37, 90, 80, 21,222,253,248,248, +140,152,183,116, 16,255,165,223,201,227, 25,229,228,248,196, 58,114,106,245, 72,161, 26, 81,227, 3, 52, 65, 69,184,196,115,219, +230, 27,143,239, 94,121,253,224,250,254, 23, 91,198,124,115,122,251,136,178, 39,183, 15, 44,115,232,200,159, 93,142,237,157,251, +203, 33,230,209,170, 59, 1,211,246, 37,147,238,250, 93,221, 17,112,115,122, 21,243,153, 97,249,204, 94, 35, 75,154, 47,173,232, +107,126,124,122,139,255,237,105,229,205,143, 60, 70,153,159,122,173, 54,159,154, 92,203,188,187,127, 94,243,169, 85, 67,239,230, + 75, 27,253,132,189, 54,114, 75,102, 42,221,245,135,162, 15,167,244,172, 35,147,123,212,146,137,221,106,202,132,174,213,100, 72, +219,202,210,179,105,121,233,214,168,172,252,218,226, 27, 25,221,174,188,140,108, 83, 78, 70,180, 46, 35,237,191,203,241, 22,170, + 69,235,160,218,118, 37, 90, 0, 62, 23, 63,220, 59, 34,239,118,244, 23,158, 91, 74,183,248,223,255,212,252,240, 0,173, 72, 0, +159,119, 15, 79,170, 19,248,240,180, 71,224,123,132, 56,122,124,227,108,224,212,129,237,223, 66,210,229, 44,120,203,214,173,108, +140,103,242,209, 95,138,103,136, 26, 34,214, 97,187, 18,177,135, 5,190,188,245,250, 96,247,228, 43,203,102,137,101, 29,238,234, +171,155,200,116,140, 13,122,179, 24,117,215,203, 41,125,249, 12,126,254,133,166,236, 73,180, 20,163,106, 45,176,229, 12,208,186, +115,231, 78,126, 61, 96,203,222, 56, 15,103,216,101,131,202,164,104, 79,120, 14, 71,197,190,106, 66, 36, 20, 95,139,116, 63, 40, +191,117,111, 8,209,238,213,170, 85, 75,141, 12,101, 65, 78, 73, 60,183,151, 16, 21,164, 84, 80,126,135, 52,245,117,191,127,117, +174,136,217,117,136,137,216,235,206,236,154,114,101,112, 6,130, 22, 47,103, 89,150, 51,133,169,239,252,190,213,196,235,207, 22, +178,103, 92, 67,233,219,160,168,244,250,161,128,116,175,149, 71,186,124,159, 77, 58, 86,118,149,246, 21,210,203,250, 94,133,228, +233,236, 74,242,107,141,180,146, 43,133,201, 41,244, 14, 85, 99,165,124,169, 34,191,204,147, 34,210,187, 34,144,160, 53, 47,233, +242,233,236,196, 42, 34,235,234,203,200,134, 89, 4,147,102, 91, 61,229, 86,128,214,193, 73,161,128,214, 27,143,254,161,128,214, +171,213,173,108, 1, 45, 61,175, 49, 65,210, 84,108,104,155, 74,175, 62,220,222, 43,126, 11, 42,202,227,233,229,228,192,144,146, +178,170,223, 55,178,105, 82,103,107,160,101,147, 38,236,177, 46,220, 56,127,234,241,234, 49, 53, 79,123,142, 43,119,222,107, 92, +169,139,231,127, 47,118,241,204,176,162,103, 78,143,250,230,232,181,141,163,142, 51,143, 86,129,138,100,138,239,229,255,236,198, +235,171,147,202,155,239,123,140, 53, 63, 62,186,194,124,104, 76, 21,243,150,158, 57,204,251,199,215, 15, 56, 59, 60,191,249,137, +215, 26,115,161,108, 81,205,158,131, 75,152,215,119,204,104,222, 59,169,217,235,162,153,226,191,177, 71, 59, 75, 98,211,204, 15, + 55,119,137,220,217, 35,114,107,135,200,141,173, 34,215, 54,137, 92, 94, 43,126,167,151,138,159,215, 66, 9, 60, 51, 95,228,244, +108, 0,238, 63, 68, 78, 76,145,143,135,199, 73,174,148, 81, 22,105,149, 87,189, 79, 96,245,225,206,126,241,219,242,115, 40, 64, +165,170, 22,237,168, 14, 53, 95,145, 39,169,169, 70,235,226,241,158,159, 27,146, 45,240,232,128, 44,129,123, 7,228, 9,188,178, +117, 74,224,243, 59,231, 37,119,138, 72,148,182,218,139,205,104,202,145, 34, 74,251, 44,201,162, 60,100, 74,157, 48,242,136,236, + 46, 81, 30,127,122,116, 82, 25, 44, 85,160,165, 74,178,190,113,139,217,221,127,109,227,163,159, 30, 28,123,218,181,108,236,223, +203,185,197, 76,168, 89, 56, 35,131,193,129,127, 56, 7, 18, 36, 72,144, 57, 95,190,124, 11,115,230,204,121, 7,129,218,253,241, +235,159, 61,123,246,219,188,198,123,127, 87,241, 29, 1,173, 51,103,206,104,130, 45, 91,229,182, 37,181, 66,190, 18, 15, 31, 62, +204,127,249,242,101, 55, 45,176,101,143, 23, 0, 84,247, 14, 28, 56, 32, 43, 86,172, 80,210,149, 43, 87,148, 49,196,214,113,243, +230, 77, 65,136,179,123, 90,124, 69,184,179, 50,155, 54,109, 42,187,106,213, 42, 37,161,124,193,160, 75, 5, 95,234,239,254,253, +251,203, 50,191, 22, 77,227,190,201, 50,214, 97,232, 93,135,238,238,238,193,225, 90, 44,207,173, 25, 71,137,144,172,173, 47, 50, + 5, 0,200,190,116,200, 33,191,243,165,140,186,215,231,224, 76,241, 59, 62, 91, 74,103,141,127, 55,107, 82, 83, 42,213, 78,139, +231,197, 51,198,184,243, 98, 81, 45,185, 49,189,178,228,118,137,180, 55,188,141,151, 59,137, 41, 27,128,215,233,203, 83,190,151, +247, 43,234, 73,145,180, 81, 47,233,161, 73, 73,214,219,253,227,132,134,239,106,126, 74,178,222,108,237, 45, 52,126, 87,175, 81, +146,245,106,101,115,169,148, 51,158,181, 68,203,225,107,202,153, 76, 81,243,184,152,106,148,202, 20,227,222,147, 19,171,229,221, +177,153,114,111,230,247,114,112, 88, 41, 89,213,183,156,204,253,165,161, 76,104, 87,250, 99, 89,215,152,150, 49, 4,109,210, 44, +144,202,116,232,250,233, 67, 15,119, 79,106,122,246,249,165,237, 47,111,141, 47,120,243,225,248,188,119,222, 94,116,127,125,123, +242, 55,103,174, 47,237,126,144,121,180,234, 93,169, 64,122,223,151,151,119,190, 59, 54, 48,183,249,233,217,109,230,130, 0, 84, +155,123,229, 51, 47,107,147,206, 60,191,101, 26,255, 67, 3,114,154,143, 77,168,101, 94,223, 35,175,121,245, 79, 25,204,139, 91, +103, 48,111, 24, 94,239, 86,158,212,209,206,218,163,237,154,212, 84,160, 83,237, 2,190,191,119,170, 34, 99, 59, 86,150, 49, 63, + 85, 84,164, 87,219, 39,183, 19, 57, 51, 79,182, 79,108, 37,195, 90,150,144, 33,205,139,201,224,102, 69,101, 80,147,194,210,234, +219,204,143, 51,235, 51,144, 87, 94,171, 0, 45,168, 15,223,110,104,103, 79,114,165, 85,245, 80,247,209, 54,113, 0,206, 70,183, + 41, 17,255,217,141, 81,121, 62,120, 79,204, 27,120,123,108,174,192, 75,195,178, 7, 30, 31,224, 22,232,115,121,159, 20,203, 24, +251,113, 65,147, 41,154,221, 1, 50, 73,148,135,129, 1,111, 36,208,231,170, 52, 42, 16,221,215,188,189,187, 64,106,165,140,143, +133,210,254, 37,209, 82, 37, 89,251,127, 78,186,178,110,190, 88, 35, 63, 94,115,191, 31,176,249, 39, 47, 0,175,170, 78, 23,218, +120,192,224,192, 63,132, 3, 8,114, 30, 11,241, 75,143, 54,105,210,228,237,194,133, 11,229,246,237,219,114,254,252,121, 25, 55, +110,156, 32, 48,189,204,155, 55, 79, 16, 76,254,109,177, 98,197,142, 50,175, 51,197,198,231, 19, 21,137,187,205,152,184,195,140, +139, 29,166,168, 72,252, 30, 53,227,220, 58, 2, 90, 0, 29, 2, 41,148, 67,176,101,171,188, 90, 64,235,193,131, 7, 14,193,150, + 61, 30, 32,192,189, 55,249,119,245,234, 85,185,116,233,146, 32,254,174,172, 91,183, 78,225,225,156, 57,115,100,217,178,101,146, +163,224, 55, 74,121,143, 30, 61, 42,136, 71,235,173,131,159,101,239,223,191, 95,246,250,245,235, 10,200, 58,117,234, 84,217, 29, + 59,118,148, 37,248, 2,109,229, 55, 91,225,111, 20, 41, 23,239,241, 87, 7,205,112,103,209,139, 69,194,253,162,191,131,128,222, +202, 69, 4,208,194,206,181,226, 35,219,150, 83,212,133, 43, 7,215, 21,128,172, 22,106,157,121, 62,163,117,110, 69,237,247,115, +229,212,194,188, 17,193, 15, 72,197,202,141,104,156, 83,100, 83,115,105, 92, 52,201, 39, 87, 87,147,102, 96, 72, 5,104,237, 29, + 45,205,203,166,189,171,238, 46,108, 90, 58,213,221, 55,238,221,133,118, 89, 84, 25, 50, 53, 44,150,244,206,171,229,141,117, 3, +173,194,233,162,181, 43,231, 22,203,171, 90,161, 84,207, 22, 12,109,233,247,236,140,187,248, 95, 92, 47, 15,230,214,145,243,243, +126, 18,207, 25,157,100,209,192,134, 50,184, 73,193,143,165, 50,197,188, 3,240, 25, 79,139, 7,249, 82,154, 70,122,174,153,115, +253,206,222, 69,247,175,140, 41,116,229,195,211, 43,230, 79, 79, 47,125,124, 57, 33,219,131,103, 75, 91, 92,219, 60,164,198, 1, +230,209,162, 83, 52, 83,130,115, 79, 47,236,244,241,252, 37,191,249,208,196,250,230,213, 61, 10,154, 23,253,152,198, 60,179, 73, + 10,243,152,218, 73,223,120,116,207, 98,222,208, 41,147,121,121,219,116,230, 5, 45,211,152,151,118, 47,102,238,240,157,219, 49, + 0,157, 65, 90,180, 45,239,187, 38, 51,229,159,221, 27,102, 11, 39,166,201,204, 30,149,133, 96,204,153,231,173,243, 42,118, 90, +215,119,200,219,213, 77,131,129, 86,120, 36, 89, 80, 9, 22, 45,148, 33,250,241, 61,147,127,124,231,191,189, 87,224,187, 57, 37, + 2,223,207, 42, 20,248,246,143,130,129, 79, 39,231, 11,124,180,240,135,192,167,103,220, 3, 33,209, 34,104,183, 43,209,202,152, + 36,138, 55,129, 22,165, 88, 15, 38, 21,148, 15, 39,166, 43, 73, 62,125,144,188,169,255, 2, 90, 0, 84, 63, 64,146,117,228,211, +253,195, 79, 42,102,143, 57,240,238,132, 2, 30, 60,199,245,142,225,225,137,241,172,193,129,191,139, 3,144, 88,165, 44, 94,188, +184,207,218,181,107,149, 69, 5,127, 41, 37,234,214,173,155, 2, 6, 8,180,102,206,156, 41,175, 95,191,150,185,115,231, 74,193, +130, 5,125,160,250, 74,169, 85,222, 32, 32, 19, 11,191,241,145, 18, 35, 37, 65, 74,180,121,243,230, 68,223,127,255, 61,119,104, + 39, 64, 74,136,196, 49, 51,166, 35,122,142,128,214,173, 91,183,228,241,227,199,242,234,213, 43,187, 96,203, 22,109,123, 64,235, +233,211,167,249, 9,178,158, 61,123,230,246,230,205, 27,187, 96,203, 94,121, 19, 38, 76,248, 12, 82, 37, 1,248, 17,127,240,111, +212,168, 81,114,236,216, 49,121,251,246,173,248,250,250, 42,160,235,231,159,127,150,161, 67,135, 42,252,140, 29, 59,182, 30,251, +233,178,199,143, 31, 87, 0,213, 7,128,168, 25, 51,102, 40,128,234,253,251,247,101, 65, 83,185,254,219,111,191,149, 29, 57,114, +100, 89, 0, 57, 3,104,105,117,206,191,238, 59,182,209,250,146, 64,139,165, 1,160,218,116,123,109, 95,121,191,123,144,124,155, + 45,193,131,156, 57, 77,209,153,202,102,142,121,255,237,210,218,114,126, 66, 5, 2,176, 77,250,234,166,157, 43, 71, 50, 83,189, +153, 29, 16,220,123, 75, 91,169,149, 63, 81,128, 35, 41,132, 74,141,146, 44, 14, 18, 59,199, 55,197, 14,195, 1,242,102,107, 31, +121,179,185,187, 50,112,236, 24,254,189,188, 90,219, 70, 94,173,106, 33, 4, 89, 60, 42,229,136,163, 41,209,130,244,106,199,154, +201,125,252,222,221, 59, 41,159,158,223, 20,243, 45, 79,241, 59, 52, 73, 30,204,171, 45, 87, 86,244,147, 29,163,127,144,214,229, +210,188, 44, 5,187,172, 50, 89, 98,206,132,157, 82,124,237,218,153, 76, 4, 99,165,179, 38, 56,247,232,212,182, 39,222,107,187, + 63,184, 52, 48,243,211,155, 67,211,191,241, 93, 82,247,209,131,117,189,174,150,200, 24,227,156, 30, 90, 4, 76, 75,199,247,184, +124, 98, 94, 87,243,202,159, 50,153,231,183, 72,101,254,163,113, 42,243,193,201,141,204,251, 38, 52, 12,216, 63,169,145,255,145, +169, 77, 3, 54, 12,250, 46, 96,197,128,202,119, 59, 86,205,114, 36, 87,138, 72,199,245, 0, 87,203,122,100, 75, 30,101,254,147, +173, 3, 69, 14,143, 21,239,141,125,132,255,245,212,211, 94, 30, 5,104, 93,221, 42,190,203, 0,220,131,108,180,248,251, 30,188, +181, 99, 4,111,247,117,185,147,153,190,107, 88, 34,245,147,199,123,166,124,252,112,125,187,124,188,186, 89, 62,156, 91, 34, 31, + 14,140, 10,244, 95, 86, 61,208,188,127, 68,224,251,155,251, 2, 39,255, 92,253, 53,222,241,155,163,114,195,224,221,251, 35,212, +164, 1, 27, 90,202,222,206, 9,148,223,128,141,173, 20, 9, 23,212,136, 10,208, 42,158, 33, 70,204, 49,213,227,206, 8,124,117, +247,237,212,186,113,231, 46,111, 22,111, 33,207, 7, 84,140, 51, 37, 89,220,184,182,140,237,195,195, 42,227, 89,131, 3,159,157, + 3, 25, 50,100, 56, 76, 80,160, 30, 11, 22, 44, 16, 76,228, 18, 55,110, 92, 37, 89, 2, 45,111,111,111, 69, 42,131,160,232,135, + 29, 21,172,100,201,146, 53, 78,158, 60, 89, 16, 52, 19, 32,185, 32,165, 69, 74,127,246,236,217,140,160,157,169, 89,179,102, 25, + 65, 35, 13,104, 48, 12,138, 75,171, 86,173, 82,225, 93,229,236,209,116, 4,180,160,234,147, 23, 47, 94, 8, 64,135, 82, 5,208, +224, 79, 8,155, 46,103,128,214,203,151, 47,243,171, 32,203,223,223,223, 13,180,108,130, 45,123,101,141, 23, 47,222,203,190,125, +251, 74,249,242,229,165, 64,129, 2,178,120,241, 98,185,113,227,134,112,222, 38,159, 33,137,146,166, 77,155, 74,242,228,201,165, + 81,163, 70, 18, 61,122,116,187,166, 28, 22,239, 40,219,187,119,239,178,223,124,243, 77,217,194,133, 11, 43, 96,138,210, 45, 2, + 44, 38, 74,183,192,211,178, 41, 82,164, 40, 11,154, 6,208,210,247,213,132, 31,104,161,199, 70,205,157,194,180, 47, 96, 89, 53, +241,159,144,134,182, 83, 7, 8,142,244,189, 63,100,174,220, 46,166,220,221,107,228, 8,164,225,251,170,126,229,169,134,252,153, +105, 81,167,124,138, 52,171, 77, 25,151, 64,230, 9, 11,109,235,103, 88, 70,208,222,115,123, 97, 11,121,176,164, 57, 39, 98, 77, + 64, 68, 26, 4, 90, 4, 89,234, 14, 67,170, 11,149, 29,134,195,171, 73,163,226, 46,119,168, 50,164,186,176, 65,145,196,119, 60, +126, 45,169, 9,180, 40,201, 90, 55,125,192,187,192,119, 47,196,236,245, 39, 12,244,107,201,219,133,149,228,225,236,106,144,100, +181,149,173, 99, 26, 9,128,216,221,176, 74,241, 0, 76, 93, 59,215,204,127,203,247,252,134,103,183,198,228,187,117,119,108,174, + 59,239, 14, 77,125,240, 83,197,140,215,114,165, 52,101,215,195, 75, 2,166, 60,169,162,158,152,218,167,193,153,157, 19, 91, 61, + 88,214,171,172,255,140,182,249,238,118,168,146,197,108,153,190,205,153,200, 12,117,225, 77, 72,141, 70,233,112,157, 17,226,213, +153, 93, 76,201,123,255,144,207, 44, 7,135, 99,119, 32,130,161,123,254, 34,221,106,100, 51,243,186,158, 50,218,202,163, 0,173, +203, 27,229,205,194,170,242,102, 94, 5,121, 61,187,140,188,254,179,184,188,158, 94,208,105,160, 5, 90, 59, 15,246,207,230, 31, +176,173, 91,224,135,211,243, 0,180,220,229,227,221,131,242,241,222, 97,249,244,226,150,220, 59,190,241, 67,205, 98,105, 31,163, + 79, 13, 47,151,193,241,170, 57,101,130,200,222, 84, 23,250,252, 89, 82,166,212,142, 37,207,103,150, 82,210,199, 11,203,196, 45, +185, 1,180,194,218,222,198,115,255,120, 14,184,194, 22,235, 49, 36, 57, 10, 80, 57,125,250,180, 2,174, 44,211,137, 19, 39, 20, +137,209,197,139, 23, 37, 75,150, 44,180,117,116,117, 84, 43,168,195, 92, 33,181,105, 29, 16, 16, 0,149,135,164, 65,202, 2, 48, +148,103,207,158, 61,121,199,143, 31,159, 23, 42,202,220,120,103, 14,208,200,210,176, 97,195,180, 89,179,102,229,174,224, 76, 97, + 1, 90, 62, 62, 62,226,231,231, 39,201,146, 37, 59,203,157,136,106,178, 4, 91,206, 2, 45, 74,178, 8,178, 0,154, 74,225,217, + 18,106,178,148,130,233, 1, 90,121,242,228, 81,108,180,166,205, 93, 41, 85, 27,117,149, 18,101, 42, 42,192,235,247,223,127, 23, +168, 24,195, 12,180,168, 62,156, 50, 99, 94,217,122, 63,118, 41, 91,184,120,233,178,139, 22, 45, 42, 59,118,236,216,178,160,105, + 0, 45,253,159,155, 26,235, 80,181,207,226,255,255, 31, 64,198,229,136,142,131, 18, 48, 85,200, 3, 18,161,252, 21,221, 98, 92, + 88,211, 45, 23, 86,227, 39, 68, 94, 95,148, 75, 91,198, 73,237,146, 25,110,192,150,197,122,119,152,174, 98, 97, 66, 91,114,106, +234, 15,202, 42,191, 98,246, 56, 62, 76, 1, 43,235,202,209,145,101, 57, 57,218,219, 33,167,139,182,154, 73,177,179, 73,110,218, +184,101,120, 45,101, 55,227,236,206, 37, 9,234,232,230, 65,243, 80,118, 24,194, 87, 86,168, 29,134,107,219,134, 48,124,167, 36, +235,197,194,234,168, 67,236, 45,142,136, 98, 39,217, 73,127,239,203, 98,198, 14, 56,243,234,186,242,126,113, 21, 24,252,127, 43, + 39, 70,150,145,189, 51, 58, 74,239,154,217,252, 0,136,106,107, 22,204, 65, 6, 24,188,123, 62, 58,178,236,234,147,249,245,206, +248, 44,172,123,234,201,238, 41,167,120,205, 25,154, 4, 78, 4, 80,249,210,198,184, 85, 48, 93,140,128,239,242, 38,121,127,111, +247, 12,243,171, 19,139,205, 47, 14,206, 48,191,240, 24,108, 46,151, 57,250, 3,149, 38,165,105,101, 50, 71, 91, 88, 62, 75,244, +225,122,222, 3,201,218,192,179,115, 90,201,167,221,253,164,117,249, 12,242,113,123, 55, 57, 57,165,174,240,186,158,231,109,229, + 33,208, 10,184,176, 86, 94,207, 41, 27, 66,162,245,206,115,184, 83, 64,139,146,206,124,169, 34, 61,122,251,103, 33, 69, 85,200, +100,246, 0,224,186,188, 94, 62,190,122, 16, 56,105, 64,155, 55, 0,180,171, 29,184,202, 8, 81,188,228,241, 34,123, 63,156, 92, + 72,110,141,205, 45,227,107,196, 82,212,135, 87,134,103,149,128,245,205, 4,106, 69, 69,162, 85, 54, 75,204,218,134,234, 48,172, + 45,111, 60,247, 79,229, 0,212, 93,249, 32, 41,241,121,254,252,185,124,250,244, 73, 1, 91,179,102,205, 82, 18,207, 41, 45,162, +221, 17,128,195,211, 56,113,226, 88,239,178,181, 85,173, 72,169, 82,165, 42,213,186,117,235, 22,120, 14,187,155,164, 56, 36, 79, + 37,160,150, 44, 54,102,204,152, 98, 93,186,116, 81, 36, 48,237,218,181, 43,144, 43, 87,174, 74,177, 98,197,226,188,100, 87,173, +239, 72,162, 85,170, 84, 41,165,204, 4, 90,182,242,241,154,173, 2, 90,130, 38,245, 28,249, 74, 0,180,229,207,156, 57,115,121, + 74,178, 8,180,108,229,227, 53,123,109, 73,137, 86,159, 62,125, 20,137, 22,129,214,242,229,203,229,135,142, 99,165,122,157, 54, +242, 77,182, 28,210,177,118, 13,241,240,240, 16,240, 60,204, 64,139, 18,173,111,106,183, 45, 91,189, 81,135,178,113, 19, 38, 44, + 91,189,122,245,178, 91,183,110, 45, 11,154, 95, 26,104, 57,196, 34,255,212,254, 30,174,114, 81,194, 1, 96, 50,178,199,119,105, + 62, 30, 27,245,141, 28,236,231, 38, 31,159, 28, 83,128,214,115, 24,179,191,189,117, 88,102,141,236, 26,152, 47,117,212, 73, 4, + 53,206,188, 12,147, 99,230,166, 37, 93, 62,200,186,134,178,174,103, 97, 37, 81,154,213,168,104,226, 15,188,231, 12, 45,235,188, + 4, 11,148,144, 85,204,153,208,103,207,196,166, 66,233,137,231,184,250,138,113,189, 30,181, 33,233, 17,104,209, 33,169,165,225, + 59,109,178, 94,173,254, 49, 52,208,154,255,157, 38,208,130,189,213,163,192,183, 79,196,127,109, 51,197,133,195,139,217,229,197, +107, 84, 89, 89,139,122,111,156,220, 77,202,101,141,243,172,220, 95,198,156, 97, 61, 34,149,118,141,117,173, 77,181,130,239,155, +148,119,243,173,150, 47,209,203, 58, 69, 83,189,133, 26,242,154,179, 4,203,102,138,182, 19,233,110,165,156, 81, 95, 28, 92,216, +211,124,120,114, 13,179,207,212,130,230,231, 83, 10,152,223,239, 30,104,174,145, 59,214,211,210, 25,163,221,101,170,154, 59,161, +247,185,117,195,253,203,103,137,182, 67,235, 61,112, 81, 31,189,110,145,148, 47,100, 87, 47,217, 59,166,134,184, 38, 49,157,219, + 61,188,178,136,123, 43,169,150, 55,209,115,222,215,162, 97, 23,104,157, 95, 41,175,255, 40, 18, 46, 27,173,122, 48,162,133, 36, +245,145,223,236,162,129,239,231, 20, 15, 6, 91, 31,142, 77, 11, 92, 52,184,185, 47,250,165, 83, 59, 96, 19,197,142,252,240,210, +208, 44,114,111, 66,126,249,214, 45,218,251,167, 51,138,203,181,145,217,229,250,168, 28,146, 38,225, 95, 64,171, 85,177,216,191, +209,173,131, 97, 12, 31,150,150, 55,158,249, 39,115, 0,182, 66,133,176, 91,237, 2,164, 45,247, 96,243,244, 73, 85, 37,242, 28, +118, 70,247, 0,156,206, 69,139, 22, 13, 67,178,238,131, 96,196, 13, 18,176,186, 80,149,213,154, 52,105, 82, 13, 72, 94,234, 76, +158, 60,185, 38, 0, 86, 37, 0,187, 10,112, 69, 80,141,121, 28,129, 44,190,205, 30,208,226,173,200,145, 35, 15,249, 43,139,109, +181,161,179, 64, 11,180,212, 50,209,159,150,211, 54, 90,150, 64,139,170,195,233,211,167, 75,213,218,205,164, 78,161, 34,210,189, + 80, 46,153,219,186,137, 28, 57,114, 68, 81,203,134, 85,117, 72, 27,173,111, 42, 86, 45,155, 48,105,138,178,160,163,128,214,195, +135, 15, 43,231, 95, 82,117,168,187, 39,252, 51, 51, 58,222,117,104,103,242,234, 80, 36,173, 41, 96,110,235, 44,226, 57,180,188, +236,235, 24, 79, 38, 85, 51, 73,217, 76,166,243,229,115,196, 63,190,114,116,115,249,136,109,251,215,247, 45,145, 93, 11, 6,202, +183,121,146,125, 32,184,113,166,254, 57,146,155,254,216, 61,176,164,156, 24,152, 83,142,253,154, 67,120,206,107,206,208, 96, 94, +122,143,199,206,194,231,240, 6,255,174,108,150,120,222,157,170,231,248,180, 97, 84, 19, 9, 56, 50, 9,190,184, 38,201,254,169, + 45, 36, 95,170, 40,135, 33,141,136,171,151,182,178,195,112, 75, 47, 27, 59, 12,155,134, 48,124,167, 36,235,197,220, 74,242,109, +214,152,154, 18, 45,223, 11, 48,124,223, 55, 92, 94,204, 41, 47, 39,199,148,147, 53,221,242,203,220, 94,223,201,244,222, 63, 8, + 13,228,245,150,205, 86, 62,172,190, 82,180,172, 85, 90,252, 95,123,203,155, 71, 87,228,244,210,126,168, 55,119, 67, 38, 16,248, + 85, 41,231, 12,109, 72,172,238,127,188,180,198,252,241,226, 26,179, 92,219,108,118,239,150,198,124,121,184,155,217,103, 98, 46, +179,159,251, 79,230, 45,115,219,154,229,254, 62, 37,221,222, 49,209, 44,135, 70,152,245, 0,173, 44, 73, 77,141,168, 42,150,109, + 29,229,199,114,105,222,185, 37, 49,165,110, 81, 58,213, 59,130,237,197,157,243, 11,238,219,242,222,174, 89,116, 74,180,252,207, + 44,149, 87, 83,114, 57, 37,193,178, 69, 24,210,219,125,115, 91,102,120,243,102,217, 15,159,252, 87,213, 11,124, 63,183,120,160, +249,252,202,192,226, 25, 99, 62, 42,152, 72, 49,182,213,125, 36,136, 29,185,125,252, 88,145, 31, 50,197,139, 25,121, 4,119, 26, +190,152, 85, 90, 46, 14,113, 21, 72,187, 84,137, 86,137,166,133, 99, 15,128,100,171,167,225,222, 65, 55,107,141,140, 95, 15, 7, + 40,253,105, 6, 64, 53, 7, 32,200,147,137,231,188,134,164,185, 59,208, 78, 53,249, 28,253, 64,209, 9,115,225,160,196,115, 94, +211, 69,211,129, 68, 75,177,197, 2,157, 8, 3, 90, 22,210,173, 48, 1, 45,184,193,240,161,141, 86,133, 10, 21,164, 68,137, 18, +220,173, 41,243, 97,244,222,171,118, 53, 89,212,170,145, 92, 61,184, 95,134, 12, 25, 34,200, 39,141, 27, 55, 22, 72,243,172,125, + 79,218, 98, 99,176,141, 22, 54, 46, 40, 96, 10,187, 24,203, 86,173, 90, 85, 57, 63,119,238, 92, 89, 24,215,127,113,137,214,215, +211,173, 29,150, 84,191,163, 82,128,166,103,175,118,143,148, 87, 59,134,200,162,198,241,164, 94, 46,147, 63, 38,180,158, 92,245, +227, 21, 12,211,210,161,245,247,249,222, 30, 90,252,155,200,189, 3, 34,119,247,218,242, 22,239,208, 57, 30,221, 57, 52, 40,156, + 40, 80, 32,233,145, 23,215,133,231,188,166,193,236, 80, 52, 75,185,198,123, 46, 79,207,139, 60, 56, 44,183, 54, 13, 19,185,184, + 66,228,220, 34,185,186,230, 23,233, 92, 61,251, 39,168, 15, 23,104, 24,131,135,162,169, 0, 45,247,110,210,184, 68, 10,101,135, + 33,109,178,184,195,240,229,242, 70, 66,187, 44,170, 12, 9,178,234, 22, 76,112,251,249,172,111,108, 1,173,144, 94,241, 97,163, + 53,173, 71, 77,120, 87,223, 36, 87,151,116,146, 77, 3, 74,203,252,190,213,229,207,161,157,164, 91,173, 92,126,180,225,210,209, +201, 28,241, 51, 82,174, 20,145,101,193,152,159,101,246,208,246, 50,188,237,183, 74, 66,221, 5,182, 11,142, 36, 69,161,104,150, + 72, 31,245,124,205, 2,137,159, 52, 42,151,216,119,235,212, 22,230, 9, 77,147,154, 31,253,158, 67, 1, 90,111,151,213, 49,143, +109,152,204,252,110,114, 22, 37,237,236,153,213, 44, 75,202, 91, 3, 45,155,229, 44,152, 54,250,145,183,107,154,203,141, 63,107, + 9,220, 55, 40,128,154,191,215,166, 86, 22,223,165,181,164, 64,154,104, 71, 28,240,192,161,195, 82,255, 83, 11,229,229,248, 76, +138,234,208, 9,159, 89,161,104,230, 73,109, 74, 3,176,255,103,229, 28,113,188,119,143,168,250,222,127,239,240, 64,243,233, 69, +129,116, 90,170,163,125,152,197, 81, 27,101,131,127,176, 39,231, 6,102,148,164,113,255, 2, 90,234,161, 74,182,254,114, 88, 26, +211,112, 88,250,127,214, 24, 14, 54,117,118, 60,157,217, 12,126,254,133,162,244,120,127,183, 11,182, 44,120, 29,204, 79,123, 42, + 65, 43, 59, 44,187, 96,203, 22, 77, 94,131, 68,235,236,154, 53,107,228,208,161, 67,194,221,135,179,103,207,150, 65,131, 6,201, +246,237,219, 5, 59, 7, 21,117, 44,236,210, 4,182,106, 50,122,244,104, 2, 45, 91,238,118, 66,180,123,212,168, 81,139,227, 57, + 69,106, 69, 63, 89, 4, 89, 4, 86, 52,130,231,110, 68,254, 39,224,154, 48, 97, 66,217,254,253,251,151,101,126, 27,253,235,115, +244, 37,157,221,248, 31,155, 77,207, 60,254,255,194, 51,158, 33, 65,214,157, 94, 38, 41,152,198, 20, 0,149, 74, 40,195,194,188, +144, 72, 96,242,244, 39,200,146,227,147, 9,180, 66, 76, 30, 26,147,142,242, 50,132,229,121, 69,144,197,231,113,254, 90, 7,251, + 66, 53,110,201, 76,177, 95,200,131,163, 10,141,197, 61, 43,200,220,254,117,224, 93, 60,219, 71,218,122,193,225,100,214,176,208, +164,202,144, 95,217,142,225,223,201,171, 53,173,132,190,178, 8,178,120,120,252, 82, 66, 94,204,255, 94, 94,204,173, 44,207,161, + 2,228, 97, 67,162, 21, 26, 16, 98,215,225,200, 31, 75,250, 30, 95,216, 91,246, 47, 29, 37,115, 7,181,144,238,181,243,248,113, + 55,162,142, 50, 58,156,196, 41,181,234,214,180,162,248,191,130, 68,235,225, 21, 57,181,164,143,236,155,220,140,210, 55, 45,137, +150,221,143,165, 20, 84,131, 7,167, 54, 48,251,172,108,101,126,187,170,145,249,205,162,239,204,126,179, 75,155,219,150,138,255, +244,187,236, 49, 30, 51,213,203, 31,243,217,145, 30, 46,186,128, 22,164, 87, 47,100,125, 35, 25, 88, 39,179,100, 76,100,202,195, + 10,241,247,215, 90,153, 20,181, 49,156,203, 98,247,178, 93,187, 10,155,229,164, 52,235,221,158, 33,242,114,108, 58,121, 57, 58, +133,188, 24,145,196, 25,169,150,221,186,231, 72,101,202, 15,218,235,126, 44,155,246,217,133,197, 93,204, 0,112, 15,195,219, 70, + 65,207,103,139, 29, 61,210,157,152,209, 34,133, 8,193, 3,112, 5,201, 86,172, 95,225,214,225,187, 47, 52,160,125,142, 65,210, +160,169,179,147,232,204,102,240, 83, 39,163,116,102,179, 4, 69, 95, 13,208, 66,221,138, 17,108, 37, 78,156,248, 49,146, 55,236, +166,188,177, 57,192, 7,170,217,215, 49, 98,196,240, 5,176,122, 5, 21,159, 15,242, 60,198, 53,130, 44, 91,118,211,214,125, 41, +105, 16,120,114,232, 21, 30,180, 84,144,149,244, 11,141, 75, 58,155,242, 31,153, 45,108,170, 67, 37,120, 52,131, 72, 59, 8, 32, +205,123, 65,249,108, 5,154,214, 28, 40,130, 2, 77,251, 0,100,249, 48, 32,180, 14,246,133,162, 73, 26, 8, 36, 77,213,225,107, +120,159, 31,207,157,123,122,220, 25,216, 91, 65,240,122, 94, 23,211, 48,213, 87,150,186,195,144,187, 12, 41,201, 82,165, 89, 4, + 87,106, 98,126,171,178,219,172, 59, 37, 87, 52,140,167,205, 22,127,117, 74,178, 84,210, 14,249, 9, 48,224, 81, 46,163,137,210, + 71, 37,241,156,215, 52,120,106, 31,108, 96, 19, 68,153,204, 49,238, 85,204, 22,251, 81,197,172,177, 30,125,235, 22,243, 81,133, + 44, 49, 30, 81,226,165,210, 36,216, 46,149, 49,234,254,178,174,209, 44, 29,171,218,164, 9,105,229,111, 13,138, 38,125,157, 35, +121,228,241,150,101,202,146,196,244, 43,174,191,202,238, 18,249, 87, 7,101,181, 43,209,178, 14, 40, 29, 30,137,150,245,251, 65, +187, 18,210,118,244,241,121, 58,250,166, 67, 48,172,243,121, 91,217, 52,191,163, 48,208, 54,104,134,129,105,206,246,207,112,190, +194,104,163,112, 50,208,222,152,172, 71,162,165,170, 16,105,179,101,157,223,214,220,161, 71,162, 21,100,244,174,216,108, 89,231, +119, 52, 31, 69, 0, 27,190,150,190, 20, 1, 85,253,239,145,248, 90, 26,247, 95, 85, 78, 55, 55, 55,197,247,139,206,238,246,175, +170,187,206, 58,235, 2,174, 78,210, 50,104, 26,193,154,195,216,101,236, 62,102,124,155, 17,203, 81,167, 36, 90,142,192, 88,120, +128,150,142, 93,135,255,229,118,143,216, 22,255,178,212, 28,251,209,250,140,101,249, 47,119, 24,163,238, 17,219,177, 12,126, 26, +252,140, 40, 14, 24,125, 41,162, 56,249, 23, 29,131,159, 6, 63, 35,150, 3, 95, 39,181,136, 9, 42, 29,134,186, 27, 31, 96, 24, +152,230,224, 17,131,159, 6, 63, 35,138, 3, 70, 95,138, 40, 78, 26, 96,195,232, 75, 70, 95,138, 88, 14,124,157,212, 28,218,104, +241, 35,177,149,156,169,170, 61, 26,142,174,107,209, 55,104,218,110,151,176,182,151,193, 79,131,159,122,251,128,241,109,218,231, +128, 94, 30, 90,230, 51,248,105,240,211, 22, 7,254,203,125, 73,229, 71, 88,231, 51,173,111,234, 63,117,223, 88,233, 68,108,115, + 27,252, 52,248, 25, 81, 28, 48,250, 82, 68,113,210,144,104, 25,125,201,232, 75, 17,203,129,175,147,154, 97,163,165,209,110,198, + 64, 17,177, 29,219,224,167,193,207,136,226,128,209,151, 34,138,147, 6, 32, 52,250,210, 63,191, 47, 69,108, 9,191, 44, 53, 3, +104, 25, 64,203, 46, 7,140,193, 39, 98, 63, 70,131,159, 6, 63, 35,138, 3, 70, 95,138, 40, 78, 26, 32,243,107,233, 75, 17,219, +226, 95,150,154,227,160,210,159,177, 44, 95, 75,227, 26,229,140,216, 78, 96,240,211,224,103, 68,113,192,232, 75, 17,197, 73, 3, +108, 24,125,233,159,223,151, 34,182,132,255, 17,106, 70,199,142,216,134, 54,248,105,240, 51,162, 56, 96,244,165,136,226,164, 1, + 96,140,190,100,244,165,136,229,192,215, 73,205,121,207,240, 17, 84, 79,227, 3,140, 32, 70, 6,145, 49,248,105,240, 51,162, 56, + 96,244,165,136,226,164, 1,180,140,190,100,244,165,136,229,128, 65,205,224,128,193, 1,131, 3, 6, 7, 12, 14, 24, 28, 48, 56, + 96,112,192,224,128, 3, 14,132, 52,142,119,119,119, 87,194,181,168,191, 6,235, 12, 14, 24, 28, 48, 56, 96,112,192,224,128,193, + 1,131, 3, 95,146, 3,255, 50, 44, 98, 0,173, 47,217,121,140,119, 25, 28, 48, 56, 96,112,192,224,128,193, 1,131, 3,142, 57, +240,149, 3, 45,199, 54, 90, 95,121,229,140,190,107,112,192,224,128,193, 1,131, 3, 6, 7, 12, 14,124,229, 28,248, 87, 99, 17, + 84,174, 28, 43,200,223,175,188,157,140,226, 27, 28, 48, 56, 96,112,192,224,128,193, 1,131, 3, 95, 33, 7,254,245, 88,196,176, +207,250, 10,123,165, 81,100,131, 3, 6, 7, 12, 14, 24, 28, 48, 56,240, 47,226,128,129, 69,254, 69,141,105, 84,197,224,128,193, + 1,131, 3, 6, 7, 12, 14, 24, 28, 48, 56, 16, 65, 28,248,219, 66,240, 68, 80,249, 13, 50, 6, 7, 12, 14, 24, 28, 48, 56, 96, +112,192,224,128,193,129,127, 44, 7, 84,160,101,253,251,217, 11,108, 56,178,139, 88, 22, 27,252, 52,248, 25, 81, 28, 48,250, 82, + 68,113,242, 47, 58, 6, 63, 13,126, 70, 20, 7,254,203,125, 41,162,120,248,119,208, 49, 60,195,107,112,253,191,220,177,141,186, + 71,236, 39,105,240,211,224,103, 68,113,192,232, 75, 17,197, 73, 3, 12,127, 45,125, 41, 98, 91,252, 63, 66,237,107,105, 92,163, +156, 17,219, 33, 13,126, 26,252,140, 40, 14, 24,125, 41,162, 56,105,128, 13,163, 47,253,243,251, 82,196,150,240,203, 82,163, 68, +171,122,208, 43,249,107,109,179,245,217, 74, 99,116,236,136,101,173,193, 79,131,159, 17,197, 1,163, 47, 69, 20, 39, 13, 0, 99, +244, 37,163, 47, 69, 44, 7,190, 94,106,169,130, 0, 22,127,191,216, 97,124,128, 17,203,106,131,159, 6, 63, 35,138, 3, 70, 95, +138, 40, 78, 26, 64,203,232, 75, 70, 95,138, 88, 14,124,157,212, 12, 27, 45,141,118, 51, 6,138,136,237,216, 6, 63, 13,126, 70, + 20, 7,140,190, 20, 81,156, 52, 0,161,209,151,254,249,125, 41, 98, 75,248, 15,162,198,206,103, 43, 57, 83, 68,123, 52, 28, 93, +215,162,111,208,180,221, 46, 97,109, 47,131,159, 6, 63,245,246, 1,227,219,180,207, 1,189, 60,180,204,103,240,211,224,167, 45, + 14,252,151,251,146,202,143,176,206,103, 90,223,212,223,113,223,144,104, 25, 18, 45,187, 28, 48, 86,121, 17,251, 73, 26,252, 52, +248, 25, 81, 28, 48,250, 82, 68,113,210,144,230,125, 45,125, 41, 98, 91,252,223, 74,173,160,201, 20,219,162,110, 95, 75,227, 26, +229,212,238,144, 41,144,133, 73,207, 97,240, 83, 15,151,244,231, 49,248,169,159, 87,122,114, 26,252,212,195, 37,253,121, 12,126, +234,231,149,158,156,255,101,126,234,225,207,215,146,231,243,236, 58,204,105, 50,181,153,152, 39,249,199, 60, 38, 83,156, 32, 78, +216,237, 48,201,147, 39,159,153, 49, 99, 70, 63,252, 62,113,113,113,121,172, 38,252,127,140,244,200, 34,237,183,226,170, 77,154, + 49, 98,196,152,148, 62,125,250,183,137, 19, 39,126,146, 36, 73, 18,239,164, 73,147,122, 39, 75,150, 76, 73,160,165, 36,188, 67, + 73,184,119, 66, 15,205,112,182,230,231,253, 88, 68,162, 36,115,113,241, 74,149, 42,149,183,179,201, 37, 69,138,195, 78,130,225, + 81,145, 34,153, 62, 49,225,185, 81, 58,248,242,121,235,174,163, 0, 58,179, 4,151, 83, 76,166, 40,122, 82,110,147, 41, 81, 52, +147,169, 67,228,200,145, 47,197,136, 28,185,147,250,140,147,252, 12, 81, 60,255,163,166, 44, 1, 71, 76,245,205, 71, 77,237,248, +203,255,127, 99,255,172, 27, 45, 90,180,197,248, 70, 54,160, 12,221,144, 92,248,203,255,188,142,243,186, 14,120,235,176,221,203, +228, 55,245,173, 88, 52,218,213, 82,249, 77,173, 72,163, 92, 65, 83, 82,156,207,169, 88, 52,234,181,210,249, 76,109,236,208,117, + 68, 51, 18,158,137, 28,148,120,174,247, 8,166,185, 10,237,174, 55, 53, 74,156, 56,231,143,217, 50, 62,110,151,215,245, 80, 61, + 23,151,140,124, 46, 60,237,174,163,176, 95,252, 59,194,120,217, 18, 99,228, 67,140,151, 15, 49,142,182,212, 81, 70,102,209, 83, +206, 95,144,111, 92, 80,226,185,214,161, 69,243, 14, 8,224,243, 83, 18,207,245, 28, 90, 52,245,208,176,206,243,111,160,249,199, +186,117,235,228,213,171, 87, 50,104,208, 32, 65,219,223, 66, 37, 9, 18, 98,104, 48,196,186,238, 97,165, 19, 22,190,127, 13,207, + 68, 60,208,202,101, 50,125,255,123,149, 98,159, 62,204, 31, 22,168, 53,248,224, 99,158,219,188,121,115,179,224,184,124,249,178, + 4, 4, 4,200,135, 15, 31,228,227,199,143, 74,226,185,154,210,164, 73,243,192,138,163,161, 58, 54, 38,189,201, 63,252,240,195, + 27,210, 59,113,226,132,188,123,247, 78,252,253,253, 21,186,239,223,191, 87,254, 91,166, 20, 41, 82,120, 59,162,153, 32, 65,130, + 19, 0,108,222, 76, 4,109, 42,112, 35,120,179, 4,112,150, 32, 14,121,244,130,183, 42,120,247, 94, 29,137,249,236,127,212, 0, + 90, 4, 88,172,179,179, 71,218,180,105,239,105,181,145,197,253, 20, 4, 88,234, 59,112, 30, 24, 51,102,204,244,150,247,113,110, + 45,233,210, 28,124, 82,167, 78,253, 3,202,191, 19,105, 7,207,117,124, 53, 33,104,198,143, 31,255, 4,249,159, 50,101,202, 39, +106, 2,173, 39,150, 9,116,159,168,137,109,142,246,180,219, 70,142, 64,150,167,201, 20, 53,166,201, 84, 33,106,148, 40,238,160, +243,250,236,217,179, 10, 63,208,239, 30,132, 23,104, 17, 84,249, 29, 48,253,242,108, 79,204,163,190,183, 70,191,226, 47,255, 91, +129, 45, 77,126,234,224,159,158, 9,162, 5,142,211,222,222,222, 15, 94,190,124,249,232,207, 63,255,188, 18, 43, 86,172, 3,252, +229,127, 94,231,125, 16,234,104,231,125,118,203, 89, 34,191,169,120,235,186,169,252, 78,175,111,230, 87,161, 72,212, 83,165,242, +152,170, 87, 42, 17,253,193,180,126, 57,253,246,205, 46,237, 87,190, 80,228,115, 78,210,140, 20, 53,106,212,146, 88, 92,181,194, +196,208, 60, 40, 53,195,175,146,208, 39,148,132, 54,175,239,232, 59,210, 11,178,210,197,138, 85,178,126,230,244,126,119,134, 14, +150,179,221,186, 72, 43,215,116,175, 9,182,156,248,142,194,208, 68,186, 0,140,179,116, 29,246, 37,130, 44,142,189,102,179, 89, + 48,214, 61,212, 73, 92, 79,255, 28,135, 79, 70, 73,160,201,164,117,104,209, 12, 30,246, 64,136, 96, 75,207,225,136,102,172,168, +145, 35,247,140, 19, 35,198,142,152, 81,163, 62, 97,226, 57,174,245, 2,225, 88, 14,136,107,149, 83, 79,185,244,124,155, 97,161, + 99,249,140,163,114,198,195, 55,115,115,210,164, 73,226,231,231,167, 36,158,243, 26, 8,196,115,162,238, 97,165, 19,222,186,253, + 83,158,255,188, 54, 90,144,100, 21,254, 57,191,219,123,243,138, 73,159, 2,234,102,176,236,244,161, 26,151, 32,171,230,119,223, + 5,127, 36, 5,179,102,149, 1,205,155,203,232, 78, 29,101, 98,143,174, 74,154,212,253,103,153,209,167,183, 60,126,252, 88,116, + 0,173,177,117,235,214,245, 81, 9,182,106,213, 74,182,108,217, 34, 71,143, 30,149,243,231,207,203,213,171, 87,229,214,173, 91, +242,224,193, 3,121,242,228,137, 96,194, 16, 45,160, 69,128, 69, 96,166, 30,129,129,129, 10, 0,228,224, 67, 0,199,123,236,140, +111,223,190, 85, 18, 87, 2,148,148, 89,181,182,189,142,189,151,249, 89,158,251,247,239,203,189,123,247,228,238,221,187,114,231, +206, 29,185,125,251,182, 82,214,155, 55,111,146,135,123, 29, 77, 16, 38, 11,160, 53,124,216, 80, 25, 58,168,143,140, 28,214, 71, +249, 29,208,191,159,244,235, 23, 58, 77,157, 58, 85, 62,125,250, 68,158,134, 25,104, 85,175, 94, 93,106,212,168,113, 28,128,166, + 79,148, 40, 81,254,180, 35,233,210, 28,124, 0,128, 60,125,125,125,189,152,112,190, 71,199,151, 18,130, 38,219,232,225,195,135, +242,252,249,115,121,241,226,133,146,216,182, 76,228, 47,211,235,215,175,149,196,123, 0, 9,130,247,216, 5,237,182,128, 22, 68, + 57,153, 48,208,142, 42, 82,164,200,243, 81,163, 70,189,171, 85,171,150,212,169, 83, 71, 78,158, 60, 41, 99,199,142,253, 16, 41, + 82, 36, 63,244,253,196,124,214,193,132, 59, 0,247,174, 33, 93, 69,234,109, 93, 79, 74,176, 8,174,142,108,108,164,116, 55,254, +242, 63,175, 59,160,169,131, 93,154, 89, 66,181, 17, 22, 24,235,193,171,135,168,219,165, 31,127,252,241, 12, 22, 42,143, 80,164, + 71,252,229,127, 94,231,253,184,113,227,174,181, 67,221,110,187,151, 41, 96,218,181,107,241,143,126,135, 87,181,246,131,100,235, + 65,253,111,227,191, 58,180,184,166,223,193, 69, 85,252,218,213, 73,234, 7,137, 86, 55, 39,104, 82,122, 85,178, 81,163, 70, 45, + 80,190,118, 23, 47, 94,108,199, 95,244,237,118,248, 70,219,225,219, 84, 18,250, 86, 59,130, 45, 71,223,145, 30,160, 21,215,100, +202,153, 49, 99, 26,191, 73, 93, 59,136,249,247,209,226,219,188,129, 28,202,145, 73,218,102, 74,126,232, 75,183,145,102,171,106, +103,112,248,109, 82,146,197,126,200, 49, 41,103,206,156, 47,241,157, 61, 66,210, 90,153,107,126,239, 40,214, 63, 25,104, 21,141, + 17, 53,234,253,149,139,166,127,188,123,243,140, 4,188,127, 44,103,207, 28,149,139,103, 15,201,210,217,147, 63,240, 30,202, 95, +212,137,254,169,221, 10,142,115,232,225,167,179,239,176, 73, 51,101,201,142,117, 82,149,238,242, 36,117,169, 78, 79, 18,185,126, +243,218, 37, 85,134,143,148,106,113,252,164,148, 11, 47,249, 67, 15,208, 74, 89,172, 99,157,148, 37, 59, 63, 73, 89,162,211,147, + 4,153,191,121,157,220, 57, 58,206,214,229,191,151, 31, 19,141,107,195,116, 46, 47,222, 45,159,248, 49,160,121, 94,121, 81, 54, +150, 93,160, 69,117, 33, 86,196, 1,150, 18,152, 46,245,234,137,215,194,217,114,127,203,106,121,177,111,147,188,216,139,180,199, + 93,118, 79,159, 44,143, 30, 61,210, 4, 90,233,210,165, 83, 36, 89,234,241,219,111,191,201,206,157, 59,229,212,169, 83,161, 64, + 22, 39, 92, 2, 35, 12,190, 14, 65, 17, 39,113,210,219,177, 99,135,236,217,179, 71,246,237,219, 39,135, 14, 29,146, 99,199,142, + 41,147,236,153, 51,103,228,194,133, 11,114,229,202, 21,185,126,253,186, 96, 64,119, 6,104, 81, 82,245,234,205,155, 55,202, 96, +198,115,164,189, 22,233,213,211,167, 79,157, 2, 90, 4, 87,190,247, 22,138,255,245,159,228,245,157,249,242,248,193,117, 89,179, +110,131,180,104,215, 77, 42,124,223, 64, 6, 15, 31,163, 0, 56, 72, 38, 20,176,232, 36,208, 98,167, 30, 85,189,122,181, 64,130, +172, 41, 83,166,188, 0,240,244, 66,253,207,186,185,101, 9,230,123,144, 90, 81,149,108,105, 14, 20, 0, 61,135, 9,178, 54,111, +222, 76,160,101,169,202,180,247, 17,133, 2, 90, 4, 89,238,238,238, 2, 26, 10,184,222,182,109,155,108,223,190, 93,118,237,218, + 37, 93,103,156,149, 86, 19,207, 75,131,190, 75,229,224,193,131, 10,104,135, 36, 79, 19,104,149, 51,153,226, 70, 51,153,154, 71, +143, 22,237,116,134, 12, 25, 94,127,251,237,183, 31,213, 74, 66,122, 18, 8,245,217,115, 72,178,110, 71,143, 28,185, 15,196, 25, + 46,142, 36, 90,232,155,165,144, 55,196,202, 27,234,114, 95, 53,129,158,111,255,182, 73,252,189, 47, 12, 11,180,236,195,175,174, +143,244,165, 26,241,111,152,196, 27, 64,138,177, 9,239,237,139,212,160,105,211,166,167, 9,180,248,203,255, 72, 61, 32,185,117, +199,175, 45, 41, 17,139,107,179,221, 1,162,190,239,209, 42,143,223,245,125,131,252,102,143,172,226,247,109,177,104,126,123,151, + 52,241, 59,183,177,133, 95,243,234, 73,124,203,228, 51,181,208, 51,152, 7,229, 33,200, 42, 86,175, 94,189,102, 4, 87, 76, 75, +151, 46,109,135, 54,111,119,238,220,185,118, 55,110,220,104,135,239,170, 29, 22, 50,237,176,176, 10, 55,208, 34,200, 74,147, 46, +169,239,153, 51, 94, 88, 24,221,148, 9,245,170,137, 79,153, 66,114,169, 88, 94,105,153, 54,249,227,191,161,141,194, 59,201, 56, +250, 54,179, 65, 51,240,130,139, 74,128, 87,225, 56,196,241, 50, 81,162, 68, 90,146,173, 16, 52, 33, 5,229,248,170,168,245,130, +206, 89,230,223, 96,222, 49,150,137,231, 65,149,112,164, 78,180,164,121, 71,165,135, 95,158,243,176,117, 77,139, 55,182,234, 94, +164,104,145,124,111, 30,220,189, 40, 23,206,239,146, 55, 47,183,203,135,247,123,165, 83,199,122,210,187, 87, 27,121,235,123, 75, + 30,222,185, 32,185,115,102,123, 3,226,182,192,150,230, 88,167, 85, 40, 27,247,191, 24, 77, 0, 35,159, 22,191, 31,147, 14, 51, + 46, 43,169,253,148,115,146, 62,247, 55, 50,100,200, 16,101, 72,202,157, 59, 55,205, 69,146,216,169, 67,112, 57, 83, 20,239,232, + 83,121,192, 1,169, 49,236,140,146,170, 13, 62, 33, 46, 89,203,254, 69,199,236, 45,141,106,100,254,116,106,177,169,198,135, 35, +166,114, 76,230,195,166, 34,114, 84, 49, 75, 8, 62, 48,150,151,115,244, 63, 12,124,252,210,143,168,206, 74, 45, 37, 91,127,149, +129, 19,149, 85,229,244,138, 97, 77,249, 77,166,100, 21, 18,198,185,253,114,222,200, 15,230,174, 21,228, 21, 64,214,249, 34,209, +237, 62, 79,155, 44,203, 9,133,231,227,186,116,150,115,203, 23,136,247,206, 53,193,183, 8,184,246,204,152,100, 15,104,133, 96, + 30,109,178, 8,126, 58,116,232, 32,131, 7, 15,150,249,243,231,203,225,195,135, 21,149, 36,193, 5,165, 70,148,100,169, 32,139, +234, 68,170,220, 28,181, 0, 85,133, 44, 12, 65,214,222,189,123,229,151, 95,126,145,190,125,251,138,151,151, 87, 40,144, 69, 41, + 20, 7, 35, 27, 18, 45, 71,175,216, 75, 73, 11,203,135, 76,123,173, 50,170,170, 69, 91,170,195,255,103,181,144,104,141, 24,218, + 91,222, 93,109,247,151,164,237, 74, 91,185,131, 85, 89,199,238,191, 6,243, 51, 99,246,194,114,233,210, 37,153, 49, 99,134, 34, +145,179, 2, 90,154,157, 17,249,243, 20, 45, 90,244,236,128, 1, 3,206,130,199, 94, 3, 7, 14,244,194,106,231,108,141, 26,213, +237, 1, 45, 77,154,104,131,117, 7, 14, 28,240, 90,181,106, 21,237,204,214,105, 62, 96,149,129, 96,152,109, 90,191,126,125, 33, + 0,180, 78, 45,198,159,151,243,119,124,165, 80,245, 94,148,192, 41, 18, 68, 27, 18,173, 96,170,216,193, 81, 48, 82, 66,183,131, + 49,147,100,122, 59,126,252,248,143,207,158, 61,147,106,213,170,113,160, 17, 72, 73,223,129, 7, 47,163, 68,142, 60,159,249,108, + 73,191,108,149,223,205,205,237, 22,193,250,138, 21, 43,148, 68, 96,110,125,124,242, 89, 41, 47,189, 74, 43,146, 44, 30,252, 61, +184, 32,158,191,149, 68,203, 89,246, 68, 84,254, 31, 65,136,192,171,117,120, 8,150,206,111, 90,115,108,203, 32,191,219, 71,198, +251,117,111,153,211,111,120,143, 98,126, 87,118,246,240, 91, 49,169, 58,165, 91,215,203,230, 55,121, 86, 41, 25,227, 49,206,245, +188, 39, 50, 0,115, 75, 21,100,241, 23,188,109,135,197, 80, 59,124,243,237,240, 61, 6,131, 44,180, 97, 59,180,185, 45,137, 86, +112,117, 28, 73,180, 8,178, 82,165,141,231, 59,223,205, 18, 81,186, 0, 0,255,244, 73, 68, 65, 84,189,150,252,185,176,155,120, +238,219, 41, 11, 22,204,148, 49,141,234, 72,171, 92,110,239,104,179, 21, 30,190,252,195,158,205, 6,205,192,115,142,143, 28,151, + 56, 86,120,120,120,200,218,181,107, 37, 97,194,132, 90, 64,203,186, 42, 33, 22, 23, 65, 55,105, 75, 23, 53, 40,241,156,135, 94, + 41,151, 45,122, 17,193,190, 24,177,162, 71,191,243,232,254,101,217,177,253, 79,241,121,122, 22,239,249, 36,159, 62, 62,144, 6, + 13,170, 72,197,111, 75, 72,191,190, 63,193,252,228,190,220,186,122, 94,130, 36, 91,142,212,136, 17, 81,166, 47, 74,195, 90,162, +149, 60, 69,186,143, 61,122,244, 80,132, 20, 27, 54,108,224,252, 52, 77, 79,129,172, 37, 90,201, 82,166,251,216,171, 87, 47,185, +125,237,168, 28,222,214, 95, 22, 12, 54,157,126,178,195,180, 64, 77,207,119,155,198,249, 29, 54,213,178, 4, 91, 42, 22, 81, 1, +151, 53, 54,209, 83,142,191, 57,143,186, 56, 14, 45, 1,182,168,156, 2,144,244, 86, 46, 43,116,183, 5, 98, 68,191,121,127, 98, + 31,179,121, 80, 35,121, 83, 46,150, 92, 44, 26, 35,176, 83,178,200, 31,173,118, 30, 6,215,157,134,239,215,174, 93,147, 18,185, +114, 73,239,198,141,101, 98,215,174,178,105,236, 24,185,177,126,185,188,220,183, 49,248, 99,122,233, 4,208, 34, 40, 34,192,160, + 52,131,146,140, 35, 71,142, 40,210, 38,107,144, 69,169, 19, 7, 17,170, 1,245, 0, 45,230,163, 36,139,234,182, 38, 77,154, 72, +231,206,157, 21,189,181,165, 36,139, 32,139, 64,142, 64,203,134, 58,210, 81,155, 43,234, 67,172,190,237, 73,174,180,251,139, 5, +208,162, 68,235,201,149, 63,228,205,197, 86,242,248,210,116,185,114,209, 75, 90,117,232, 37,115,246, 7, 72,219,185,207, 37,117, +230, 60,138,132,111,250,244,233, 10, 24,115, 2,104, 69,198, 68,213,188,124,249,242, 71,231,204,153,227,181,120,241, 98,175, 63, +254,248,195,107,220,184,113, 94, 88,169,120, 65, 66,246,130,146, 46, 39,140,228,131,235,133, 54,152, 5,254, 1,187,122, 17,104, +205,210,174,112,200, 28, 4, 90, 84, 19,218, 59, 8,180, 46,223,127,171, 0, 45,170, 24,169,162,197,123,236, 78, 24, 80, 3,190, + 28, 50,195, 93, 98,187,213,150,185, 11,150,202,234,213,171, 63, 66, 53,250, 2,118, 89,135,163,155, 76, 63,212,131,157,134, 35, + 59, 46, 91,229,167, 61, 31,219,152,160,159, 18, 2,170,178, 79,159, 62, 45, 91,183,110,149, 69,139, 22, 41, 18,198,213, 75, 70, +201, 25,143,198,114, 96,113, 74,121,120,118,176,220,221,147, 87,134,118,136,238,107,195, 32,222, 89, 22,253, 99,242, 67,162,117, +244,206,169,185,126,247, 78,254,233, 87,191,170,139,223,254, 53, 61, 20,233,214, 72, 0,174,159,155,185,250, 29, 95,211,210,239, +228,218,166,126, 21, 10, 71, 62,169,163,208,145, 49,241, 55,163,186,144,146, 44, 38, 72, 52,219, 97,177,165, 72,179, 84, 73, 22, + 65, 22,190,177, 48, 3, 45, 21,100, 45,216, 92, 91, 22,109,175, 40, 99,230,229,148, 38,109, 74,201,184,241, 99, 4,106,196,119, +180,217,178, 50,134,215, 81,244,127, 86, 22, 72,246,219, 99,129,200,141, 71, 23, 85,144, 69,179,133,149, 43, 87,210, 62,235, 9, + 37, 89,224,245, 35,168,148,181, 84,135,122,128,150,173,202, 71, 4,208,138, 22, 39,150,169, 71,134, 20,145,246,187,166, 74,248, + 32, 67,156, 40,251,227, 68,141,220, 3, 47,131, 96,218,241, 1,105,115,167,205,235,230,126,248, 16,112, 81, 62, 4, 92,135,134, +225,162,244,232,222, 84,154, 55,171, 33,111,223,156, 70,186,132, 5,250, 85, 41, 82,172,168, 84,175, 89, 87,186,116,232,248, 49, +200,102, 75,139,244,215,118,159,182, 85,119,126,253,245, 87,153, 55,111,158, 44, 95,190, 92, 17, 90,184, 37, 77,250,113,146,201, +244,244, 79,147,169,142,206, 10, 41,116,176, 16, 87,250,208,198,141, 27,101,206,228,246, 50,181, 95,236,215,183,221, 77,199,110, +109, 52, 41, 38, 62,252,189,191,213,116,152, 96,139,146, 45,149,118, 88,177,136,206,178,125,137,108,218, 18, 45,235, 74,106,149, +202, 45, 90,140, 91, 39,251,182, 12,252, 48,177,171,188, 45, 31, 7,162,244, 24, 31,155, 39,140, 36, 88,226,117,179,247, 44,192, +200, 99,130,157,223,126,252, 81, 78, 67,242,116,126,241, 98,185,177,106,165, 60,245,112, 87,212,133, 58, 85,135, 33,200,115, 50, + 35,120,160, 17, 60,140,148, 21,169, 1, 7, 11, 2, 32,218,229, 80,234, 97, 9,178,216,208, 90, 64,139, 52, 41, 62,167,186,176, +117,235,214,202,132,200,201, 17,106,207, 96,117,161, 10,178,168,146,162,189,150,179, 64,139, 32,129,171, 6, 84,102,111, 80,133, +244, 73,178,212,218, 91, 0,173,254,253,250,202,133,179,176, 41, 56,119, 72,206,158, 58, 36,167, 78,122, 73,227,150,157,100,246, +190, 0,105, 51,231,185, 36, 79,155, 85,169,203,180,105,211, 20, 94, 0, 60, 89,218,104,217,108, 46, 12,194,233, 51,103,206,188, +112,214,172,153, 94,224,173, 23, 84,115, 94,232, 35, 94,235,215,175,247, 90,178,100,137,114, 14,222, 18, 36, 81,226,161,215,237, + 67,132, 1, 45, 2,108,242,144,171,110,170, 11,169, 46,222,189,123,183,120,122,122, 42, 0,185,110,207, 37, 82,172,118, 95, 41, + 89,187,151,162, 86,100,123,161,141, 28, 1,173,215, 7, 46,190,148, 74,173,127,255, 16, 41,121, 17, 95,168, 6,127, 73, 99, 50, +165,214,179, 19,209,202, 70, 43,184,142, 44, 35,129, 63,120, 38,200, 35, 0, 5, 50,124,248,112,101,165, 72, 9, 27,141,142,185, +240, 88, 60,103,144,204, 30, 91, 89, 54,204,169, 38, 59, 87,181,151,252,217, 99, 63,211,250,254, 62,243,253, 90,160,191, 30, 19, +236, 57, 24,156,123,224,156,187, 4,129, 61, 76,173,248,159,215,121, 31,137,249, 52,143,202,197, 99,221,240,190,188,198,239,209, +249, 37,126,141,171,167,246,187,115,124,154, 34,221,234,213, 58,143,223,233, 45, 61,252,230,140,168,236, 87,183, 66,252,215, 26, + 42, 68,245, 61,145,192,215,166,180,199,130,196,185, 29,164,162, 10,200, 2, 31,219, 65,157,168,168, 11, 85,144, 69, 59,173,176, + 72,180, 8,178, 82,167,143,247,198, 18,100,117, 31,146, 79,186,247,251, 65,210,101, 76,233,203,251,170, 36, 76,179,242,255,224, + 12,148,194,179, 15,242,224, 47,199, 77, 74, 94, 49,254, 81, 37,154, 45,172, 69,183,165, 58,180,163, 78,212,187, 19,241, 14,202, +162,168, 34,145,120,174, 30,174,153,210,198,191,181,123,205,160, 79,190, 15,118, 72,160,247,177,231,175,247,111,144,205,195,186, +125,202,144, 56, 30, 13,185, 93, 29,213, 33,118,140, 24, 91,158, 63,189, 42, 31,252,247,129, 3,129, 80, 23,214,151,122,245, 42, + 75,133,242,197,197,236, 79,147,144, 91,242,204,231,182,116,239,221, 91, 18, 38, 79, 43, 3,126, 25, 44, 52,144, 15, 43, 95,254, +193,207, 77, 35, 48,130,234, 93, 40,205,202,151, 52,169, 76,136, 26, 85, 30, 69,143, 46,119,163, 69,147, 25, 38,147,143,206,178, + 43,116,168, 61,161, 52, 11,253,235, 78,207, 38,166,113, 15,182,153, 22, 19, 92,173, 26, 13,203, 98, 28,252,229,127, 74,183,168, + 70, 84,105, 19,131, 80,154,101,249,171,243,189,255,252,108,214, 21,179,214,147,218,170, 65,236,228, 89,127, 90,219,236,187,192, + 15,152, 32,222, 85, 76, 40,151,138,196,240,175, 19,207, 49,200, 34, 29, 76,202,143, 8, 96,126,239,212, 73, 30, 98,178,241, 6, + 99,159, 97, 18,124,182,117,139,248,108,223, 34,207,119,110, 86, 18,207,119, 77,177,107,163, 21,162, 72, 4, 69,148, 40,177,147, +216, 3, 89, 84,151, 81, 66,165, 30,122,128, 22,109,153, 40, 37,251,230,155,111, 20,219, 44, 74,178, 8,180, 56,145,171, 32,139, +147, 40, 39, 78,174, 0, 96,207,243,196,137,214,222, 75, 0, 72, 73, 7,158,121,133,180,151,191,180, 73, 11, 58,215, 38,101, 1, +180,250,244,233,163,148,113,255,254,253, 50,123,246,108,101, 53, 82,172,116, 69,153,180,229,169,180, 6,208, 74,150,198, 77, 1, + 33,148,206, 81,101,169, 5,180,168, 42, 44, 87,174,220, 97,108, 40,240,130, 52,200, 11,160,192,235,230,205, 27, 94,231,206,157, +245, 2, 29, 47,216,165,121, 1, 48, 43, 82, 45,240,178,161,118, 97, 67,231, 8,175, 68, 75, 5, 90, 84,205,169, 32, 75,181,167, +195,228, 43,251,246, 31,144,117,235, 55,202,198, 77,238, 10, 72,230, 36,162, 33,209,122, 79,160, 53,106, 21,212,185,169,202,113, + 71,225, 39, 72,180, 52, 19,242,249, 59, 2, 90, 28,120,104, 84, 10, 21, 41,237,219, 20,208,231,227,227,163,168,183,185,226, 35, + 0, 38, 80,236,223,191,191,252,252,243,207,202,246,106, 24,155, 59, 84,109,135,133,223, 78, 60,211,182, 98,197,138,247, 33,125, + 51,179,156, 24, 52, 63,116,234,212,137,125,251, 44,127,249,159,215,121,159,249,112,189,167, 22,237,186, 21, 93, 94, 62,187,233, +225,247,228,202, 6,191, 78,205,114,251, 61, 56,187, 64,145,110,117,255, 49,143,223,173, 67,163,253,126,172,147,214,207, 37,169, +137,253, 72, 85, 41, 57, 36, 73,160, 69,149, 33,109,178,168, 46, 84,237,178, 8,180,152, 40,201, 34,200,194,119,239, 52,208, 82, + 65,214, 66, 11, 73, 86,183,193,121, 1,178,234, 74,102,183, 84, 47, 44, 65,214,215, 46,209,226,174, 93,142,115,148,186,114,145, +202,241,129,146, 44, 48, 63, 4,200,194,132,217, 22,106,240,135, 88,124,253,172,213,214, 14,238, 71,180,250, 47, 90,186, 84,177, +110,188,188,189, 41, 80,110,193, 14,232, 96, 6,145,185,137,246, 74,219,108, 34,179,123,201,227, 21,147, 2,211, 37,136,117, 3, +229,177, 43,217,194,206, 66,111, 26,190,127,240,223, 47, 39,142,239, 14, 6, 89,121,243,102,151, 55,111,110,201,211,103,183,229, +238,195,187,178,121,199, 30,137, 22, 47,133, 52,111,211, 69,184, 27, 49, 28, 60,248, 39, 62,154, 36, 79,158, 60,138, 29, 42,237, +169,224,190,198,127, 70,164, 72, 79,102, 69,138,228,205, 4,105,214, 19,157, 18,173, 16,116, 80, 81,110,152,137, 78, 32, 69, 64, +101, 75,243, 96, 13,180,200, 28,103, 5, 62,255, 68,134,218, 45,147, 51,149,139,159, 34,251,247,195,126,159,250,250,254,249,179, +114,183,146,139,156, 42, 18,227, 67,149,216,218, 32,203, 18,104,225, 92, 26, 86,168,160, 36,170, 16, 21,176,133,180, 97,244,104, +229, 26,127,119, 77,214, 7,180, 56, 88,208,176,156,160,133,147, 41, 85, 68,148,100,209, 80,154,210, 27,107,144,165, 87,162, 69, +187, 46,236,180, 82,118,239,169,234,194,137, 19, 39, 42, 82, 33, 74,203, 40,145, 32,192,225,238, 70, 72,120,164,113,227,198,239, +156,104,244,189, 44, 31,213, 73,164, 77,149, 18,129, 34, 7,187,176, 2, 45, 74,113,160,214, 83,212,100,116,105, 49,103,206, 92, +105,208,101,130,180,154,237, 3,137,150,155, 50,193,115,162,167, 20, 72, 11,104, 97, 64,157, 68,245, 32,192, 27, 64,213, 53, 5, +104,129, 31, 94,144, 20,120, 97, 96,246,162,202, 15, 0,244, 16, 0, 89, 19,148,215, 25,255, 69, 10,139,176,155, 41,110,236,216, +177,253,217, 15,152,120,238,234,234, 26,223, 9,254,153, 8,180,168,126,165,186,152, 32,210, 18,100, 17,188, 16, 4,179,109,142, + 31, 63,174,216,214,113,211, 2, 36, 90,143,236,189, 3,128,201,123,249,190,199, 10,208, 74, 95,188,133, 98,100,207,163, 43,212, +219,180,255, 83, 15,236,116, 19,168, 89,130,255, 19,140, 57, 2, 90, 92,217, 1,180, 74,201,146, 37,185,139, 75,217, 0,177, 6, +118, 47,117,155,118,144, 2,197, 43,192,254,171,181, 2,182, 40,110,135,154, 70,177, 53,251, 59,129, 22,140,253,247, 97, 7,236, + 39,128,117,159,188,121,243,222,249,233,167,159,188,249, 13,241,224, 47,255,243, 58,239,163, 31,124,130,132,107,187, 29,158, 82, + 2, 70,223, 88,251,190, 41,154,208,247,218,233,117,126, 87, 78, 44,247,171, 82, 42,142,223,133,131, 51,253,206,237,155,226, 87, +231,219, 36,126,103,119,141,240,171, 94, 54,129, 95,229,202,149,159, 69,143, 30,253, 60,242, 87,215,234, 7, 4, 90, 4, 89, 51, +103,206,108,135,239, 83, 1, 87,214,137, 32,139, 82, 47,103, 36, 90,182, 65, 86, 30, 5,100,185,102, 77, 29, 10,100,125,237, 64, + 11,160,170, 61,210, 35, 76,180, 47, 41,153,231,166, 18,244,193, 80,210,238,134, 13, 27,222, 13,218,240,115, 93,171,109,190, 20, +208,138, 28,217,212,113,197,198,238,175, 63, 61,154,122, 95, 60,227,139,146, 8,180, 26,167, 20,166,103, 51,102,220, 24,219,114, +240,139,200,166,200,246, 92,145,152, 8,180, 46,156, 63,166, 72,178,110, 92,219, 10, 85,225, 89,121,243, 10,155, 0,158, 93,145, + 68, 73, 93, 36, 86,252,100, 18, 59, 97, 74, 41, 89,161,134, 28,240,186, 38, 71, 79, 93,251, 55, 2, 45, 54,217, 20, 43, 63, 90, +183,113, 77,143, 31, 45,235,230,182,166,115,203, 25,137, 86, 16,208,218,107,249, 27,142,254,246,117, 62, 90, 48,107,230, 97, 21, + 74, 20,126, 88,177, 74,109,115,128,249, 99,224,197,187,190, 50,164,125,143, 55,101, 98, 69, 13,204, 18, 45,214, 20, 61,181, 82, + 37, 90,234, 4,171,245,107,103,215, 97,136, 87, 17,104,113,194,181, 6, 89, 4, 95,156, 24,232,206,192,250,208,146,104, 97, 55, + 88, 0, 38, 19,233,217,179,167, 50, 73,171,187, 11, 9,102, 48,209, 40, 59,216, 8, 92,104,179,197,247, 48, 97, 2,118, 10,104, + 81, 42, 64,112,133,202,188, 10, 2, 87,175, 8,224,194, 10,180, 40, 21, 25, 54,108,152, 82,103, 30, 4,112,177, 98,199,149,116, +174,185,228,219, 42, 53, 21,157, 57,203,203,247,106, 1, 45,236,150,219,179,105,211, 38, 69, 61,200, 68,192, 69,176, 5, 94,122, + 97,139,255, 9, 60, 63, 20,124,119, 90, 93,200,134, 3,136, 43,147, 43, 87, 46,138,223, 67,172,112, 75,148, 40,177, 7,237,162, +123,183, 13,129, 22,165,115,148, 86, 81,242,216,105,218, 57,161, 93, 86,173,110,243, 21,169, 35, 55, 49, 80,178, 69, 16, 67,176, + 69, 21,157, 35,160, 5, 27,173, 27,148,100,165, 43,214, 76, 76, 73,242, 9,252,188, 41,210, 76,238, 26,100,226,185,245,127,170, +149,113,239,163, 94,160,149, 61,123,118, 69,138, 85,167, 89, 23,233,252,235, 52, 41, 84,184,172,228,117, 73, 38,195,250,245,161, + 77,152,196,137, 19, 71, 49,192,255, 59,129, 22,218,165, 25,118,134,113,176, 27,140,148, 20,169, 23, 54, 19, 60, 96, 99,241,151, +255,131,174,255, 10,144,197,124,141,109,125,251, 0,160,171,123,247,238,237, 3,181,243,243,179, 39, 15,251, 76, 29,213,254,213, +196, 97,173, 94,239,222,186,252,133,122,190,108,238,136,151, 35,251,215,127,189,121,237,172, 23,248,214,159, 65, 13,236, 3,160, +119, 86,107, 44,129, 29,136, 2,180, 32,189,181, 9,180, 0, 12,218, 49, 81,234,165, 23,104,193, 89, 80,214,212, 25,226,189, 89, +184,165, 78,176, 77, 86,183,193,142, 65,214,215, 14,180, 84, 62,211,222,145, 64,106,217,178,101, 2,181,176, 53,208,138,133,126, +251,148,146, 47,124, 19, 47,240,253, 94, 1, 79, 59, 56,106,163, 47,161, 58, 76,154,194,180,237,206,203, 37,114, 65,220,228,230, +211,104, 39, 3,247,199,191, 65,160,245,178, 78,254, 27,155, 11,140, 57,185,165,194, 60,241, 28,177, 89, 18, 69,141,191,205, 94, + 89,169, 58, 60,184,207, 67,154, 54,173, 41,243,231,141, 22,255,119, 55,224,214,224,166,120, 63,185, 45, 81, 99, 38,144,168,113, +146, 74,244,248, 41,101,250,188,181,178,255,228, 45,217,178,245,192,191, 85,117, 24, 7,223,212, 13, 27,126,180, 40, 17, 84,157, +143,107,125,150,188, 31,138,206,242, 57, 61,100, 90,255,216, 47,239,108, 54, 29,213,178,209,210,243,130,127,120, 30,107, 91, 70, +231,108, 27,221, 50,167,169,218,174, 81,237,215,119,207,123,201,214, 63,127,151,238,191, 77, 10,252,115,211,165,215,169,178,151, +125, 26, 47,153, 91, 41,189,149,167,234,134,170,195,170, 21,234, 74,255,159,199,134, 74, 91, 55,122, 10, 19,239,253,216,168,171, +174, 93,135,244,248, 78,160, 69, 73, 22, 1, 16, 37, 69,142, 64,150, 30,137, 22,193, 27, 39,113, 91,134,239,148,110,208,230,134, +210, 44, 26, 54,211, 62,140,246, 13, 54, 92, 70, 56, 98,203, 94,238,106,163,155, 8, 11, 96, 21,102, 27, 45, 76,104, 74,153, 8, + 12,105,255, 67, 29, 57, 36,108, 2, 41,145,178, 11,115,238,220,185, 50,107,214, 44,193,110, 58,101,203,182, 22,208,194,253, 93, + 4, 88,170, 93, 22,207, 1,208,188, 32, 17,163,170,176,166,222,246,182,204, 7,240,150, 8,116, 71,182,111,223,222, 11, 19,170, +151, 53,208,162,148,236,247,223,127,247,194,142,178, 9, 80, 85, 36,215,122,135, 10,180,176, 29, 93,152, 44,141,223, 9, 86,212, +235,252,109,208,160,129, 98, 15, 71,195, 95,123,116, 9,150, 48,201,123, 79,134, 36, 21,128,140,237, 73, 62,113,227,128,160,236, + 2,240, 13, 35,232,140,146, 41, 83, 38,133,175, 89,178,100, 17, 72, 97,184,125,157,190, 56, 44,253,104, 5,191,130,101,180,150, +104,209, 6,166, 80,153,106, 82,184, 88, 69,249,198,205, 77, 26,184,101,144,238,223, 87, 82, 36,110,144,232,252, 19,128,150, 45, + 22,117,193,197,125, 72,186, 85, 71,165, 74,149,186, 9,233, 41, 62,163,215,175,161,218,127,141,254,243,156, 96,202, 86, 2, 40, +126,134,190,251, 12,125,195, 7, 96,243,178, 86,219, 19,104,225,219,105, 7,195,221,118,216, 17, 28, 66,154,101, 9,178,156, 1, + 90, 25, 51,164,221,241,196,231,230, 75,143, 35,189,253,104,248,254,243,160,220, 14, 37, 89,255, 6, 27, 45,149,207, 48,122,111, + 79,163,119, 56, 1,126, 24, 47, 94,188, 22, 22,252,143,137,126,127, 2, 99,107, 32,199, 57,142,179,212, 28,128,255,119, 53,218, + 72,175,154, 48,216, 24, 30,224,126,130, 3,154,161,232, 37, 74,102,186,253,242,211, 22, 57, 37,177,196, 75, 76,226, 21, 24,201, +103,228,138,118,171, 22, 22,152,233,179, 54,239, 52, 89, 95,232, 15, 57, 59,233,144, 36,136, 18,143,210, 25,155, 7,141,225,167, +140, 31,241,241,151, 1,189,165, 86,237,170,242,242,213, 45,121,236,125, 71,110,221,191, 43,209, 20,144,149, 74, 10,151,169, 46, +158, 39,110,202, 62, 0,173,193,131, 70,127,248,183, 25,195,167, 42,213,165, 81,234,210, 93,158, 58,240,163,165, 75,136,226, 82, +188, 75,163,148, 37,187, 60,181,246,163,245,218,231,154, 28,220,210, 87, 22, 14, 49,157,210,218,117,168,245,221,127, 5,247,173, +119, 29,234, 7, 90,156, 32, 11,231,204,250,248,236, 46,119,217,183,104,138,204,237, 92, 87, 10,231,206,233,147, 50,123,233,171, +206,128, 44, 50, 9, 19,215, 67,174,140,154, 53,237, 37,179,103,237, 11,149, 60,247, 92, 22, 38,222,251,245,151, 89, 78, 1, 45, + 75,144, 69,213,153, 45, 73,150, 94, 27, 45, 2, 45,218,125,169,146, 44, 75,195,119,130, 35,216,170, 40,118, 89, 28,124,244,238, +100,180,234, 36,123,169,154,164, 91, 10, 11,160,229, 92, 63,178,176,209, 34,208, 90,184,112,161, 98, 99,241, 29,156,193, 18, 32, + 80,122, 66,159, 98, 4, 14, 19, 38, 76, 16,168, 2, 5, 64, 70, 1,163, 0, 75, 14,141,225,113,127, 6,118, 89,122, 65, 34,116, +130,118, 90,144, 24, 41,210,172,172, 89,179,238, 69, 33,109,130, 10, 71,133, 71, 31,170, 15,112,114, 12,187, 90,188, 96, 16,238, +181, 96,193, 2, 47,172,156,205, 4, 91, 76, 24,232,205, 84, 77,210,175, 22, 84,129, 94, 5, 10, 20, 56,142, 58, 88, 14,248,161, +200,211, 54,143,128, 90,141, 32,208,124,220, 89, 57,115,227,165,178,203,144,160, 91,141, 50,160,254,114,130, 96,152, 39, 45,160, +197, 93, 55,101,203,150,149, 10, 80, 97, 87,170, 84, 73,225, 39,221, 67,208, 81, 41, 87,124,220,129,218,172, 89,179, 96,181, 50, +128,129,183, 30,160, 5,137,157, 80, 74, 10, 23, 25,210,162,229,143,146, 47,117, 42,169,239,150, 94, 70,127, 83, 76,150,142, 25, +169,168, 42, 1,244,254, 46,160, 69,245, 47, 85, 44, 52,112,111, 31,212,198,150,255,117,217, 78, 89,242,182, 88,177, 98, 55,128, +177,222, 64, 45,238,131, 29,192,207,109, 1, 46, 21, 96,193, 69,199, 51, 44, 96,158,195,133,202,115,240,192,210, 9,168,205,230, + 34,208,162,106,208,218,240,221, 26,100,233, 5, 90,112,217,145, 31,253,242,250,235, 23,119,228,254,141, 61, 50,125,110,221,119, +142,212,133,150, 46, 33,156,251,104,191,142,220, 24,255,126,196, 98,227, 6,192,151,162, 30,166,148, 28,106, 90, 51,119,141, 99, + 1,114, 25,223,145,214, 4,242,217,129, 86,194,164, 38,247,107,207, 39,201,121,113,253,180,232, 93,230,253,137,175,204,246, 49, +173,221,183, 55, 82,139,151, 62,117,171, 28,220,191,249,219,249,159,182,247, 89, 35,241,163,196,161,223, 55,123, 71, 12, 72,181, +238,220,187,121, 1, 70,239, 55,165,126,195,134, 18, 59, 65,114,137,147, 40,181, 28, 57,115, 67,246, 30,191, 42,171,183, 29, 19, +151, 44,197,165, 80,217, 26, 18, 51,122,116,110,166,249,151,185,119,232,244,252,199,113, 94,255,247,163, 53,237,130,100,202, 95, + 57,216,143, 22,237,183, 80,103,123,126,180,130,249,154,162, 68,167,231, 85,126, 57, 20,236, 71,171,250,144,147,146, 50,103, 69, +167,252,104,125, 29, 95,135,195, 82, 58,239, 25, 30,198,221, 49,115,101,201,208, 53,127, 54,215, 7, 11, 70,246,251,180,227,143, +145, 10,200, 98,202,151, 53,163, 93,201,128, 85, 49, 66,168,130,232,199,136, 32,200, 30,208,218,186,229,156, 48,105, 0,173, 16, + 52,185,115,134,210, 39,170,196, 56,241,106,129, 44, 59, 18,173, 16, 52, 41, 37, 35,208,162,148,193, 18,100, 81, 26, 68, 35,118, +190, 71, 5, 89, 42,160,179,161,142,180,167, 6, 83, 28,150, 18,104,113,167, 36,207,145, 28,251,204,250, 63, 83,255, 79,211, 2, +104, 17, 64, 81, 90,197,196,115,235, 52,102,204, 24, 97, 82,109,184,172,128, 86,168,114,210, 94, 10, 3,106,183,252,249,243, 31, + 33, 48, 34, 8, 34,208,194,181, 45, 58, 63, 6,235,118,223, 3,131, 91, 47,168,239,188, 32,225,241, 2,144, 57, 65,207,242, 72, +177,241,174, 24,248,237, 74,111,243,112, 65,161,216,128, 97, 96,183,229, 45, 62, 4, 77, 21,104,169,234,193,198,253,151, 73,137, + 31,250, 75,185, 6,253,148,157,136,148, 54, 18, 20, 83, 61, 75,201,164, 29,160, 21, 76, 83,149,104,193,141,133,192,157,133, 2, +178,170, 86,173,170,216, 76, 17,164,210, 62,143, 54,110, 4,179,244, 49,212,166, 77, 27, 33,192,181, 1,180,130,105, 66,162,245, +120, 52,236, 13,169,114, 36,208, 42, 92,184,176, 0,128, 40,198,251, 3,123,246,144,206, 85, 42,200, 66,128, 44, 74, 55,225, 24, + 85, 16,218, 72,217,112, 1,213,161, 53, 32,212,173, 82,213,217, 62,204,102, 73,179, 53,236,199,142,225,219,160,189,206, 49,220, + 91,201, 95,139,255,122, 37, 89,193, 52, 33, 45, 24, 53, 98,196,136,151,176, 25,124, 3,149,248, 75,216, 31,250, 32, 61,199, 55, +244, 10, 82,215,103,176,127,124, 6, 73,227, 51,244,135,231,216,233,244, 2,234,100, 31,168,111, 55,227,221, 8,149, 26,226, 8, + 85,119, 2, 45, 26,187,227, 91, 12, 54,124,167, 71,120, 72,113, 21,117,161,101,178,163, 58, 12,166, 73,208,148, 51, 71,182,109, + 79, 30,156, 10,184,113,126,157,236,223, 54, 70,166,140,239,240,202,158, 77,150,181,223, 45,139,146,126,238, 54,114,162,105, 29, +102,213, 44, 39,128,214,125,142,169, 28,163, 40,197,194, 66, 45, 0,215,232,122, 3,152,212,230, 17,130,102, 4,169, 14, 45,105, +222,193, 91,173,119, 29,182, 31, 51,183,241,147, 25, 47,247, 62, 49, 93, 88, 37, 74, 2,208, 50,181,124, 37, 76,205,255,240,189, +223,178, 90, 15, 2, 35, 46, 28,212,195, 86,221,139, 20,202,151,231,205,245,203,176,149,197, 98, 44, 85,134,236, 18, 61, 65, 26, + 57,116,250,182,236,129, 36,203,173, 64, 37,201, 87,162,154,100,113,205,250, 22, 68,254,117, 14, 75, 85,137, 86,218, 50, 93,188, + 19,185,125,251, 42,105,138,244, 31,186,119,239,174,140,151,107,214,172, 33,207, 29,249,209, 10,230,167, 42,209, 74, 85,178,139, +119,194, 44,164,147,241, 3, 53, 44, 52,217,160, 47, 54, 13, 58, 17,213,183,191, 62, 58,121, 92, 51, 92,235, 84,251,219,119, 43, +135,119,151,181,195,186, 42, 0,107,108,203,239,228,219,130, 57, 94, 20,112,203, 60, 66,103,141, 66, 1, 45, 2,152, 86, 63, 14, + 80, 36, 86,214,105,236,152,197,194,164, 94,215,227, 25,158, 64,139,246, 5, 42,200,162, 4, 67,235,208, 2, 69, 4, 90, 28,104, + 72, 87, 13,179, 67, 23, 14,106, 12, 69, 74,229, 40, 73,209,216,201,104,111, 64,219, 75,131,104,218, 13,113,167, 32, 13,182,193, +203,189, 78,243,211, 2,104,177, 28, 44, 15,165,107, 44, 35,203,204,242,211,240,157,170, 84, 2, 68,110, 16,160,161, 60,237,192, +180,128,150, 90, 22,128,153, 84,152,168,134,195,248,251, 4, 0, 11,129, 22,183,250,235, 57, 66,212, 29,239,219, 65,144,133, 85, +177, 23,212,111,199, 64, 51,175, 53, 17,228,201,198,123, 4, 89, 65,190,181,118, 58,154,112, 9,180, 88, 39,214,141,253,132,245, +226,230, 2,110, 40,160,207, 48,130,100,170, 11, 41,149,100, 10, 82, 29,218, 5, 48, 4, 90, 80, 95,120,163,140,130,221,116, 10, +200,162, 10,146, 97,119, 84,245, 35, 55, 66,112,131, 4,109,179,160,230, 82,182, 48, 59, 2, 90, 80,195, 28,133,244, 78,177, 21, +163,221, 24, 13,247,105, 7,195,231, 56,248,176, 76, 52,226, 87,164, 92, 0, 88,148, 60,210, 57, 46, 0,215, 81, 71,117,215,211, + 0, 58,242, 88,182,209, 90,130, 42, 0,149,211,252,133,125,222, 53,254,194,238, 80,249, 15, 90,192, 23,186, 14,235, 62, 95, 6, +252,217,138, 29,149, 47, 80,215,215,144,108,189, 68,219,248, 64,130,229, 3,105,235, 11,216, 20,190,196, 38,129,231,176,245, 34, +128, 47, 99,231, 13, 54,129, 22, 37, 90,234,238, 66,130, 44, 26,190, 91,131, 44, 7, 18,173, 96,154,169, 92, 98,182,202,150, 43, +241,219,223, 6,212,251,176,108, 78,143,128, 42,229,115, 94,143, 29, 51,234, 54,218,108,233, 9,207,163, 49,137,235, 98,154,131, + 76,154,160, 40, 12, 47,208,164, 9,105,214, 56,168,204,159, 99,145,240,158,139, 21,168, 20,185,211,206, 30,200, 98, 17, 52,105, + 34,143, 94, 41,151, 90, 37, 45,154, 81, 35, 39,138,119,185,151,215,206, 15,109, 30,158,144,244, 87, 55, 75,188,141, 7,247,167, +233,254, 70,106, 78,246,147, 90, 67, 79, 7, 68,142,153,152,106,104, 58, 73,213,162, 89, 20,210,170,251,147,199, 77, 52,207,248, + 99,190,148,255,174,158, 28, 60,113, 85, 70,254, 62, 83, 10, 22,171, 16, 24, 51,122, 12,126, 3,255,202, 16, 60, 65,140,137,133, + 69,225, 21, 2, 35, 74,244,105,207, 59,116,232, 80,201,242,151, 31,173,103,216,117, 72,199,197,182, 14,235, 54, 34,157,203, 92, +128,210, 68,130, 82,122,238,202,215, 65, 39, 12,221,248, 31,249,136,234, 71,203,210,159,150,227,130,230,113,203,232, 85, 32,135, +235,147,130, 76,217, 50,123,231,207,154,233, 78,193,236,153,246,103,205,156, 70,175,244, 37,212, 7,200,184,133, 4, 68,156, 24, +245, 38,173, 88,135,244, 95, 69, 16, 68, 73,150, 30,144,165, 71,162,197, 0,209, 4,112,106,226, 59,212, 68, 91, 44, 53, 17,176, +169, 9, 43,190,240, 4,149,214,203,211,255,119,236, 32,160,229, 44,200, 98, 76, 69,148,223,153, 88,135, 52, 96,207,142, 52, 1, +137,142, 0,245, 28,214, 0,155, 1,164,119, 32,237, 6,200,170,103,143, 0,238, 57, 10, 52, 29,130, 38, 12,120, 15,161,125,238, +169, 9,237,115,207, 50,177,142,150,137,224, 18,109,116,200,234,221,193, 52, 85,160, 69, 9, 20, 29,247, 17,252,112,199, 41, 35, + 2,208, 30,143,131, 7, 1,146,101,226,192, 68,195,117, 43,213,161,101, 57,243, 18,108,161,172,143,105,112, 12, 85,140,146,112, +237, 25, 64,221, 91, 0,140,247, 72,254,176,205,122, 11, 64,242,140,146,172, 32,144,101, 13, 68,181, 38, 29, 61,109, 98,157,199, +146, 38,195,235,172, 65, 90, 96, 37,201, 98,156, 51,110,211,214,235,176,208, 94, 57,203, 64, 85,188, 13,124,124, 1, 73,227, 43, + 72, 86, 95,125,255,253,247,207,177,219,116, 43,104,219, 3, 88,118, 39, 71,180,121, 53, 74,181,152,208,198, 14, 19,242,212,182, +193,156,224,114,230, 41,154,240,221,216, 5,185,197, 53, 91,252, 55, 9,226,197,216, 70, 53,162, 30,128,101,195, 70,235,115,183, + 81, 88,218, 88,207,228,104,143,110, 44,240,249, 5, 55,217, 96, 81,163,229,119, 79, 79,221, 35, 26,104,177,220,153, 34, 39, 78, +120,174,252,248,223,222,182, 61,189, 67,134,157,187,126,171,225,184,107, 82,160,193, 4,223, 72,177,146,208,215, 91, 38,123,223, +187,141, 74, 91, 6,149,126,250, 31, 11, 42, 61,158, 0,139, 11,127,142,111,121, 96,163, 58, 50, 74, 20,185, 15,155,209,135, 72, + 24, 4,158,235, 4, 90,227,185,176,228, 66,151,227,102, 94,253,116,116,245,109,116,160, 34, 72,213,130, 82, 81,252, 98,171,169, +148, 15,250,255, 45,126,121, 77,189,207,223, 98, 86,247,163,233,122, 81,216, 51,217,247, 12, 31,118,154,186,158,180,158, 28,207, + 98, 96,164,158, 95,119,194, 71,110,237, 45, 58, 4, 77,220, 63, 97, 11,248, 88,130, 32,235,115, 39, 64,145,174, 74,234,236,132, +225,161, 21,122,210, 1,208,114, 73,145,226, 8,119,210, 49,209,208,219, 58, 97,146,161,215,231, 16, 9,117,127,148, 52, 89,178, +189, 22,133,209, 51, 72, 58, 91,246,175,142, 38,193, 18, 86,181, 94, 0, 58,222,106,162, 10, 68, 77, 0, 5,222,106,162, 20, 43, + 56,197,142, 13, 91, 92,135, 65,165,157,229, 93,120, 38, 71,103,222,101,171,141,104,139, 69, 85, 11,109,181,104,163,229,172,109, +150, 86,187,151, 1,208, 92, 7,208,197,144, 75, 90, 0,203, 46,208,114,166,146, 90,223,102,234,244,177,220,243, 21, 75,248,142, +146, 45,103, 0,214,127, 0,104,153, 48,118,140, 71, 58,140, 49, 86,203, 38, 75,171,221, 77,118, 28,150, 58,106, 74, 77,154, 65, + 15,211,102,180,173, 41, 81,252,141,166,248,137,175,153, 98, 36,221,168,252,183,109, 75,170,151,166, 51, 93,236,107,167, 73,255, + 87,202,214,124, 46, 48,115,153, 76, 1,211, 45,252,104,205,252,203, 51,188, 30,137, 86,120,232,232,226, 55, 65, 20, 50, 42, 42, +100, 44,130,251,227,127, 85,254, 90,252, 15,190,207,107,204,111,117, 63,216, 11,189,174, 23, 58,159,201,121, 27, 45,231,223, 97, +243,137,175,189, 19,134,135, 13, 70,221,195,195,189,208,207, 26,252, 52,248, 25, 81, 28, 48,250, 82, 68,113,242, 47, 58, 6, 63, + 13,126, 70, 44, 7,108, 80, 83,129,150,163, 95,203,123,118,242,125,246,114,254, 29, 47, 48, 62,192,136,229,186,193, 79,131,159, + 17,197, 1,163, 47, 69, 20, 39, 13,176, 97,244, 37,163, 47, 69, 44, 7,156, 0, 90,170,148, 75, 85, 27,170,210, 44, 75, 9,152, +122,237, 51, 23,210,126,172,195,160,213, 8, 63, 20,235,228, 76,153,108, 61,175,117, 77,139,190,214,243, 97, 41,179, 65, 51,116, + 59, 59,226,137,209, 70,246, 57, 96,244, 37,163, 47,233,237, 3,198,119,100,124, 71,182, 56,160,183,255, 88,230,251,183,244, 37, +181, 30,246,120, 16,170,158, 95,129, 68,235,159, 97,163,165,213, 67,116,222, 55, 86, 79, 58, 25,165, 51,155,193, 79,157,140,210, +153,205,224,167, 78, 70,233,204,102,240, 83, 39,163,116,102, 51,248,169,147, 81, 58,179, 25,252,212,201,168,240,102,179, 97,163, +165,216,100,217, 83, 23,254, 13,170, 67,135, 18, 45,155,245, 71,140,237, 40,247,239,175, 74,252,244,233,150, 20, 76, 60,231, 53, + 39,153,101,116, 66, 39, 25,166,145,253,107,229, 39,195,245,232, 13,217, 99, 47,239,215, 90,247,136,232, 1, 70,221, 35,130,139, +255,167, 97,240,211,224,103, 68,113,192,232, 75, 17,197, 73, 13, 58, 86,187, 14,185, 3, 81,221,101, 88, 49, 72,109,200,107,234, +206, 68,203,243,224,251, 95,168,168,250, 94, 67, 64, 69,112,245,248,241,226,114,143, 31, 47,236,248, 87, 90, 92,142,215,156, 4, + 91,193,157, 48,153,139, 11,195,183, 4,187, 67,112,184, 43, 16,121,129, 83,163,132, 72,255,142, 65, 82, 47,224, 8, 15,216,208, +251, 14, 75,209,173,190,142, 17,148,139,113, 14,115,231,206,221, 30, 97, 86, 22,194,209,101, 71, 27,113, 15, 45, 7,159, 81,145, + 34,153, 62, 49,225,241, 81, 26, 47,114,148, 87,107, 64,203,138,157,128,147,225, 34,193,147,137,231,120, 87,214,127, 41,112,213, +106, 47,250, 60,106, 2,215, 17, 59,176, 35,247, 53,206,187,219,120, 64,139,159,234, 35,244, 67,212, 23,222,251, 79, 35,252,144, + 47,118, 12,158,198,255,126, 72,209,244,208, 28,220, 53, 85,137,125, 91,155,108,229,175,173, 66, 15,238,153, 42,233,145,237,245, + 39,143,236,148,218,158,247,105, 71,229,228,174, 72,150,143,137,231,122, 3,156,235,173, 59,139,204,122,214, 69,162,227, 70,254, +218,170, 55,243,233,161, 89, 28,249,232,169,124, 11, 82,121,173, 70,212, 73, 83, 7,153, 16, 89,244,148, 83,125, 32, 46,118, 52, + 79, 71,186, 15, 55, 59,140, 25,152,214,206,203,156,161,169,183,188,246,104,178,173,217,151,126, 10,250,181,244,147,165, 69,219, + 97, 57,177,187,178, 58,234,186, 13, 59, 45,183,241, 92,139, 88,208,253, 47, 89,247,224, 34,193, 61,204, 36, 56, 21,127, 75,111, +253,116, 67,100,233,126,200,198,174,122,189,253, 83,103,149,131,179,125,142,186, 59, 91,134,127, 82,126,231,118, 29, 82,122, 69, + 96,117,230, 84,175, 63,183,108,254,246, 37, 19,207,121,141,247, 82,102,175,147, 62, 93,161,250, 91, 50, 22,109,242, 56, 69,190, +186, 31,211, 22,106,248,216, 37, 95,221, 45,188,110, 85,235,224,134, 32,176, 10,120,115, 69,252,124, 14,137,217,239, 78,176, 79, + 21, 91, 39,138, 67,209, 48, 0,173,196,137, 93,227,199, 77,149,123, 96,162,244,249, 14, 38, 72,151,235, 77,252, 52,185,222, 36, + 76,155,255, 96,220, 84,185, 6,243,158,131, 22,209,236, 48,217,147,154, 82,102, 75,106,234,145, 45,153,201,131,191,252,175,209, +194,214, 52,245, 2,142,240,128, 13,203,103,199,233,236,129,154,117,183,164,131, 1, 55, 49,194,165,172,128, 39,254, 77,112,144, +234, 14, 71,164,155,106,215,174,189, 18,215, 83, 91,228, 83,105,166, 32,192, 82,219, 24,231,129, 24, 20,166,160,125, 71, 89, 39, + 94,231,125,139,188, 4,102,150, 82, 48,187,229,196,214,241,198, 69,139,149,244,218,123,224,232,213, 43,215,110, 63,188,112,249, +230,237, 77,219,118, 29,207,147, 55,223, 49,222, 11, 99,187, 71, 66, 96,228, 70, 0,108,203,144,206, 6,165,101,188, 6,122,142, + 38,244, 16,229,196, 0,184,143,177, 37,157, 73,120,230,128,189,239, 72, 71,155,214, 71,124,186,183,116,128, 74, 15,246,140,115, + 9, 94, 51, 24,180,245, 97,205, 79, 5, 80,161,158,167,209, 22,190,112,101,113, 10,255, 7, 96, 64,247,252,243,207, 63,111,194, +187,254, 51, 56, 92,125, 11,199,171,143,225,107,231, 82, 80, 64,105,235, 73, 46, 84, 27,117,171,154,114,235,177, 93, 35,223,242, +215, 86,217,127,237,152,185,231,225, 93,189,110,241,215,201, 73, 60, 50,194,245, 76, 69,120,167,183,152, 88,158, 33, 61, 13,154, +116, 56,241, 60, 1, 15,149, 4,128,104, 43,118,162,158, 62,159, 29,229, 25,135,231,159,143, 28, 57, 82,137, 50, 64, 31, 67, 0, +154,244, 41,196,111,139,247, 45, 15, 61, 52,215, 35, 4, 86, 32,163, 88,128,191,122,156,255, 90,210,204,134,151, 45, 70, 98,220, + 73, 85,179, 64,176, 70, 58, 76,193,192, 13, 94,249,103, 96, 1,244, 16,215,126,213,209,238,118,187, 20, 64,250,210,117,235,214, +125,164,175, 62, 58, 7,198,255,253, 78,182,145, 61,218,173,224, 66,229, 60,163, 36,128,159,108,159, 54, 54,190, 41,107,126, 18, +228,181, 66,123, 44, 67,164, 6,119, 56,192,117,135, 31, 59,119, 56, 83, 93,198,235, 72,246, 64,160,238, 54, 34,200,130,227,103, + 37, 58, 5,128,150,221, 96,212, 97,104,119,187, 60, 14, 11, 63,209,190,147,225, 92,248, 13,199, 74, 56, 1, 22, 58,208,102,132, + 18,213,129,182, 13,135,220,124,141,158,254, 25,161,229,116,150,216,191, 40,191,150, 59,148,191,170,250,151, 52,107, 97, 71, 2, +172,183,111, 47,195,211,248,101,225, 57,175,241, 94,198, 98, 77,188,122,141, 92, 16,120,236,252, 29,121,244,252,189,240,183,221, +128, 63, 3, 83, 22,168,207, 96,193, 54, 59, 54, 27,159, 32, 75, 30, 13,150, 75,235, 19,203,179, 87,239,101,208,210,107, 82,177, +151,135,148,104,179, 88,154,252,182, 22,180,222, 42,243,108, 88,128, 86, 92,151,172,229,227,167,206,251,180,125,239,113,230,173, +135,183,201,165,219,103,228,226,173, 43,178,118,251, 9,105,221, 99,140, 57, 65,154,188, 79,153,199,153,142, 93, 48,149, 41,118, +214,164,166, 38, 57, 93, 34,109,111, 95, 45,247,167,125,127,116,146,231,251, 39,203,190,233,237,164,123,157, 60,159,120,157,247, +153, 79, 99, 64, 11, 5, 56,224,125,252, 16,194,187,120, 90, 38, 94, 11, 43,216,192,251,149,119,152,205,254, 10, 15, 73, 7,177, +245,182,129,151,189, 49,201, 59,138, 85,101,243, 3,196,104, 30, 3, 34,145,146,205,226,198,173,215, 56, 90,180, 14, 76, 77,226, +198,109, 80, 60, 93,186,145, 15,238,223,223, 2,175,243,238,240, 52,239, 14, 7,148,238, 91,183,110,221,132, 16, 42, 93, 45,120, + 96, 19,104, 69,142, 28, 41, 16, 94,199,119,192,243,187,187,117,226,117,222, 15, 3,208,202, 86,188, 68,169, 19,175,223,248,190, +191,119,251,238,139,223,186, 14,216,209,175,239,136, 77,179, 23,173,219,118,240,216,217, 35, 57,114,228, 62,130,114,113,146,178, +117,216, 27,124,210, 99, 34,244, 2, 80, 49,211,171, 60, 61,236,171, 33, 41, 0, 50,223,243, 30,136, 89, 47, 42, 84,250,214, 64, +203,251,242,238,237,114,255,204, 73,185,115,226,168,226,193,159, 3, 35,211,133,109,238,114,102,227, 90, 57,181,102,133,226,213, +159,137,113,229, 50,103,206,204, 73, 82,247, 4, 97,145, 49, 53, 36,141, 1,244,200,188,122,245,106, 37,200, 56,194, 40, 17,176, +118,214,232,159, 81, 17,254,102,247,224,193,131,175,237,222,189,219, 27, 94,157,125, 17,122,233, 62, 60,226, 63, 0,200,240, 69, +251,154,225,108,212,140,186,155,219,182,109,107, 70, 56, 39,115,243,230,205, 41,217,234,107,175,156,148, 96,117, 7,184,106,240, + 93,105,121,243,234,161,240,151,255, 45, 37, 91, 85, 17,234,169, 75,141,188, 79,207,159, 88,252,137,191,252,175, 81, 78,245, 54, +230,154,200, 83, 17,219,240, 5,251, 11, 67, 44,241,224,100, 99, 25, 29,129,206,145,233,179, 79, 39, 77,203,108,163,127,250,233, + 39,197,155, 63,219,158,116,212,196,112, 73, 12, 77,194,216,151,120, 96,180,141, 62,111,167,171, 41,151,221, 45,128,150,117,228, + 3,173,254,185,242,230,205,155, 50,118,236, 88,203,112, 38,158, 4,109, 76,120,216, 51,136, 64, 43, 58,215,101, 68, 8, 0,153, + 0, 92,179, 94, 20,232,157,112,163, 0,188,190,226,228, 77,158, 50,218, 4,192,135,189, 88,161,122,105,178, 44, 51, 24, 85,129, + 33,178, 24, 33, 3,161,185, 4, 17, 2, 88,254,121, 86,101,181,164,217, 2,125,207,253,240,225,195,238,248,126,220,209,212,193, + 9,206,170,221, 1, 6,221, 17,193,129,146, 66,135,241, 81,113,223, 97, 57, 41,201, 2,109, 47,148,203, 11, 64,213, 19, 78,134, + 61,224,188, 90,203, 89,175,222,186, 59,234, 23,214,247, 28,209, 28,139,126,239,163,142,147,224,139, 18,230,134,253, 83, 61, 12, +160,229, 12,171, 35, 52,175,115, 18, 45, 45,160,149, 60,119, 45,121,254, 54, 80, 94,190,147,224,196,255,188,110,111,224,101,227, + 83,146, 69,144,117,235,228, 80,185,255,204, 87, 42,245, 98,191,254,235,200, 90,117,128,220,122,252, 90, 57,199,224,248, 33, 70, +172, 88,227, 77,209,163,215, 54,165, 79,159, 82,145,110,253,255, 8,213, 9, 9,160, 50,229, 43,235,183, 3,225,108,188,159,191, +150,123, 79,124,228,240,185, 51,114, 4, 0,240,248,197, 71,114,232,236,121, 89,188,105,137,184, 22, 44,253, 46, 78,178,172,182, +188,176,135,162, 9,201,213,130,118, 85,178,190,223, 59,173,141,188, 4,184,242, 59, 62, 59, 84,122,178,123,188,108, 26,213, 72, +154,149,203,240,158,249,237,213, 29,215, 9,130,130, 65, 4, 1,197,230,205,155, 15, 1,108,120, 90, 38, 94,179, 2, 27,129,124, + 86,231, 96,174,188, 67, 5, 90,234, 59, 22, 45, 90,228, 89,166, 76, 25, 15,240,180,180,157, 46, 21,170,238,205, 76,166,140,205, + 98,198,108,187,107,250,244,214, 47, 30, 60,104,135, 25,172, 19, 16, 92,231,123,151, 46,117,234,254,211, 79, 71,206,238,222,125, +246,202,153, 51,123, 56,240,193,163,176, 59, 2,108,187,231,203,151,111,137,157,114, 82,202, 22,200,242, 0,160, 92,178,144,100, +173, 32,216,194,255, 21,234, 53,222,103, 62,230, 7, 45,107, 53,163,205,193, 7,106,194, 25,187,247, 30,186,124,239,246,189,231, + 55,206, 95,244,158,250,219,168,157,211,198, 78,223, 50,110,202,130,149, 43,214,239, 92,191,116,213,250, 77,204,163,183,238,200, +151, 30,224,196,155, 43, 69, 14, 94,156, 12, 24,206,135, 30,143,233, 61,153, 97,116,150, 44, 92, 32,233,210,164, 33, 24,178, 5, +182, 66, 1,173,251,103, 78, 73,215,120, 38, 37,169, 19, 35, 39, 66,245, 26,127, 25, 83,142,137,147, 90,150, 44, 89,194, 10,180, +234, 49, 78, 25,129, 22, 86,250,175, 80, 62, 2,161, 52, 58,234,222, 23, 33,113,174, 46, 94,188,216,220,170, 85, 43,115,189,122, +245,148, 4,239,206,102, 76, 98,239, 49,113,155, 33, 25, 51, 3,188,153, 17,108,220, 92,179,102, 77, 51, 66,107,220,132, 71,123, + 74,189, 44,143,224,186, 83, 93, 72, 73, 22, 65, 22, 15,254,242, 63,175, 83, 77, 72, 9, 86,187,239,243, 63,155, 48,172,187, 4, +248,191,145,241, 67,187, 73,155,239, 11, 60,227,117,170, 19, 29,244,121,170, 8,199,163,124, 79,212,177, 3,160, 80,105, 23,198, +181,100, 91, 49,250,193,131, 7, 15, 84, 41, 76, 88,128,150, 55, 1, 6,193, 48, 35, 78,168, 33,190,248,203, 16, 87, 4, 91,236, + 31, 40,135,183,157,114,150, 6,200,185,139, 9, 81, 44, 19, 67, 58,149, 43, 87, 78, 73, 12, 86,206,208, 78, 4,108, 12,243, 84, +164, 72,145, 55,160, 85,204, 30, 63, 1, 44,231,239,219,183, 79,169, 50, 65, 32,242,245, 66, 58,202, 50, 49,225,252, 48, 82, 54, + 0,109, 95, 70,221, 96,104, 47,244,123, 91, 18, 40,221,192, 0, 33,177,142,179, 63, 50,242, 6, 67, 93,181,107,215,238, 21, 35, + 28, 0,128,237,193,187,104,248,171, 30,122,104, 50, 24,243, 12,150,157,188,155, 53,107,150,194, 3,140, 29, 74,249, 25,176, 29, +247, 41,217,178, 69,115, 49,193, 21, 34,127,184,163, 93, 66, 0, 45,254, 71,123, 80,178, 78,160, 69,137,159,163,195, 81, 57, 51, + 32,212,216, 30,198,116, 69, 40, 47, 47,212,215, 11,224,210, 11, 18, 52, 45,201,150,158,186,107, 20, 43,212,109,187, 52,161, 46, +252, 63,162, 2, 83, 24,226,230,222,189,123,202,184, 97, 0, 45,103,217,252, 55,231,215, 82, 29, 18, 80, 61,125,243, 73,110, 61, + 49,139,247,235,143,114,228,202, 11,153,181,249,170, 45,160, 21, 92, 19, 2, 45,118,132, 91,143, 94,203,205,135,175,228, 6, 82, +153, 54,243,100,164,251, 91,105, 50,227,153,100, 40,253,147, 92,190,171, 44, 80, 5,158,106, 17,179,238,116, 32, 68,196,239,176, +178, 8,136,159, 32,129,181,119,248, 96,186, 84, 9, 38, 76,151,231,217,246,163,187,100,251,137, 37,178,247,212, 46,121, 4, 16, +119,253,254, 11,217,127,234,158,252,190,104,182,252,248, 75, 13, 25, 62,189,171, 76, 91, 56, 82, 82,100,205,249, 42, 81,162, 76, + 9,180, 88, 12,224,164,148,229,131,207,117,241,191,178,213, 38,208,122,119,126,141, 60, 58,182, 82,142, 46, 29, 40,204,239,136, + 38, 6, 74, 56,220,253, 11,112, 20, 40, 80,224, 46, 2, 13,123,218, 74,188,167,130, 13, 60,227, 40,160,167,173,215,141,230, 59, +152,192,239, 59, 24,212, 60, 17, 75,207, 19,113, 21,249, 46, 15, 43,245,158,205,226, 98,249,150,190,107,150, 44, 63,249, 62,121, +210,222, 31, 32,235,225,218,181, 13,110, 78,157, 90,247,224,136, 17,141,187, 54,105,178,244,220,233,211,167, 94, 61,127,126,214, +125,193,130,115,115,167, 77,219, 77, 49, 62,226,243, 81,162, 69,149,134,205,131,106, 65, 74,172, 8,168,212, 12, 60, 15, 2, 90, + 33,174, 49, 31,243,107,181,143,122, 31,147,201,129, 11,151,110,220, 27,221,111,248,238,217, 35, 39,120,174,156,181,104,247,186, +213,238,219, 87,109,218,189,126,197,166,221, 75,143,158,188,176,145,121,116,210,139, 68,105, 21, 7, 46, 72, 30, 20,105, 6, 39, + 90,198, 80,100, 80,233, 33, 67,134,200, 47,189,122,202,220, 41,147,101,254,180,169,140,115, 72,201,150, 67,187, 32,218, 78, 80, +146,101, 9,180, 8,178, 24,156,220, 26,104, 49, 62, 37, 7, 76, 55, 55, 55,107,160,165,179,248,166,130,156,184,247,238,221, 43, +176,159,163, 36,139, 54, 65,154, 7,212,171,167, 16,106,229, 49,164, 84,102, 4,205, 54,171,128,171, 74,149, 42,102, 0,183, 0, + 4,208, 54,175, 90,181,202, 92,176, 96, 65, 51,232,155,209,151,204,136,247,248, 26,245, 39, 56,176,121, 80,114, 69,117,161,165, + 68,139,255,121,157, 54, 89, 84, 23,158, 59,190,228, 19, 65, 22, 15,254,158,197,127, 94,231,125, 59,100,201,235,168, 80, 23,254, +181, 34, 11, 58, 24, 87,141, 32,132, 82, 71, 6,129, 87, 65, 22, 65, 45,250,153, 45,160,165,197, 19,101,172, 82,165,153, 12,237, +165, 74, 28, 25, 94,100,250,244,233,194,208, 52, 32, 98, 9,180, 44,105,206, 36,120,176, 62, 8,222, 24,168,153, 49, 71, 9,170, +217, 15,216,207,216,223, 24,247, 18,170,208, 69, 14, 10,150, 8,125,233, 58, 65, 36, 1, 32, 99,110,162,125,164,114,229,202, 74, +108, 78, 6, 37,175, 80,161,130, 18, 59,147, 64,171,120,241,226,102,208,202,161, 85, 81, 7,247,115, 1,204,190,216,178,101,139, + 2,132, 88, 70, 46, 60, 88, 7, 44, 58, 2, 33,253,209,163,250,100,123,141,195, 34,207, 15,170, 46,101, 92,167, 52,107,208,160, + 65,228, 29, 85,126, 25,145, 22, 32,200,184, 34, 49, 3,168,185, 96,167, 60, 10,208,162,186,144,146,116,130, 43, 38, 72,127, 21, + 41, 23, 36,177,238,232,159,122,128,150,189,234, 42, 32, 11,109,236,133,254, 67, 73,182, 23, 2,211,123, 33, 30,169, 23, 67, 71, +133,131,135, 17,254, 40,213,227,236, 3,148,100, 81, 18,136,111, 85, 1,254,170,148,156,253,212,142, 68, 75,179, 44,229,202,153, +162,230,116, 77,252, 67,201,194,174,158, 37, 10,101, 62,144,195, 53, 81, 83, 87, 87, 83, 12,205, 7,141, 12, 42, 7, 10, 6,157, + 88,198, 60,252, 63,119,184, 2,230, 63,245, 87,203, 24,158, 64,235,193,139,143,178,216,243,137,244,156,121, 70,190,237,185, 77, +106,253,226,161, 11,104, 93,186,243, 92, 46, 34, 93,184,237, 35,133, 27,140, 13, 6, 90,169, 10,212,151,211,215,159, 42, 99, 83, + 86,183,204,178,111,231, 98,185,119,235, 28, 86, 83,190,212,227,223,183,215,150,180,201,234, 55,177,255, 71,175,171,251,100,208, +220, 38,226,113,100,173,188,244,245,151,115,160,181,255,244, 61,105, 51,176,158,252,216,191,169,212,239, 82, 83, 38,204,234, 47, + 45,187,214,255, 20, 63,101,238, 97, 90,125, 67, 5, 90,239, 79, 47,145, 79,239, 94,200, 39,223, 39,226,127,107,175,188, 59,185, + 64,222, 93,221, 46, 62,215, 14,203,149,189,203,100,221,208, 58,178,110, 72, 29, 77,160,197,247, 97, 37, 56, 28, 43,183, 67, 80, +197,120, 98,101, 50,193,186, 12,188,198,123,204,195,188, 90,101,180,115, 95, 53,134,143, 2,192, 82, 52, 91,182,108,203, 49,104, +120, 66, 50,225, 9, 21,226,111,142,104, 82, 93,216, 60,102,204, 54, 88, 18,183,127,233,229,213, 98, 70,139, 22,237,114,186,186, +158,203,146, 41,211,243, 18,197,139,191,232,221,189,251,189,155,103,207,158,188,113,241,226,201, 99, 7, 15,158,153, 60,112,224, +217,223, 71,143,222, 10, 9,208,114,216, 5,217,181, 89,179, 7,170,108, 1, 45,235,107, 90, 60, 64,220,192,205,231, 46, 94,191, + 49,115,246,242, 93, 80, 29, 62,220,181,117,247,190, 67, 71, 78,237,245,121,254,234,158,231,129, 83,171,143, 28, 63,187,130,121, +180,232,240, 62,237,175,176,210,254,160, 6,228,102, 95,228,196,200,201, 21,131,185,244,239,209, 77,122,180,106, 41, 93,127,168, + 45,171,166, 79,145, 31,127,168,243, 62,200,102,203, 46,121, 2, 45,170, 11, 85, 73,150, 37,184, 34,144,227,132,203,247, 13,112, + 77, 33,131,243,103,145,195,139,231,134, 7,104, 65, 8, 28,125, 51, 37, 60,156,188, 96,188,254, 10, 5, 67, 84, 13,199, 7, 6, +111,223, 37, 75,150,248,194,214, 78, 1, 89, 4, 84,136, 69,104, 46, 93,186,180, 25, 65,159,253, 33,149, 81,212,134,144,188,152, + 33, 29, 53, 67, 90, 99, 70,192,233, 43,176,211,178,150,104,133,122, 17,213,133,148,100,245,252, 62,213,158,227,187, 27, 77, 90, + 56, 33,111,106, 74,172, 40,185,234, 84, 61,239,211, 96,137, 22, 36, 91,144,104, 61,229,117, 7,134,241, 10,208,162, 84,133,224, + 23,101, 22,214,149, 96, 0,253, 70, 81, 67, 89,130, 44,242, 54, 12, 64,139, 18, 51, 5,104,145, 38, 19, 37,101, 4, 47, 12,180, +203,126,192,180,109,219, 54, 71, 64,171, 0,128,206,107,107,137, 22,131,134, 83, 58,132,197,137,128,215, 2,201,160,192,116, 64, + 9, 94, 14,158, 19, 92,107, 25,200,187, 98, 33,246,138,160, 68, 85,147,146, 30,251, 15, 65,155, 10,226,184, 32, 0, 45,107,181, +174, 86, 55,176,188,159, 3,210,182,231,156,180, 25,172,157, 18, 40, 6,107,191,116,233,146,156, 63,127, 94,137,137,135, 54,184, +171, 65, 48, 50,190,141,141,180, 19,100,255,231, 65,181,248,239,191,255, 46, 88, 64, 82, 5, 25, 61,232,249,212,148,232,241, 40, + 95,190,188,189,197,170, 2,180, 84,115, 3,148,197, 29, 18, 39,247,174, 93,187,186, 3,184, 41, 9, 96, 91, 5, 90,212,126,204, +193,184,247, 20,191,125,236,149, 17,224,175, 14,190, 77, 15,140,179,171, 84,144, 5,213,172, 23, 2, 42,123, 65, 93,184,131,146, + 44,204, 59, 30, 0,191,211, 48,142,122, 97,124,187, 4,213, 41, 23,108, 85,157, 97,100, 68,231, 69, 89,158, 18,168,179, 95,210, +110,144,106, 67,130, 96, 53,118, 48,239,161,207, 63,115,230,189,110,110,241,146,230,112, 75,210,191, 78,141,178, 79,102, 76, 29, + 39, 27,214, 97,225,178,123,131,204,152, 50, 92,234,214, 40,243, 50,103,182,100,163,178,103, 76,104,207, 84,194,153, 87,105,230, +181,198, 34,154, 15,252,179, 50, 88,251,209, 10,105,171,101,171,114,142,220, 59, 16,104,221,241,126, 47, 11,119, 63,150,238,127, +156,150,242,221,183, 74,141,254,250,128,214, 41, 0,160, 21,155,118, 73,199, 78, 93,228,187,106,181,165,251,164, 93,138, 68, 43, + 73,182, 74,114,248,194, 3,229,131,203,226,154, 65, 38,141,106, 33,155, 86, 79,130, 26,224,166, 36, 72,148, 8,161,197,108, 31, +105,242,228, 57,225,126, 96,165, 44,219, 49, 85,182, 28,218, 32, 55, 30,188,144,211, 87,159,200, 30,175,187,178,102,247, 21,153, +177,230,164, 12,158,117, 64,186, 79,220, 33,173,122, 53,149, 95,199, 12,144, 4,105, 11,208,110,199,225,161, 2,173,151,139,107, +203,203,165, 63,136,223,161, 73,242,241,197,109,145,192, 79,114,231,212, 78, 89, 63,188,158, 76,105,144, 66, 38,215, 75, 38,171, +127,171,166, 11,104, 97, 66,115,193, 10,116, 39,213,133,176,117,241,196, 7,145, 95, 45, 4,207,121,141,247,152,135,121,181,202, +168,231, 62, 62,204, 92, 42, 93, 12,210, 12, 28,108,247,104, 16, 45, 90,177,109, 19, 38,180,246,127,242,164,221,172,150, 45,219, +186, 96, 2, 6,240, 11, 8,240,247, 55,251,191,127,111, 62,124,232, 80, 64,187,182,109,159,239,219,178,197,107,225,188,121, 94, +181, 43, 84, 56, 92,212,205,141,170, 63,123, 54, 80,202,187, 62, 39,208,130, 81,237,128,245,238, 30,103, 78,157,191,122,110,253, +230, 61, 30,239,223,251,251, 6, 4,152,253,206, 92,188,182,227,226,213,155, 91, 39, 78,249, 99, 3,243,232,225, 21, 13,223,105, + 7, 67,169, 8, 87,136,156,184, 78,158, 60,169,168, 97,250,118,235, 42,221, 91, 54,151,206,181,171, 75,135,138,229,100, 84,139, + 38, 50,181, 95,111, 74,181,184, 50,183,123, 16,104,145, 22,129,150, 45,117, 33, 39, 73,166, 33, 5,220,100,116,217,130,114,100, +233,124,103,129, 86, 45, 76, 10,236,207,170,225,115, 6, 72, 46,159, 2, 88, 43,106, 25,128,204, 75,184, 23,211, 81, 25, 41,209, +130,148,226, 30,129, 22,140,232,205, 80,233, 16, 96,153,161,206, 50, 67, 21,245, 26, 96,192, 12,137,137, 25, 82, 50,115,225,194, +133,149,115, 87, 87,215, 67,160,169, 57,153,171,187, 14, 71,245,113,155,125,112,123,167, 51, 99,127,201, 61, 80, 45, 11,109,178, +218, 66, 93, 72,201, 86,167,234,249,236,217,104, 89, 23, 61, 50, 38,194,199, 4, 26,180,161,218,191,127,191,210, 70,156,112, 32, +129, 81,212,133,228, 53, 65, 22, 1,137, 78,160, 21, 11, 82,207,137, 80,183, 62, 70, 44,198, 79,224,217, 39, 6,197, 61,116,232, + 80, 48,216, 34,176,163, 49,188, 10,180, 8,238, 80, 48,123, 18, 45, 91,236, 46,223,165, 75, 23,165, 15, 4,169,254,202,233,233, +147, 54,242, 20,199,194,230, 26,190,105,129,164, 81, 32,129, 84,234, 75, 16,215,172, 89, 51, 2,183, 79,216,192, 48, 7,207, 57, +235,138, 71,149,204,102, 87, 65, 22, 39,109, 74,218,200, 95,242,131,243, 4,191, 5,168,143, 63,160,207, 77,117, 80,126,218,208, +205,155, 61,123,182, 50,158, 79,155, 54, 77,208,159, 20,251, 50,130, 2,218,144,225,217,182, 72,124,231, 44,128, 27, 69, 90,134, + 54,112, 40,209,178,180,235,164,116, 11,245, 13, 6, 90, 52, 95, 0, 45,154, 47, 44,165,244,153, 7,108, 29,253,240, 63,154,173, +114, 98, 92,220, 65,195,119,226,105,254, 18,100, 1,172, 17,100,109, 71,254, 12, 65,207,252, 2,201,173, 34,209, 38, 31,152,176, + 0,249,136,123,159, 67, 93,232,176, 59,100,203,150, 40,119,222,156, 41,231,164, 77,155, 38,144, 96,151,109, 66,240,203,115, 46, + 4,120,174,166, 12, 25,210, 75,145, 2,233, 55,231,202,154, 40,143, 35,162, 57,179, 36,204, 87, 36,127,134, 5, 61,126,110,253, +113,187,199,102,217,226,190, 94,186,116,250, 81, 10,230,203, 36,189,187,124, 39, 51,167,246,151,189,187,214,138,199,150,149,210, +227,231,150,129, 37,138,100,218,162, 69, 51,140,125, 58,248,177,175, 28,104, 89, 75,178, 66, 27,197,171, 21,180,195,168,100, 88, +193, 44, 3,194,247,102, 74,154, 38,155,108,118,247,148, 9, 11, 15, 74,135,241,251,164, 92,183, 45, 82,173,239, 54, 93, 18,173, +195,231,239, 75,135,142,157, 21, 81, 60, 63,228, 76,174,110,146, 44,219,183, 82,160, 82,107,217,125,252,170,242,129,184,102,206, + 32, 99, 7, 55,150,163, 7, 54,200,218,181,107,204,166,104,209, 24,224,214,230,145,169,104,182,119,231,174,159,133, 45,214,125, + 57,127,227,169,120, 93,122, 44, 59,142,221,150, 21, 59, 46, 73,181,182,185,229,219,198,153,165, 92,221,180, 82,170, 90, 10,169, +211,169,179,140, 91,184, 91,226,165,202,245, 86,171, 67,132, 0, 90, 4, 91, 65, 41,224,166,167, 2,174, 44,211,170, 95,191,211, + 5,180,248, 78, 12,252, 93, 32, 53,241,132, 77,137, 39, 6, 2, 4, 70,255,235,224, 57,175,241, 30,243,104,149, 79,239,125,168, + 89, 50, 97, 64, 82, 0, 28, 36, 20, 91, 28, 61,215, 60,110,220, 31,158,223,189,219,214,123,235,214, 6,217, 93, 93, 47, 65,141, + 23,240, 1, 40, 1,118, 41,230,183,190,190,102, 12,232,230,181,107,214, 4,180,110,222,252, 78,187, 70,141,150, 31, 94,191,190, + 53,141,229,181,202, 98, 1,180,130,237,177,104,155,101,109,163,101,113, 77,203, 13,132,229, 43,227,186,164, 72,233,121,249,234, +141,155,167,206, 93, 59,178,126,163,199,254,109, 59, 61, 15, 94,191,249, 96,247,177,147,103,247, 96, 66,216,139,204,241,180,202, +200,251,220, 89,200, 1,159, 3, 42, 13,172,185,106, 60,114,228,136, 28,218,181, 83,186, 53,111, 38, 29,106,124, 39, 29, 1,178, +186,151, 47, 45, 3,191,171, 32, 43,134, 13, 36,208, 58,235,136,182, 10,180,108,169, 11, 85,144,197,119,142,253,166,176, 76,170, + 94, 94,142,173, 90, 34, 89,179,102,213,171, 58, 44, 84,180,104,209, 0, 74, 29,168, 62, 66, 57, 18, 6,149, 37, 15, 84,238,239, + 9, 68, 8, 14,112,141,129,162, 29, 29,125, 49,185,158,131,154,208, 12,169,130,153,106, 39,208, 53, 3, 84,132, 72, 13, 26, 52, +120, 85,163, 70,141,171,144,188, 30, 7, 49, 26, 95,235,218, 90,223,189, 94,154, 88, 99,186, 22, 59,115,242,192,184, 55,252,229, +127,181, 48, 58,118, 29, 90,151, 59, 18, 36, 11,143,168,194,226, 36, 67,117, 33, 37, 89,156,192,235,215,175,175, 36, 21,100, 81, +130, 2, 41,174,150,234, 48, 22, 0,214, 13, 76,206, 1,180,191,226,193,182,154, 60,121,178, 64, 42, 18, 12,182,172,129, 86,208, +120,169, 27,104, 65,186,179, 9, 42,124, 69,242, 64, 53, 39,254,111,208,211, 39,237,228, 33, 64, 97, 91,183,160,212,140,234, 71, +180, 11,219,185, 28, 18, 37,218,220, 84, 48, 22,105, 33,146,195, 69, 16,238,211,133,195, 34, 44,236, 94, 67,253,191, 23,253,224, + 5,199,102,242,147,117,230,228,205,141, 21,144,252, 60, 4, 8,185, 4, 32,250, 20,115, 1, 13,215,227, 58, 40,219, 60,242,143, + 7,129, 41,232, 6, 82,213, 10,224,206, 96,192,138, 52, 16, 96,150,160,106,198,248,241,227,149,124, 65, 82,184,214,118,104, 46, +166,170,208, 17,208,130, 45, 42,165,214,183, 85,144,197, 50,163,191,146, 39, 4,157,161, 14,212,103, 7,119, 23,162,239,120,161, +142, 94, 0,131,138, 36, 11, 25, 51, 4,101,254,153,234, 57,170,143,161, 82,231,198,162,199, 84,213,113,206,194, 55,175, 75, 66, + 30,142,246, 13,241,104,118,183, 36,163, 91, 52,173, 45,253,251,245,149,180,105,211, 42,166, 1, 76,252,190,169, 42,102,194, 38, + 22, 89,191,126,189,178,211, 56, 95,222,220,178,111,207, 70,129, 26,240,156,189, 50,228,112, 77, 60,110,208,111,189, 80,191,139, +178,114,249, 66,105,210,176,186,228,206,158, 90,114,101, 75,165,164,238, 63,125, 27,156,198, 12,105, 35,219, 55, 47, 20,175, 99, + 59, 36,187,107,226, 19, 17, 85, 47,123,116, 52,176,200,231,126,253,231,163,175,129, 34, 9,178,188,119,236,216,241, 81, 53, 12, + 93,133, 78,156, 62, 77, 90, 25,216,127,186,180,238,191, 92, 74,117, 88, 43,223,245,217,170, 11,104,237, 58,118, 69,126,234,136, +221,123, 24,204,160, 87,151,140,153, 50,201,182,253,103,101,235,190,211,178,121,239,169, 32,160,149, 94,134, 13,248, 65, 30,220, +187,202, 78,254,206, 20, 59,182,170,251, 12,197,132, 36,153,115,250,158,188,124, 70,214,237, 57, 40, 19,151,204,144,249,155,182, +200,226,109, 23,100,226,178, 99, 82,171,125, 37, 41, 91,251, 47,144,197, 84,185, 69, 77, 25, 58,123, 79,184,128, 22, 85,135,214, + 64,107,229,128, 42,186,129, 22, 6,170,132, 0, 60, 30, 39, 78,156,240,252,249,231,159, 9,170, 74, 50,241,156,215,120,143,121, + 34,170,181, 33, 34,111,139, 65,196, 19,237, 71,213,161, 67,117,100,147,104,209,126, 50,251,251,119,186, 63,127,126,157, 36,137, + 19,191,133, 90, 66, 1, 89,148,102, 97, 50, 55, 31,216,191,223,188,103,247,110,115,145,194,133,159, 31, 91,180,168,222,235,155, + 55, 27,113, 55,162, 86, 89, 85,160,101,107,183,161,173,107,150,182, 92, 90,180,131,238,103,168, 80,177,202,169, 71,222, 62,151, +183,238,220,191,222,115,255,177,213,222, 79,159, 31, 46, 86,188, 36, 1, 65, 22,157, 52, 20,160, 69,251, 7, 72,241,148,129, 12, + 18, 60, 57,184,115,135,236, 91,191, 86,218,127, 95, 57, 24,100, 13,175, 94, 81, 22,181,109, 38, 71,102, 42,118, 90,154, 64,139, +187, 11, 85,149,161,165,186,240,215,108,105,100, 88,161,236, 50,182,124, 17, 69,250,194, 68,233,151, 78,160,149, 12,146,171,135, + 4, 25, 92,221, 98,146, 80,213,120,156,100,169, 46,220,196,201,142, 82, 5,156,107,185,250, 80,118, 29, 66, 45,120,170,101,203, +150,215,170, 86,173,234, 15,160,245, 14,198,207,102,203,132,110,233, 15, 73, 5,237, 37,237,249,209, 10,197,106,130,170, 34,153, +210,244,237,211,177,145,220,184,178, 75,248, 91,204, 53, 93, 95, 21,108, 81, 77, 72,155, 44, 43, 3,120,135, 77, 70,160, 69,144, + 5,183, 19,202,196, 77, 73,150, 10,178,212, 95,130, 44,218, 86,105, 1, 45, 74,178, 32, 13,250,191, 37, 49, 70, 32, 2, 53, 74, +204, 56,249,131, 31, 10,224,182, 6, 90, 88,132, 56, 35,209,202, 92,169, 82,165, 64,170, 53, 41,125,160,244, 13, 6,241,220,240, +145, 73,111,223,180,202, 71,160, 53, 0, 54, 90,129, 92, 20, 16, 20,109,220,184,145,253,134,160,178, 63,212, 92,143,105, 71, 6, + 27, 35,129,122,119,173,163,119,160,223, 76,197,179,168,238, 39,197, 30, 17, 27,114, 20,112, 65,128,197,126, 69,251, 55,240,155, +192, 95,239,119,212, 26, 54,155,202, 56, 62,122,244,104,101, 55, 33,250,141, 23,237,136,248, 93, 97, 1,160,180, 27, 12,237, 3, + 41,225,226,193,126,202,124, 72,246,236, 29, 29, 2, 45, 72,247, 54,231,200,145,227,161, 37,200, 98,221,149, 69,187,171, 43, 85, +136,161,231, 13,236, 38, 68,221, 61, 32,177,245, 4, 80,245, 66,189,105,143,165, 46, 68,167,130,135,129,180,123,195,243, 44, 27, + 1,171,169,108,217,178, 28, 19, 9, 58, 15,134,177,221,194,244, 88,174,108, 73,189, 31,222, 58, 44,235, 87,195,172, 32, 75,102, + 69, 50, 8, 96,169,204,159,148, 6, 46, 92,184, 80, 81,201,142, 28, 49, 76,182,108, 90, 38,103, 79,108,145, 29,155,231, 75, 78, +183, 36,118, 23, 2,188,119,231,250, 97, 89, 52,111,188, 20, 47,236, 22, 12,176,172,129, 86,191,159,171,203,250,149, 19,229,226, +105, 15,217,182,105,142,228,112, 75,124, 39, 76,149,208,249,208, 87, 46,209, 82,107,105,219,189,131,163,202, 65, 34,176, 20,171, + 17,140, 89, 31,149, 1,136, 70,188, 20,207,143, 31, 55, 94,202,230, 47, 33,237, 58, 76,149,210,173, 22, 96, 7,225,102, 93, 64, +203,221,243,164, 76,155,187, 76, 42,124, 91, 17,157, 56,139,116,248,185,143,172,219,126, 88,214,108, 59, 40,171,183, 30,248, 75, +228,155, 41,189,252,218,179, 6,164, 94,239, 5, 34,222, 0, 83,151, 46,118, 13,242, 18,166, 45,112, 96,233,166, 35, 50,109,197, +100,249,161,107, 65,169,209, 46,183,252, 54,125,149,244,157,186, 71,218, 15, 95, 35,223,183,106, 18, 12,180,234,247,156, 44,109, +127,157,239,188,234,208, 66,162,245,118,223,216, 80, 64,107, 69,255,202,186,129, 22, 91, 2, 64,162, 53,236,176, 60,161,246,240, +196,170,121, 1, 19,207,121,141,247,116,246, 73,205,108,160, 85,179, 73,147, 38,123,104, 12,143, 93,101,164, 93,201,209, 67, 42, +208,122,180,100, 73,237,100, 73,147, 66,136,229,171, 72,178, 48,144,155,119,238,220,105, 94,190,108,153,121,209,194,133,230, 28, +217,178, 61,123,123,252,120, 21,223,235,215,235, 59, 3,180, 44,119, 24, 70,160, 68, 75,169, 18, 38,204,245, 87,174,223, 62,116, +212,235,194,194,211,231,175,207,187,116,245,198, 86, 94,211,100,146, 69, 6,170, 1, 57,129,254,241,199, 31,202, 4,222,171,115, + 71,233,219,166,181,244,111,218, 80, 86,143, 28, 34, 91, 70, 14,150, 61, 35, 7,202,129,225,253,229,232,168,129,178, 99,220, 72, + 93,170,195,179,155,214, 5, 3, 45,213, 38,139, 82,172, 97, 69,114, 40, 32,107,114,205,111, 21,144,197, 65,156, 64, 75,143, 49, + 60,212,161, 59, 96, 8,172,216,189, 96, 49, 34,216,245,233, 15, 99, 99, 63,128, 37, 5,116,208,158,136, 0,129,191,168,162,150, + 68,139, 92, 80,252,104, 17, 72, 65,194, 19,128,201,210, 12,213,153, 25,147,173, 25,125,211, 12,155, 47, 51,248,105,105, 43,153, + 20,252,226,142,206, 73,182,120, 76, 91, 44,170, 9, 41,193, 34,184,218,190,105,158,242,109,111,223, 52, 87, 1, 91,188,206,251, +179,199,228, 73, 51,184, 91,194,132,187, 55,212,253,189,111,187, 68,154,155, 84,248, 46, 76,116,143, 8, 4, 8, 34,251,247,239, + 31, 10,100, 81,146,193,196, 67, 11,104, 81, 93, 72,190, 91, 30, 4, 66,148,104,210, 54, 15,128, 32, 4,208, 34,128,161, 90, 54, + 8, 28,216, 83,117, 89,179,100, 50, 1, 11,233, 82,170,195,178,207,156, 57,147,237, 98,147,119, 90,125, 22,109, 52,142,253,147, +192,141,180,168, 54, 36, 56,162,203, 4,238, 66, 99,191,160, 29,213,175,191,254,202,119, 56, 92, 92, 97, 33,118,143, 32,139,234, +114, 74,107,168, 46,103,191,161,212,141,246,111, 4,181,160,225,166, 85, 38,245, 62,108, 4,207,147,198,178,101,203,248,238,249, + 72,180,121,107, 72,105, 11, 15,238, 54,164, 17, 63,119,241,242,160, 90, 17,247, 9,178,152,207,222, 49, 29, 96,200, 29, 18, 96, +197, 32,158,139,179, 81,163, 70, 29, 7, 80,242,129,164,233, 3,250,160,191, 10,178,248, 75, 21, 42, 15, 72,103, 63,128, 96,127, + 71,101,135, 16, 97, 7,198, 57, 47,148,215, 11,125,129, 64,171, 23,121,171, 30,228, 49, 0, 23, 65,241,124, 2,111,218,155,225, +125,122, 54, 2,232,101,153,102,190, 28, 89, 18, 3,104, 29,148,179,199, 86,201,173,203,158,178,106,217,108,233,211,187,151, 96, + 76,151,129, 3, 7, 66,106,221, 83,150, 47,158, 41,183,175,236,151,131,123,150, 73,175, 46,181,101,212,208, 46,194,231,236, 17, +231,189, 71,183, 15,200,201,195,203, 20,154,147,199,253, 34, 5,243,102, 12, 6, 92,189, 59, 87,149,229,243,135,200,141, 11,123, +196, 99,227, 76,233,222,169,230, 95, 52, 13,160,165,217, 94,200,160,207,143,150, 37, 37,170, 10, 41, 82,231, 74,156, 98,111,174, +114,232, 71,134, 91,221, 83, 39,135, 1,111,175,241, 82,189,253,100,201, 84,161,231, 71,151,124,245, 40, 65,176,121,168,187, 14, + 67,140,104,118,254,100,202,148, 78, 70, 15,109, 13,219,149,151,146, 56, 73,146,243, 86,238, 29, 66,208,167, 49,124,179,206,195, +205,158, 39,206, 75,245,182,185,164, 74,243, 28,210,115,210, 14,105, 63,106,155, 52, 25,184, 81,170,247, 88, 42,165,170,167,134, +100, 43, 51, 36, 94,219,164,116,237, 46, 1,206, 24,195,251,238, 28, 20,172, 54,164,250,240,205,150,158, 33,128,214,172,214,217, +100,121,191,138, 78, 1, 45,128,199, 56,133, 10, 21,218, 76, 0,212,177, 99,199, 67, 76, 60,231, 53,222,211,211,146, 86,121, 66, +120,131,199,224, 89, 16, 43,178,113, 16,125, 43, 59, 14,209, 86, 52,190,255, 3,171,104,135,170, 30, 85,117,232,123,248,112,189, +172,153, 50, 93, 93,185, 98, 69, 0,128,181,249,192,129, 3,102,216, 64,152,231, 97,139, 63,236, 51, 2,242,230,204,121,202,239, +234,213,239, 78,172, 88,209,208, 73,213,161,230,174, 67,103,141,225, 85, 62,228,112, 75,119,161, 65,221,202,239,107,124, 95,198, +183,108,169,188, 47, 43,124, 83,232,109,246, 44,105,245, 78,132, 10, 25, 26,182,195,142,230, 61,193,214,207,237,219, 74,167, 6, +245,164, 77,229, 10,138, 36,107,207,196, 49,178,111,204, 16,217, 55,180,191,220, 94,219, 79, 46,205, 25, 35,163,219,180, 52,235, + 49,134, 63,181,118,165, 2,180,186, 37,140,162,216, 99,169, 62,153,198, 86, 40, 42, 83,106, 87,146, 89,205,235, 42, 32,139,223, + 89, 16,208,226,228,230,232,136, 3, 67,106,197, 93, 8, 85,104, 4, 91,164, 73, 91, 29, 78,150,156, 52,105, 40,219,163, 71, 15, + 1, 32,163, 1,175,106,120,236,144, 40,118, 92, 30, 1,120,122,128,201,231, 5,128,132, 25,188, 80,252,103, 97,226, 81,118, 29, +210,222,137, 96,139, 9,170,110,111, 72,253, 2, 48, 57, 81,221, 18,234,160,225, 59,109,178,168, 46,164, 36,203,242,224,127, 94, +231,125,230,235, 90, 51,113,155, 35,187,134,248,116,194,175,158,190, 79,160,197,250,209, 25,235,128, 1, 3, 66, 0, 45, 75,144, +165, 3,104, 69,166, 77,150,101,217, 40,121,161, 52,147,128,138, 42, 25,212, 79, 89, 88,210,205, 7, 37, 8, 4, 8,144, 58, 19, + 28,144,175, 5,116,148, 55, 54, 36, 77,175,233,118, 34,200,133,193,125,248, 33, 83,192, 16, 54, 43,208,107,191, 45, 31,124,142, +200,198,133,100, 37,128, 0,128, 18, 34,152, 6,208,240,121, 38, 36,144,159,248,159, 32,137,253, 23,101,164, 45, 17,253,124, 57, +108,123, 26,132,179,191,208,208,157,207,210, 6,139,106, 40,250, 96, 3,159,105,180,174, 21, 93, 33, 68, 89, 81, 14,101, 23, 28, +141,252,113, 67,117, 98, 28, 29, 18,211,251, 4,129, 4,117, 60,168,158,164,196, 11,215,105, 91,229, 8,100,145,126,102,164, 49, +176,109, 83,220, 56,160,111, 30,231,238, 90,182, 9, 15,190,143, 7, 65, 22,242,173, 70,154,129,254,249, 2,191,189,181,218,135, +126,178,104,244,142,118,222,134,111,121, 26, 65, 22,203,216,173, 91, 55,101, 23, 39, 54, 41, 8,118,217, 10,190, 3,229, 58, 36, +156, 4, 93, 53,180,232, 70,228,125,130,162, 7, 55,247,201,225,109,191,202,169,125, 19,228,198,197,109, 0, 64,187,100,218,228, +209, 74,186,114,110, 39, 0,211, 90, 25,212,175,169, 52,170, 83, 88,154, 53, 40, 33, 35, 6,119,212, 4, 90, 42,205,147,123,199, +201,165, 83, 27,228, 58,104, 14,232,221, 70,250,116,107, 46,215,206,109,151,163,251, 86,200,111,189, 27,135,164,249,153,129, 86, + 68,242,237,111,164, 21, 54,160,165,238,106,161,141, 1, 7, 32,126,132, 68,210,137, 18, 39,251,228,146,183,214,135, 20,249,234, +223, 74,158,183,222,162,100, 57,235, 89,250,124, 10, 81, 79,171, 16, 60,254,208,219, 67,162,149, 73, 50,100, 72, 43, 25,131, 83, + 58,172, 32,211, 73,214, 44,233,100,209,220,145,114,254,220,217,192, 88,177, 99, 79,113, 4,180,232,222, 33, 94,170, 60, 79,255, + 92,177, 79,254, 88,185, 86, 42, 54,204, 33, 63, 14, 89, 45, 13,127,217, 32,213,122,172,146,111, 58, 44,149,234, 45, 43,200,176, +137, 61,165,215,152,197, 18, 47,117,110, 31,157,238, 29,174, 76, 25,240,163,188,125,120, 73, 2,174,239,148,215, 27, 58, 40,128, +235,213,202,102, 10,208,154,213, 42,171,172,197,110,195, 57,189,191,147,218,133,146, 19,104, 93,113,166, 97, 49,105, 53,196,234, + 86,113,229,192,196,115, 94,115,134, 70, 80, 94,213, 27, 60,253, 84, 29,135,100, 99, 61,141,223, 97, 7,161,216,101,209,230, 11, +171,242,233,160,173, 57,160,211, 24,126,251,164, 73,173,205, 47, 94,180,155,211,173, 91, 27, 74,181,254,152, 49, 35,128,234, 66, + 74,178,126,238,218, 53, 32, 81,194,132,111,151,143, 25,211,236,227,195,135, 53,166, 53,108,216,172, 81,212,168,165,180,202,252, + 57,141,225,249,110,168,208,202,181,111,219, 20,219,208, 95,200,211, 39,119,101,211,186,233,178, 96,206, 32, 41, 94, 36,151,240, +158, 86,249, 44,238, 71,162,203,134,165,152, 76,167, 66, 12, 79,144,213,137, 54, 89,223,148, 82, 64,214,129, 17,253,228,238,134, +190,114,111,211, 8,217, 53,108,128,196,211,233,222,129, 64, 72,149,100, 13,204,153, 94, 70, 20,207, 37,191, 87, 44, 30, 44,197, + 34,200, 90,209,183, 43, 54, 88,252, 34, 23,118,121, 80,162,165, 5,180, 76,176,113, 57, 70,176, 65,160,213,169, 83, 39,197, 39, + 17, 37, 5,104,255,119,176,183,185,134, 58,209,168,151,146, 44,173, 73, 44,184,250, 4, 80,232, 51,102, 53,209, 8, 30,147,155, + 2,180, 32, 61, 50, 99, 69,111,198,124,166, 36,140, 5,102, 72,125,204,246,128, 22, 37, 85,182, 37, 90,243,130, 37, 90, 99, 6, +228, 24,217,171, 97,178,190,181, 43, 20,255, 72, 63, 91,252,237, 82, 51, 81,251, 81, 29, 18, 36,114,212,102, 4, 90, 84,115,169, +134,239, 28,159,200, 67,218, 43,169,146, 44, 21, 60,233,145,104,169,182, 89,170,253,212,156, 57,115,148, 73,155,187, 3,193, 19, +115,211,166, 77, 21, 9, 17, 39, 92,148,139, 0,235, 91, 39,250, 84, 91,142,149,148,144,225, 27,167,132, 37, 31, 38,239, 15,180, +175, 97,187,225, 63,141,194,157, 57, 82,208, 30,139, 59, 1, 97,152,205,231,115, 6, 61,156, 31,125,226, 8,140,206,159,227,151, + 62,181,242,233, 36,154, 10, 82,171,131, 0,215, 15,104,131, 71,160, 78,159,100, 4,133, 84,173,233,164, 17,156, 13,192,245,130, + 42,101, 3,112,161, 95, 43,122,208,223,132,197,164, 98,188,143,254,169, 0, 24,140, 9, 4,153, 92,120,233, 13,155,196,119,176, + 78, 99, 40,201, 34,200,162,107, 3, 72,180, 20, 21, 41,193, 22, 36,125, 84, 19,234,178, 27,180, 85, 47, 44,116, 21,167,111, 48, +128, 39,152,154,200, 93,173,234,193, 5, 16, 36,101,188,222,220, 89,158,132, 55, 63,128,214,253, 91,151,119,200,197,227,243,229, +232,246,193, 10,224, 58,123,104, 58,192,214,118,184, 68,217, 36, 99,135,182,151,198,117,139, 72,211,122,197, 32,121,170, 43, 67, +127,251, 73,154, 53,172, 64,160,181,203,222,187,255,162,185, 83, 46, 28,155, 43, 71,182, 15, 82,104,158, 57, 56, 85,174,159,223, + 42,103,142,109,144, 81,131,219, 42, 0,139, 52,123,116,254, 63,205,156, 89, 18,127, 81,251,180,240,242,238,171,121,158, 70,240, + 16,123,127,160,237, 10, 59, 30,108,137,148,196,157, 39,188,167, 81,145,255,239,206,176, 8,169,131,129,224,241,235, 87, 47,229, +246,205,203,178,110,213, 44, 72,175, 58, 73,187,230,229,164,101,195,162,210,186,113,113,105,219,172,164, 28,216,235, 78,195,190, +247,216,175,222, 64,143,195,210, 52, 57, 74,250,141,159,191, 83,102,175,221, 39,157,134, 79,151, 31,250,174,147,239,187,175,146, +198,191,109,132, 1,252,118,233, 54,114,177,184,100, 41,246, 86,175,195,210,114,248, 96, 17,106,167,125,238, 52,209, 31, 47, 26, +211, 69,222,220, 56, 36,239,142,205,148,215,235,218,202,230,223, 91,200,150,169,221,164, 99,181,220,146,195, 37,210, 99,230, 99, +126, 43, 94, 56,220,153,130,157, 94,233,172,188,192, 7,242,154,110,126,254,149, 49,132,199,121, 75, 71,168,148, 98, 97, 64,222, +141, 1,173, 15,192, 70,176,241,177, 13,250,193,229, 84,221, 59,188,186,127,191,237, 59,216, 95,205,233,215,175, 85,214,204,153, +175, 65,125,236,151, 48, 65, 2, 63,183, 76,153,174,204, 25, 51,166,197,199, 59,119,190, 63,189, 98, 69,189, 70, 49, 98,180,111, +105,123, 71, 91,136,186, 71, 16,208,114,200, 79, 55,215,116, 50,117,194,175, 50,126,116, 47,233,217,249, 7, 37,185,102, 74, 99, +111,187,184,202, 6, 91, 52,211,103, 76,151,238,209,220,137, 19,100,241,239,163,101,120,227,250, 50,176,114, 57,217, 63,252, 55, + 57, 58,226, 87,185, 56,115,148,236, 25, 50, 64, 10,186,102,166, 88,222,214,150,231, 80, 14, 75, 9,180, 84, 73,214,200, 18,185, +101, 92,165, 18, 50,181,110,149, 96, 41, 22, 39,250,141, 35,127, 19,143, 41, 99,229,202, 1, 79,218,218, 88, 3, 45, 91,229, 76, + 11,199,166,207,169,202,167,202, 40,200, 91,189,163, 48, 83,214, 77, 31,138,102,144, 68,235, 33,192,197, 27, 2, 44, 26,196,195, +152, 94, 1, 90, 80, 79, 41,255, 41,217, 98,130,218, 66,249,181, 2, 90,161,104,210, 22,139, 54, 89, 33,108,180,178,254,101,163, +181,107, 99,157,113,148,100, 89, 58, 53,229,127, 94,183, 40,108, 40,154, 0,146,143,200, 51,218,121,170, 32,139, 18, 18,168,201, + 67,201,200,237, 0,173, 96,154, 40,255, 36, 72, 72,240,120,128, 34,209,161,218,152,246, 46, 84,105, 97,247, 47,213, 82, 19, 81, +150,202, 72,147,144, 28, 1, 44,155,253, 19,207,159,165,244,138,210, 48, 60,191, 60,168, 94,203,169, 58,164,125, 13,120,238,200, +198,207, 22,205, 20,116, 7, 65,219, 44,130,107,142, 1, 78, 78, 38,118,191, 35, 0, 24, 69,141, 72, 59, 45,170,250, 48, 78,191, +210, 73,219,146,102, 43, 2, 42,214,153,161,139, 8,132, 40,117,228,127, 94, 7, 61,189, 27, 93,236,150, 19,118, 94, 74, 8, 17, +210, 6,189,145,252,229,129,235,118,253,186, 5,213,195,225, 24, 2, 0,248,150,128, 10,243, 26,129, 42,143,101, 0, 95, 10,192, +166, 90, 30,255,107, 57, 26, 63,117,242, 74, 79,182, 16,229,132, 49,124,243,242,165,178,189, 91,190, 96, 24,192,213, 38, 5,100, + 29,241,248, 77, 1, 71, 4, 67,141,235, 22,149,110, 29,106, 41,170,189,246,173,106, 72,225,252,105,253,105, 64,159, 47, 67, 8, + 91, 95,251, 52,207,111,148,179, 7,167,201, 97,187, 52,171,147,230,187,156, 89, 18, 13,119,117, 77,108, 57,198,124,241,221,151, +122,152,247, 55,230,113,206, 51,188, 85, 65,147, 81,125,136,143,230, 35,237, 61,152,224, 61,250, 3, 62, 66, 78, 52,201, 52, 42, +101, 19,104, 37, 74,156,120, 27, 68,214, 1, 24,204,253,182,109,219,250,225,225,131,251,208,125,155,229,217,211, 71, 0, 88,155, +101,214,180,193,144, 76, 60,160,142,253,189,201,197, 37,163, 22,208, 98, 25,212, 16, 60,223, 53,233, 19,208,115,244,114, 25, 57, +103,143, 12,254, 99,135,180, 30, 48, 87, 74,213,234, 28, 16, 63,117, 30,167, 67,240,144,110, 30, 23, 83, 28, 0,169,129, 69, 51, +197,243, 93, 55,169,187,248,156, 92, 45, 35, 58,124, 39,249,211,196,240,229,117,222,183,195, 3,173, 78, 24,194, 91,124,144, 55, +116,173, 65,211,154,102, 40,160, 5,145,250,161, 18, 37, 74,208, 19,252,207, 54,130, 61,219, 42,106, 8,154,116, 88,218, 57, 67, +134,159,188,175, 92,105,245,241,197,139, 38,254, 23, 47,214,240, 63,121,178,138,255,133, 11,149, 1,176,170,126,244,246,174,113, +122,245,234,122, 45, 19, 37,250, 9, 65, 4,237, 25,243,218, 3, 90,225,217,117,104,151,159,193, 18,173, 55,240, 37,228,125, 71, + 54,174,157, 38,243,103, 15,212, 35,209,178, 71, 51,125, 28, 56, 46,109, 93,167,198,251,201, 61,126,150,229,191,246,149,211,115, +103,200,206, 81,131,229,247,214,205,205, 65,146, 44, 91, 32,139,252, 13, 5,180, 8, 10, 40,129, 97, 58,190,114,137,156, 88,179, + 92, 78,172, 91,169, 0, 45, 38,218,103,157,135, 36,235,194,222, 93,114,113,255,110,129,218,247,161, 85, 67,217, 43,231, 55,152, +108, 21, 67,102,180, 59, 87,219,246,118,130,105,182,187,101, 6, 0,254, 91,176,125, 50, 3, 12,152, 1, 56,148,144, 59,144,202, +132, 80, 29, 2,236, 60,133, 68,198, 90,117,104,179,156,246,118, 29,210, 54,139,234,194, 96,137, 86,249,226, 31,169, 70,180,178, +213,178, 9,180,200, 75, 75,144,165,170,164,172,145,150, 22,208, 66,189,149, 93,135,112,162, 25, 64,181, 25,221, 69, 80,181, 71, +144,133, 49,238, 38,239,235, 28,184,109,214, 29, 19,181, 47, 53, 1,244,155, 5, 58, 37,131,104,149,164,163, 81,238,140, 3, 56, +160, 99, 89,123,238, 55,108, 2, 45, 74,178, 40, 33,163, 4, 19,207,106,141, 25,214,197,183,251, 29, 65,178,181, 7,128, 58,144, +110, 65, 32,189,249, 0,233,148, 35, 7,170,150,116,173,105,206, 98,172, 77,186,199, 32,192, 34, 79,185,131, 15, 15,232, 5, 89, +161,190, 35,203,151, 65, 82,182,215, 82,162, 69,201, 22,255,243,186,238,249,200, 70, 70,180,213, 83,170,120, 1,100, 63, 64, 37, +123,142, 27, 33, 14, 30, 60,200,255,252,182,190, 11,227, 56,175,179,251,132,200, 22,170,141,242,100,118, 73,158,221, 53,209,180, + 26, 85, 10,126,220,184,114,172, 92, 61,179, 74, 78,238, 29, 47, 93,218, 87,151,177, 35,186, 73,175,174, 77,164, 76,241,204, 31, +177, 43,112,150,155, 91, 18,203,184,179, 42, 97,167,104,142, 25, 14,159,129, 93, 26, 73,169,162,153, 62,230,204,146,100, 70,206, + 12,201,108,245, 51,173, 57, 46, 44,117,255, 55, 60,227,188,234, 48,168,214, 33,220, 59, 4, 73,178,180, 64, 86,200,143,197, 58, + 72,116,189,122,177, 76,177, 98, 21, 55, 69,141,218, 3,192,107, 43, 62,106, 31,172, 28, 2,176, 35,229,253,197,139,231,177, 67, +231,158,224,218,171,224,224,210,255,103,191,221,198, 85,131, 74,211, 64, 30, 46, 28,222, 48, 69, 84, 80,233,204, 46,166,228, 89, +147,153,166,103, 79, 30,233, 29,127,249, 63, 60, 31,117,208,179,122, 3, 77,219,253, 88, 56,120, 49,198, 33,129, 26, 6,154, 5, +216,254, 75, 95, 30,206,248,208, 9,197, 79, 53, 4,207,170,126,253, 90,222,242,244,108,138,221,133,141, 95,221,184,209,224, 20, +108,178,168, 46,108, 28, 51,102,187,122, 38,147,171,131,250,219, 4, 90,225,220,117,232,240,163,118,205,156,198,163, 74,197, 98, +210,185,125, 93, 37,241,156,215,194,209, 70,193, 65,165,227, 98,103, 33, 19,141,229,157, 13, 42,141,201,235, 4, 93, 60, 56,147, + 0,144,173, 35, 33, 56,170,123, 99,216,250,220,131,218,132,146, 23,103, 14, 71, 52,179, 66,210,114, 67,181,199, 82,127, 41,241, +178,120,129, 45, 99,120,187, 52,169, 70,180,246,163,165,210,234, 82, 59,113, 43, 74,178,248,107,163, 2,161,104,194,142,209, 19, +233, 17, 19,248,234, 48,129,151,182,182,163, 91,211, 36,216,154,132,228,141,186,210,143, 22,127,201, 79,189, 32,203, 46, 48, 64, +187,140,134,153, 4, 29,219,206,181,170,219, 56, 72, 36,223, 99, 87,224,239,122,191,163,160,124, 9,176,225,225, 19,165,152, 12, +229,131,107,137,157,105,116,228,117,212,238, 41, 49,182,111,197,194,250, 46,120, 65, 63, 89,122,129,187, 53, 77,170, 3, 27, 97, + 1,116, 10, 82, 34, 63,252, 30,194,255, 90, 17, 88,206,106, 0,174,129,170,141, 22,127,249, 31,244,171,133,227,123,231,163,191, + 16, 16, 18, 28, 50, 17, 40, 6,129, 44, 71,234,194,207, 1, 54,236,210,204,153, 57,153, 43, 12,210, 87, 54,249,161,116,224,246, + 13, 19,101,208,128,159,164, 82,185,220,146, 61, 75,226,181, 89,179, 38,117,100, 79,167,155,230,192, 1,237,165, 98,217, 92,129, +112, 15,177,130,239,115,178,127, 58,217,204,255,186,236, 97, 6, 89,225,225,196,255, 27,215, 26,104,217,250,159, 42, 85, 58,168, + 10,235,195, 46,107, 42,192,215,197, 36,201,146, 77,117, 6,104,133,163,160,186, 63, 22, 39, 66, 18,232,165, 25,194,144, 61,140, + 3,133, 51, 52,172, 95, 97,179,156,246,130, 74,211, 38,139,247,156, 41, 39, 6,218,182, 84, 31,234, 77,204,175,103,194,181, 85, + 6,216, 55,113,242,209, 82, 25,170,143,234,109, 35,103,186,150, 65,211, 6,183,184, 11,145,134,239,180,221,178,190, 61,184, 75, +226,248,220,117,200,223,176,182,187, 51, 13,164, 1, 54,116,219,180, 89,189,211, 81,187,219,163,169,101,159,100,147, 38,188,149, +255,201, 16, 75, 0,111,179,156,172, 55,179,255, 91,250,103, 53, 74,176,168, 46, 12,146,100,105,129, 44,189,117, 31,128,133,203, + 3,236, 4,247,129, 52,148,182,142, 13,156, 25,235,194,208, 30,182, 30,209,108, 35,184,103, 40,156, 35, 75,146, 77, 65,169,168, +142,247,234,167,233,154,104,125,182,204, 73,237,186, 84,178,120,151, 38, 77, 29,229,250, 55,101, 9,151,234, 48, 60,140,248, 28, + 13, 97,208, 12, 79,139,132,126,214,224,167,193,207,136,226,128,209,151, 34,138,147,127,209,113,196, 79,205,205, 45,118,138, 98, +180,209,151,107,163,176,190,233,191,220, 70, 97,229,217,127,250,185,255,114,135, 49,234, 30,177, 93,223,224,167,193,207,136,226, +128,209,151, 34,138,147,218,128, 48,172,111, 50,218, 40,172,156,179,253,220,215,194,207,136,173,245,151,167,102, 41,213, 10,241, +118, 54,128,173,228, 76, 17,237,209,112,116, 93,139,190, 65,211,118,187,132,181,189, 12,126, 26,252,212,219, 7,140,111,211, 62, + 7,244,242,208, 50,159,193, 79,131,159,182, 56,240, 95,238, 75, 90,223,196,215,120,223,218, 62,235,139,217,107,125, 45, 40,218, + 40,103,196,118,107,131,159, 6, 63, 35,138, 3, 70, 95,138, 40, 78, 26,210, 39,163, 47,253,243,251, 82,196,150,240,203, 82, 51, +128,150, 6,191,141, 15, 48, 98, 59,100, 8,126, 78,169, 99, 74,195,164,247, 21,118,242, 27,109,164,151,129,250,242, 25,252,212, +199, 39,189,185, 12,126,234,229,148,190,124, 6, 63,245,241, 73,111,174,175,133,159,122,235,243, 79,205,103, 87,117,248, 57, 11, +172,167,113,233,243,227, 7, 36,198,164,170,133,164,181, 93, 89,139,102, 50,208,232,140,208, 14,251,153,120,142,196,107,142,142, + 96,154,240, 33, 68,255, 96,202,206,181,160,115,238, 12, 82, 19,119, 15,209,117,130,101,226, 53, 91,187,135,130,105, 98, 23,139, + 55,118,220,209, 27,178, 86,122, 9,255, 87, 12,254, 60, 9,187, 94,170,219, 40,176,195,186,195,239, 88,203,138, 21, 43, 62,100, +226,185,206,134,213,226,167, 61, 50,197,210,165, 78,121, 57, 69,114,132, 72, 10,189,117, 59,152,230,244,234,166, 81, 51,106,152, + 62, 50,241, 92,171, 76, 14,242, 59, 91,206,194,216,157,181, 16,238, 46, 24,162,100, 43, 18, 3, 45, 91, 31,161,104,194,127, 78, +115,180,215, 14,248,178,186,197, 95,254,215, 42,179,213,125,103,203,169,135,188, 65, 83, 15,151,244,231, 49,248,169,159, 87,122, +114, 26,252,212,195, 37,253,121,254,203,252,212,207,165,127,107,206,236, 73, 77, 41,225,164,179, 7,194,205,120,240,151,255, 53, +234, 26,162,195,124,159,221,244,161, 82, 22,147, 48, 85,203,106,250, 8, 31, 51, 51,224,167,196, 29, 65,171,221,225,180,209, 29, +129,139,221, 27, 53,106,180, 9,215,135,130,110, 57, 36, 91,110, 4,108,117, 66,250,123,105,138,180, 13, 14, 28, 63,210,199, 12, +131, 96, 51,254, 27,163,218, 99, 43, 52,227,126,109, 11,202, 99,203, 55,140, 37,205, 96,159,135,200, 47,245,234,213, 59,142,116, + 66, 77, 8, 83,113, 2,161, 62,188,240, 59, 5,191, 13,112, 93,241,230,142, 56, 19,197, 38,101,138,110, 25,116, 55,152, 38, 1, +214,177, 37, 11,228,228,154, 21,114,104,222,204, 16, 62, 21,183,255,214, 75,118,252,210, 77,118,255,242,243,115,220,216,141, 52, + 1,113,204,154, 35,106,188, 26, 90,195,146,197, 14, 63, 64, 2, 44,214,155,129, 79,225,191,230,161,206,126, 24,150,143, 58,102, +241,194,249,223, 61,187,123, 89,110,157,130, 39,243,116, 46,111,241, 46,130,101,245, 80,104, 78,255,206,148,130, 0, 75, 46, 44, + 21,166,233, 53, 76,159, 38, 86, 14,238, 51,229,145,133,126,174,152,120,174,228, 7,208, 10, 84,243, 43,224, 12,215,130,136, 58, + 83,206,142,112, 54,136, 40, 65, 74, 68, 13,185,127,255,190,192, 55,208, 45,208,177,222,169, 21,130, 38, 66, 21,173,104,209,230, +231, 19,155,118, 28,189,116,244,244,181, 91,107,183, 28, 58, 86,175, 73,171, 67,188,174,147,151,204,230, 76, 57,245,146, 53,104, +234,229,148,190,124, 6, 63,245,241, 73,111, 46,131,159,122, 57,165, 47,223,127,153,159,250, 56,244,207,204, 21,118,247, 14, 5, + 83,153, 98,103, 77,106,106,146,211, 37,210,246,246,213,114,127,218,247, 71, 39,121,190,127,178,236,155,222, 78,186,215,201,243, +137,215,121,159,249,108,212, 61, 68,135, 33,192, 82, 39,209, 14, 69, 76,114,226,196, 9, 70,155,117,183, 78, 8, 96,237,142,176, + 63,238,136,154,190, 22, 52,173,253,163, 88,119,194,206,116,252,135,216,126,138,231,109,123, 7,131,176, 34,164, 15, 98, 43,102, +240, 7, 77, 74,185, 44, 15,187, 64,235,220,185,115, 98, 35,109, 61,127,254,124, 23, 0,186, 44, 36,146, 13,209,237, 39,125, 95, +242,141,121, 84, 43, 58,205, 83,143, 16, 64,235,228,234,229,210, 53,174, 73, 73,150,199, 31, 37,114,200,146,170,197,158,173,111, + 80,105, 39,174,143, 67,106, 10, 96,144,155, 68,114,152, 76,249, 91, 39,142,124,198, 22, 77, 91,253,140, 64,139,180,233,192,175, +110,221,186, 47,225,208,240, 17,156,192,106, 25,228,133,229,163, 46,183,125,213,236,143, 87,247, 46,151,189, 51,186,200,204, 94, + 63, 72,172, 24,209, 46, 91,151,211, 26,104,205,168, 25, 89, 82,198, 53, 77, 14,202,231,201, 32,200, 76,248,239,201,107,174,137, + 77,173,167,215,136, 20,220, 71,194, 0,180,162,195,167,206,236,133, 11, 23, 42, 44,102,176, 92,122,165, 38,240, 70,152, 21,129, +115, 72,245,221,161,218,136,146, 43,130,172, 87,175,222,188,191,119,243,222,203, 95,122,252,190,125,198,130,205, 59,247, 28,185, +120,172,102,189,198,251,156,144,108,133,133,159, 90,195,134, 65, 83,139, 67,206,221, 55,248,233, 28,191,180,114, 27,252,212,226, +144,115,247,255,203,252,116,142, 83,255,134,220,144, 92, 45,104, 87, 37,235,251,189,211,218,200, 75,128, 43,191,227,179, 67,165, + 39,187,199,203,166, 81,141,164, 89,185, 12,239,153,223, 1,128, 49, 89, 3,173,139, 23, 47, 42, 64,107,120, 77,151,119,253,202, +152,132,137,231, 8,148,235, 14, 96,228, 14,207,188,140,236,190,222, 17, 77,220,123, 68, 41,142,158,131,129, 71, 25,204,149,207, +216,163,105,169, 58, 68,236,175,143, 8,109,114, 28, 94,135,143,213,170, 85,139,233,104,205,154, 53, 39,224,127, 61,252,166, 37, + 13,232,163, 92,122, 23,202,238,109, 94, 49,233, 83, 64,221, 12,150,142, 50, 67, 0,173,131,115,254,180, 9,180, 22, 85, 46,242, +100, 93,189,111,183,111,107, 85,115, 44,234,208,152, 33,187,130,232,166,109,157, 61,211,211,128, 89,191, 17, 24,134, 2, 6,214, +253, 11,129,106,179,245,238,221,251, 5,121, 1,190,202,211,167, 79,149,208, 46,240, 34, 29, 66,178, 5,226,121, 7,165,142, 50, + 93, 15, 77, 27,125, 56, 81,153, 18,133, 95, 77, 29, 61, 72, 94,220,191, 42, 71, 22,254, 42,107,135,181,144, 49,173, 43, 75,140, +104, 81,238,218,162, 73, 85, 32,165, 84, 4, 89, 71, 22,246, 19,132, 93, 34,143,218, 32, 29,244,245,245, 69, 32,104, 95, 53, 80, +111,106,196, 19,123,177,115,122,103, 97, 94, 62, 99,165,106,212, 26,124, 92,224,205,250, 8, 14, 97, 56, 22,122,118,102,104, 14, +120,249,246, 71,172,190,192,203,151, 47, 75,159, 62,125, 8,132, 45,131, 96, 7,211,164,154,112,253,182, 35,231,238,223,190,255, +226,250,197, 27,143, 39,140,154,179,109,194,180,213,235, 86,110, 57,188,105,249, 6,207,213,188,111,235,155, 14, 39, 63,245, 14, + 19, 90,117,215, 75,199, 50,159, 65, 51, 44, 92,179,255,140,193, 79,131,159, 17,197,129,255,114, 95,178,203, 67,204,141, 69,144, +170,241,151,153, 44,255, 91,156, 43,247,173,254, 23,197,255, 98, 65,207,242, 62, 19,175,169,244,170,226, 92,203,100, 73, 79,219, + 58, 22,106,184,187,187, 43, 0, 65,253, 85, 41, 2, 56, 41,248,229,131,207,117,241,191,178,213, 38,208,122,119,126,141, 60, 58, +182, 82,142, 46, 29, 40,204,239,168, 52, 84, 29, 54,201,103, 18, 74,179,126,254, 38,209,251, 99,199,142,237, 34,168, 34,192, 82, + 37, 93,221, 75,152, 24, 3,108,219,168, 81,163,220, 23, 45, 90, 68,160,197,228,232,240,126,115,252,144, 28,117, 9, 41, 41,178, + 4, 94,156,100, 17,218, 71, 16,191, 77,230,206,157,203, 50,210, 14,203,238,129, 24, 98,158,148, 98, 33, 94,215, 41,100,178,235, + 24, 16,147,108,220,166, 25, 83, 94,242, 95, 49,201, 28,208, 60,175,188, 40, 27,203,102,253,169, 58,180, 60, 70,103, 77, 41,211, +138,102,149, 5,149, 10, 61,198,245,109, 72,163,145, 26, 34, 49,210,189, 9, 46,121, 19,212, 74,149,244,218,251,149,147,223, 5, +180, 43,174,233,229,156, 32, 11,193,127,159, 51, 48,238,173, 91,183,132, 1,107,119,236,216,161, 4,134, 45, 93,186,116, 48,208, + 66,121, 83,180,202,158,193, 59, 96,206, 16, 75,240,166,167, 3, 41,121,162, 69,137, 50,237,248,142,213,114,109,255, 42, 57,182, +124,148, 44,249,181,177,116,169, 85,204,156, 32,118,204,247,184, 93,193, 30,161, 78,165, 76,110,217, 51, 38,191,194,192,228, 12, +218,250,227,143, 63, 42,113,218, 24,239, 13, 82, 56,129,228,146,170, 78,217,189,123,183, 80,221, 87,177, 76,161,183,213,115,154, + 10,235, 46, 24, 66, 82, 66, 82,249,152,117, 39,253, 93,187,118, 41, 32,139,191, 0, 89,228,223, 2,132,214,120,199, 0,204,120, + 47,213,187,161,108,234,240,252,197,115, 87,238,221,155, 56,114,246,238,133,211,150,237, 94,187,122,199,238, 13, 30,199, 54,175, +247, 56,190,242,232,233, 27,235,121,223,186, 60,225,229,167, 19,245, 51,178, 26, 28, 48, 56, 96,112,224, 95,207, 1,123, 88,132, + 21, 39, 64,250,235, 71, 1, 74, 21,173,254, 43,247, 44,238, 7,255,199, 28,208, 95,205,107,153,135,215,249, 31,177,129,151,225, +190, 91, 4, 48,215,177,234, 80, 11,104,189, 63,189, 68, 62,189,123, 33,159,124,159,136,255,173,189,242,238,228, 2,121,119,117, +187,248, 92, 59, 44, 87,246, 46,147,117, 67,235,200,186, 33,117, 52,129, 86, 80, 69,118, 81,146, 5, 48,165, 36, 4, 71, 13, 5, +180,186,118,237,186, 13, 76,112,135, 10, 72, 23,208,122,125, 96,119, 8,160,117,186, 96,122,185,209,165,133, 80,186, 49,108,216, + 48,233,220,185,179,244,232,209, 67, 1, 90, 4, 33, 40,135, 67,160, 5, 59,175,125, 4, 90,205,155, 55, 39,208,178, 25,239,172, +156,201, 20,181, 74,146,120,123,222, 44, 24,237,111,238, 90, 65, 94, 1,100,157, 47, 18, 93, 23,208,154, 82, 40,139,204,175, 80, +224,225,170, 90,101,183,160,129, 71, 34,213, 71, 82,226, 84, 1,100, 69, 43, 27, 47,214,190,151,243, 70,250,154,251, 84,151, 87, +229,108,131, 55, 0,148,246, 72,143, 0, 82, 46,170, 32,235,230,205,155,138, 77, 26, 12,225,159, 80,146,133,244, 8,246,105, 10, +202, 46,142,122,124,151, 60,209,153,119,203, 39,190, 11,104, 91, 84, 19,188,217,234,116,201,242,212,174,146, 46,101, 82,217, 48, +186,149, 44, 25,208, 80,170,162, 30,200, 87, 21, 73, 79, 76,180, 52, 0,132, 79, 41,101,163,196,137,160,144, 1,149, 25, 24,248, +249,115, 4,131,126,242, 68, 1, 89, 67,134, 12, 33, 77, 91, 49,239,236,125, 7,169, 33,109,122, 66, 9, 30,233,109,222,188, 57, +132, 36,235,202,149, 43,210,190,125,251, 0, 60, 92, 29, 32,235, 42,226,245, 29,194,121, 84,107, 98,153, 51,103,222,112,234,194, +141,107, 43, 55,238,219,199, 47,249,205,179,211, 10, 54, 62,116,234,218,198,109,187,143, 46,231,125,203,103, 34,130,159, 17,240, + 97, 27, 36, 12, 14, 24, 28, 48, 56,240,175,225,128, 30,160,165,130, 41, 75,208,100, 13,176, 44, 65,152,101,126, 75,169,150,229, + 51,184,110, 43, 16,183,179,124,213,148,104,149, 99, 5,145,128, 31,254,127,168, 18,173,151,139,107,203,203,165, 63,136,223,161, + 73,242,241,197,109,145,192, 79,114,231,212, 78, 89, 63,188,158, 76,105,144, 66, 38,215, 75, 38,171,127,171,166, 23,104, 41, 54, + 89,150, 1,134, 7,126,151,248, 29, 37, 89, 76, 63,151,137,245, 94, 5, 90, 11, 22, 44,208, 5,180, 84,105, 17,165, 90,150,146, + 45, 70, 95,111,215,174,157, 2,180,122,246,236,169, 0,173,233,211,167,107, 2,173,239,191,255,126, 63,129, 86,211,166, 77, 25, +220, 55,166, 13,110, 71, 42, 28, 51,218,202,199, 83,250,251,153, 7, 53,146, 55, 0, 67, 23,139,198, 8, 28,145, 46,202, 38, 91, + 45, 99, 45,209,154, 91, 46,223,253,149, 53, 74,111,222,220,236,251,225, 40,123, 61, 36,197,214,139, 71,129,104,209,150,223,155, +208,251,245,135,145,173, 20,186,151,138,198, 32, 72, 8,117, 0,100,121,211,232,157, 7,213,133, 4, 89, 27, 54,108, 16,216,100, + 61,166,132,203,234,129,200, 69, 98,199,216,228,243,231, 96, 95,115,223,154, 10, 93,103,123, 16, 65, 86,155,159,135,126, 60,225, +229, 37,105, 92,146,200, 47, 13,203, 6,102, 77,153,216, 15,116,156, 9, 96,157, 15,101,187,208,182,109, 91,105,211,166,141, 76, +157, 58, 85,177,209,154, 48, 97,130, 52,107,214, 76,106,212,168, 17, 16, 35, 70,140, 49, 78,148, 45, 14,130,224,158,163, 45, 22, + 65,214,186,117,235,100,201,146, 37,138,100,204, 90,146, 5,126, 81,181,201, 29,162,161, 64, 22,223,135,248,138,223,245,236,243, +235,141, 91,247,158,220,220,117,248,252,206,205,219,247,157,184,112,245,238,174,235,119, 30,123,214,107,208,228, 12,238, 91,198, + 19,179,224,103,141, 48,241,211,137, 58, 26, 89, 13, 14, 24, 28, 48, 56,240,159,224, 0, 49,136, 45, 44,194,202, 59, 2, 79,127, +221, 86, 36, 93,193, 82, 47,245,154,229,175, 69,190,242,170, 68, 43, 72,226,165,108,200,250,236,135,181,218,144, 47, 12, 1,180, + 8,182,130, 82,192, 77, 79, 5, 92, 89,166, 85,191,126, 23,102,160, 69,208,117,240,224,193,109,152,124,183, 17,100,169, 64, 11, +106,190, 8, 7, 90, 52,138, 70,213, 28, 74,180,176, 19,242, 0,129, 86,147, 38, 77, 8,180,162, 89, 51, 63, 83,204,120,251, 78, +247,111,109,254, 48,177,171,188, 45, 31, 71, 46, 21,139,241,225,199, 68,145, 94, 65,149,100,105,255, 19,252, 24,129,214,186,159, +219,201,164,252, 25,101,118,153, 60,119,209, 25, 54, 33, 13, 69,170,139,148, 89,205,152, 49,102,252, 93,199,251,182, 8,248, 48, +173, 55,232,198,149,203,197, 98,188,239,154, 60,178,165, 61, 85, 48, 77, 72,178,188,169, 38,187,113,227,134,156, 61,123, 86, 49, +244,167, 36,203, 6,200, 50,177,188,231, 7,119, 8,248, 48,182,189,188,253, 38,182, 66, 87, 79,135, 74,150,183,118,169,212,249, +235,248,165, 41, 88, 79, 90,118,254, 77, 32,125,148,214,221, 71,124, 32,232,138, 23, 51,250,124,208,208,218,117,106,239, 53, 4, +175,223, 97,135,169, 60,126,252,152, 0,139,109, 66,209, 45, 37, 99, 76,220,117,202,128,185,142, 34,199, 71,142, 30, 61,250,166, +147, 39, 79, 42,234,194, 45, 91,182, 40, 32,139, 54, 89, 0,212,129,148,100,193, 30, 76, 83,146,101, 89, 64,184,116, 24,177,105, +203,206,203, 23,111, 60, 56,190,209,227,224,230,219, 15,158,238, 89,184,100,197, 33, 92,167, 77, 89,240, 17, 86,126,234,225,185, +145,199,224,128,193, 1,131, 3,255,101, 14,216,194, 34,228,135,181,170,208, 22,168,210, 2, 90, 22, 18,173,202, 54,128, 89,120, +217,110,173, 58, 76, 21,138,160, 51, 64,139,170, 67,107,160,181,114, 64, 21,221, 64,139,118, 89,150, 18, 45,158, 95,186,116,201, + 29, 0,203,157, 42, 67, 53,205,158, 61, 91, 23,208,242, 89,187, 52,132, 36, 75,149,108,217,146,104,141, 31, 63, 94, 19,104, 85, +175, 94,253, 32,129, 22,128,192, 20, 48, 42,132,196, 38,142, 75,182,198,155,218,214,253,244, 97,206, 32,121, 87, 49,161, 92, 46, + 26,227, 93,189,248,145,158,219, 3, 89,100, 52,129,214,250, 78, 63,202,204,210, 57,111, 47,253,190,196, 6, 52,240, 96,164,218, + 72, 25,213,134,136,155, 34,235, 15,107, 91,213,250,244, 97,193,112,121, 95, 37,177, 92, 41, 26,227, 77,205,184,145,124, 64,215, + 38,210,134, 77, 83,123, 72,175, 30,193,189,196, 75,130,149,173, 91,183,210,240,253,158,117,195,178,188,238, 63,213,255,244, 97, +230, 47,242,238,219,248,148,144,189,109,159,196, 54,120,179,124,150, 32, 43, 71,217,230,111,247, 31, 58, 42, 4, 51, 0,194,210, +180,227, 32, 33,200, 10,111,111,196,243,157,193,227, 15,215,175, 95,151,123,247,238, 41,234,206,236,217,179,223,198,245,110, 0, + 53, 15, 40,117,164,116, 10,126,176, 22, 56,120,215,239, 80, 61, 11,250,146,236,217,179, 71, 1, 89,252,165,212, 18,207, 44,232, +216,177,163, 98,147,165, 37,201,178,164, 15,169, 85,172,239,191,205, 18, 48,228,183, 86, 31,154, 52, 40,241,126,202,132, 1, 1, +181,170,230,218, 1,240, 26, 12,182, 21,126,118,104,224, 52, 63, 35,128,103, 6, 9,131, 3, 6, 7, 12, 14,252,235, 57,160, 7, +104,217, 2, 94,196, 98,127,225,177,255, 75,182,248,223,158,141,150,154, 63,232,254,183,159,129,177, 90, 59,254,255,122,165, 61, +137,214,219,125, 99, 67, 1,173, 21,253, 43,107, 2, 45, 26,195,183,135, 33, 60,141,223,169, 46,180, 4, 91,214, 64,107,248,240, +225,238, 48, 96,215, 5,180,158, 46,157,227, 16,104,117,233,210, 37, 88,117, 56,102,204, 24, 77,160,133, 29,133,135, 1,180,182, +210, 79, 22,216, 16,108, 56,157, 48, 69,182,114,163, 38,252,241,244,229,189, 59,114,191,114, 42, 57, 87, 44,230,251, 42,113,162, +188,117, 4,178,130,129,214, 79, 77,111,194,141,195,186,117, 13, 42, 14, 68, 71,168,137,148, 94,109,216, 88, 46, 89,138, 14, 25, + 61,229,233,171,123,119, 2, 31,126,159, 86,206, 23,141,249,190,114,236, 40,190,246, 64,150,101,135,128, 11, 7,111,238,220, 91, +185,114, 37, 13,223, 67, 0,173, 16,229,173,148, 66,206,160,188,149, 98,107,151,151, 32, 43,103,185, 22,111, 15, 28, 58, 38,112, +179,161,128, 30,248, 56,147,228,185,107, 57,173,114,180,238,188,240,145, 54,120,192,128, 1,138, 61, 22, 37,113, 4,190,148, 62, +209, 5, 3,218, 92,217, 45,136, 77, 18,242,235,175,191,242, 93, 52, 86,180,117,212,161, 74,152,199,209,163, 71, 67, 72,178,174, + 94,189,234,180, 36, 75,125, 1,128, 86,185, 46, 29, 26, 66, 66,246, 82,222,188,188, 34, 55,206,207,247,172, 81, 37,207, 96, 24, +194, 39,100,158,176,242,243, 51,124,192, 6, 73,131, 3, 6, 7, 12, 14,252,167, 56,128,225, 62,172,187, 14,249, 28,119, 25,170, + 59, 14,131,141,233,131,174,241,126, 40,205, 85, 4, 48,215, 57,160,229,187,115, 80,176,218,144,234,195, 55, 91,122,134, 0, 90, +179, 90,103,147,229,253, 42,106, 2, 45,107,247, 14, 30, 30, 30,187, 32, 45, 81,164, 91, 42,208,130,241,186,251,188,121,243,220, +199,141, 27,231, 94,160, 64, 1, 2,173,129, 26, 21,126, 64,195,106, 30,199,210, 68,183,105,163, 69,160, 5,131,113, 25, 52,104, +144, 12, 30, 60,152, 19,248, 3, 71, 52,233,194,129,126,178, 0,180, 20, 23, 14, 5,179,102, 30, 86,170, 96,222, 7, 21,171, 84, + 15,120,239,255, 33,240,226, 93, 95,153, 50,124,234,139,210,241, 98,127, 72, 31, 59,161,166,225, 54, 36, 90,215, 81,188, 53, 72, +191, 34, 85, 71, 82,232, 22,200,154,249,151,146, 5,114,221, 41, 95,177,122, 64,128,249, 99,224,229,123,111,101,218,208,169,175, +202,197,141,245, 33,109,236, 68,157,244, 52, 52,128, 86,123, 26,189,115,119, 97,201,146, 37, 91, 88,151,151,116, 89,222,201,195, +166, 62, 47, 29, 87,187,188, 4, 89,185,191,105,249,246,208,145, 19,220,253,169,216,125, 81, 82,180, 96,217, 58, 73,157,191, 46, +109,178,194,115,196, 68,121,223,211,167, 25, 37,112,144, 94,113, 71,228,148,194,133, 11,127,224, 42, 6,253, 64, 54,109,218, 68, +192,104,198,245,193, 72, 54,237,169,224, 15,107, 43,140,231, 3, 73,103,233,210,165, 74,249, 8,222,144, 95,145,100,193, 15,155, + 83,146, 44,203, 10,185,185,166,147, 93, 27, 6,137,199,234,190,158,203,255,104, 56,216,213, 53, 77, 57,203,246,119,150,159,225, + 97,150,241,172,193, 1,131, 3, 6, 7, 12, 14,124, 53, 28,208, 86, 29,218,170, 10, 36, 90, 87,166, 12,248, 81,222, 62,188, 36, + 1,215,119,202,235, 13, 29, 20,192,245,106,101, 51, 5,104,205,106,149, 85,214, 98,183,225,156,222,223, 73,237, 66,201, 9,180, +174, 56, 98,137, 53,208, 90,181,106,213, 46, 24, 67,187, 15,169,150, 52,216,143,214, 47,149, 18,188,131, 90,201, 29,146, 15,122, +227,174,105,111,178,181,120, 79, 27, 55, 55, 55,127, 78,212,183,250,252, 36,103, 75,231, 80, 64, 23, 15,170, 14,233,183,169,111, +223,190, 10,200, 2,128,146,184,113,227,210,181, 65, 8,155, 27,235, 50,195, 95, 86,125,213, 25,169, 91,230, 52, 85,219, 55,170, +251,250,238,185, 19,178,101,218,112,233, 53,112,226,167, 89,238,151, 95,164,202, 81,254, 78,236, 84,217, 11,232,233, 2, 0, 90, +171, 80,156, 1, 72,223, 35, 41,187, 27,114,100, 74, 87,161, 77,189, 90,175, 72,119,243,180, 17,210,119,248,180,192,121, 91,174, +190, 76,151,167,194,157, 88, 46, 57, 44, 13,175,245,188, 34, 56,143,117,121,187,255, 58,254,211,204, 77,151,124, 82,102, 47,171, + 89,222,228, 57,235,148, 44, 88,177,205,219,195,199,188,100,237,218,181,220, 28, 33,123,247,238,149,133,203,214, 75,250, 34, 13, +124, 9,194,156, 42, 76,232,204, 9,105,143, 69, 55, 12,216,112, 64, 96,164, 74,245,114,196,137, 19,103, 23,182,217, 62,130,141, +149, 39,217,227,232, 61,201,146, 37,123,197,246,133,159, 53,197, 38, 11, 32, 43, 48, 60,146, 44,245, 93,148,104,117,254,169,129, +248,191,243,246,124,253,252,242,224,211, 7,250,149, 11, 15, 63,195,201, 43,227,113,131, 3, 6, 7, 12, 14, 24, 28,248,183,115, +160, 28, 36, 10, 8,181,211, 62,119,154,232,143, 23,141,233, 34,111,110, 28,146,119,199,102,202,235,117,109,101,243,239, 45,100, +203,212,110,210,161, 90,110,201,225, 18,233, 49,243, 49,191, 21, 79, 66, 56, 94, 11, 17,130, 39,155,233, 3,242, 14,128,253,203, +250,206, 69,255,239, 71,139,231,184,254, 19, 82, 60, 59,252,181,229,204,141, 70,103,179, 10, 21, 42,244,145,210,141,203,245, 43, +202,201, 28,201,164, 83,167, 78, 50,112,224, 64, 26,181, 75,242,228,201, 25,134,135, 6,214,161, 13,212,172,194,166,168,206, 72, +225, 13, 60, 81,225,156,110,143,207,236,218, 36,251, 22, 77,145,185,157,235, 74,177,188, 57,159,165,204, 81,246,180, 14,144, 21, + 92, 78,196, 47,164, 31, 15, 58, 69, 83,222,157, 53,107,210,120, 5,115,184, 61, 60,189,115,147,236, 95, 60, 77,161, 91, 60, 95, + 46,159,180, 57,203, 95,210, 0, 89, 14, 29,217,217, 44,111,158, 28,207, 82,184,149, 60,229,160,188,193, 52, 51, 23,109,176,225, +254, 67,111, 69, 29, 71,227,114,122, 85, 95,180, 98, 3, 64, 86,125,103, 65,150,189,114, 38,196, 70, 3, 33, 40,130, 11, 13,182, +115, 66, 39,190, 33, 75,154,235, 9,214,104, 71,103, 41,201,122,245,234,149,179,146,172, 80,229,116,205,148,102,116,157, 26,101, + 6,119,254,233,135,114,225,229,167, 19,117,211,202,250, 95,118, 96,104,212, 93,171,119, 56,119,223,224,167,115,252,210,202,109, +240, 83,139, 67,255,157,251,156,223, 41,213, 82,127,225,173,201,137, 35,143,139, 41, 14,128,212,192,162,153,226,249,174,155,212, + 93,124, 78,174,150, 17, 29,190,147,252,105, 98,248,242, 58,239, 59, 1,138,172,179,198,177,148,116,241, 92,163,104,142, 58, 54, +125, 81,173,105, 91,170,168,156,109,219, 80,113,237, 0,251, 26,210, 91, 67,124,227,128,110, 8,154,120, 38,102,174, 44, 25,126, +206,159,205,245,193,130,145,253, 62,237,248, 99,164, 2,134,152,242,101,205,104,237, 85,222, 30,217,255, 3,152,204,153,191,129, + 20, 38, 69,206,156, 57,163,103,203,156,174, 93,190,172,153,239,207, 25,214,231,227,206,153,163,131,233,230,215, 71,215,102,221, +195, 89,222, 96,154, 41,242,214, 42,210,166,215,216,247,222, 79,158, 9,157,188, 46, 94,185, 49, 44, 32,139,252,176, 11,180, 40, +201,226,238, 69, 58, 44, 13, 7,208,114, 67,236,194, 43,211,166, 77,147,107,215,174,133,217, 38,203, 94, 57,161,222,204,133,246, +239, 26,198,246, 55, 6, 94, 39,198, 22, 29, 89, 13,126,234, 96,146, 19, 89, 12,126, 58,193, 44, 29, 89, 13,126,234, 96,210,127, + 36,139,106,147,101,253,235, 92,245, 51,187,152,146,103, 77,102,154,158, 61,121,164,119,252,229,255,112,128,162,224, 71, 45, 37, + 93, 60,143, 0,154,116,209, 79,159, 86, 76,138,187,126,103,104,230,113,205,112,173, 83,237,111,223,173, 28,222, 93,214, 12,235, +170,128,161,177, 45,191,147,111, 11,230,120, 81,192, 45,243, 8, 45, 98, 65,247, 67,125,128,185,179,100,184,216,161,102,133,183, + 43,134,117,147,181,195,127,150,121, 93,126,144,241,173,170, 73,165,194,185, 94,230,207,150,105,188, 14,186, 54, 63,234,112,150, + 55, 4, 77,170, 7,219,246,254,253,253,237,187, 15, 37, 83,209,134,206, 74,178,212, 42,216, 27,124,162,229,205,155,247, 25,141, +221,115,231,206, 77, 21,174, 51, 6,136,214, 52, 99,192, 86,107, 12,195,235,208,233,169, 51,187, 11, 45,248,252,217,249,169,163, + 77,245,100, 49, 6,115, 61, 92,210,159,199,224,167,126, 94,233,201,105,240, 83, 15,151,244,231,249, 47,243, 83, 63,151,254,121, + 57,195, 30, 84,218, 86, 93, 92, 93, 77, 49,116,214,241,171,236, 48,121,220, 50,122, 21,200,225,250,164, 32, 83,182,204,222,249, +179,102,186, 83, 48,123,166,253, 89, 51,167,113,198,181, 65,104,160,229,150,241, 92,193,236,174, 79, 11,229,200,242, 12,116,159, +130,238,253, 2,217, 50, 29,207,157, 57, 67,173,240,240, 51,156,229, 13, 85,206, 20, 57,235, 20,206, 94,186,217,114,218,108,233, + 44,151,117, 54, 71,237, 94, 25,129,159, 87,226,129,111,156,164,109,143,102,145,170, 85,171,222,182,231,241,221, 25,128,173,230, +141,104,126, 58, 89, 79, 91,217,191,202,239, 40, 2,234, 77, 18, 70,221, 35,136,145,246, 22,128, 17, 64,222,104,163, 8, 96,162, +214, 2, 48,156,175,248, 90,218, 40,156,213,252,111, 62,254,181, 52,174, 81,206,136,237,159, 95,154,159,116,193, 97,115,135, 98, + 88,128, 86, 56, 89,241,165,235, 30,214,226, 26,229, 12, 43,231,108, 63,103,240,211,224,103, 68,113,224,191,220,151, 34,138,135, +127, 7,157,136,149,104, 57, 81,131,255,114,135, 49,234,238, 68, 71,209,145,213,224,167, 14, 38, 57,145,197,224,167, 19,204,210, +145,213,224,167, 14, 38, 57,145,197,224,167, 19,204,210,145,245,107,225,167,142,170,124,157, 89,216, 0,182,146, 51,181,177, 71, +195,209,117, 45,250, 6, 77,219,237, 18,214,246, 50,248,105,240, 83,111, 31, 48,190, 77,251, 28,208,203, 67,203,124, 6, 63, 13, +126,218,226,192,127,185, 47,105,125, 19, 95,227,125,235, 93,135,250, 28,150, 70, 64, 77,191, 22, 20,109,148, 51, 2, 26,219,130, +132,193, 79,131,159, 17,197, 1,163, 47, 69, 20, 39,255,162, 99,240,211,224,103, 68,113,224,115,244,165,136, 42,219,223, 65, 39, +124,187, 13,195, 81,226,207,209, 16, 6,205,112, 52,136,141, 71, 13,126, 26,252,140, 40, 14, 24,125, 41,162, 56,105,128, 34,173, +190,196,192,244, 76,246, 14, 91,247,181,104,134,165,245, 12,154, 97,225,218,191,243,153, 8,181,209,114, 3,143,152,244, 28, 97, +237,132,157,225, 77,253, 28,156, 90,126,130,151,118, 41, 95,190,252, 96,139,151, 5,211, 44,147, 43,234,137,111,242, 68,245,254, +127,138,230,253, 77,222,152,222,223,228,143,237, 93, 38, 95,236, 19,122, 10, 24,148, 39,172,229,116,244, 10,131,166,118, 3,100, +136,157, 32,249,217, 56,137, 82, 94,137, 25, 47,201,149,104, 49,227, 33,197, 13, 78, 81,162,199,244,176,213,238,234,181,148,249, +235,164, 79,150,167,214,138,100,121,106,150, 70,176,235,229,252, 77,158,167,238,178,191,126,235, 44, 77,158,191,118, 94,254,166, + 42, 88, 47,157,157,162,124,117,109,132,104, 10, 81,194,147,236,241, 51,117,234,212,238,136,176,112,197, 94,194,247,184, 71,187, + 57,191,122,105, 73, 89,212,241, 28,146, 18,156,214, 34, 93,196,185, 86,208, 89, 93,125,169, 28, 54,109, 52, 52,153, 58, 53, 55, +153,238, 50,241,156,215,254, 73,253, 19,206,157,247,161,189,189,227,199,143,127,131,229,226, 47,255,243,186, 86, 57,193,180, 40, +122, 82,110,147, 41, 81, 52,147,169, 3, 34,128, 92,138, 17, 57,114, 39,245, 25, 71,223,187,197,189,142, 56,247, 11, 74, 60,183, + 62,236,221,215,213, 70, 58,250,185,101, 22,131,166,147, 12, 51,178,219,230, 64, 54, 92,166,167,118,134,196,121, 92,164, 72, 17, +201,145, 35, 7, 7,161,199, 65,215,120,143,121,108, 29, 78,119, 66,124,120,227, 38, 79,158, 44,129,129,129,193,161,116, 16, 14, +103,176,173, 15,144, 0, 75,238,120,202,177,141,127,136,188,243, 65,122, 46,242,254,165,200,179,139,242, 77,254,184,222, 78, 52, +168,101, 57,227, 39, 78,156,120, 98,146, 36, 73, 30,194,201,168,183, 86, 98, 62,230,231,120,100,245, 62,205,186,199,141, 19,243, + 67,204,152,209, 2,109, 37,222,179, 81,254, 96,154,120,239, 33,150, 13,131, 95,136,228,226,226,226,173,166, 20, 41, 82,120, 91, + 38,120,168,247,102,194,115,150, 32,212, 81, 57, 99, 69,142, 26,189, 95,148,104,113,247, 68,137, 17,251, 81,148, 24,113, 30, 69, +141, 17,111, 15,175,161,108,177, 28,240, 87,179,238,120, 54, 67,170,116,174,247,126,159,185, 70,154,117, 29, 42,151,175,221,148, +150, 93,126,147,171, 55,110, 75,199, 62, 35,148, 95,130, 46, 71, 3,175, 75,254,134, 75, 39,205, 89,247,220, 37,127,131,135,147, +230,172, 85,126, 39,207, 93,239,131,235, 15,248,155, 34,127,195,123,147,231,172,243,113, 41,208,104,113, 88,251,103,227,172,169, +223, 54,201,236,242,209, 86,226, 61, 71,109,228, 68,255,211,202, 26,204, 79, 21,100,193,157, 5,189, 14, 75,147, 74, 5, 71,141, +239, 90,179,147,173,212,191, 94,193, 81,245,114,153,164,113,129,216, 5,213,231,236,241, 51,115,230,204,151, 62,126,252,136,128, +218,102,121,255,254,189, 48, 80, 57, 61,237, 35, 68,150, 18, 0,220,213,213, 85,153,116, 53, 14, 61,237, 94, 3, 52, 78, 35,157, + 65, 98,208,118,173,195, 17,205,120,240,165, 54, 16,225,155,246,196,136, 17,227, 9, 19, 66,108,237,225, 53, 16,181, 23, 89,130, +239,179, 71,243, 52,226,103, 42,126,217,158, 61,123, 38,143, 31, 63, 86,210,211,167, 79, 37, 86,172, 88, 87, 35,160,238, 38, 2, +171,169,165, 75,127,124,131, 24,162,222,221,187, 75,255, 4, 9, 62,240,154,158,254,137,250,121,160, 28, 87,156, 73,124,198,217, +113,137,160,138,131, 47,127,249,172,245,127, 71,125,222, 17,200, 66,108,173,168, 16, 51, 85,136, 26, 37,138, 59,198,165,215, 8, + 42,255,137,239,193,152,255,192, 9,160, 69, 73,149,159, 58, 57, 68,138, 20,233, 3, 66,119, 45, 65,156,215, 5, 72,243,139, 23, + 47,190,144,215,212,251,204,139,164, 74,190,244,244, 79,173,254,104,125,223,160,233, 44,199,254,189,249,195,100,147,181,133,157, +148,192,106,226,196,137, 2,176, 35,239,222,189, 11, 6, 63, 28,136,182,111,223,174,132, 64,201,149, 43, 23,129, 23, 59,180,221, +143,250,219,234,165,187, 84,111, 92, 81,152,138,150,206,255, 16, 31,111, 95,228,143,108,197,115,215, 22, 45, 90, 40, 8,139,193, +133, 17,212, 89, 28, 73,180, 20,160,117,113,133,108,235,154, 94,100,119,111,145,121,133, 69, 86, 34, 48,247,150, 54, 97, 6, 90, + 4, 77, 67,134, 12, 81, 98,253,173, 89,179, 70,150, 47, 95, 46,139, 22, 45, 18, 4,186,150,153, 51,103,202,168, 81,163,132, 65, +172,153,252,253,253, 21,158, 32,223,199, 32,176,101, 89,157,224, 15,176,120,161,116, 39, 74, 22,206,224, 93, 34, 40, 21, 47,144, + 86, 1, 58, 4, 88,193, 12,181, 58,225, 61, 71, 3, 26, 6,170,123, 62,112,252,249,226,204, 25,121,126,242,164, 60, 63,113, 66, +248,223,231,216, 17,164, 67, 72, 7,196,231,232, 62,121,118,216, 83,158, 30,216, 45, 79,246,236,144,199, 59, 60,228, 62, 6,120, +117, 0, 13,162,111,111,160, 40, 25, 45, 70,236,187, 63,118,254,205, 60,115,233, 86,217,113,224,172,108,221,123, 90, 38,207,219, + 36,205, 58,244, 55,199,136, 29,255, 46,158,183,231,103, 75,115,240,137, 17, 39,193,213,117, 91, 60,165,223,176,201,146, 50, 87, + 5, 73,145,179,124,136,212,185,223, 40, 45,160,149,216, 37,247,247, 23,192, 54,191, 20,249,234,189,225,111, 74,245, 55,111,200, +255, 41,114,127,127, 30,101, 77,236,136,159,246,218,136, 0, 75,109,154, 39,127,252, 33, 15, 16,148, 92, 61,120,207, 17, 77,203, +123, 4,183,228,187, 86,178, 2,193, 42,137, 16, 64, 11, 32,171, 16,110, 8,128, 17,251,136,108,253,115,192, 58,185,180,122,150, +101, 58,189,108,192, 58,130,172, 64,255, 55,129,252,109, 86, 36,118, 33,130, 45,139, 50,133,104,163,140, 25, 51, 94,121,251,246, +173, 32,200,187, 18,220,219, 58, 1,104,105, 1, 13,146,254, 95,123, 87, 1, 38,197,209, 68, 47,184,123,112, 75, 32,193,221, 37, +184, 75,112,130, 91,144, 16,220, 37,200, 5,119, 9,238,238,238,238,206, 29,238,122,232,113, 56, 28,183,248, 93,253,239, 13, 59, +251,207, 45,187, 59, 51,199, 65, 66,178,243,125,253,205,238, 76, 79, 77, 79,181,189,174,170,174,114, 84,239,236,227,227,226,197, +139,199, 54,207,232, 12,135, 9,100,248, 46,128,128, 83,248,159, 61, 86,172, 88,199,153,199,193,120,224,140, 38,175, 23, 70,116, +128,155, 59,118,236,120, 1, 64,104,185,114,229,138, 37, 48, 48,208, 2, 80,100, 65, 48,116,127, 72, 97,216, 62, 41,161,114,116, + 56,107,159,175, 17,144, 92,145,162, 35,222,170, 45, 17,104, 85,201, 19, 62,168, 69,153,168,150, 6, 69,163,112,236,170,136,104, + 12,177,236, 8,235,182,121,230,167, 20,139, 32, 11,131,170, 72,145, 34, 2, 81,153,240,154,145,114, 18, 96, 45, 91,181, 88,214, +110, 92, 37, 43,215, 46,147,197,203, 23,200,252,197,115,100,214,188,233, 50,117,230, 36,153, 48,229, 47, 25, 61,110,132, 12, 27, + 53, 88, 6, 15, 31, 32,253, 6,246, 37, 64,180,143, 63,171, 91, 78, 21, 88,253,240,195, 15, 47,248,155,103, 45,240,114,213,230, + 29, 1,173, 4, 30, 30,223,135, 11, 19,102, 48,230,146,199, 24, 63, 95,146,191, 85,171, 86, 85,218,218,176, 97,195,222, 1, 24, + 89, 50,160,127,242, 89,103,237, 83,115, 61, 24,208,194,247, 9,234, 62,232,214,173, 91, 74,226,111, 94,115, 3,173,143,106, 73, +183,222,157,180, 65, 87,151, 63, 7,205, 16, 20,227, 31,243, 72,136, 84,135,194, 1,241,201,147, 39, 28,208,157,225, 1, 5,108, +156, 57,115, 70, 1, 36,248, 92,123,112, 96,171,136, 89,187,135,181,217,113,111,174, 48,109,190, 53, 91,122, 77,108, 43,144,174, +216,123, 67, 31,124,240,224, 65,101, 53, 25, 41, 82,164,221,160, 23,211, 85,167, 86, 85,135,133, 51,133,247, 47,149, 59,214,139, +194,153, 34,248,127,170,234,144, 18,170,233,211,167, 75,245,234,213,131, 13,182,234,192, 91,175, 94,189, 96,147, 16, 1, 40, 87, +252,124,206,217,192, 75,128,165,101, 96,133,146, 25,159,228,203,153,194, 47,121,210,184,202,138,142, 96,149,169, 71,143, 30, 74, +162, 84, 65, 15,104,129,119,183,158, 28, 63, 46, 23,199,140,177,165,203,227,255,146,171, 83,199,201,181, 89,227,196,103,222, 56, +185,177, 16,105, 1,126,207,197,181,153,227,228,202,148,113,114,103,221, 26, 35, 64, 43, 79,210, 20,105,158,204, 93,177, 67,166, + 46,222, 46, 69,107,117, 71, 40,158, 26,242,125,222, 95,164, 84,253, 62, 50,114,230, 38, 25, 59,107,157, 36, 73,241,227, 99,124, +179,163, 0,216,186, 29, 48, 98,228, 24,183,206, 32, 20, 79,185,170,245, 37, 75,161,202, 50,112,244, 52, 25, 61,121,158, 2,182, +166,207, 95, 41,251, 14, 31,119, 9,180, 48, 57,143, 47, 86,189,125,192,132,217,235, 44,197,235,244,181, 76,152,179,206, 82,162, +158,122,246, 84,254,151,172,255,167,114, 46, 83,167,115, 0,234,103,188,171,182,244, 81, 29,149,250, 80, 71,141,210, 36, 83,234, +136,199, 97, 76,138, 76, 33, 1, 90,234,228,229,180, 35, 89,111,216,129, 96,181,200, 54,126,170,146, 44,246, 73,182, 59, 0, 3, + 5,108,109,154,210,115,133, 10,180,142, 47,232,185,130,224, 42,240, 21, 0,205,174, 65,242,230,218,238, 64, 85,178,229,108, 34, + 67,123,218, 8,181,225, 5, 38,196,120,124,129,243, 27,109,194,100, 27,224, 72,173,104,167, 82,116, 84,239,227,216,167,253,253, +253, 5, 65,187, 31,161, 95,189, 3, 32,146,245,235,215, 75,246,236,217,131,138, 22, 45,250,150,253,189, 73,147, 38, 28, 63, 8, +182,236, 15, 71, 52, 75,194,156,224,145, 5,199,187,119,239, 44, 24,167, 44, 43, 87,174,180,128,142,242,155,215, 32,137,178,164, + 77,155,246, 33,136, 57,124,222,201,208,252,218,215,215,247,253,209,163, 71,229,220,185,115,114,227,198, 13, 69,162,199, 49,174, + 65,145,240, 34,155,210, 75,155, 42,137,100,248,148,181,231, 50,101,201, 62,142,177, 48, 13, 0,131, 96,175, 34,168,162, 36,139, + 32, 11, 31,108, 26,104,109,219,182, 77, 16, 31,214,101,202,147, 39,143,252,244,211, 79,130,168, 9,186, 64, 11,253, 98, 5, 36, +224, 7,180, 9, 82,242,231,221,186,117,123,207,122,226,193, 51,255,243, 58,243, 97, 49,176,194,217, 88,167, 2,173, 34, 30, 30, +209,194, 3, 87, 70, 8, 31,254, 4, 64,233,243, 18, 37, 74,216, 38,145, 20, 41, 82, 4,133, 15, 31,254, 49, 36, 89, 62, 17,194, +132,233,250,157,135, 71, 2, 19, 18, 45,190,250,119, 74,173, 8,168,160, 93,241,193,130,124, 1,210, 66,166, 95,126,249,101, 49, +175,241, 30,243, 48,175,217, 58, 50, 57,109,235,142,117, 38,233, 49,251,127,153,166, 83,118,161, 41,230, 68,130, 36,197,150, 74, +106,126,231,197,239, 60,214,255,218,235,204,207,235,218,103,237,255,243,217,104, 72,144,212, 40,180, 25,151, 56,110, 8,234,205, +181, 68,107,221,186,117,162, 38, 13,113,165,147, 49, 92, 10, 7,158,139, 23, 47, 42, 98,116,170, 21,252,252,252,100,251,246,237, +242,215, 95,127, 73, 7, 12, 26, 29, 59,118,148,137, 19, 39,170, 54, 13, 14,203,167, 74,180,126,174, 91, 82,254,156,217, 69,150, +159,155, 46,149, 26,150,123,143,129, 90,141, 65, 24, 46,115,230,204, 15,248,206,145, 35, 71,146, 22, 85, 12,134, 14,208,232,188, +227,148,165, 47,207,134, 30,112,145,137,128,137, 82, 43,174,184,180,171, 90,103, 64,139,171, 50, 2, 77, 7, 64,203,246, 22, 78, +216,218, 9,246,202,249,221,114,236,224, 98,169, 92,169,188, 2,170, 30, 63,126,172,128,203,251,247,239, 43, 60,230,217, 9,208, +178,209, 36,208,162, 20, 43, 24,208,154, 8,160, 53,125,156, 92,159, 3,128,181,104,156,237,149, 4, 92,188,118,117, 26,128,214, +154, 85,246, 64,203,158, 27,145,195, 70,136,226, 51,125,241, 22,105,215,127,182,164, 40,220, 70, 18,101,173, 98,163,149, 42,127, +109,201, 93,227, 79,105, 59,112,161, 12,159,186, 90, 32,217,242, 1, 1, 87,106, 68,135,220,142, 16, 41,234,173,154, 53,107, 10, + 84, 53,210,182, 99, 87,233,218,119,152, 12, 27, 63, 75, 1, 90,147,103, 47,147,221, 7,188,236,129, 86, 48, 58,144,102, 92,131, +148, 13, 32,171,143,165,231,160,201,150,162,181,122, 89,250, 12,155,174,252,239, 55,106,182,165,100, 61, 79,203,144,241, 11, 44, +229, 26, 15,180,108,222,115,220, 2,137,227, 53, 87,109,195,190,142,174,162,142,142, 31, 90, 44,127, 86, 40, 43,126,136,169,168, + 5, 88,252,125, 60, 89, 50,113, 34,209,114,248, 26, 21,104, 49,206,163, 35,137, 17,175,243,112, 2,180,180, 52, 21, 73, 22,249, + 70, 58,236,151,103,206,156,166,100, 77, 84,160,245, 65,146,245, 92, 94,236,232, 47,247,251,199,151,167, 11,106,202,211, 21, 45, +222,240,186,145,254, 65, 53,162, 86,117, 79, 80, 71,176, 65, 41, 20, 23, 95,108,175,108,163, 55,111,222, 20,128,175, 43,174,104, +130,239,222,124,102,215,174, 93, 2, 48,164,168, 35, 25, 71,147, 65,203, 55,111,222,172,212,255,249,243,231, 5,210, 54, 65,157, + 82,178,165,119,196,128,122,240, 54,202, 98,193, 88,100, 65, 89, 20,128, 69, 73, 22,127,239,219,183,207, 82,168, 80, 33,229, 26, +222, 99,129, 90,241, 54, 8,218,171,245,157,189,227,213,181,107,215,222, 49, 88, 57,206,202, 55, 2,203, 41,245, 2,137,150, 52, + 43, 21,229,213,111,149, 82, 88, 54,123, 61,125, 59,106,198,230, 11,168,171,202,122,133,181,191, 79, 53, 97,143, 88,177, 2, 41, +201, 98,234,240,205, 55,129, 46, 84,135,193, 30,167,116,138,146,172,106,191, 84, 86,202,196,179,125,250,165,110,117,169,215,168, +142, 52,105,214, 80,145,106, 57,144,104, 5,163,137,113,228, 0,192,250, 37,240,243, 18,212,197,151, 80, 63,151,192,203, 75,136, + 19,251, 20, 17, 23, 20,164,197,115,221,186,117,159,249,248,248, 92,130,196,232, 18,159,113,246,221, 81, 60, 60,114,124, 19,235, +199,253,145,226,126, 31,128,113,252, 61,199, 53, 6,146, 71,200, 45,130,233,151, 0,219, 79,195,134, 9, 51,139,249, 28, 73,191, +140,242, 51, 91,182,108, 51, 80, 30, 1,176, 90,138,126,144, 86,155,120,141,247,152,199, 40, 61,119,190,127, 6, 7,156, 96, 17, +165,112, 4, 65, 60,169, 73,251, 31,139,138, 30,234,127, 71,249,180,215,172, 96,202, 70,203,250,108,121,158, 73, 27,170,232,133, +200, 99,212, 14,221, 60,227,248,145,154,167,108, 64,139, 96, 75,155, 26, 55,110, 44,205,154, 53,147,223,127,255, 93,218,182,109, +171, 0, 45,130, 46, 43, 3, 92,190, 24,171,177,240, 41,190, 75,177,109,194,182,145, 50, 96,126,111,129, 17,110, 47,235, 3, 63, + 19, 96,241, 32,224,194, 53,195,158,190, 67, 19,104, 81, 5,216,168, 81, 35,105,221,186,181,180,108,217, 82,249, 78,254,199, 64, +195, 78,173,168, 51,185,218, 37,184, 58, 9,181,221,161, 67,135,152,231,157, 3,213,161,141, 15,121,115, 36,247,187,112,122,187, +172, 94,208, 83, 86,206,235, 46,203,230,116,149, 37, 51, 59, 75,197, 10,101,148,137,171, 77,155, 54,202,251, 90,181,106,165, 36, + 78,186, 70,128,214, 67,188,251, 35,160, 5, 48,165, 0, 45,128, 43,245, 80,128,214,236, 15, 64,235,246,202,229, 46, 39,243, 48, + 97, 34,116,171,213,180,235,155,169, 75,118, 72,202, 34,109, 37,117,137,142,146, 44, 71,117, 27,173,180, 63,213,151,130,117, 7, + 75,209,134,195,101,232,140,205, 82,179,105,151,215,225, 34, 68,166, 26,216,212, 65,160,229, 57,104,140, 84,131,228,144, 82,211, +150,109,218, 75, 55,128, 45, 2,173,241, 51, 22,203,246,189,135, 93, 2,173,216,177, 99,251,160, 80,150,141, 27, 55, 90,160,194, +182, 64,133,100,217,189,123,183,101,255,254,253, 22,212,137, 5,139, 3,203,241,227,199, 45,176, 3, 81, 38,100,172,198, 9, 8, +157, 30, 31,234,104,155,173,142,150,163,142,150,206,234, 34,158, 0, 90,183, 32,109,180, 7, 90, 71,194,134,149, 58,223, 59, 84, + 29, 58,124, 7, 1, 20,193, 11,164, 13, 79, 84, 91, 57,237,153,215, 9,102,120,205, 85, 57, 85,137, 22, 64, 69, 32, 1,203,249, +243,231, 2,217,239, 28, 73,180, 94,159, 95, 23,244,116,126, 53,121,182,180,193, 59, 7, 18, 45,167,175,161, 26,145, 42,113,103, +106, 68, 45, 80,132,164, 75,207,118, 43, 3, 37, 89,171, 86,173, 18, 38,154, 4,168, 32,139,210, 25,212,153,236,221,187,151,193, +223,223,160, 64,217,245, 26, 17,237,175, 0,208, 94, 80,106, 69, 96, 5,137, 83, 48,144, 85,169, 82, 37,203,140, 25, 51, 44, 40, +163, 34,213,234,211,167,207,179, 8, 17, 34,208,102,203,200,113, 8,160,239, 61, 65, 22, 36, 91, 74,223, 84,165, 58,224, 59,213, +156, 30, 80,129, 38,234, 51,124,238,209, 45,199,158,191,203,156, 53,231, 48, 35, 68,181,121, 96, 88, 23, 62,119,244,232,247,246, +173, 92, 25, 52,184, 94,189,247,121, 99,196,240, 41, 98,112,172, 35,104,162, 73,131, 42,209, 98,167,212, 74,183, 96,159, 4, 65, + 89, 17, 41, 85,170,148, 2,110, 32,133, 50, 2,180,246,227, 59, 47,129,167,151, 80, 47,151, 0,134, 47, 65, 59,113, 9,227,249, + 85,168,139, 21, 41, 20,234,248,125,191,126,253,124,120,157,135, 43,160, 5, 41,210,211, 63, 39,174,147, 40, 63, 86,145, 25,179, + 23, 8,212,184,239, 17,114,235, 9,236,178, 14, 70,240,240,168, 94, 3,139, 50, 87,118, 92,142,248, 9, 51,137, 61,152, 39,110, +105, 83,178,100,201, 2, 32, 17,101,187,177, 64, 66,118,143, 9,237,214,139,128,139, 64,139,245, 7,222, 76, 53, 91, 63,238,252, +255, 12, 14,216, 97, 17,165, 80, 90, 32,165, 5, 75,246, 0,203,254,158,253,115, 31, 72,125, 0,109,206,158,197,245,164, 33,224, +132,190,141,150,131, 15, 51, 5,180, 70,141, 26,101, 8,104,177,240,232, 48, 53,219, 14,109, 45,227,182,140,145, 31,210,164,218, +135, 75, 49,169, 42,228,234,135,106, 6,252, 31,108,230, 35, 29, 1, 45,128,181,205,176, 9,184,232, 40,241,158, 11,250,161,101, + 12,111,123, 69,158,108,201,252, 78,123,111,146,249, 83,219,203,220,201,109,101,246,196,214, 50,115,220,239, 82,174,108, 73, 69, +253,115,224,192, 1,193, 74, 92,246,236,217,163,172,252, 1, 26,116,129, 22,190,249, 22, 7,210,108,223,125, 39,189, 32,125, 75, +151, 36,137,172,233,209, 21,234,193,191, 20, 53, 33,213,133, 84, 27,122, 79, 28, 36, 29,170,150,147, 6, 37, 10,203,214,126,189, +229,230,210,197, 46,129, 86,216,136,209,118,140,158,177, 90,106,180, 29, 43, 63,148,236, 40,105, 74,182,151,164,153,203, 74,226, +244, 69, 36, 89,198, 98,146,169, 68, 83, 41,214,104,132,148,110, 54, 70,154,245,157, 39,127,254,181, 76, 34, 71,143,179,195, 76, +125, 49, 47,129,214,204,133,107,165,119,255,145,138,228,144,210,146, 72,209,227,217,236,180,126,109,239,233, 18,104, 1,216, 42, + 64,107,235,214,173,150,157, 59,119, 90,192, 59, 11,248,104, 57,124,248,176, 50,201, 66,165,107,129,100,194,130,137,147, 26, 38, + 93,160,197, 58, 58,229,189, 49,120, 29,141,111, 37,158,229,203,216, 64,166,170, 58,100, 89,105,183, 99, 6,104, 17, 64, 81, 26, +236, 12, 72,113,211, 2, 39,118,158, 93,241,146,118, 86,170,141,214,201, 19, 39,222,114,176,112,101,163,245,112,126,237,247, 78, +108,180,156,190, 70,171, 70, 84,213,137,206,206, 58,187, 17, 21,195,119,128,159,119,252, 54,130, 44,128,158, 87,184,118,146, 9, + 96,224, 53,175,179,253,163,159, 82, 5,202,235, 46, 13,228, 33,161,218, 5, 96,110,129,244, 69, 1, 89,148, 92,169,146,172,242, +229,203, 91, 22, 44, 88, 96, 1, 64,180,120,121,121, 89, 46, 95,190,172,128,111,168,153, 97,135,109,232, 96, 0,250,189, 72, 79, +145,158,105, 18, 37, 56,249, 85, 10, 21,170, 53,152,177,253,164, 69, 42,213,108, 50, 95,143, 42, 84,109, 61,192,207,147, 56,159, +193, 24,183, 1, 64,228, 10,165, 59, 60, 56,230,162,190,105,159,165, 85, 65, 58, 37, 73,160, 69,155, 44,173, 20,139,116,170,215, +170, 34,117, 26,252, 34, 13,154,212,147,166, 45, 26, 99,209,210, 66,218,117,108, 45, 67, 70, 12, 50, 4,180,192, 71, 5,104,173, + 89,179,230,210,146, 37, 75, 46,205,153, 51,231,210,136, 17, 35,174, 34, 0,188, 2,180,178,102,205,250, 30,128,213, 7,182,170, +151,176,112,185,132, 58,223,239,172,144,248,190,231,251,206, 61,149, 82,191, 14,127,247, 77,252,220, 47,160, 26,252, 3, 51, 86, + 18, 35, 59, 17,237,108,180,108,175, 96,159,216, 63, 99,178, 28, 95,190, 88,188, 22,205, 83,164,171,236, 75, 76,187,198,141,148, + 93, 99,135,203,202, 14, 45,185,104,127,228, 6, 90,122, 45,242,159,127,223, 17,200, 98,169, 85, 80,244,225,231, 7,245,161,250, +219,254,236, 12, 92,217, 63,195,231,236, 37, 90,214,255,197, 66,192, 41,215, 54, 90, 78, 62,204, 20,208, 26, 62,124,184, 75,160, + 5,155,138, 54, 52,130,116,148, 40, 37,226, 32,204,131,198,240,248,192,212,102, 62,146, 64,107,202,146,195, 35,112,238,195,223, + 76,185,114,229,186, 79,122,148,196,105, 15, 26,177, 19,124,153,161,255,169,121,115,103, 77,226,231,125,112,141, 76, 25,221, 92, +254, 26,210, 72, 70,245,111, 32,195,250,214,145, 62, 93,171,201,224,190,245,197,179,251, 47,210,171,115,117,233,222,190,178,116, +106, 85, 65,218,181, 40, 35, 63,124, 23, 55, 40, 71,230,132,239,114,101, 77,244,220,209,251, 9,180,218,183,111, 79, 59, 4,155, + 40,149,141, 70, 47,113,227,130, 43,245, 20,118, 22,222, 90,190,249,136,228,255,197, 83, 50,148,239, 46, 89,138,214,193,202,158, +182,230, 31,142,140,133,235, 74,153,230, 99,165, 98,171, 9, 82,187,203, 12,153,184,120,143, 68,137, 22,251,150, 51, 30, 69,141, +147,104,115,204,132,223, 95,140,241,109,202,139,209,227, 37,191, 24, 45, 78,146,139,116,231, 16, 35,126,138,199, 81, 99,198, 3, + 72,139, 45, 69, 74,148, 17,136,157, 8,172,164,109,143, 33, 82,175,101, 79,233,246,231,104, 67, 64,139, 19,169,171,111,230,100, +203, 3, 19,157, 75,137, 22,235,200, 11,117, 52,121, 84,115, 25, 51,232, 67,253, 12,232, 89, 83,122,183,253, 89,250,253,129,186, +234, 82, 83, 58,213,206, 47,109,170,231,150, 86, 77, 75, 73,179,250, 69,165, 64,166, 68, 65, 89, 51,124,251, 46,123,134,248, 14, +235, 72,203, 19, 78, 22, 80,209, 56, 5, 82,188, 79,240,102, 4,104, 89,193,150,178,235,240,151,146,217, 70, 12,254,189, 98, 7, + 71,169, 75,245,108, 35, 92,236, 58,252,212,102,109,228,249,195,180,205,226,161,170, 11,173, 6,240,202,179, 80, 79, 93,161,106, + 14,224, 88, 0,140,148, 13, 55, 0, 19,138,228,200,217,129,231, 31, 64,149,105, 33,216, 82, 85,134, 4, 93,216,113,102,153, 60, +121,178, 13,100, 81,146, 9,187, 71, 11,164,104, 22,208,164,132, 60,212,142,114, 85,234,205, 36,208,250,185,122, 99,103,187, 89, +109,239,130, 73,193, 37,136,254, 5,198, 68,130, 50, 74,187,118,237, 20, 73,185, 10,180, 10, 22, 44, 40, 0,206,175,241,192,116, + 36,151, 18, 61, 2,173, 89,179,102, 5,147,104,113,179, 18,105, 96,124,165,138, 79, 0,106,165, 70,141, 26,138, 4,158,246,158, + 6, 84,135,251, 33,249, 83,128, 22,120,117, 9, 64,245,210,184,113,227,174, 0, 4, 63,175, 93,187,182,162, 58,172, 83,167, 78, + 32,254,251, 15, 29, 58,244, 26,164,197,122, 64,235, 21,129,214,224,165,215,197, 35,113, 17,238, 40, 12,132, 68, 75, 55, 33,223, +107, 87, 64,139, 32,171,109, 52, 15, 37,209,110,142,137, 42,236,174,241, 34,202, 31,137,162,201,174,145,131,130, 1, 45,183,234, + 48,212,154,251, 23, 37,228, 12,100,177, 16,246,224, 41, 52,128,150, 14, 77,179,223,254,105, 54, 90, 70, 84,135,131, 6, 13,114, + 9,180,160,102,107, 19, 12,241,216,253,161, 90,133,110, 29,232,222,193,236,215, 17, 88,249, 62,126,183,133, 96,139,182, 90, 76, +133,139, 22,127,200, 45,234, 84, 71, 66,218,109,179, 65, 99, 69,234, 0,173, 24, 88, 1,143,134,196,196,144,123, 7,230, 99,126, +148,217,169, 29, 72,174, 44, 73,252, 14,238, 89, 33, 35, 7,212,151, 65,189,107,202,203, 23, 15, 12,165,103,143,174, 74,214, 12, +241, 29,185,121,160, 84,240,214,162, 89,107,164,117,195,222,210,170, 65,175, 96,169,109,163, 94,210,190, 73, 47,153, 59,101,137, +146,248,155,215,152,207,179,203, 40, 73,150, 36,137, 83,169, 9,128,214,237,197, 27, 14, 73,161,186, 3, 37, 91,229,222,146, 58, +223, 47,146, 52,125, 97, 91,109,101, 45,222, 80, 42,181,158, 40,213,218, 79,149,134, 61,231,202,248, 69,123, 37, 74,244,216,180, +131,113,120,196, 78,148,234, 34, 31,158,178,246,164, 66, 99,233,214, 19,202,121,199,161, 51,202,249,244,197,235,202,121,252,140, + 37, 18, 46, 98,180,231, 46,252,104, 5,163,143, 9,204, 7,143,217, 84,133,148, 96,168,170, 66,168,118, 45,176, 93,178, 92,189, +122,213,130, 1,215, 66,123, 30, 61,160,149, 43, 75, 98,191, 3,187,151,203,136,254,245,164, 95,207,234,134,234,135,245,168,212, + 81,250,111, 29,214,145, 61,208,162,109, 35, 93,111, 56, 98, 20,175, 99,215,148,211,251,234, 51,159,226, 67,203,110,215,161,217, +110, 22,146,252,135, 9, 46,217,231,160,226, 85,118, 41,219, 3, 45,170, 40,169,138, 36,200,162,109,148, 30,208,130, 17,245, 3, +214, 43, 1, 20,248,169,212,243, 53,128,233,149,209,162, 89, 46, 79,153, 98,129, 74, 95, 81, 23,243, 58,108,200, 44, 48,104, 15, +125,160, 85,185,238, 44, 2,173,138,213, 26,204,213, 97,202, 72, 74,107, 47, 52,104, 32, 75, 49, 79,120, 98,199, 42, 19, 22,129, + 54,160,197,223,189,122,245, 82, 22,160,232,211, 28, 67,237, 55, 8,217, 94, 65,208,196,221,133,170,141, 86,205, 58,213, 96,143, + 85, 59,216, 72,218,161,115, 91,233,218,163,179,252,209,183,135,140, 24, 61,204, 8,208,218,135,118,119,105,211,166, 77,138,218, +112,234,212,169, 87,202,148, 41,243, 26, 26,138, 32,173, 49,252,152, 49, 99,130,224,215,240, 53,128,216,117, 87, 18, 45,140,223, +126,139,246,220, 83,128, 86,138,124, 13,149,186,231, 65, 19, 19, 21, 96,242, 63, 64,156, 84,171, 86,205, 86,118,130, 49, 87, 64, +235,232,194,185,193,128, 22, 65, 22, 77, 14, 8,178,254, 76, 25, 71,118,193, 30, 13, 42,234,215, 84, 27,194, 24,254,134, 19, 99, +248,144,180, 97,247, 51, 95,144, 3,161,101,163,101, 7,160,114,171,255, 63,224, 53,231,210, 48,222,183, 74,180,244,252,230,133, + 26, 87,148, 78,192, 65, 80, 15,104,117,238,220, 89,160,195, 15,177, 68, 11, 43,177, 32,116, 94, 58, 10,108, 29,146,210, 59,146, +104,101,200,144,225, 60, 0,213,117,179,170, 67,130, 38,184,107,192, 24, 99,219,108,102, 27, 12,120, 13,182, 33,138,107, 7,138, +173,185, 26,167,113, 47,220, 62, 4, 90,193,150,195,226,231,204,156,216,111,247,182,197,210,175,123, 53, 72,173,202, 43,147,248, +169, 3, 19, 12, 37,103,147, 56,129,214,250,213, 94, 50,180,223, 10, 25,242,231,114,135,105,254,172,221,194,164,189, 63,113,244, + 6,151, 18,173,112,145,162,239, 26, 60,113,185,212,235, 60, 89,242,212,236, 39, 5,235, 12,146,244,133,254, 63,152,231, 44,221, + 68,170,119,152, 38,181,187,206,146,246, 67, 87, 74,159, 49,203, 36, 90,204,120, 78, 85, 51, 4, 90,253,231,123, 75,249,174,203, +164,100,155,153, 82,184,233, 95,146,175,238, 32,201, 81,173,135,100, 42,215, 70,210, 20,109, 36,223,229,173, 46,139, 86,109,113, + 41,193,178,103,172, 10,180,168, 42,100,231,112,150, 96,108,173, 0, 45, 72,138, 92, 74,180,114,102, 78,228,183,107,235, 34,241, +236, 86, 85,186,182, 45, 23, 42,117,164, 45, 51,129, 20,141,199,157, 1, 45,250, 67,131,161,177,240,236,170, 15, 56, 3, 90,170, + 58,145,103, 87, 96,204, 17,109,171,170,208,169,179, 82,251,221,134, 58,234, 66,237, 43, 20,213, 33, 38,190,183, 4, 89,220, 64, + 3,245,222,155,166, 77,155,222, 96,130,228,228, 29,129, 22, 65, 22,236,139, 12,169, 14, 97, 8,191,155, 42, 67,238, 46, 36,144, +162,234, 24,230, 6, 10,200, 90, 22, 54,172,229,234,180,105,150,235,215,175, 43, 0,155, 64,140,246,123,104, 43,187, 93,240, 52, + 47,238, 81, 93,168,236,222,180, 38,254,230, 53,222,251,232,168, 80,181,254, 28, 2, 45, 72,182,230,232,140, 87,126, 52, 7,160, + 57, 4,141,253,185, 24, 37,208, 34,232, 32,192, 98,226,111, 21,128,209, 62, 19,244,156,214, 63,129, 22, 23,163,180,203,162, 61, + 86,225,194,133,165,100,201,146,228,169, 84,169, 82, 69,177, 31,173, 95,191,190,128,183,138,253, 44, 1,156,158, 68, 11,117,185, + 23, 54,105, 54,160, 53,105,210,164,171,144, 94, 41, 42, 67, 0,161, 32,254,230,153,255,127,254,249,231,247, 24,235,124,116, 84, +135, 87, 41,201, 74,158,183,190,120,196,205, 42, 13, 0, 50,177,179,148, 11,104, 37,241,183,253,255, 95,127,253,149,247,222,187, + 2, 90, 84, 23,170,146,172,246, 49,194, 72, 23, 72,178,122, 37,142,206, 93,183,202, 24,204,241, 24, 99,190, 80,146,229,194,189, + 67, 72,166, 23,247, 51,255, 16, 14,160, 9, 42,128, 73,147,180,187, 11,121, 79,221,117,200,223,106, 94,154, 3, 16, 93,105,159, +213,222, 87,105,216,211,194,166, 89,211,135, 26,235, 80,171, 66,212, 37,114,145,182, 19, 4, 21, 80,191,124,100, 12, 15,177,191, +210,153,233,150, 96,192,128, 1,138,216, 26, 20, 13,171,228,208, 89,243,215,235, 80, 87,198,109, 29, 43,121,139,230,121,130,103, +181, 62,181,190, 1,144,104,144,242,251, 20, 27, 75, 84, 46,244,178,196,207, 5, 61, 93,149, 54,148,141,225,239, 18, 80, 97, 85, + 44,233,210,165,115,184, 67, 76, 53, 6,230,125, 26,196, 83,229, 67,201,150,179, 50,230,200,148,200,111,235,134,121,210,181, 77, + 89,105,221,180, 88,168, 76,226, 4, 90, 35,134, 77,149, 12,233,114, 75,186, 52, 57, 29,166, 34,133,202, 10,147,246,126,195,186, + 29, 93, 27,195,135,139,208,163,122,227, 46,111, 70,207,222, 34,133,234, 13,150,130,181,250,202,119, 89, 75,216,192,102,186,220, +229,164, 90,155,191,164, 97,175, 5, 50,116,230, 78,169,209,180,219,107,216, 91,113,183,134,195,131, 64,235,185,229,141, 60,246, +127, 37,143,159, 91, 20,160,245,232,233, 11,121,248,196, 95, 30, 60,126,174, 0,173,107, 55,239,202,165,107, 55, 67, 4,180,104, +143, 67, 9, 6, 54, 16, 40,187,204,232, 79,137, 19, 45, 86,233, 22,216,191, 41,147, 45, 38,115, 93,160,197, 58,218,178, 97,174, +116,105, 93, 70,126,111, 82, 56, 84,234,200,202,144,248, 0,121, 43, 0, 54,158,179, 31, 57, 0, 82,184, 20, 95,185,207, 77, 16, + 33, 1, 90,246,126,181, 92,129, 45, 71,149, 68,227,119, 86, 48,219, 61,119,193,114, 82,227, 34, 66,117, 90, 74,201,129,186, 43, +150, 82, 55,131,206, 75,213, 87,101,192,214,254,167,180, 69,164,225, 59,109,178, 8,174, 84, 27, 27,238,236,163, 36,235,251,239, +191, 55,106, 12,239,137,133,144, 63,202,169,108,122,224, 38, 8,110,128,160, 36,139, 32,139,146,173, 39,176,219, 98,221, 19,140, + 97, 87,244, 83,216, 70, 57, 29, 63,192,171,211,148, 52,170, 78, 74, 89, 30,126, 43, 39,112,124,192, 81,123,126,161,126, 18,244, + 30, 50,235,232, 22,239,231,239,179,102,207, 51, 92, 15,104,209,120, 29,230, 16, 2,181,230, 71,128, 75, 5, 88, 84,247, 65, 26, +163, 0, 16, 61,160, 69, 63, 89,181,234,213,128, 61, 86, 93,249,181, 69, 35,105,217,186,185,180,237,208, 74, 58,117,109, 47,221, +255,232, 42,189,255,252, 67,250, 15,250, 83,134, 12, 27, 36, 99,199,143, 54, 2,180,246, 64,250,167,168, 14, 87,175, 94,125, 9, +229,188,138,221,192, 10,208,226, 25, 82, 40,238, 14, 86,254, 3,200,189,199,238,114, 31,140, 61, 78,109,180, 8,150, 32,117,244, + 35, 32, 68,187,167, 77,162, 34,169,227,247,193, 29,134,192,104, 93,208,222, 88,223,108, 71, 52,180,151,210,165, 75,179,156, 15, + 92, 1, 45,182, 23, 85, 93,168,130,172,126,223,197, 85, 64, 22,235,142,247, 49, 15,188,132, 61,217, 84, 23, 14, 75,117, 39, 61, +119, 6, 55, 7, 62,129, 3, 33,138,117,152, 10, 47,220, 6,253,188, 2, 36,232,118,128,187,144, 40,221,226,174, 67,238,148,163, + 93, 22,125,181, 96, 7, 8, 7,136,237, 72,124,198,232,241, 77,238,194, 57, 31,206, 60, 56, 81,154,245,106,196, 78,162, 58,191, + 36,200,154,217,101,100,115,217,116, 99,134,226,119,107,214,158,161, 95, 12,104,209,219, 58,213,152, 4, 81, 70,128, 22,243,112, +112,230,115,206, 62, 60, 91,198,132,126,235, 87,205,148, 86, 77,138, 72,195, 90,121, 67,101, 18, 39,208, 82, 39, 43, 78,142,174, +124,157, 5,211, 45,224,143,142, 11,129,200,240,113,229, 51,120,242, 42,233, 52,116,137, 20,168,222, 77, 14, 30,246,178,145, 56, +116,196, 91, 42,183, 24, 42,189,199,111,146,254, 19,215, 74,212,152,113, 40, 41,114,234,222,129, 64,235, 89,128,107,160,229,115, +203, 87, 46,126,236, 9,222,101, 59, 2,191,125, 80, 40,197,224, 29, 25,157, 74,180,104, 40,205, 93,135,122, 18, 45,214,209,186, +149, 51,228,183, 70,133,164, 65,141, 92,161, 82, 71, 40, 87, 54,248, 51,122,200,190,195, 54,117,251,246,109,251,118,146, 13,246, + 53, 15,185, 67,138,247,233,183, 9,187,218, 76, 73,180, 52, 32, 75,217, 41, 7, 80,164,236, 66,116, 6,182, 28, 49, 21,238, 28, + 46,178, 45, 57,114, 59,241, 9,206, 75,149, 87, 65,210,235, 69,224, 66, 23, 14,220,240, 65,233, 14,199, 16,173,186,144,187,120, +185, 9, 4, 59, 73, 13,185,119,192,164,124,155,245, 74, 64, 77,144, 69,181, 49,219, 1, 36, 51,150, 71,247,239, 43,224, 26, 64, +201,130,247,232,185,119,136, 8,227,250, 55, 4,146,246,174, 92,120,173, 82,174,176,210,172,100,196, 23,141, 75,198,122, 88,182, + 82,157, 57,144,100,205,237, 61,108,246,209, 13, 71, 30,189, 30, 51,115, 11,221, 59, 84,210, 25,236,110, 47, 92,184, 80, 96,219, +164,248, 9,163,170,140,110,112,200, 3,158, 85,128,197,241, 19, 0, 65,177,181, 2, 61,167,106,120, 74,167,134, 12, 25,162, 0, + 50,168,247,148, 50,211,223, 31,199,104,142,201, 92,252,114, 92,238,212,169,147, 98,159, 69, 32,103, 64,162,181,135, 42, 67,140, +227,151,186,118,237,122, 9, 59,168,175, 66,173,247, 26,146,177,247,176,245,122, 7, 16,116,139,103,128,197,247,240, 33,248, 26, + 11,107, 67, 64,139, 14,158, 41,113, 43, 94,188,184,178, 11, 18,106, 71, 74,196, 20,183, 57, 80, 67, 42, 54,100,148,190,177,220, +156, 67, 80, 15,126,122, 64, 75, 85, 23, 82,146, 69,144, 53, 40, 77, 66, 5,100,169, 64, 75, 99,223,168, 23,162,199,232, 28,229, +206,231,230,128, 25, 14,132, 72,162,165,190,160, 46, 58,235,253,105,211,166, 41,254,179, 56, 96,210,115, 58,255,179,227, 64,183, + 78, 67,211,250, 78, 74,227,210,241, 26, 6,170, 9, 19,183, 12,149, 41,219,135,203,247, 63,124,191, 23,171,159,116, 88,249, 76, +233,133, 93,121, 4, 88, 19,214,123, 74,189, 54, 85,196, 78,162,245, 17, 77, 39,170,195, 11, 38, 84,135, 54,154,148, 76,113,210, + 49, 42,209,162,218,131, 19,164, 3,137,150,141,102,214,244, 9,238,111, 94,191, 80, 6,121,254, 46,158, 61, 27, 72,192,115, 95, + 67,106, 67,170, 23,237, 84,135, 54,154,224,211, 45, 74, 27,207, 98, 82,229, 68,166,213,109,187,250, 77,196,100, 7,180, 28,213, + 81,129,132,201, 82, 61, 25, 48, 97,133,244, 25,189, 68, 74,212,104, 45,133, 42,181,148, 34, 85, 91, 73,185, 58, 29,164,207,216, + 21,242,231,120,248,227, 74,158,154,146, 72, 71,222,225,109, 52, 9,180,158,250,191,118, 46,209, 42,210, 72,174,222,184, 35,227, +224,210,193, 46,228,142,125,147, 10, 86, 78, 2, 45, 26, 69,115, 87, 33, 13,222, 57,201, 82,149, 68, 85, 33,183,245,211, 80, 90, +221,157, 6, 62, 89,208,182, 28,169, 14, 53,117, 20,223, 86, 71,125,187,215, 15,149, 58,130,154,112, 33,235,134, 0,139, 96, 2, +246, 45,148, 88,217,118,104,242, 62, 23, 49,108, 63,148,140,206,158, 61,155, 64,203,209, 14, 78, 91, 57,237,213,130, 4, 85,244, +171, 69,144, 69,240, 66,163,115,208,226,206, 62,170,171, 62,138,139,168, 97,170,141, 38,218,195, 38,103, 49, 14,185,141,222,153, +243, 82, 7, 42, 68,135, 14, 75, 9, 50,176,205,159, 91,241, 31, 97, 75,254, 91, 0,160, 32,246, 27, 24,135,191,135, 84,227, 41, + 65, 22, 85,104, 40,155, 81,135,165,101,225,140,244, 1,213,131,172,103,218,108, 81,146,217,187,119,111, 11, 22, 61,138, 36,139, + 32, 11, 19, 47,199,166,178, 14,198, 38,181,156,145,160,138,124, 77, 73, 9,125, 5,114,108,163,196,142, 19, 58,251, 86,253,194, +225, 20, 39,165,109,171, 38, 22,170, 10,153, 40,201, 34,200,130, 52,107,130,157,119,120, 71,223,222, 0,237,212, 66, 48,193,239, + 35,176, 34, 40,162,211, 99,128, 91, 69,202, 67,128, 69, 67,118,124, 15,119,100,114,209, 0,159,166,182, 35, 24, 77,130,166,209, +216,101,215,172,229,175,210,170,237,111,210,190, 83, 91,233,210,163,147,244,236,221, 93, 60,177,163,120,224,144,254, 50,108,228, + 16, 25,253,215, 72, 25, 63,105,156, 76,157, 62, 89,215, 97, 41,234,112, 15,190,247, 18,218,143,146,208,127, 46, 1,188, 94,135, +154,215, 7,106,217, 96,137,215,192,231, 43,104, 19,220, 41,174, 61,108,229, 84, 37, 90,116,250,204,239, 34,200,162,182,131,160, + 16, 59, 25,149, 40, 35,116, 5, 4,181,177, 2, 54,169,230,236,210,165,139, 35,160,101,163, 73, 0,181,115,236,136,143,212,133, + 4, 88,127,229, 76, 45,147, 10,164,151,189, 67,251,216,111, 36,161, 7,121, 53,244,142, 90,214,255,178, 35,208,175,229,219,205, + 0,155,127, 93, 94,110, 63,158, 2, 7,112, 65, 20,255,211,161, 39, 36, 42,180, 99,160, 67, 56, 71,161, 77, 12, 53,108, 76,126, + 57,107, 52,255, 57,104,253,245, 89, 50,126, 67, 63,105,216,161,186,140, 90,254,135, 2,178,134,204,239, 42, 73,147, 39,157,139, + 60, 41,156,117,106,245, 58, 6,139,214,215,239, 62,255,200, 24,158,160,194,224,174, 67, 91, 35,164,173, 21,252,240, 4, 82, 36, +205, 29, 83, 60,115,117,203,193,152,147,162,234, 84,148,170, 16, 78,160,244,185,211,183,111, 95, 71, 54, 90, 54,154, 89,210,199, +159, 82,182, 68,230,215,126,190,215,229,233, 35, 31,217,186,246, 47, 89, 58,187,135,203,180,122, 97, 31,169, 88, 42,195,155,220, + 89, 19,159,116, 52,240, 98,194,222, 15,191, 55,111, 29,217,146,217, 75,176,180,255,177,125,251, 45, 6, 46,120, 42,112, 60,152, +255,255,114,184,130,145,162,196,188, 85,189,113,231,183,125,199, 44,129,209,251, 30,153,176,120,175, 98,147, 85,243,215,174,111, +163,197,140,115,203, 35, 92,184,130, 78, 90,122, 48,160, 85,165,207, 38,216,104, 45,213,216,104, 13,148, 28, 85, 97,163, 85,182, +181,164, 1,208, 74, 95,164,174,180,198,110,195, 8,145,163,187, 10,243, 18,108,160,160, 3, 82,168,184, 20, 21,161, 86, 85,200, +137,150, 54, 60, 12,203, 66,176, 65,105, 22,243,129, 95,142, 28,150,126,214, 58, 2,104, 58,197,141, 24,148, 4, 99, 98, 9,178, +174,184,109,158,244,241, 13,167, 8,140, 56,201, 99, 2, 10,178,218,111,185,244,180,111, 15,158, 84,137, 22, 37, 89,164, 5,201, +142,226,242,193,128, 68,203,208,192,203,208, 59,108, 63,148,152, 18,124, 80,165,200,126,193,126,224, 64,133,232,136,166, 18,130, + 7,206, 72,169,134, 83, 66,240,176, 79,210, 15,157,213,240, 61, 3,248,192,240, 60,102, 67,240,148,194, 55,222,129, 84,253, 57, + 37, 90, 0, 9, 22, 44, 48, 20, 55, 31,152,184,159, 65, 66,114, 7, 52, 75,233,180,207,136, 0, 90,111,184,128,228,194,202,222, + 73, 41, 37, 90,191,150,136, 96,105, 88, 34,214,195,114, 48,128, 47, 91,185,238,108,170, 11, 49, 38, 85,195,152, 19,207,217,184, + 4,190, 68,196,248,152, 15,121, 26,227, 60, 16,210,155,187,180,191, 35,224, 66,200, 25, 5, 88,192,117,130, 34,229,201,153, 51, + 39, 65, 6, 29,206, 50,114, 65,124, 87, 99, 29,129, 22,220, 44, 40,246,176,170,218,145,103,140, 63, 74,226,111,222,235,223,191, +191, 80,242, 69,151, 59,122, 33,120, 80, 62,186,213,185,132, 5,219, 37,180,157, 75,176,193,162,250,208,105, 34, 24,211, 3, 90, +216,240,224,199,112,101,180, 31, 35,200,162, 79, 47, 26,251, 83,250, 70, 95,132,227,225, 0,152,188,160,109, 86,139, 22, 45,132, + 54,190, 14, 36, 90,193,129,214,152, 97,210, 43,105, 12,233,151, 42,158, 77, 93,200,118, 56,185, 64, 6,153, 81, 44,155,236,251, + 24,104, 57,170,122, 67,109,222,228,236,237,166,105,146, 97,238,236,250, 28,200, 15,253, 55,195,174,248, 35, 21,210,207,174, 31, + 74, 0,131, 81,183, 54,253, 27,217,212,132, 91,111,207,146, 63,167,183, 23,216,103, 45, 4,125,251, 88,136,124,229, 71, 13, 27, + 19, 88,122,208,105,171,186,118, 80,221, 59,152,216,117,168,165, 25, 90,187, 14,131,149, 19,146,169,141,185,179, 38, 13,202,157, + 45,121, 32,128,151,211,132, 93,134,239, 41,197, 98,178, 3, 89,246,223, 30, 13,224,225, 32,165, 83,102,146, 21,100, 69,211, 7, + 90, 74,142,200, 17, 34, 69,239, 25, 53, 70,156,189,145,163,197,188, 23, 5, 41,122,172,111,247, 2,128,245,228, 61, 23,245, 31, + 12,104, 93,189,251, 92, 1, 90,151,111, 61,146,210,191, 79,144, 43, 55,239, 75,245,182,163,229,250,109, 63,249,181,203, 8,185, +121,199, 79,114, 23, 46, 27, 24, 62, 74, 76,110,113,119,118,216, 75,180,198,195, 14,228, 5, 93, 55, 16, 76, 49,209, 22, 75, 5, + 86,148, 98,209,169, 37,207,204, 7, 94,185, 12,193,195,151,254,191,142,146,133, 74, 29,193, 86, 37, 7, 12,177,207, 32, 93, 1, +152,216,128, 87, 36,211,126, 28,239,227,250, 25,168,204, 28,222,119, 84, 71,142,164, 84, 54,191, 90, 86, 73,150, 65, 27, 45, 67, + 19, 4,193,148, 51,181,162,131,248,135, 70,104,134,102, 80,233,216,176,191,234, 7,254,237,135, 52,232, 17, 19,248,185, 31,223, +223, 15,188,115,229,155,202, 86, 78, 58, 34,165,119,122,170,119, 41,125,228,228,173,170,225, 65,227, 35, 27, 45, 35,237, 19,224, + 58, 45,104,121, 2,240,159, 35, 77, 0,184, 87,144,100,237,135,179,213,245,144, 14, 6,209,193, 51,165, 61, 0,226, 92,172, 98, + 67,162, 83,119, 54,193,248,249, 57,130, 74, 67,226,182, 8,146,212,115, 0,206,151,232,230, 65,155, 84, 41,151,246, 12,155,184, + 75,120,102,139, 29, 31,130, 73,180, 8,180, 8,244,104,140, 79, 27, 94,170, 6,233,243, 15,170, 73, 5,100, 18, 88,105, 19, 85, +157, 0,188,246,170,195, 96, 64,107,163,103,119,184,112, 24,136,221,133,253,109,246,125,108,151,251,134,246, 85, 64,214,222,126, + 93,117, 93,163, 56,154, 59, 12,204, 97,122, 89,140,180,121, 61, 26,246,247,255,203, 52,205,242,202,157,223,104,195, 6, 80,168, +149,234,199,239,247, 21,255,185,224,139,180,233,127, 56,132,255,212,177,107, 3,140,106,153,105,168, 17,154,116, 88,106,136,166, +201, 26,117,211, 4,195,254,239, 71, 43, 5,252,104, 37,181,249,209,138, 28, 51,254, 69, 56, 40,189, 24, 49, 90,156,139, 17, 34, +199,188, 20,209, 53,200, 34,235,237,249, 25, 7, 3,254,120, 76, 86,215,232,186,129, 54, 88,106,162,154, 80, 77,148,100, 89, 65, +150,203,160,210, 38,235,214, 85,246,207, 90,239,161,184,235,208, 80, 57,169, 30,116,166, 86,196, 61,167, 19,238,223,192,207,111, +240, 78, 38, 35,135,246,219, 77,239, 58,116,242, 2, 27, 77,168, 20, 35,209,230, 20,169, 9, 36, 70,157,144, 26,161,173, 38,180, + 62,151, 11,231,181,214,196,223,127, 91, 91,178,190, 56, 10,202,182,216, 62,222,161,179,255, 88, 52,236,196,115,193, 22, 12,218, +190, 73,213, 97,164, 8, 17,188, 1,128,253,212, 4,169,154,159,154, 0,108,253,212, 68, 41,150, 45, 69,137,226,109,103,163,101, +227, 39, 3,146, 83, 26,172,151,172,129,203,255,110,126, 26,105,127,122,121, 12,245, 77, 61, 34,118,247,191, 22,154, 38, 63,235, + 31,149,221,222,143,150,190,167,248, 80, 42,254,215, 82,185,238,114,134, 82,133, 91,201,184,249,233,230,103,104,113,192,221,150, + 66,139,147, 31,232,184,249,233,230,103,104,113,224,115,180,165,208, 42,219,223, 65,199, 13,180,254, 1, 43,199,208,168,248,207, +209,176,221, 52, 67,163,102,254, 79,195,205, 79, 55, 63, 67,139, 3,238,182, 20, 90,156,116,131,204,175,165, 45,133,110,141,127, + 89,106,246,187, 14,249,223,118,176, 2, 28, 37, 51, 69,116, 70,195,213,117, 61,250,110,154,142,235, 37,164,245,229,230,167,155, +159, 70,219,128,187,111, 58,231,128, 81, 30,106,243,185,249,233,230,167, 35, 14,252,151,219,146, 94,159,112,223, 55,193,129,175, + 5, 69,187,203,105,162, 82, 13,100,117,243,211, 0,147, 76,100,113,243,211, 4,179, 12,100,117,243,211, 0,147, 76,100,113,243, +211, 4,179, 12,100,253, 47,243,211, 0,123,254,177, 89,220,170, 67,157,170,249, 47, 55,108,247,183,135,110,191,117,243,211,205, +207,208,226,128,187, 45,133, 22, 39, 63,208,113,243,243,159,207,207,208, 45,225,151,165,246,233, 64, 43, 90,194,244, 25,190, 77, +153,117,118,156,100, 89, 78, 50,241, 55,175,253, 71, 1, 76, 20,124,119, 93,108,215,222,138,221,109,207,241,187,131, 3, 62,252, + 27, 58,117, 76,124, 87, 13, 36,110,151,175,138, 20,213, 96,187, 53,244,237, 69, 60, 60,194,213,242,240,104, 5, 15,141, 55,153, +248,155,215,156,188,195, 16, 77,131,229, 83,179,125, 17,154,158,109, 19,231,223,179,177,238, 70,158, 29,149,207,179, 83,226,120, +135,182,212, 28, 59,168, 85,146,184,161,244,237, 49,176,107,108, 42,119, 97,226,124, 3,105, 38,232,198,178,163,253, 69,190,221, +100,125, 56,202,238, 46,103, 40, 48, 81, 67,194,205, 79, 55, 63, 67,139, 3,159,163, 45,133, 86,217,254, 14, 58, 46,109,180, 60, +224,232,175,136,213,155, 56,230,185,143,143, 56, 41, 50, 55,205, 83,172,218,165,109,123,143, 93, 62,123,233,214,221,147,231,111, +248,172,220,176,215, 59, 83,190,114,231,121,207,197, 23,185,170,136,111,224, 85,190, 54,182,247, 46, 68, 58,101, 77, 11,121, 13, +244, 92,109,211, 14, 70, 19,147,201, 30,134,163, 49,147,240,140, 83,207,198, 6,106,167, 38,226,117, 5, 48,126, 25, 61, 27,195, +185, 41, 61,173,211, 57,162,253,225,244,219,227,196, 73, 29, 35, 90,226, 76,125, 98,125,151,115,127,204,164,153,252, 99, 36,205, +232, 31, 35,121,206,253,209, 18,103,244,228, 61, 19,252,164, 63,171,203, 72,116,244,217,197, 64,217, 93, 78,100, 13,179,123,188, +171,147,197, 67,152, 26,229,240,120, 15,231,173,219,224, 16,114, 23, 98,161,237,130,223,155, 93, 49, 98,196,216, 12, 2,157,145, +126,208,121,151,161, 14, 72, 96, 53,238,167,159,222,251,175, 94, 45,126, 29, 58, 72,143,152, 49,223,241, 90, 8,192,198, 55, 17, + 34,120,212, 76,146, 36,252,188,196,137,195,159, 79,146, 56,252,133,164,137,195, 47,136, 16, 33,108, 29,208,114,228,139, 77,125, +133,145,114,214, 69,102,198,240,100,226,111,189,227, 35,154,237,203, 38,218,120,100,251,160, 0,158, 29, 61,220,235,247, 84,157, + 14,110,239,124,157,231, 16,124,187,253, 35, 81,225,206,226, 58,226, 0,190, 99, 88, 31, 38, 56, 8,125,143,107, 55,145,145,192, +217,204,183,235,125,171,225, 54,143,140,145,195,133, 9,211, 57,106,196,136, 91, 35,133, 11,119,159,137,191,121,141,247, 76,180, +121,179,101,114,217,230, 67,131,152,149,134,145,182,100,246,117,110,154,102, 57,230, 58,191,155,159,255,112,126,234, 97,145,208, + 45,254, 23,166, 70,144,197, 87,170,103,237,235,163, 37, 72,151, 49, 95,137,234, 23,158,249, 91, 94,249,248,220,121,210,177,213, +192,173,205,219,141, 88, 53,114,218,186, 13,187, 15,159, 59,148, 33, 79,233,179,204, 99,114,130, 72, 1, 95, 42,222, 0, 42,111, + 49,137, 43, 1, 92,233,213, 26,193, 98, 5, 65, 76, 95,241, 30,232,217,123,132,119, 56, 65,208,183,202,133, 29, 91,228,246,201, + 99,114,195,235,176,192, 73,165, 18, 24,151,233,236,166,117,114,114,205, 10, 57,190,124,177,226,213,154,137, 1,115, 17,254,226, +174, 93,121,141,118,192, 36,153, 50,101,122, 67, 62, 49,164, 8, 29,237,193, 91, 62, 99,203,181,118,240,253, 14,105, 70, 75,144, +166, 88,140,164, 89, 31, 52,237, 62,225,237,250, 3,155,229,204,181,227, 72,151,100,233,182,115,210,168,243, 95,111, 99, 36,205, +246,128,121,244,248, 9,199,140,249,224, 60,214,230,244, 29,249, 25,172,245,133, 54, 1, 16,190,208, 38, 4,117,125,129, 96,174, + 87,224,111, 38,135,163, 9,151, 0, 75,206, 46, 80,210, 31,133, 61,232,189,251, 16, 94,176, 75, 77,112, 8,186, 11,113,209,118, +193,203,243, 46, 60,239, 42,206,155, 33,126, 82,138, 69,144, 5,183,232, 34, 69,138,200, 57,124, 3,175,233,125,187,221,253, 84, +137, 18,133, 63, 62, 98,120,243, 55,171, 87,207,146,141, 27,215,203,134, 13,235,100,213,202,153, 50,102,116, 43,120,193, 15,127, + 26,249,127, 52, 65,147, 18,181,129, 72,163,144, 40,185,188,168,198,250,228,111,235,181, 81, 0, 46, 35,241,219,145,244,205,246, +237,148, 96,117, 0,184,250,165,220, 79,226,255,236,174,240,204,255, 90,201, 86,217,212,169, 99,180,249, 57,203,131, 51, 94,243, + 2,121,230,127,163,109,201, 46,159,226, 71, 10, 11,142,137,112, 42,169, 4, 1, 86, 15,246,137, 57,115,230, 4,162,205,204,114, + 84,239, 78,120,147, 22,223,120, 3,126,147,130, 5,138,143,159,181,106,129,244,133, 26,244,141,151,177,114, 17, 19,229,204, 19, + 57, 66,132,219, 91,151, 76, 10,124,116,243,148,188,121,233, 39,207, 46, 31,147,219,231, 14,201,156, 41,163,222, 69, 12, 23,142, +241,253, 28,121,196,231, 43, 12,181, 37, 39,223,224,236,178,155,166, 73,134,233,100,119,243,211,205,207, 80,225,128, 43, 44, 18, + 42, 47,248, 59,137,104, 99,227,217,151, 35, 94,138,172,243, 55,239,242,186,232,115,253,206,227,243, 39,206,251,182,105,210,107, +205,111,191, 13, 88,216,160,221,152,201,163,103,109,156, 63,125,225,134,181,204, 99, 98, 34, 75, 1,112,226,135,176, 41, 74, 48, + 80,196,167, 19,134,167, 96,156,183, 89,179,102, 9,226,105,201, 28,156,147, 37, 77, 74, 48,228, 8,108,217, 75,180,252,110,159, + 60, 46,109,163,123, 40,137,161,114,212, 40,239,234, 53,158, 25, 74,135,137, 96, 11, 17,227, 67, 10,180,106,116,128,228,133,252, +130,116,231, 25,202,215, 13, 41,169,209,111, 39,128,250, 46, 91, 49,203,230, 35,199,228,222,147, 0,185,121,255,153,236, 57,121, + 78, 14,156,123, 32,135, 46,242,247, 69,153,181,106,129,164,206, 94,248,101,212,111,211,148,113, 53,145, 1, 44, 94, 70, 44, 50, + 89,188,120,177,146, 8, 88,141, 28, 12, 53, 2,135,138,148,130,169,135,141,159,246, 64, 11,177,223,130, 1, 45, 72, 71,118,193, +211,245, 46,196, 22, 36,208, 26,227,162,205, 26, 26,120, 9,170, 40,201, 34,200, 2,210, 15, 9,208, 74,149, 51,103,202, 7,247, +253,246, 65,178, 56, 89, 16,192,153,222,161,149,196, 0,189,147, 38,254,133, 80, 49, 71,165, 80,161, 31, 30,162,172,105, 13, 2, +131,129,140,227, 9,176,194,248,149,119, 16, 24, 55,144,109,134,241,217, 32,185,124, 15,224,113,135,193,145,225, 56,148,239, 33, +216,178, 63,108,223, 78,117, 33, 37, 89, 4, 89, 60,120,230,127, 94,167,154,144, 18,172,230,229,179, 61, 28,213,191,131,188,121, +237, 47, 35,251,181,151,166,229,179, 63,228,117,170, 19, 29,213,145, 71,141,165, 97, 51,151,242, 68,168, 22, 79, 85, 82, 71,128, +197,223, 74, 74,152, 56,201, 93,109,128,113,246, 51,198,240, 99, 28, 68, 72,141,181, 32,214, 85, 29,165, 69, 48,225,135,164, 3, +239,239,247,181, 31,152,165,196,175,253,159, 62,127,241,188,115,191, 73, 75,226,103,168,146,197,238,227, 29,209,204, 83, 48, 95, + 78,127,127,223, 11,242,226,210, 22,121,235,191, 93,222, 6,236, 16,239, 63,235,200,177, 17,109,228,141,197, 71,110, 95, 59, 37, +233,210,252,192,104, 19,185, 13,214,209,167, 14,151,134,218,167,201,151,184,105,154,100,152, 78,118, 55, 63,255,131,252,116,133, + 69, 66,151, 29,127, 3, 53, 87, 40, 50, 78,242,204,103, 79,158,247,185,213,238,247, 1,155, 58, 54,237,189,186, 71,167, 17, 75, +250,244,159, 54,191,239,216,101,211,134, 78, 94, 51,105,251,190, 83,203,152,199, 96,177,191,161,180,138,129, 91, 25,242,130,146, + 44,134, 81, 96,192, 93, 6, 27,101,176,234,158, 8,207, 48,125,220, 95, 50, 99,252, 56, 78, 12,148,108,185,244,246, 76,137, 22, + 37, 89, 90,160,165, 70,121,183, 7, 90, 4,118,156, 52,225,233,218, 30,104, 25, 44,190, 71, 14, 70,159,103,188, 71, 76,228,148, +100,229, 51,250, 32, 85,130,177, 82,100,126,184,233,240, 46, 89,187,127,150,108, 59,186, 85,238, 60,122, 45,151,238, 4,200,206, + 83,143,101,224,204, 57,242, 75,219, 82,210,107, 88, 51, 25, 51,173,159, 36,252, 49,211,179,216,177,191,215,170,122,130,189, 10, + 82,169,123,140,205,198, 88,122,148, 6,146,135,140, 31,199,224,196,199,143, 31, 23,196,127, 83,226, 60, 30, 60,120, 80, 16, 36, + 86,154,182,255, 83, 26, 33,190, 24, 3,248, 34,220,197, 61, 71,229,166,234,176, 67,126, 15, 69,154,213,175,124,220,215,120,254, + 16,193, 21, 19, 36,129,187, 64,139, 0,139, 32, 67, 15,104, 25, 98, 11,213,132, 61, 98,197, 10,164, 36,139,169,195, 55,223, 4, +186, 80, 29,218,211,252, 38, 65,130,240, 39, 30, 62,216, 43, 79, 30, 77,145,213, 43,190, 67, 80,222,111, 40,153, 85, 82,184,112, +223,200,146, 69,153,228,233,147,217,136, 85,121, 68, 18, 37,138,192, 54,234, 74,141,168,210, 31, 85,165, 74, 21,217,185,115,167, + 48, 80, 51, 99,250, 33,126,158, 48, 72,238,194,133, 11,109, 49,241, 24, 90, 4, 15, 80,234,229,244,160,228,138,234, 66,173, 68, +139,255,121,157, 54, 89, 84, 23,158, 62, 58, 63,144, 32,139, 7,207,167,240,159,215,121,223, 25,225,177, 11,246,151, 43,223,108, +212,239,137,115, 52,207,110,253, 38, 70, 81, 64, 74, 29, 49, 81,210,239, 44, 4, 72, 84, 25, 18,124,179,111,111,218,180, 73, 86, +172, 88, 33, 8,141,226, 80, 90, 8, 41, 88, 11,216,113,221,101, 66, 56,155,129, 0,148,247, 40,197,227,161, 2, 45, 85,146,149, + 32, 83,165, 14,235,183, 29, 60,236,123,255,209,131, 92,101, 91, 14,143,149,181,114, 44, 23, 44,136, 28, 37, 98,196,219, 47,238, + 93,148, 39,251, 39,200,219,167,231, 65, 49, 80,222,191,189, 41,123,218,253, 44,235,234, 21,145, 3, 35, 58, 97, 12,184, 35, 87, +206,159,148, 72,225,195,223, 0,173,136,134, 26,143, 59,147,155, 3,110, 14,252,235, 56,224, 10,139, 96,240,200,137, 84,193,154, +242,226,156,199,250,155,103,245, 94, 73, 77, 30,230,181,255,175,205,203,251,218,255,218,223,164,159,203, 74,171, 44,206,206,236, +103,181,117,160,218,104,105,109,181,254,127,223,213,199,197, 77,145,245,192,177, 51,215,174,118,241,156,182,242,226, 5,159,107, + 99,255, 90,186,108,250,162, 45,139,239,248, 61,186,178, 98,203,145, 57, 59, 14,156, 94,200, 60, 70,106,156,246, 87, 83,167, 78, +125, 71,192, 67,144,197,131, 19, 25,129, 1,131,162,118,235,208, 94, 58,252,218, 88, 90,213,172, 38,139, 38,142,151,134,213,171, +190,178,218,108, 57, 37, 79,160, 69,213,136, 42,201,210,130, 43,190,131, 82, 44,190,175,103,234,132,226,153,237, 7, 57, 56,111, +198,167, 0, 45, 15,196, 83,219,176, 96,193, 2, 89, 13,149, 23,212,112,207, 80, 48,103,106,211, 96,101,166, 77, 86,215,209,127, + 4, 30, 57,183, 83, 58,141,174, 44,107,247, 46,149,167, 47,222,201,201,107,254,178,235,244, 99,169,211,225,103,169,213,174,182, + 84,104, 82, 94,134,141,239, 44, 13,219,214, 10,140,145, 40, 83,127,103, 31, 14,160,229, 71, 48,181,126,253,122, 89,181,106,149, + 34, 97,161, 84, 8, 42, 34,153, 48, 97,130,192,182, 74, 6, 12, 24,160,128, 87, 6,153, 77,158, 42,131, 2, 64, 40,173, 97, 92, + 49, 23,245,117, 8,192,237, 16,212,184, 74, 66,160, 89, 69,138,213,166, 77,155, 93,205,154, 53, 83,128,150, 53,141, 49, 82,231, +174,242, 64,127, 25, 62,119,244,232,247,246,173, 92, 25, 52,184, 94,189,247,121, 99,196,240, 41,226,220, 24, 62, 24, 41,218,100, +205,157,211,246,245,171,151,199,229,242,133,116, 72,105,164, 71,183,111,109, 64,171, 99,135,228,226,115,181,152,220,184, 86, 94, + 44, 1, 7,160,234,237,242, 38,106,212,176,141, 12,148, 57, 74,152, 48, 97,110, 33, 62, 91, 16,121, 72, 73,150, 10,178,200,103, + 74, 17,113, 14, 66,156,194, 91,160, 69,213,162,238, 65,117, 33, 37, 89,157, 42, 38,222, 7, 0, 53, 97,146,103,170,140,148, 88, + 81,114,213,170, 98,150, 7, 54,137, 22, 36, 91,144,104, 61,224,117,103,134,241, 69,138,120,134, 91,182,227, 66,169,181, 7,110, +253,209,180,247,162, 41,137,242,180,232,239,241,125, 14, 2,242,240,145,126,252,165,105,209,114,181,159,108,217,178, 69, 81,145, +159, 56,113, 66, 1, 90, 44, 51,212,189,129,232, 75, 90,213,161,173,220, 8,193,114,151, 11, 16,246,151,188,121,243,190, 32, 48, +103,159,225, 1, 85,180, 34,209, 82, 37, 89,157, 60, 39, 44, 73,157,175,238,160,171, 55,238,220,222,178,199,203,251,219, 76,149, +203, 58, 99, 0,237,175,182,111, 88,240,254,253,155, 51, 18,248,246,170, 4,220, 58, 45,167,134, 54,145,131, 61,107,203,171, 23, + 39,144,206,203,179, 39, 23,101, 76,201,124, 50,161,118,117, 25,220,178,197, 59,240,190,189, 46, 67,221, 25,220, 28,112,115,224, + 95,201, 1, 29,160, 85, 65,157,127, 48, 62,247, 32, 8,226,127, 21, 88,169,191, 53,115,148,114,207,254,191,246,154,253,179, 90, +154,124, 7,159,205,159, 63,255, 66, 92,119,102,126,162,173, 7,117,215,161,249,208, 59,177,147,101, 30,180,104,245,246, 83,219, + 15,156,241, 26, 62,105,245, 34,255, 23, 47,159, 6, 88, 94, 63,219,123,228,226,234,211,151,110,109, 28, 51,121,222, 6,230, 49, + 82,235, 52,124,167, 20,198,199,199, 71,177,161, 34,200, 58,118,236,152, 28, 62,124, 88,186,182,107, 43,237, 26, 55,148,223,170, + 86,146,102,165,138, 74,191,198,245,101,116,143,174,148,106, 49,184,180,211,131, 64,139,180,156,169, 11, 57, 97, 48,253,153,253, + 71, 25, 82, 56,135, 28, 90, 48,203, 44,208,170,140, 85,254, 33, 20,160,151,181, 16, 41,147, 38, 77,250, 0,182, 74,178,104,209, + 34,137, 30, 61,250,121, 92,143,164,247,253,137,179,102,245, 90,189,103,137,204, 90, 55, 74, 86,239, 94, 37,151,239, 90,228,216, +149,231,178,237,196, 35, 89,188,231,158,140, 89,125, 83,122,204,190, 44,191,143, 63, 45, 13, 59, 55,150,158,195,250, 74,140,100, +185,248, 94,135, 7,129, 22,165, 20, 90,160, 69,137, 11, 13,244, 57,177,222,189,123, 87,177, 87,163, 90,118,230,204,153, 74,112, + 87,130,217,126,253,250,233, 1,173, 93,104, 84,187,160,106,178, 37,168,159,118,213,171, 87,207, 6,180,216,122,173,141, 87,239, +179,131,221,135,196,164, 7,118,105,158,196,249, 12,226,160,109,128,141,217, 21,216,188, 41, 19, 58, 59, 24,234,242, 6, 30,112, + 21, 12,216, 70, 47, 73,162,240,115,239,220,217, 44,190,119, 90, 43, 32,139,233,202,197, 12,178,111,119, 38,217,191, 55, 23, 64, + 86,113,185,113,189,188,220,244,169, 42, 15,252,250,201,237, 91,171, 36,105,210,112, 43,116, 10,172, 24,190, 23, 42, 84, 40,144, +129,134,199,141, 27,199,239,124,195,107, 76,173, 90,181,122, 15,181,169,210,102,161,186,125,111,189,174,107, 32,175,238, 58, 28, +208,249,199,217,251,183,180, 58, 57,236,143, 12,127,170,229,160, 77, 86, 51,168, 11, 41,217,106, 85, 49,171, 51, 27, 45, 77,177, + 61,195,212,106, 63,169,200,162, 45, 23,250,110,240,186, 63,202,115,234,174,101,113,179, 52, 90,235,145,180,116,238,116, 37, 59, +239,222,125,242,161, 95,178,239,211,189, 25, 63, 97, 98, 16, 37,113,243,231,207,151, 10, 21, 42, 16,192,216, 27,195,219,104, 2, +104,249, 17,104, 81,138, 69,245, 61, 37,163, 76,129,129,129, 2,187, 62, 5,104,125,155,185, 82,245,117,219, 14, 28,186,235,247, +240,126,194,108,213,250,140,159,181,106, 51,127,199,207, 92,137,113, 73, 29, 30, 52,118,127,254,248,154,188,123,189, 23, 18,182, +119,114,162,127,125,217,219,190,146,108,250,181,148,188,125,125, 69, 94,188,184, 46, 15, 31,249,200,156, 46,237,165, 77,170,239, +100, 30,218, 39, 36, 96,220,112,225, 62,220, 28,112,115,192,205,129, 96, 28,208,130, 32,206, 63,206,128,150,221,117, 69,162,165, +230,215, 3,103,142,222, 97, 5, 99,206, 76,132,180,101, 36,192,178, 79,198,106, 49, 94,188, 52,209,147,164,201,123,234,248,185, +107, 87,246, 30,189,176,123,238,210,141, 91, 55,108,221,119,224,246,189,199, 7, 79,157,189,114, 56,241,143,121, 78,235,236,148, +179,189,136, 59, 11,253,253,253, 21,117,215,217,179,103, 21,187, 17,236,142,146,253,176,203,106,219,160,190, 52,175, 84, 81, 1, + 89,173,138, 23,146,238,229, 75,201,188, 1,125, 9,180, 78,185, 42,169, 10,180, 28,169, 11, 85,144,197,119, 14, 43,154, 75,198, + 84, 44, 38, 71,150,206,151, 52,105,210, 24, 85, 29,230,204,147, 39,207,155,219,183,111, 75,201,146, 37, 57,233,198,178,150, 37, +115,134, 12, 25, 94, 81, 13,199, 40,244,184,214, 66,143,155,223,231, 73,247,242,228,229,211,114,232,194, 99, 57,117,221, 95,142, + 92,122, 38,155,188, 31,201,252,157,190, 82,180,250,119, 82,176, 2,236,138,172,233,231,118, 61,101,240,130, 19, 18, 61,113,230, + 0,103,116, 9,180, 90,180,104, 33,185,115,231,150,236,217,179, 75,150, 44, 89, 36, 93,186,116, 10,160,242,243,243, 83, 84,134, +107,214,172, 81,212, 94, 4, 49,197,139, 23,167, 93,153,242, 29, 58, 18, 45, 69, 85,168, 7,180, 66, 2,182, 96,223,116, 73,126, +255, 93, 36,125,122, 41, 80,160,128,180,107,215,142,155, 31,108, 64,139,118, 85, 80, 45,191,198, 55, 79, 71,162, 90,204,233, 1, + 3,248,115,111,223,250, 42, 82,171, 15, 32, 43,163, 92,189,148, 19,234,195, 48, 10, 8,188,116,161,172,220,242,169, 38,183,111, +214, 5, 24,107, 11,169,214, 81,193,174,196, 43, 58,245,164, 24,190, 19,116,236,221,187, 87,145,100, 33,255, 69, 79, 79,207,214, + 35, 71,142, 92, 14,160,250, 6,103,233,213,171,151,180,111, 15,123,170,166, 77, 9, 68, 94,232,213, 61,239, 55, 47, 17, 59,230, +208,118,121, 79, 31,219, 55,194,127, 88,187,188,167,126, 47,242,109, 52,245, 57, 3,187, 14,131,189, 34,117,217, 54, 17, 43,180, + 24,213,110,230,186, 11,227,214, 29,121, 52,103,234,154,115,155,191, 43,212,102,247,226,237, 87, 47,205,223, 19,112,225,215, 49, + 62, 39,138, 86,104,248, 60,249,247, 63,190,139, 24, 37,214,203, 48, 97, 35, 44,209,180,221,143,138,139,122,241,227,226,135,118, +105,127,252,241,135,114,166,234,148, 18, 46,168, 17, 21,160,149, 50,101,145, 72,165,235,116,155,248,220,223, 18, 80,185, 81,207, + 25,245, 90,247,159,195,223, 63, 85,110,251,151,198, 94, 44, 24,109,238, 44,124,251,250, 30,128,214, 62,121,124,114,187,236,237, + 80, 89, 54, 52, 44, 38, 75, 42,231, 19,127,255,235,242,224,225, 13,185,121, 23,106,196, 13,155,164, 81,130,132, 50,177, 85, 59, +225, 51, 70,248,233,206,227,230,128,155, 3,255, 45, 14,104, 37, 81,174, 36, 90,118, 96,137,136,204, 16,208,178,151,116,169, 18, + 45,235,187,156,109, 80, 51, 94, 9,122, 91, 42, 99,124,155, 33,117,225,242,117, 47,223,245,123,114, 97,235, 94,239,205,199,207, + 94,218,251,204, 63,224, 66,169,159, 27, 93,136,150,232,135,116, 70,223, 68,208,116,227,198, 13,236, 12,219,168,216, 57, 29, 60, +112, 64,246,109,219, 38,187,215,172,146,166, 21,202, 74,115, 43,200,234,243,115, 25,153,217,178,177,236,159, 62,217, 16,208,226, +238, 66, 85,101,168, 85, 23,246, 74,155, 84,250,231, 76, 39,195,138,229,150,128,128, 0, 37, 81,250,101, 16,104,125, 11,201,213, +221,171, 87,175, 42, 18, 12, 76, 70,199,173,223,201, 93, 97, 84, 23,174, 29, 59,118,172,162,138,195,239, 17,122, 60,136,251,125, +134, 23, 94,231, 79,201,146, 29,222, 50,120,246, 20,153,186,122,187,204,218,118, 71,134, 44,189, 46,101, 27,148, 8, 6,180, 74, + 54,170, 35,189,103,157, 54, 4,180, 8,176, 0,250,248, 77, 52,114, 23,242,119, 57, 36, 93,213,234,181,148,172,121,138, 74,237, +218,117, 20, 27, 29, 2, 48, 72,145, 92, 2, 45,218,104,209, 62,107, 68, 25, 15, 25, 87, 35,222, 43, 21,108, 57,146,104, 41,232, +200,156,100,107,100,197,138, 21,229, 66,131, 6,178, 20, 64, 8,224, 69, 73,185,114, 81, 13,254, 65,162,197,223, 4, 49, 80,115, + 1, 20, 37, 33, 95, 29, 25,155, 43,172, 78,148, 48,252,185,149, 43,151, 11,118,198,217,212,133,139, 23,102,178, 1,173, 77,235, +139,219,174, 67, 34, 9, 73,205,116, 67, 64,139,182,131,148,100,209,109, 7, 37,132, 4, 90, 80,193, 46, 86,191,215,254,140,141, + 21,148,120,185, 60, 58,212, 72, 26, 57,103,234, 36, 61,187,254, 94, 91,174, 94,220, 46, 60,231, 73,157,188, 7,175,243, 65,170, + 9,105,147,101,103, 0,239,146,102,172,148,141, 98,229,168,210,119,248,172,141,151, 23, 45,217,251,104,249,142,211, 1, 71,119, +157,123,121,177,253,236,103, 7,199,172,127,113, 97,221,145,103,119,146,228,111,179,211, 35,121,165,244, 32,228,210, 54, 13,110, + 60,252,168, 46,164,132, 22,146, 75,219, 6, 11, 74,239,176,144, 9, 49,208,138, 28, 62,252,253,103,151, 14,203,201,193, 13,229, +249,157,237,242, 58,224,180, 88,252,207,203,195,123,103,196, 51,211,247,210, 54, 89, 66,105,158, 36,145,252, 89,169,186, 28,240, +190, 44,135,188, 46,184,129,150, 94, 99,114,223,119,115,224, 95,204, 1, 87, 88, 36, 36, 18, 45,178,202, 12,208,178,207,107, 15, +218,116, 88,239,218, 97,169,145, 45,149,113, 83,100,217,117,233,250,173,163, 80, 23,174,190,118,235,193,198, 27,183,125, 15,240, +154,153, 58,167, 26,112,237,218,181, 50,105,210, 36,233,222,173,155,116,110,211, 74,186, 54,107, 42, 93,234,213,150, 37, 67, 7, +200, 90,164,109,195, 7,202,158,161,125, 97, 36, 59, 72, 54,141, 30,106, 72,117,120,106,237, 74, 27,208, 82,109,178, 40,197,234, +159, 59,189, 2,178,198, 86, 42,161,128, 44,139,197,162, 0, 45, 35,198,240, 0, 37, 91, 41, 21,162,173, 75, 3,128,131,172, 89, +179,190,206,156, 57,179, 5,106, 37,169, 89,179,166,162,130,163, 68,142,103,240, 64, 87,162, 5, 63, 89,251,230,110, 56, 37, 35, +231,142,149,178, 13,211, 74,177, 26, 41,165,203,132, 77,210,110,202, 69,105, 56,252,128,148,110,246,155, 13,108, 85,238,177, 88, + 26,121,174,209, 85, 29, 54,111,222, 92,145,100, 17,104,225,155, 20,160, 69, 59,162,170,245,219, 72,235, 94,227, 37,103,174,194, +146, 37,193,183,242, 7,212,178,176,141, 19,216, 21,185, 4, 90,246,187, 14, 97,235,115,136, 96,139, 64,171,126,253,250,187, 32, +209, 81,108,180,236, 15, 94, 51,208, 14,252, 40, 93, 35, 79,105, 79, 54,104,208, 32, 5,104,181,109,219, 86, 1, 88, 76,252,173, + 2, 48,168,233, 72,211,169, 45, 25, 84,135,243,150, 46,157, 76,253,185, 13, 80,149, 45,147, 64,206,156, 42, 35,103, 79, 85,146, +230,205,210,217,174,163,238,100,208,192,238,134, 85,135,220, 93, 72,208, 65, 59, 60, 72,220,222,117,235,214,237, 13,191,121,240, +224,193, 54,154, 84,195,242, 72,150, 44,217, 19,103,223, 62,103, 84,150, 36,195,254,200,212,103,104,219,188, 39, 9,174,182,172, +157,169, 60,179,101,237, 12, 5,108,241, 58,239, 79, 27,154, 57,169,103,251, 88,177,118,172,174, 54,188, 91,243,216, 78, 55, 64, +216,189, 39, 76,148, 52,181, 18,103,255,185,215,146,213,135, 30,110,152,185,253,241,230,126, 75, 31,237,232,189,248,217,209, 13, +222, 1,119,190, 47,214,105,143, 71,138,178,217,172, 32,203, 37,208,130,164,211,143,187,126,167, 76,153, 2, 96, 94, 91, 81, 31, + 18,108,114, 7, 48,212,138, 10,208,138,159,177, 82,149,144,168, 14,239,122,237,144, 3, 93,107,202,149,181,227,228,245,203,171, +176,153,188, 38,119,110, 67, 69,158, 40,158, 52,249, 54,158, 52, 76,144, 72, 86, 46, 92, 43,123,143, 93,151,213,107,118,186, 85, +135, 6, 58,146, 59,139,155, 3,255, 86, 14, 24,181,209,178,218, 77, 85, 80,165, 78,156,131,172,146,167, 18, 58, 18,173,220,246, +146, 43,103, 64,204, 58,175,217,232, 26,224,185,189,141, 86,112,224,101, 96, 75,229, 55,217,178,164,188,220,180,126,161, 87, 77, +106,231,127, 81,190,196,247, 79, 43,149, 73, 31,192,107, 6, 94,110,203, 66,195,118, 24, 85,191,226,251,218,255,214, 92, 90,214, +170, 41, 77,202,148,148, 22,144,100,109, 31, 55, 74,118,142, 28, 36,187, 6,245,149,107,171,123,203,217,185, 99,100, 96,243, 38, +111,141, 24,195, 31, 95,177, 68, 1, 90,237, 99,133, 85,236,177, 8,178, 20,117, 97,241, 60,242, 87,149, 82, 50,181, 65, 53, 5, +100,193, 15,148, 10,180,124,117,202, 29,181, 82,165, 74, 65,156, 20,185,123,139, 96,139,244,104, 7, 70,219, 39,170, 89,184,187, +175, 99,199,142,148, 18,209,249,105, 4, 61, 62,208, 24,190, 78,187, 81,111,183,123, 93, 1,200, 74, 33,133,126, 78, 42,173, 38, +158,149,134, 35,207, 72,213, 1, 39,165, 68,143, 3, 82,176, 98, 82, 41, 92,229, 7, 25,182,196, 75,242, 87,239,254, 70,207, 24, + 94, 5, 90,233,161,138, 83,129, 22, 93, 61,228, 44, 84, 65,114,229, 45, 41, 69, 1,190,126,249, 49,165,180,135, 26,150, 82, 57, +240,210, 52,208,130, 42,109, 23, 84,145,187, 48,249,238,130,253,151, 67,160,101, 80,178,165,216,148,209,209,235,228,201,147, 63, + 2, 92, 42,192, 2,223, 1,136,146, 74,209,162, 69, 93, 2, 45, 24,195,215, 26, 57,162,249,155, 97,195,134, 9,253,137,177, 83, +180,111,247, 35,212,133,213,161, 46,172, 39, 99,199, 20,177,129, 34,186,228,232,214,181,250,187, 40, 81,194, 54,209,171, 39,220, +143, 66, 23, 14,220,113, 72, 96, 72,169, 14,193,180,179, 3,121,157, 2,173,163, 59,106,143,161, 77, 22,213,133,148,100,105, 15, +254,231,117,222,103,190, 86,149,226, 52, 61,180,253,207, 71,109,113, 54, 80, 70,102, 81,220, 58,196,205, 88,191,106,195,238,115, +182, 44, 61,240,108,103,239, 69,143,182, 46, 59,100,185,210,176,231,146, 99, 17,190,175, 78, 79,254,220,141, 72,144,229,114,231, + 46, 22, 64,119, 41,157,165, 20,143, 42,113,110,246,224,134, 10,218,251,193,197,133, 2,180, 50, 21,109,210,155,110, 29,204, 26, +195,111,156, 50,226,189,247,216, 94,178,169, 67, 29,121,250,236,186,220,243,187, 33,151,175, 94, 81, 64, 86,131,132,137,165,123, +185,170,178,203,235,154,236, 1,208,234,217,189,223, 91,183, 49,188,193,218,119,103,115,115,224, 95,200, 1, 87, 88, 4,227,167, + 2,146,172, 41, 31,206, 9,145,212,157,135,188,206,251,225, 53,249, 20,119, 49, 46,254,171,207,168,116,121, 86,127,107,119, 43, + 42,116, 13,176,219,181,141,150,158, 68, 11,171,218,132, 77,155,212, 32,236, 0,240, 8,148,115, 94, 67,101,223,250,134, 82, 36, +255, 15,156, 20,139, 24, 40,128,154,229, 27,186,108, 88, 48,103,182,252, 53,176,191, 52, 46, 93, 66, 1, 89,109, 96,147, 69,144, +181, 23, 6,224, 62,235,123,201,205, 13, 67,101,203, 96, 79,137,110,208,189, 3,129,144, 42,201,234,147, 33,133, 12,204,151, 81, +134, 99, 39,147, 42,197, 34,200, 90,220,173,173,172, 26,240,135,156,221,190,153,160, 68, 15,104,121,192,200,253, 8,193, 20,129, + 22,165, 43,229,202,149,147, 50,101,202, 80,178,245, 18,234, 42, 2,204, 45, 72,148,100, 25,113, 25,224, 65, 59,182,232, 73,178, + 60, 24,191,252,184,252,181,104,131, 20,173,154, 70,234, 12, 58, 32,149,250,157,144,226, 61,188, 36, 79,135,195, 82,174,113,121, +233, 55,246, 15,105, 55,114,189, 68, 79,146,245,145,142,123, 7, 63,123,160,133, 29, 98,210,165, 75, 23,169, 5,117, 97,214, 36, +137,165,230,143, 41,100, 72,209,188, 50,111,112,127, 69, 29,164, 7,180,236, 61,195,227,219, 22, 80,146,133,221,107,187, 96, 63, + 69,144,181,252, 67,187,253,255, 1, 63, 83, 4, 52,158,188,174,211, 14,110, 83, 21, 55,116,232, 80,105,210,164,137, 84,171, 86, + 77,153,200, 41,225,226, 89, 5, 88,144, 16,145,199,138, 31, 44,208,163, 35, 75,103, 71,152,248,241,195,157, 94,176, 96,170,160, +140, 18, 57,114, 56, 57,125,178,146, 2,178,238,220,106, 10, 67,248,150, 80,247, 70,145,242,229,203, 67,122,214, 85,190,141, 23, +142, 6,237,206,194,251,104,223, 49,138,146, 74,110,218,128, 68, 43,136, 59, 98, 41,105,227,225, 72,162, 5,160,253,202, 89, 1, + 41,169,114, 44,209,154,105,147,104, 13,237,153,126, 80,231, 90,223,118,171, 82, 60,223,123,250,217,226,185, 77,165,216, 45, 6, +183,140,105,100, 83, 0,219, 94,216,232, 25,234,207,153,186,246,210,161,101, 7, 95, 28,159,178,246,250,229, 40,233, 27,114,119, + 33,191, 85,245,175,229,178,106, 96, 23,215, 34,114,228,200,119,153,240, 61, 3,185,211,112,201,146, 37, 50,102,204, 24,218,245, +169, 18,173,252,233,127,106,212, 51,126,198,202,157,204,184,119,136, 30, 37,242,109,223,155,231,229,241,195,107, 50,171,121,125, +105,155, 34,137,180, 68, 59, 61,122,242,170,236, 61,122, 73,214,108, 56, 32,127,100, 46, 35, 67, 74,213,145, 88,225, 35,112, 39, +167,219,189,131,137, 1,213,157,213,205,129,127, 19, 7,244,176,200, 87,253,173, 6, 62,238,155, 31, 82, 37,147,157,107,251,201, +206, 53,127,202,226,201,181,148,148,250,251,164, 92, 1,187,146,230, 56,114, 58,151,226,187,228,201,125,167,141, 30, 37,179,135, + 15, 17,207,122,181,164,123,217,226, 80, 23, 14,144, 3,195, 7,200,233,153, 35,101,203,192, 62,146,245,135, 84, 84, 27,165,112, +192,216,143, 28,150, 18,104,169,146,172, 65,249, 51,201,136, 82,249,101, 92,181, 50, 54, 41, 22, 37, 89,107, 6,245,150,205,127, + 13,147,139,251,118,209,158,201, 30,104, 57, 42,103, 50,216,223, 60,126,242,228,137,178, 77,222,234,173,222, 85,120, 28,251,162, +126, 68,147, 14, 75,147,164, 47,100, 25, 58,239,136, 76, 90,115, 66,154, 15, 89, 36,229,251, 30,147, 98, 0, 90, 85, 7,156,144, + 65, 11,143, 75,171, 97, 27, 37,193, 15,249, 2,244, 28,150, 66,146,114,175, 79,159, 62,138,234, 80,149,104,193,221,132, 2, 82, +184, 35,178, 59,212,178,173,203, 20,151, 89,131,250, 11,220, 51,192, 39,104, 17, 69,117, 88,167, 78, 29,123, 63, 90,174, 28, 3, + 82, 34, 66,199,169,189,145,202, 91, 39,111, 5,116,168,128,203, 10,180,116,191, 29, 25, 26, 0,176, 91, 8,178, 8, 92, 8,172, + 88, 22,218, 4, 97, 7,159, 34,197, 98,217,139, 21, 43, 38,105,211,166,133,173, 85, 4, 11,159,209, 16,118, 84,206, 31,243,228, +249,254,225,210,165,211, 96, 95, 52, 89, 30,222, 31, 38,126,119,187,136,223,189,158,242,232,225, 56,120,135, 31, 7,201, 76, 31, +201,147, 59,197, 35,208,113,228,134,195, 17,205,129,227,199,143, 87, 0, 43, 93, 56,192,143,212,123,170,142,157, 29,228,131,221, +199,127, 68,147,182, 88,185,211,166,168,163,181,209,202,155, 38,121, 55, 94,223,190,166,234, 8, 74,178,180, 78, 77,249,159,215, +117,190,157,183, 63, 56, 43,141, 87, 50,113,202, 66,173,183, 46,218,253,224,100,234,226,157,118,241,191, 6,100, 57,147,102,185, +116, 88,138,250,184, 79,195,127, 44, 56,130, 25,167,171,146, 45, 51, 14, 75,243,228,204,241,226,234,165,115,114,233,252, 57,105, +141,186,109,156,252, 59, 57,112,194, 71,118, 66,146,213, 47, 95, 53, 25, 88,180,166,100, 74,253, 35, 55,126,184, 29,150, 6,111, + 76,110,167,157,161, 59,179,186,249,249, 15,231,167, 1, 44, 18,186, 95, 16,186,212, 92,199, 58,212,123, 23,165, 86, 93, 58, 54, +177, 73,180,206, 30, 29, 44,123,215, 55,144, 34, 5, 82,235, 73,180,156, 53,108, 37, 4, 79,163, 42, 63,191, 26,213,169,189,204, +233,221, 93,142,205,158, 38,155, 97,159, 53,164, 89,227,183, 86, 73,150, 35,144,197,162,126, 4,180, 8,164,232,248,148,233,232, +146,249,226,181,124,145,120,173, 92,162, 0, 45, 38, 74,182,206, 64,146,117,118,247,118, 57,183,119,135, 32, 44,141, 81,207,240, + 69, 33,201,194, 46,247, 64,129,163,210, 32,188,219,182, 83, 76,143,103,246,229, 84,243,171, 33,120, 74, 55,252,243, 77,219, 17, + 27,197,115,246, 73,233, 57,237,184, 52,236,187, 74,242, 85,235,254, 6,146, 44, 67, 33,120, 48, 1, 30,230,214,125,238,218,164, +167,114,238,128,164, 77, 13,109,139,184, 19,114,222,188,121,138,127,178,205,155, 55, 75,239,222,189, 21,149,221,168, 81,163,148, + 93,101,144, 90, 28, 54, 48,137, 59,251, 68, 85, 37,199,251, 54,208,229, 12,108, 0,168, 68,132, 97,123, 62,216, 61, 53,198,121, + 96,221,186,117,239,210,229, 68, 99, 56, 79,165,218,143,128,134, 96,145, 18,195,156, 57,115,210, 38,143,110, 19,198, 35,193,251, +121,176,195, 89, 91, 74,141, 48, 59,167,230,204,110,253,250,214,205, 21,216, 93,120, 72, 2, 94,236,147,235,215,230, 34,194, 64, +243, 55, 9, 19,132,167,163,210, 52, 78, 62,198, 17,205,143, 66,240, 16, 20, 58,147,104, 25, 1, 90,234,187,135,181,207,239, 69, +117, 33,109,179, 84, 67,120,218,102, 81,109,104,147,104, 21,203,247,158,234, 67, 59, 91, 45,167, 19, 4,162, 44,164,192,174, 83, + 0,248,226, 3, 35,167,174,114, 53, 81,250,210, 3,113,173,112,142, 28, 57, 82, 89,129,152,179,122,212,155,116,210, 2,236,222, + 0,216, 12, 30,130, 39, 99,165,252,233, 10, 53,236,149, 48, 83,165,114, 14, 8, 59,163,153, 39, 74,164, 72,183,199,141, 26,243, +110,197,164,105, 50,176, 70, 29,197,248,125,230,240, 41,210,183,104,133,192, 88, 17, 34,176, 63,186, 67,240,124,204, 80,189, 58, 50, 48, 12,125,148,197, 77, 51, 36, 92,115,254,140,155,159,161,203,207,175,153,154,107, 99,120, 35, 95,150, 58, 85,210,205, 21, - 16,171,173,117,243,170, 74, 42, 93, 34,175,240,154,206,179,174, 26,161, 45,168,116, 52,236, 70,100,162,177,188,217,160,210,112, -115,224, 69, 23, 15,102, 18, 36, 43,199, 12, 78,226,204, 86, 27,146,162, 91,176, 29, 25,109,132, 79, 70, 0,140, 26, 84,154, 6, + 17,171,173,117,139,106, 74, 42, 83, 50,175,240,154,206,179,174, 26,161, 45,168,116, 52,236, 70,100,162,177,188,217,160,210,112, +115,224, 69, 23, 15,102, 18, 36, 43,199, 12, 78,226,204, 86, 7,146,162, 91,176, 29, 25,109,132, 79, 70, 0,140, 26, 84,154, 6, 242,209, 19,103,242,103, 10, 65, 80,233, 44, 4, 91,176,161,185,135,228,199,196,221, 99, 76,184,254, 16, 94,192, 3,194,133, 11, 247, 10,233, 53, 38,204, 0,240,246, 33, 61,194, 91, 65, 86, 22, 35,229, 52,240,189,186, 64, 11,174, 60,210, 66,162,230, 9,251, 182,115,148,172, 65, 37,247, 10,146,172,253, 40,215, 6,168,112,131,104,231, 70, 41, 22,234,145, 64,150,110, 8, 82,155, 0, 69, -106,214, 48,145, 34,133,173, 3,247, 13,139, 16, 84,250, 98,226, 68,225, 47,225,247, 82, 56, 40,109,128, 12,148,202,133, 20,108, -240,185, 58, 80,165,189,253, 20,137,150, 13,104,253,145,169,215, 7, 63, 90,153,250,216, 23,168, 77,229, 56,141, 41,201,226,217, - 40,128, 1,192, 74, 13, 64,213, 11,105, 41,126,159,204,150, 45,199, 37,156, 15,225,255, 52,164,150, 25, 51,102, 76,246,137,223, -110,160, 9, 4,203,226,170,191,219,130, 74, 71, 13, 23,238,129, 59,168,180, 33,214,186, 39,113, 67,108, 50,156,201,205, 79,195, -172, 50,148,241,115,240,211,208,139,255,161,153, 66,238, 71,203,254,131,104,116,141,107,122,246, 56,234, 99,159,163, 34,220, 52, - 67,183,149,125, 42, 63, 85, 27, 45,109,169,108, 52,177, 19, 50, 18,164, 89,249,145, 26, 67,162,213, 9,169, 33,109,254,172,153, -115,225,188,214,154,248,219,213,241,169,229,116, 68,219, 16, 77,148,253, 24, 84,181,254,144,194,190, 81, 13,239,173,125,128, 42, -101,123,191, 79, 78,105,210,102,139,134,239, 60,219, 23,198,179, 77,156, 24,220,117,200,179, 81,160,197,124,148,104, 1, 84, 21, -193,185, 22, 82, 11,164,170, 72, 5,177,139,243,123,220,118,101, 4,111,232,219, 77, 54, 53, 55, 77,147, 12,251,167,182,121,147, -159,225,174,119,147, 12,115,215,123,232, 50,236,191, 78,205,221, 1, 67,183, 5,184,249,233,230,103,104,113,192,221,150, 66,139, -147, 31,232,184,249,233,230,103,104,113,224,191,220,150, 66,139,135,127, 7,157,208,147,104,153, 44,253,127,185,193,184,191,221, -100, 99,113,175,242,156,114,192,221,150,220,109, 41,180, 56,224,110, 75,161,197, 73, 55,192,254, 28,109, 41,116,107,231,239,161, -230, 48,214, 33,153,229, 40,153, 41,162, 51, 26,174,174,235,209,119,211,116, 92, 47, 33,173, 47, 55, 63,221,252, 52,218, 6,220, -125,211, 57, 7,140,242, 80,155,207,205, 79, 55, 63, 29,113,224,191,220,150,244,250,196,215,122,223,124, 64,233, 80,248,210,207, -129,120,221, 52, 67,161, 98, 52, 36,220,252,116,243, 51,180, 56,224,110, 75,161,197, 73,183,180,196,221,150,254,155,109, 41,116, -191,250,203, 82,115,171, 14,221,106, 41,183, 90,202, 1, 7,220,131,121,232, 14, 68, 95, 29, 63, 17, 14, 42,172,145, 20, 54,101, -201, 74,177, 50,213, 60, 22, 54,121,233,234,218,252,238, 5,139,194,129,175,174,222, 67,177,217,187,191, 61, 20,153,249,159, 35, -149, 42, 85,178,140, 63,164, 76,242,123,234, 20,201, 90,165,250, 46,105,179,212,113, 62,222, 13,149, 60,121,242,216,169, 82, 38, -111,192, 60,204,203,103,236, 24,165,215, 8, 35,194, 45, 65, 39,184,102,216,140,192,191,231,176,179,107, 51,220, 16,116, 2, 13, - 87,222,161,245,104,134,164,174, 92,210,132, 3,205,218, 8, 54,220, 10, 62,161,126, 67,188,195, 6, 60,195, 23, 84, 43, 56, 52, -173,237,226,101, 46,105, 98,247, 93, 49, 4,123,110, 6,183, 1,205, 72, 7,190,174, 26,242, 63,175,135,128,102, 70,236,134, 59, - 14, 23, 20,167,240,172,214,117,131, 17, 94,152,225, 39, 94, 17,166, 5, 92,112,108,195,217,199,122,110,129,151,216,123,199, 55, - 74,179, 26,158,157, 13, 90,167,153,248, 27,137,215, 28, 29,127, 59, 77, 6, 69,103, 10,205,114,162,222, 78, 49,125, 2,205, 70, -216,249,120,144, 9, 52, 26, 25,169,112,107, 30, 27, 63,101, 74,122,201,158,200, 67, 73,252,109,246,191, 25,176,225,140,126, 8, -218,188,246,145,114,112,124, 75, 30, 86, 50,248,253,182,111, 55, 2,178,152, 39,233, 79, 77,238, 44, 57, 26, 36,137,114, 55,186, -102, 4,104, 97, 32, 44,153, 35,108,216,137, 56,255,138, 50,113,247,103,120,140,111, 13,176,131,117, 22,199,185, 4, 9, 18,204, -130, 43, 22,186, 31, 9,255,137,223,174, 60, 46,231, 60,226,188, 57,234,145,225,237, 97,143, 28,106,226,127, 94,183,163,111,180, +106,214, 48,145, 34,133,173, 11,247, 13,139, 16, 84,250, 98,226, 68,225, 47,225,247, 82, 56, 40,109,136, 12,148,202,133, 20,108, +240,185,186, 80,165,189,253, 20,137,150, 13,104,253,145,169,215, 7, 63, 90,153,250,216, 23,168, 77,149, 56, 77, 40,201,226,217, + 40,128, 1,192, 74, 13, 64,213, 11,105, 41,126,159,204,150, 45,199, 37,156, 15,225,255, 84,164,223, 51,102,204,152,236, 19,191, +221, 64, 19, 8,150,197, 85,127,183, 5,149,142, 26, 46,220, 3,119, 80,105, 67,172,117, 79,226,134,216,100, 56,147,155,159,134, + 89,101, 40,227,231,224,167,161, 23,255, 67, 51,133,220,143,150,253, 7,209,232, 26,215,244,236,113,212,199, 62, 71, 69,184,105, +134,110, 43,251, 84,126,170, 54, 90,218, 82,217,104, 98, 39,100, 36, 72,179, 10, 32, 53,129, 68,171, 19, 82, 35,218,252, 89, 51, +231,194,121,173, 53,241,183,171,227, 83,203,233,136,182, 33,154, 40,251, 49,168,106,253, 33,133,125,163, 26,222, 91,251, 0, 85, +202,246,126,159,156,210,164,205, 22, 13,223,121,182, 47,140,103,155, 56, 49,184,235,144,103,163, 64,139,249, 40,209, 2,168, 42, +138,115,109,164,150, 72,213,144, 10, 97, 23,231,247,184,237,202, 8,222,208,183,155,108,106,110,154, 38, 25,246, 79,109,243, 38, + 63,195, 93,239, 38, 25,230,174,247,208,101,216,127,157,154,187, 3,134,110, 11,112,243,211,205,207,208,226,128,187, 45,133, 22, + 39, 63,208,113,243,211,205,207,208,226,192,127,185, 45,133, 22, 15,255, 14, 58,161, 39,209, 50, 89,250,255,114,131,113,127,187, +201,198,226, 94,229, 57,229,128,187, 45,185,219, 82,104,113,192,221,150, 66,139,147,110,128,253, 57,218, 82,232,214,206,223, 67, +205, 97,172, 67, 50,203, 81, 50, 83, 68,103, 52, 92, 93,215,163,239,166,233,184, 94, 66, 90, 95,110,126,186,249,105,180, 13,184, +251,166,115, 14, 24,229,161, 54,159,155,159,110,126, 58,226,192,127,185, 45,233,245,137,175,245,190,249,128,210,161,240,165,159, + 3,241,186,105,134, 66,197,104, 72,184,249,233,230,103,104,113,192,221,150, 66,139,147,110,105,137,187, 45,253, 55,219, 82,232, +126,245,151,165,230, 86, 29,186,213, 82,110,181,148, 3, 14,184, 7,243,208, 29,136,190, 58,126, 34, 28, 84, 88, 35, 41,108,202, + 82,149, 99,101,170,117, 44,108,242, 50, 53,180,249,221, 11, 22,133, 3, 95, 93,189,135, 98,179,119,127,123, 40, 50,243, 63, 71, + 42, 85,170,100, 25,127, 72,153,228,183,212, 41,146,181, 74,245, 93,210,230,169,227,124,188, 27, 42,121,242,228,177, 83,165, 76, +222,144,121,152,151,207,216, 49, 74,175, 17, 70,132, 91,130, 78,112,205,176, 25,129,127,207, 97,103,215,102,184, 33,232, 4, 26, +174,188, 67,235,209, 12, 73, 93,185,164, 9, 7,154,117, 16,108,184, 21,124, 66,253,138,120,135, 13,121,134, 47,168, 86,112,104, + 90,199,197,203, 92,210,196,238,187,226, 8,246,220, 28,110, 3,154,147, 14,124, 93, 53,226,127, 94, 15, 1,205,140,216, 13,119, + 28, 46, 40, 78,225, 89,173,235, 6, 35,188, 48,195, 79,188, 34, 76, 75,184,224,216,134,179,143,245,220, 18, 47,177,247,142,111, +148,102,117, 60, 59, 11,180, 78, 51,241, 55, 18,175, 57, 58,254,118,154, 12,138,206, 20,154,229, 68,189,157, 98,250, 4,154,141, +177,243,241, 32, 19,104, 52, 54, 82,225,214, 60, 54,126,202,228,244,146, 61,145,135,146,248,219,236,127, 51, 96,195, 25,253, 16, +180,121,237, 35,229,225,248,150, 60,172,108,240,251,109,223,110, 4,100, 49, 79,210,124, 77,239, 44, 57, 26, 36,137,114, 55,190, +102, 4,104, 97, 32, 44,149, 35,108,216, 9, 56,255,130, 50,113,247,103,120,140,111, 13,177,131,117, 38,199,185, 4, 9, 18,204, +132, 43, 22,186, 31, 9,255,137,223,174, 60, 46,231, 60,226,188, 57,234,145,225,237, 97,143, 28,106,226,127, 94,183,163,111,180, 31, 25,100,165,146,205, 8, 77,142, 17, 29,144, 90, 35, 41,193,212,117,142,143,104, 50, 60, 19, 34, 71,236, 69,180,130, 77,152, - 47, 54, 34,109,194,252,177,137,252,100,194,110,230, 45, 56,207, 51,194,207,104, 41, 60,210,197,205,240,141, 87,172, 31,191,217, - 19, 45,185, 7, 3,175,123, 68, 79,238,145, 31,191,167, 70, 77,238,177, 45,250,119, 97, 78, 69, 77,225,177, 9,169,115,244, 36, - 30, 63, 26,161,169,247, 65, 38,238, 27,225,167, 74, 46, 37,126,208,245,208,106,107,218,128, 51,221, 23,205,228, 39,105,222,105, -134,166,209,162,126, 14,154, 70,223,253, 79,204,103, 47,209,162, 3,211,255, 31,154,248, 66,133,121,149,128,169,123,231,246,107, + 47, 54, 34,109,194,252,177,137,252,100,194,110,230, 45, 56,207, 53,194,207,104, 41, 60,210,197,205,240,141, 87,172, 31,191,217, + 19, 45,185, 7, 3,175,123, 68, 79,238, 81, 0,191,167, 68, 77,238,177, 45,250,119, 97, 78, 69, 77,225,177, 9,169,115,244, 36, + 30, 63, 26,161,169,247, 65, 38,238, 27,225,167, 74, 46, 37,126,208,245,208,106,107,218,128, 51,221, 23,205,224, 39,105,222,105, +134,166,209,162,126, 14,154, 70,223,253, 79,204,103, 47,209,162, 3,211,255, 31,154,248, 66, 69,120,149,128,169,123,231,246,107, 111, 92,185,180,238,246,245, 43,235, 54,172, 89,185, 41, 86,204,152, 43,208,168,143,192,211,104, 64,138,168, 81,253,225,247,104, 127,204,152, 49, 22,111,217,176,118, 35,243, 48, 47,159,177, 3, 91,174, 42, 34,109,162, 68,137,142, 34,198,218,237, 27, 55,110, -248,190,121,243,198,247,226,197,139,190, 8,214,123, 19,239, 57,138, 98,164,117,194, 73,189,202, 45,152, 40,110,152,129,105,146, -133, 61,146, 38,166,199,145, 68, 81, 60, 6,130, 78, 65,179,157, 90,155, 31,157,251,208,213,171, 87,233,201, 60,136, 78, 81,127, -253,245,215, 32,254, 7, 40, 34, 48,112,118,184, 44, 39,188,211, 95,164,111, 38,184,203,184, 2, 2, 56,253,120,133, 52,121, 61, +248,190,121,243,198,247,226,197,139,190, 8,214,123, 19,239, 57,138, 98,164,117,194, 73,189,202, 45,148, 40,110,152,129,105,146, +133, 61,146, 38,166,199,145, 68, 81, 60, 6,130, 78, 33,179,157, 90,155, 31,157,251,208,213,171, 87,233,201, 60,136, 78, 81,127, +249,229,151, 32,254, 7, 40, 34, 48,112,118,184, 44, 39,188,211, 95,164,111, 38,184,203,184, 2, 2, 56,253,120,133, 52,121, 61, 4, 52,189, 30, 63,126, 44,183,111,223,166,171, 5,111,147, 45, 80,143,159, 42, 57,250, 61, 91, 13,103,175,171, 16,158,165, 21, - 98, 0,246,135,179,212,190, 8,149,179, 18,215,215, 33,147, 22,108,233,209,140, 3,112,177, 12,245,191,123,238,220,185,211,206, -159, 63, 63, 15,129,171,151, 0,104, 46, 77,151, 46,221, 1,222, 3, 61,179, 19,132, 66, 19,206,117,119,207,155, 55,111,246,185, -115,231,230, 3, 12, 47, 93,191,126,253, 50, 68, 47,216, 31, 82,154, 24,220,151, 34,128,233,118, 4,216, 30,123,235,214,173, 73, -136,117, 57,243,240,225,195,179, 17,142,105, 55,239,133,180,156, 88, 92,236, 64,204,199,113,167, 79,159,158,130,118, 63, 11,193, -192,231,160,238,119,155, 41, 39, 38,149,162,232,135,239,112, 8, 19, 38,154, 64, 44, 2, 2,224,247,205,150,224, 3, 44,128, 9, -124,241,101,126, 71, 3, 47,193,207,184,113,227, 42,132, 36,241, 89, 35,131,185, 10,228, 70,140, 24, 81,201, 62, 33,212,207, 47, -188,111,178,191, 87, 42, 86,172,216, 73, 60,211, 28,113, 49,175,163, 43, 49,224,251, 37,252,111,139,192,216,199,193,139,234, 70, -250,145, 81,160,149,170, 80,235, 71, 75,189, 69,148,179, 70, 10,230,236,219,179,133, 9, 51,254,117,213,170,111,199,167, 79,127, - 24,179,116, 79, 0,172,181, 67,134, 12, 57,138, 54,233,141,177,206,251,204,153, 51,222, 93,187,118, 61, 2,176,176, 6, 52, 82, -154,252,246, 96,217, 9,166, 94,236,247, 40,242,112,135, 71,231, 7,219, 61, 6,170,137,255,121,221, 14,108,233,245, 77,147,195, -135,146,221, 8, 77, 79, 6, 43,239,209,163, 7,235,153, 96, 75,239,176,167,217, 17, 78,163,119,162,158,189, 49,254,120, 35,222, -172, 55, 34,130, 40, 9, 14,171,189,225,152,218, 27,142,169,189, 1, 96, 25, 26,205,217, 97,163, 25, 53,153,199,198,191,110,252, - 38, 93,142, 37,146, 40, 41, 61,214, 68, 73,230,177,162,116,219, 52, 50,241,120,109, 89,112,167,169,172,124,222, 66,102, 94,171, - 45,157,151, 22,144,236, 85,227, 7, 2,152,113, 30,113,228,147,207,200,183,235,125,171,253,125,195, 52,209,255,119, 48, 42, 10, -157,106,107, 19,252, 23,146,207, 35,141,244, 77,187,151,167, 68,136,185, 3,164,107,109,151, 41, 1,108,247,163,253,158,199,255, - 74,118,121, 13,151,211, 40, 3,236,177,136,209,231,254,161,249, 62, 14, 42,205,130,170,238,239, 41,157, 34,112,202,155, 43,251, -180, 56,177, 99, 78, 1,227,253, 49,169, 6,190,120,241, 66, 30, 14, 30, 44,247, 16,164, 23,147, 14,131,208,190,141, 25, 51,230, -179,120,113, 98,141,102, 94, 62,195,103, 13, 84,110, 68,130, 44, 2, 43, 76, 16,190, 8, 92,172,128, 44,196,152,243,197,164,235, -187,109,219, 54, 95,172,246, 8,182, 28, 73,182,156, 85,110,194, 31,147,133,243, 26,217,231,215, 23, 23, 14,140,151, 23,183, 55, -139,255,209, 85,114,118,193, 64, 25,220,164,252,139, 31, 99,125,227, 5,122,170,255, 38, 83, 13, 27, 78, 62,127,134, 36,235,126, -251,246,237, 21,191,149,116,178,137,201,155, 33,130, 82, 26,233,212,142,242, 64, 74,166, 0, 45,158,113,255, 71,158, 9,180,172, -255,117, 7, 10,187, 12,126,170, 67, 77, 92,103,185,204, 28,246,252, 12,131,193,127, 18, 0,213, 67,212, 1, 65,239, 13, 76,208, - 62,112,118,122, 31, 18,204,205, 1,150, 87,103, 30, 61,126,122,174,123,239, 97,205, 80, 79, 93, 48,200,173, 44, 83,166,204, 90, - 74,186, 12,212,187,146,133, 96, 2,177, 14,231, 32,150,228,188,165,203, 87,109, 92,182,114, 45, 48,214,150, 13,168,255,173, 8, -222,125,228,207, 63,255, 92,111, 5, 28,218,239,112,217,169,153, 31, 64,120, 1,188,225, 47, 92,176,120,217,198,133, 75, 87,109, - 88,183,110,253, 26,128,162,245,160,185, 55, 36, 52, 9,164, 16, 17,126, 58, 6,245, 41, 94,222, 39,150,158, 60,115,110, 9,218, -233,252,155, 55,111, 46,198, 0,191, 25,237,127,185, 21,108, 25, 46, 39, 50, 46,173, 84,169, 18,193,218,180,185,243, 23, 46,251, -107,225,210,101, 43, 87,174, 90,136,152,143, 75, 48, 96,110,133,100,115,133,209,111, 71, 29,221, 6, 29, 89,182,108,153,146,232, -113,223,254,176,188,252, 16, 49,129,253, 21, 96, 75, 27, 59,210,198, 79,130, 28,130, 44, 60,155,195,108,178, 3, 72, 14,235, 40, -112,114,122, 33,184, 34,160,194,132,152,203, 62,193,153,109,110, 23, 96,203, 33, 77,196,176,244, 34,184, 2,168,182,148, 42, 85, -234, 9,127,243,140,200, 8, 22,196, 39,181, 84,175, 94,157, 18, 82,221,126,100, 20,104,165, 44,216,194,151, 64, 43, 67,233,206, - 1, 8,128, 30, 78,125,206, 89,155,207,128,240, 81, 4, 89,129,213,170, 5,121,166, 77,251,100, 80,199,142, 55,223,190,125,235, - 13,167,189,222,104, 67,222, 8,242,238,141,177,206, 27, 13,223, 27, 19, 25,125,201, 57, 10,101,230, 72,170, 51, 2,253,208, 31, -207,220, 69, 63,189,131,116,183, 64,142, 24,247,255,104, 26,229,249,178,225,225, 95,175, 25,245, 77, 16,219,192,230,241, 30, 47, -110,109,244,216, 72,176, 69,201,150,209,190,233,106,224,136,153,204, 35, 85,180,239, 61, 22,125, 95, 40,202, 3, 0, 15, 45, 88, -114, 84, 71,213, 48,102, 44, 0,189, 74, 86,154,139, 81,207, 98,157, 99, 22, 91,175, 21, 67,255,153,133,223,249, 28,188, 87, 75, -179, 45,250,204,102,130, 44,166,106,213,170,121, 35, 42,134, 55,218,190, 55,250,187, 55, 22, 85,222, 88,248,121, 99,193,110, 6, -104,157,220,242,178,187, 12,123,150, 92,146,230,136,246,110,252,145,186,178,214,210, 74,166,251, 23,148,113,207, 51,201,168,103, - 63,200,132,231,217,100,166,127, 81, 89,244,188,150,212, 26,154, 65, 32,233,218,138, 17, 63,146, 93, 89, 67, 29,108,128,190, 97, -154, 4, 69,123,246,236, 17,206, 29,246, 9,116,180,139,110,163, 52,103, 98,188,148,157, 59,119, 18,168,205, 68,212, 14,223,167, - 79,159, 42, 99, 11, 4, 14,140, 69,106,102,172, 51, 51, 15, 41,121,191,242, 16, 60,246,223,251, 49,208,178, 34,201,194,204, 73, - 85, 32,165, 84,223,198,142, 61,177, 90,213,170, 24,167, 95, 41,227, 55, 99, 10,250, 20, 47, 46,215,243,231, 23, 50,159,137,129, -151, 83,165, 72,241, 34,126,156, 88, 35,248, 12,159,213,235,212, 84, 23,142, 31, 63,254, 54, 72,250,130,182,175,159,159,159, 2, -180,208,113,124, 17, 50, 70, 57, 35, 30,222, 77,171, 26,209,190,240,142, 26,204,119,105, 83, 39,184,123,247,244, 76, 80,156, 39, -114, 18,115,198,129, 52, 34, 93, 18,137, 12, 43, 32,178, 97,128,248, 44,232, 19,244, 67,146,184,119, 65,236, 59,157, 78,237,172, -113, 84, 64, 44,190, 64,242, 1,103,122, 49,175,168,211,138, 92, 54,108, 72,176, 46, 50,142,162,189, 68,139,215, 93,208,117, 70, - 51,180,128, 86, 24, 0,231,105, 0, 44, 79, 57,113, 97,242,183, 0, 92, 91, 0, 0, 44, 8,143,243,120,193,130, 5,173, 31, 62, -126,126,254,222,131, 39,199, 59,247, 28, 88,115,238,168, 81,149,239, 92,191,254, 7,212,170,139,169, 70,212,171,119,235,253,106, -144, 4,238, 2,168,154,115,234,220,149, 75,103, 46, 92,191,182,114,221,246, 67, 91,182,239, 62,176,119,239,190, 77,136, 43,185, - 12, 19,210,121,120, 56,167, 42, 76,171, 70,116,197,207,106,148,100, 97,208, 93,112,250,252,213,139,231, 46, 93,191,178, 98,237, -182,125, 27, 55,239,100, 32,108, 11,174, 47,130, 20,225,120,158, 60,121, 76,209,204,155, 55,239,118,120,178,159,236,119,255,241, -233, 39, 79, 95,156, 35, 45, 38, 72,181,230, 3,184, 76,193, 34,225, 32, 38,128,189,102,202,137, 21,247,118,180,239,169,190,126, -143,110,221,127,240,248,206,146,213,155,183,173,221,176,109,211,182,109, 59, 22, 18,124,161,156,244,236,110,136, 38, 86,157,126, - 12,126,205,213,235, 5,196,227,244,242,242,146,229,203,151,203,172, 89,179,100,250,244,233,130,250,146,244, 57, 10, 42, 49, 46, - 25,170, 9, 17, 3,180, 32,252,139, 0, 45,130, 44, 45,192,114, 6,228, 84,176,101, 39, 33, 99,147,177,175,119, 85,146,181,144, - 32, 11,117,107, 25, 61,122,180,133,237, 21, 99,152, 2,178, 8,182,240,220, 66, 72, 8,247,227, 92,201, 85,127, 87, 1, 19, 22, - 83, 28,251, 14, 32,157,194,228, 63, 19, 0, 38,185, 22,132, 69, 72, 85,126,205, 95, 7, 94, 75,221, 63,150, 74,216,100,165, 27, -234, 1, 45,208,249, 38, 19,164,109, 3,211,164,185, 14,176, 37, 11, 43, 85, 10,152, 54,104,208, 77,244, 21, 5,104, 17, 36, 96, -172,243, 62,114,228,136,119,203,150, 45, 15,225,253, 77, 12,140, 75,163, 33,213,121,204, 49,136, 65,191,177, 0, 80, 64,244,235, - 39, 7,229,217,197,174,178,109, 74, 52,153,212,253, 67, 88, 44,158, 9,182, 40,221,162, 42,209, 96,223,116, 60,244, 36,246,136, - 2,137,207,248,156,181, 99,191,243,244,202, 46,211,252,127,150,228, 63, 69,226, 88,170, 30,246,117,148, 21,225,181,130, 56, 89, -255,252,243,207, 12,169, 21, 5,201, 30,104, 69,134, 83,221,103, 92, 32, 64, 18, 25,136,251,153,237, 94,110,163,137, 9,126,183, - 10,178,120,110,209,162,133,247,138, 21, 43, 62, 2, 89,190,190,190,222, 88,192, 27,149,104,217,128,214,220,203,205,100, 97, 64, - 53, 25,112, 59,165, 20,239, 21, 67,146,230, 15, 23, 24, 47, 67,216, 87,105, 43, 70,148, 26,211,227,200,152,231,233,100,254,139, - 74,210,116, 90, 54,129, 36, 76, 27,131,212, 81,251,212,153, 22, 12,221, 54, 10,138, 72, 44, 37,210, 18,180,245, 87,139, 23, 47, - 22,140,217,202, 60, 77,208,133,235,212, 52, 56,171, 35,103, 5, 89, 77,201,152, 85,187,242,234,217,179,103, 2, 65,136, 64,162, -207,248,179,171,156,213,145,161,175, 50,144,233, 43,151,104,233,171, 14,201, 3, 21, 77,210,238,106,221,234, 21,155,161,222,240, -103,165,145,241,236,212,152, 28, 5,129,227,148,116,225,194, 5,101,149, 12,144,164,196,216,195, 4,253,100,235,198,117, 27,105, -207,165,199, 79,136, 33, 55,163, 83,248, 58, 3, 90,232, 68,190,168, 88, 95,172,218,244, 66,252,240, 85,223, 36,137,255,205,153, - 59, 39,167,137, 92,234, 32,178, 59,158,200,222,196, 34,251, 83,136,116,136, 35,210, 54,186, 72,139,240,176, 59,169, 38,215,102, -117, 12, 74, 26, 53,220, 25, 62,163, 87, 70,187,251,169, 17,184, 89, 9,178,203,163, 83,167, 78, 12,228, 76,143,224,206,194,197, -232,146,167,218,145,141, 25, 18,140,167,176,209,186,201,179, 1,117,164, 51,186, 90,160,245, 30,161, 87, 30, 69,142, 28,121, 33, - 50,219,175,190, 92,150,139,146, 44, 21,100,113,226, 26, 56,112,160, 5,147,181,101,255,254,253, 22,134,245,193, 4,209,239,143, -161,211,219,254,241,231,232,122, 7, 54,110,236,116,235,192,158, 94,207, 79,121,183, 69,222, 59,180,217,210,253,232, 15, 25,102, -207,152, 49, 99,252,220, 69,203, 87,159,185,116,227,218,165,171,183,238,238,216,123,216,199,235,168,247,173,115,199,188,207, 92, - 56,117,114, 51, 0,252, 14,188,139,147,164, 43,213,172,246,117,208, 74,204,158,249,215,226,149, 27,207, 92,188,113,245,242,181, -219, 55,183,238, 58,200, 24,135, 10, 48, 58,123,252,216, 10, 12, 22, 27, 33, 65,216,109,134, 38,164, 13,163,142,122,159, 92,242, -232,137,255, 5,255, 23, 47,175,169,244,158, 63,125,186,245,241,131, 7,179, 1, 66,151, 66,186,197, 54,106,184,156, 80, 23,142, -153,253,215,146,229, 0,111,119, 31, 60,124,234,183,121,231,254, 19, 7, 15, 28, 60,118,234,240,161,109,103,188,189,230,162,156, -203,176, 66, 55, 68, 19,253,227,201,129, 3, 7,148, 32,226, 22,128, 41,212,151, 2,182,212,248,158, 80, 71, 74,155, 54,109,132, -193,199, 1, 74, 4, 97,153,158, 57,170, 35, 85,117,104, 15,130,208, 79,217,220, 93, 75,185,130,171, 14,131,145,167,180, 75, 5, - 89,142,232,216,211,167,164,203, 1,208, 10, 70, 83, 43,201,194,141,205,144, 50, 91, 0, 90, 44,103,207,158,181,128,111, 22,128, - 76,214,249,102, 72,232,148, 69, 2, 2,150, 83, 50,238,244, 32, 96, 66,219,109, 11,245,112, 32, 64,144, 80, 5, 79,190,253,246, -219,111,239, 16, 38,170,148, 10,168,194, 38, 47, 85,227,215,174,243,101,241,209, 64,201, 88,182,235,235, 40,169, 43,100,231, 61, -157, 54,255, 77,106,132,201,154, 87,174, 92, 64, 96,245,234,178,224,151, 95, 2,198,245,233,115, 19, 99,167, 13,104, 17, 48, 16, -112,161, 46, 93,217, 22,241, 53,195, 42, 87,174,204, 49, 83, 57, 32,213, 17,198, 58,165, 68,243,194,177, 5,226,115,168,169,122, - 43,216,217, 1,208, 50,216, 77, 63,100,139,146,194, 35, 81,188,116,225,142,183, 94,153, 78, 1, 88, 35,175,231,145,130, 45,226, - 75,228, 4, 30, 99,156, 16,250, 6,188, 60, 3,233,146,160,255, 72,238,220,185, 89, 31, 60, 62, 2, 90,248,158, 55,148,148,112, - 65,128,249,131,125,211,225,129,113,105, 51, 76, 0,188,235,213,171,231,141, 5,184, 55,128,181, 55, 98,187,126, 80,191,118,239, -125, 51, 71,129,162, 1,241,146,165, 8,140,147, 56,197,251,168,177,147, 62, 13, 31, 37, 78, 83, 16,114, 57,198, 3, 48,217,128, -214,132,231,217,165,251,233,196,146, 32,123,216,192,232, 73,195,250,143,157, 52,250, 12, 36,143, 71,231, 45,152,123,170,122,163, - 10, 15,114, 52,138, 34, 35,158,252, 32,127, 61,175, 44,153, 43,198, 9, 84,109,186, 76, 49,242,243,101, 78, 73,169, 19, 1, 17, -219,239,194,133, 11,149,249,218, 10,180, 86,135,224,181, 54,160, 69,224, 70,154, 4, 89,192, 2,148,134,167, 12, 1, 61, 83,143, -252,203, 36, 90,193,191, 93,131, 34, 61,121,135, 70,238,180,201,194,160,173, 72,112,184,106,230,128,222,166, 85,171,247, 88,145, - 63,135,244,224, 89,247,174, 93,131,216, 73, 88, 17,196, 76, 77,154, 52,121, 29, 35,122,244,217,142,140,230,237, 57, 13,144,113, -154, 32,139, 9,246, 20, 31, 73,180, 96, 99,162, 72,181,208,249,104,224,170,119,252, 58,116,114,149,103, 47, 95, 44,187, 23,180, - 59,206, 35,217,151, 76,228, 96, 90,145,195,153, 69,122,126, 47,210, 53,137, 72,251, 88,242,170, 73,236, 71, 62, 51,183, 94,107, - 87,166,249, 83, 16,164,129,170,225, 3,229,157,203,239, 68, 89,131,216,160,121, 94,189,122, 53,109,180,230, 26, 38,242,113,198, -239,161, 38,188,167, 21,247,242, 63,178, 49,116,138,217,195, 6,180,176,234, 80, 6, 90,130, 66, 16, 57,147, 41, 83,166, 71,168, - 47,170, 77,117, 59, 9,213,133, 4, 88,106,234,223,191,191, 5, 43,103, 11, 86,221, 22,148,237, 14,218, 64,223, 45, 59,118,117, - 95, 48,118,108,205, 27, 59,183,247,182,156, 56, 58, 85,110, 92, 93,136, 65,105,189,157, 68,203,105,249,105,248,141, 1,114,202, -172,133,107, 86, 22,200,157,234,117,137,159, 83,191,175, 90, 50, 83, 80,221, 10,217,131, 26, 84,200, 26, 88,187, 84,198,183,207, - 31, 63, 94, 15,169,214, 53,171,129,188, 46, 47,152, 15, 19,237,220,185,139,215,109, 92,188,122,215,254,173,187, 15, 17, 76, 43, - 32,203, 62,225,253,119,116, 9, 34, 3,140,203, 79, 97,178, 24,231,125,226, 28,237,176, 28,210,178,248,251, 79,131, 84,235, 4, -243, 26,161,201,111,135,196,110,194,204,191, 86, 45,119, 70,243,161,175,239, 12, 72,181, 78, 88, 13,228, 93,146, 69, 93,191,130, - 52, 68, 32,253, 19,128,117,129,189,155,178,248,217,186,117,171,236,216,177, 67,168, 82,168, 81,163, 6,195, 4, 9, 36,111, 2, -154,148,196,126,116,184, 2, 90,186, 96, 75, 7,104, 81,101,232, 12,172,145,182, 61,125, 23,182, 90,106,185,219,170,146, 44,130, - 44, 92,220, 76,112, 5,192, 27, 12,100,161,253, 88, 8,182,112,191,185, 43, 38,162,237,244,111,214,172,153, 32,191, 13,160, 32, -191, 26,102,140, 82, 27,214,173,146,190,137,147,126,127,207,105, 94, 50,121,243, 3, 9,155,178, 52,112,150, 46,208,242,192,247, -109,157, 53,108,216, 77, 74,180, 40,217,154, 87,190,124,192,208, 46, 93,110, 66,194,168, 0, 44, 72,176, 21,208, 5,160,181,213, - 85, 57, 33,213,121,166, 69, 80,191,255,254,187,162, 46,102,224,248,171,167,151,202,173,163,191,203,214,201, 81,141, 72,180,140, - 52, 85, 37, 79,212,164, 30,153,147,230,137,120,175,207,145,108, 10,200,106, 48, 53,181,196, 77, 31,246, 86,196, 56,138, 81,187, -179, 56,154,185, 8, 84, 49,102, 8,212,245,228, 99, 15,235, 11, 63, 82, 29,130,247,253, 88,126,130, 69, 6,189, 71,190,220,142, - 10, 7, 13,200,230,251,247,239,123,227,123,189, 49,238, 42, 32,107,243,150,109,167,210,101,253,201, 82,166,122,243,192, 45,120, -254,212, 21,111, 57,119,205, 71, 86,238, 56, 39,133,202,215,122, 25, 33, 70,226,195, 30, 81,226, 5, 55, 70,214, 16,215, 2,173, -161, 79,146,203,210, 71, 77,100,205,147, 14, 50,231, 74, 99,201, 94,250,251, 87,232,131, 94,237,218,181,163,253,151, 87,163, 54, -181,253,170, 78,140, 45, 83,252,243, 74,199,213,185, 36, 74,114,143,190,134,153,248,153, 51, 98, 65,189,154,154, 37, 85,234, 4, -219,196,151,159, 8,180,214,169,207, 83, 58, 70,224, 70,154,248, 12,198,161, 77,249,153, 63, 71, 17,246, 88,147,231,231,126,215, - 63,130, 62, 13,223, 97, 92,168,136, 33, 97, 79, 32, 29,219,183,127,207, 74, 69,225,146, 35,165,134,254,125,251,132,241,227,131, -104,136, 71,221, 59,129, 7, 64,152, 86, 84,233,244, 59, 48,241,159,209, 2, 45, 24, 22,219, 84,135,152, 48,124, 9,180,246,237, -219, 71, 59, 45, 87,118, 22, 10,253,232,177, 60,230,157,186, 51, 88, 46, 74, 65, 57,253, 46,186,255,139,243, 25, 14,202,145, 92, -239,196, 11, 42,195,254,217, 36,176,119,198,119,231, 27,180, 57,184, 38,239, 20,255,109,149, 23,202,250,174,139, 36,106,216,200, -122,171,199, 96,101,167, 58,143,188,128,161,241, 67,148,239, 50,206, 15, 8,144,116,212,124, 70,234,241, 71,172, 20,198, 97, 48, -190,192, 51, 30,112,181,187,197,158, 30,109,162,168, 10, 26,207, 51, 7, 97,214, 21, 84, 16, 2,245,137, 64,189, 69, 81,175,242, - 27,182, 84, 28,196, 8,226,104,208,248,147,179,130,209, 38,139,210, 1, 74,178, 8,178, 38, 77,154,100,193,100, 96, 57,117,234, -148, 5, 70,172,207,161, 6,216, 7,169,195,114, 95,168, 11,159,238,223,219, 33,240,234,133, 69,242,230,245, 93,216, 91,113, 23, -162,214, 70,203,233,183, 19, 64,128,119,179, 23, 47, 93,177,224,231, 28, 73,222,158,216,182, 34,232,242,158,117,114,251,208, 38, -121,120, 96,121, 80,179, 95,178,189,123,245,232,193,102, 76,124,215,205, 0, 45,216,104, 44, 90,181,122,221,170,181,155,246,238, - 58,176,231, 16,219,205, 39, 3, 45,108, 46,152, 10, 41, 9,219,138, 67, 90,111, 3, 2,102, 96, 80, 58,103, 6,104, 65,154, 49, -109,217,178,149,243,157,209,180,220,191, 55,155,170, 83,103, 64, 75,187, 51, 80, 11,180, 32,185, 81,164,206,147,102,175,144, 34, -149,127,151,140,217,242, 10, 87,164, 0, 58,130,126,235, 18,104, 57,179,209,178,130,160,143,192,144, 22, 56, 57, 3, 70, 90,149, -161, 43,160,197,118,171,188,199,186,243, 81,167,211, 84,162,193, 59,109,177, 32, 41, 83, 36, 89, 4, 89,234,194, 0,245,101,225, -117, 74,178, 8,198, 10, 21, 42,244,152,134,242,160, 89,206, 5,221, 83,246,162, 32,130, 46, 76,176,194,177,141, 18, 46, 74,237, - 49,209, 75,207,158,127, 60,200, 81,165,143,208, 86, 43,113,238, 70, 87,141, 0, 45, 0,164,109,232,131,222, 4, 91, 67,179,103, - 87,192,214,236, 50,101, 2, 60, 91,183,190,137,141, 31,222, 24,235,188, 49,214,121, 99, 81,233, 18,104, 65,170,227, 11,169,142, - 64,170, 35,144,234,200,168, 81,163, 20, 59, 26, 44, 90,228,250,249,245,114,247,100, 79,185,189,191,168, 2,182,120,184,176,209, - 50, 50, 46,121, 68, 74,225,241, 93,202, 2,145,159, 12,191,146, 71, 1, 89,149, 7, 37,151,200,137, 60, 86,120,132,243,200, 15, - 2,246, 27, 85,180, 52, 91, 98,131,135, 50,230, 64,154,245, 2, 55, 84,219, 51, 71, 54, 90, 81,177, 64,127,133,141, 48, 50,116, -232, 80,142, 81, 90,251, 94, 27, 77, 2, 45, 26,187, 19,156,210,182, 13,244,189,211,103,203,103, 25, 51, 15, 11,139,251,183,197, -247,241,107, 57,119,243,133,236, 57,243, 68,118,159,126, 36, 27,119,174,146, 14,127,118, 9,138, 18, 55, 17, 23,152, 14, 37, 91, -144, 74, 77,251,243, 96,126,197, 70,139,105,196,179,239,101,228,179, 84,226,121, 53,185,228, 40,247, 29,170,255,165, 23, 22, 39, - 52,178,247,218,177,107,251,209, 84, 37, 34, 42, 42,196, 49,151,138, 83,125, 72,147,132,127,196, 65,187, 41, 10, 60, 52, 82,167, -153,108,183, 92,100,161,128,220,121,104,246,240, 86,129,150,170,205,226,127,218,109,209, 30,204, 44, 49,119,126, 29, 14, 36,142, - 30,221,255, 17, 6,233, 27,165, 74, 41,170, 66, 72,111, 40, 9, 74,165,121, 44, 35,108, 73,158,221,174, 85, 75,174,102,201,162, -228, 73, 10,195, 76, 35,140,213, 2, 45, 71, 54, 90,144,162,248, 98,213, 98, 8,104,197,142,239,225,243,224,221, 18, 57, 37, 9, -228,132,196,148,211,146, 82,124, 94,254,116,231,221,133,106, 23, 31, 14,108,127,113, 79,189,197,119, 54,149,153, 43,107,243, 79, -147,181, 5,166,203,241,145,123, 36,102,216,232, 70,213, 92,202,231,208, 64,157, 64,203,164,225,186, 17, 86,132, 56, 15, 36, 72, -126, 20,207, 67,229,200, 14,165, 24,192,178,131, 81,122, 65,112,197,193,139,191,217, 73,168, 78,162,157,206,209,163, 71, 5,224, -229,184,179,151,210,240, 29, 3,140,162, 46,164, 36, 11,157,215,178,105,195, 58, 75,149, 98, 63, 89, 42,150, 44,162,216,192, 0, - 20, 31, 2,136, 91,132,119,220,194, 42,106, 3,140,142, 55,113, 55, 34,104,218,187,120,112,246,154,217, 27, 54,108,152, 7,233, -216,226, 2, 89, 98,189,190,178,103, 69,208,157,177,197,131, 30,206,170, 23, 20, 48,175, 97, 96,235,138, 57,222,137, 37,224, 48, + 98, 0,246,135,179,212,190, 8,149,179, 18,215,215, 33,147, 22,108,233,209,140, 3,112,177, 12,245,191,123,206,156, 57, 83,207, +159, 63, 63, 23,129,171,151, 0,104, 46, 77,151, 46,221, 1,222, 3, 61,179, 19,132, 66, 19,206,117,119,207,157, 59,119,214,185, +115,231,230, 3, 12, 47, 93,191,126,253, 50, 68, 47,216, 31, 82,154, 24,220,151, 34,128,233,118, 4,216, 30,123,235,214,173,137, +136,117, 57,227,240,225,195,179, 16,142,105, 55,239,133,180,156, 88, 92,236, 64,204,199,191, 78,159, 62, 61, 25,237,126, 38,130, +129,207, 70,221,239, 54, 83, 78, 76, 42,197,208, 15,223,225, 16, 38, 76, 52,129, 88, 4, 4,192,239,155, 45,193, 7, 88, 0, 19, +248,226,203,252,142, 6, 94,130,159,191,254,250,171, 98, 72, 18,159, 53, 50,152,171, 64,110,196,136, 17,149,237, 19, 66,253,252, +204,251, 38,251,123,229,226,197,139,159,196, 51, 45, 16, 23,243, 58,186, 18, 3,190, 95,194,255,182, 8,140,125, 28,188,168, 97, +164, 31, 25, 5, 90,169, 10,183,126,180,212, 91, 68, 57,107,164, 96,206,190, 61, 91,152, 48,227, 94, 87,171,246,118, 92,250,244, +135, 49, 75,247, 4,192, 90, 59,100,200,144,163,104,147,222, 24,235,188,207,156, 57,227,221,181,107,215, 35, 0, 11,107, 64, 35, +165,201,111, 15,150,157, 96,234,197,126,143,162, 15,119,120,116,126,176,221, 99,160,154,248,159,215,237,192,150, 94,223, 52, 57, +124, 40,217,141,208,244,100,176,242, 30, 61,122,176,158, 9,182,244, 14,123,154, 29,225, 52,122, 39,234,217, 27,227,143, 55,226, +205,122, 35, 34,136,146,224,176,218, 27,142,169,189,225,152,218, 27, 0,150,161,209,156, 29, 54,154, 81,147,121,108,156,119,227, + 87,233,114, 44,145, 68, 73,233,177, 38, 74, 50,143, 21,101,218,166,145, 9,199,235,200,130, 59,205,100,229,243,150, 50,227, 90, + 29,233,188,180,160,100,175, 22, 63, 16,192,140,243,136, 35,159,124, 70,190, 93,239, 91,237,239, 27,166,137,254,191,131, 81, 81, +232, 84, 91,155,224,191,144,124, 30,105,164,111,218,189, 60, 37, 66,204, 29, 32, 93,107,187, 76, 9, 96,187, 31,237,247, 60,254, + 87,182,203,107,184,156, 70, 25, 96,143, 69,140, 62,247, 15,205,247,113, 80,105, 22, 84,117,127, 79,233, 20,129, 83,222, 92,217, +167,198,137, 29,115, 50, 24,239,143, 73, 53,240,197,139, 23,242,112,240, 96,185,135, 32,189,152,116, 24,132,246,109,204,152, 49, +159,197,139, 19,107, 52,243,242, 25, 62,107,160,114, 35, 18,100, 17, 88, 97,130,240, 69,224, 98, 5,100, 33,198,156, 47, 38, 93, +223,109,219,182,249, 98,181, 71,176,229, 72,178,229,172,114, 19,254,152, 44,156,215,200, 62,191,188,184,112, 96,156,188,184,189, + 89,252,143,174,146,179, 11, 6,202,224,166, 21, 94,252, 24,235, 27, 47,208, 83,253, 55,153,106,216,112,242,249, 19, 36, 89,247, +219,183,111,175,248,173,164,147, 77, 76,222, 12, 17,148,210, 72,167,118,148, 7, 82, 50, 5,104,241,140,251, 63,242, 76,160,101, +253,175, 59, 80,216,101,240, 83, 29,106,226, 58,203,101,230,176,231,103, 24, 12,254, 19, 1,168, 30,162, 14, 8,122,111, 96,130, +246,129,179,211,251,144, 96,110, 14,176,188, 58,243,232,241,211,115,221,123, 15,107,142,122,234,130, 65,110,101,217,178,101,215, + 82,210,101,160,222,149, 44, 4, 19,136,117, 56, 27,177, 36,231, 46, 93,190,106,227,178,149,107,129,177,182,108, 64,253,111, 69, +240,238, 35,127,254,249,231,122, 43,224,208,126,135,203, 78,205,252, 0,194, 11,224, 13,127,225,130,197,203, 54, 46, 92,186,106, +195,186,117,235,215, 0, 20,173, 7,205,189, 33,161, 73, 32,133,136,240,211, 48,168, 79,246,242, 62,177,244,228,153,115, 75,208, + 78,231,223,188,121,115, 49, 6,248,205,104,255,203,173, 96,203,112, 57,145,113,105,229,202,149, 9,214,166,206,153,191,112,217, +188,133, 75,151,173, 92,185,106, 33, 98, 62, 46,193,128,185, 21,146,205, 21, 70,191, 29,117,116, 27,116,100,217,178,101, 74,162, +199,125,251,195,242,242, 67,196, 4,246, 87,128, 45,109,236, 72, 27, 63, 9,114, 8,178,240,108, 14,179,201, 14, 32, 57,172,163, +192, 73,233,133,224,138,128, 10, 19, 98, 46,251, 4,103,182,185, 93,128, 45,135, 52, 17,195,210,139,224, 10,160,218, 82,186,116, +233, 39,252,205, 51, 34, 35, 88, 16,159,212, 82,163, 70, 13, 74, 72,117,251,145, 81,160,149,178, 80, 75, 95, 2,173, 12,101, 58, + 7, 32, 0,122, 56,245, 57,103,109, 62, 3,194, 71, 17,100, 5, 86,175, 30,228,153, 54,237,147, 65, 29, 59,222,124,251,246,173, + 55,156,246,122,163, 13,121, 35,200,187, 55,198, 58,111, 52,124,111, 76,100,244, 37,231, 40,148,153, 35,169,206, 8,244, 67,127, + 60,115, 23,253,244, 14,210,221,130, 57, 98,220,255,163, 89,148,231,203,134,135,127,189,102,212, 55, 65,108, 3,155,199,121,188, +184,181,209, 99, 35,193, 22, 37, 91, 70,251,166,171,129, 35,102, 50,143, 84,209,190,247, 88,244,125,225, 40, 15, 0, 60,180, 96, +201, 81, 29, 85,199,152,177, 0,244, 42, 91,105, 46, 70, 61,139,117,142, 89,108,189, 86, 28,253,103, 38,126,231,119,240, 94, 45, +205,182,232, 51,155, 9,178,152,170, 87,175,238,141,168, 24,222,104,251,222,232,239,222, 88, 84,121, 99,225,231,141, 5,187, 25, +160,117,114,203,203,238, 50,236, 89,114, 73,154, 35,218,187,113, 71,234,201, 90, 75, 43,153,230, 95, 72,254,122,158, 73, 70, 61, +251, 65,198, 63,207, 38, 51,252,139,201,162,231,181,165,246,208, 12, 2, 73,215, 86,140,248,145,236,202, 26,234, 96, 3,244, 13, +211, 36, 40,218,179,103,143,112,238,176, 79,160,163, 93,116, 27,165, 57, 3,227,165,236,220,185,147, 64,109, 6,162,118,248, 62, +125,250, 84, 25, 91, 32,112, 96, 44, 82, 51, 99,157,153,121, 72,201,251,149,135,224,177,255,222,143,129,150, 21, 73, 22, 97, 78, +170, 2, 41,165,250, 54,118,236, 9,213,171, 85,195, 56,253, 74, 25,191, 25, 83,208,167, 68, 9,185, 94,160,128,144,249, 76, 12, +188,156, 42, 69,138, 23,241,227,196, 26,193,103,248,172, 94,167,166,186,112,220,184,113,183, 65,210, 23,180,125,253,252,252, 20, +160,133,142,227,139,144, 49,202, 25,241,240,110, 90,213,136,246,133,119,212, 96,190, 75,155, 58,193,221,187,167,103,128,226, 92, +145,147,152, 51, 14,164, 17,233,146, 72,100, 88, 65,145, 13, 3,196,103, 65,159,160, 31,146,196,189, 11, 98,223,233,116,106,103, +141,163, 34, 98,241, 5,146, 15, 56,211,139,121, 37,157, 86,228,178, 97, 67,130,117,145,113, 20,237, 37, 90,188,238,130,174, 51, +154,161, 5,180,194, 0, 56, 79, 5, 96,121,202,137, 11,147,191, 5,224,218, 2, 0, 96, 65,120,156,199, 11, 22, 44,104,253,240, +241,243,243,247, 30, 60, 57,222,185,231,192, 90,115, 70,141,170,114,231,250,245, 63,160, 86, 93, 76, 53,162, 94,189, 91,239, 87, +135, 36,112, 23, 64,213,236, 83,231,174, 92, 58,115,225,250,181,149,235,182, 31,218,178,125,247,129,189,123,247,109, 66, 92,201, +101,152,144,206,195,195, 57, 85, 97, 90, 53,162, 43,126, 86,167, 36, 11,131,238,130,211,231,175, 94, 60,119,233,250,149, 21,107, +183,237,219,184,121, 39, 3, 97, 91,112,125, 17,164, 8,199,243,228,201, 99,138,102,222,188,121,183,195,147,253, 36,191,251,143, + 79, 63,121,250,226, 28,105, 49, 65,170, 53, 31,192,101, 50, 22, 9, 7, 49, 1,236, 53, 83, 78,172,184,183,163,125, 79,241,245, +123,116,235,254,131,199,119,150,172,222,188,109,237,134,109,155,182,109,219,177,144,224, 11,229,164,103,119, 67, 52,177,234,244, + 99,240,107,174, 94, 47, 32, 30,167,151,151,151, 44, 95,190, 92,102,206,156, 41,211,166, 77, 19,212,151,164,207, 81, 72,137,113, +201, 80, 77,136, 24,160, 5,225, 95, 4,104, 17,100,105, 1,150, 51, 32,167,130, 45, 59, 9, 25,155,140,125,189,171,146,172,133, + 4, 89,168, 91,203,232,209,163, 45,108,175, 24,195, 20,144, 69,176,133,231, 22, 66, 66,184, 31,231,202,174,250,187, 10,152,176, +152,226,216,119, 0,233, 20, 38,255, 25, 0, 48,201,181, 32, 44, 66,170, 10,107,230, 29,120, 45,245,254, 88, 42, 97,147,149,105, +164, 7,180, 64,231,155, 76,144,182, 13, 76,147,230, 58,192,150, 44,172, 92, 57, 96,234,160, 65, 55,209, 87, 20,160, 69,144,128, +177,206,251,200,145, 35,222,191,255,254,251, 33,188,191,169,129,113,105, 52,164, 58,143, 57, 6, 49,232, 55, 22, 0, 10,136,126, +253,228,160, 60,187,216, 85,182, 77,142, 38, 19,187,127, 8,139,197, 51,193, 22,165, 91, 84, 37, 26,236,155,142,135,158,196, 30, + 81, 32,241, 25,151,179, 78,236,119,158, 94,217,101,170,255, 79,146, 60, 95, 36,142,165,234, 97, 95, 71, 89, 17, 94, 43,136,147, +245, 79, 63,253,196,144, 90, 81,144,236,129, 86,100, 56,213,125,198, 5, 2, 36,145,129,184,159,217,238,229, 54,154,152,224,119, +171, 32,139,231,150, 45, 91,122,175, 88,177,226, 35,144,229,235,235,235,141, 5,188, 81,137,150, 13,104,205,185,220, 92, 22, 6, + 84,151, 1,183, 83, 74,137, 94, 49, 36,105,129,112,129,241, 50,132,125,149,182, 82, 68,169, 57, 45,142,140,121,158, 78,230,191, +168, 44,205,166,102, 19, 72,194,180, 49, 72, 29,181, 79,157,105,193,208,109,163,160,136,196, 82, 34, 45, 65, 91,127,181,120,241, + 98,193,152,173,204,211, 4, 93,184, 78, 77,131,179, 58,114, 86,144,213,148,140, 89,181, 43,175,158, 61,123, 38, 16,132, 8, 36, +250,140, 63,187,202, 89, 29, 25,250, 42, 3,153,190,114,137,150,190,234,144, 60, 80,209, 36,237,174,214,173, 94,177, 25,234, 13, +127, 86, 26, 25,207, 78,141,201, 81, 16, 56, 78, 73, 23, 46, 92, 80, 86,201, 0, 73, 74,140, 61, 76,208, 79,182,110, 92,183,145, +246, 92,122,252,132, 24,114, 51, 58,133,175, 51,160,133, 78,228,139,138,245,197,170, 77, 47,196, 15, 95,245, 77,146,248,223,156, +185,115,114,170,200,165, 14, 34,187,227,137,236, 77, 44,178, 63,133, 72,135, 56, 34,109,163,139,180, 12, 15,187,147,234,114,109, +102,199,160,164, 81,195,157,225, 51,122,101,180,187,159, 26,129,155,149, 32,187, 60, 58,117,234,196, 64,206,244, 8,238, 44, 92, +140, 46,121,170, 29,217,152, 33,193,120, 10, 27,173,155, 60, 27, 80, 71, 58,163,171, 5, 90,239, 17,122,229, 81,228,200,145, 23, + 34,179,253,234,203,101,185, 40,201, 82, 65, 22, 39,174,129, 3, 7, 90, 48, 89, 91,246,239,223,111, 97, 88, 31, 76, 16,253,254, + 24, 58,173,237, 31,127,142,174,127, 96,227,198, 78,183, 14,236,233,245,252,148,119, 91,228,189, 67,155, 45,221,143,254,144, 97, +214,244,233,211,199,205, 89,180,124,245,153, 75, 55,174, 93,186,122,235,238,142,189,135,125,188,142,122,223, 58,119,204,251,204, +133, 83, 39, 55, 3,192,239,192,187, 56, 73,186, 82,205,106, 95, 7,173,196,172, 25,243, 22,175,220,120,230,226,141,171,151,175, +221,190,185,117,215, 65,198, 56, 84,128,209,217,227,199, 86, 96,176,216, 8, 9,194,110, 51, 52, 33,109, 24,117,212,251,228,146, + 71, 79,252, 47,248,191,120,121, 77,165,247,252,233,211,173,143, 31, 60,152, 5, 16,186, 20,210, 45,182, 81,195,229,132,186,112, +204,172,121, 75,150, 3,188,221,125,240,240,169,223,230,157,251, 79, 28, 60,112,240,216,169,195,135,182,157,241,246,154,131,114, + 46,195, 10,221, 16, 77,244,143, 39, 7, 14, 28, 80,130,136, 91, 0,166, 80, 95, 10,216, 82,227,123, 66, 29, 41,109,218,180, 17, + 6, 31, 7, 40, 17,132,101,122,230,168,142, 84,213,161, 61, 8, 66, 63,101,115,119, 45,229, 10,174, 58, 12, 70,158,210, 46, 21, +100, 57,162, 99, 79,159,146, 46, 7, 64, 43, 24, 77,173, 36, 11, 55, 54, 67,202,108, 1,104,177,156, 61,123,214, 2,190, 89, 0, + 50, 89,231,155, 33,161, 83, 22, 9, 8, 88, 78,201,184,211,131,128, 9,109,183, 45,212,195,129, 0, 65, 66, 21, 60,249,246,235, +175,191,190, 67,152,168,210, 42,160, 10,155,188,116,205, 95,186,206,151,197, 71, 3, 37, 99,185,174,175,163,164,174,152,157,247, +116,218,252, 55,169, 17, 38,107,110,249,242, 1,129, 53,106,200,130,159,127, 14,248,171, 79,159,155, 24, 59,109, 64,139,128,129, +128, 11,117,233,202,182,136,175, 25, 86,165, 74, 21,142,153,202, 1,169,142, 48,214, 41, 37,154, 23,142, 45, 16,159, 67,205,212, + 91,193,206, 14,128,150,193,110,250, 33, 91,148, 20, 30,137,226,165, 11,119,188,245,202,116, 10,192, 26,121, 61,143, 20,106, 25, + 95, 34, 39,240, 24,227,132,208, 55,224,229, 25, 72,151, 4,253, 71,114,231,206,205,250,224,241, 17,208,194,247,188,161,164,132, + 11, 2,204, 31,236,155, 14, 15,140, 75,155, 97, 2,224, 93,191,126,125,111, 44,192,189, 1,172,189, 17,219,245,131,250,181,123, +239,155, 57, 10, 22, 11,136,151, 44, 69, 96,156,196, 41,222, 71,141,157,244,105,248, 40,113,154,129,144,203, 49, 30,128,201, 6, +180,198, 63,207, 46,221, 79, 39,150, 4,217,195, 6, 70, 79, 26,214,127,236,196,209,103, 32,121, 60, 58,119,193,156, 83, 53, 26, + 87,124,144,163,113, 20, 25,241,228, 7,153,247,188,138,100,174, 20, 39, 80,181,233, 50,197,200,207,151, 57, 37,165, 78, 4, 68, +108,191, 11, 23, 46, 84,230,107, 43,208, 90, 29,130,215,218,128, 22,129, 27,105, 18,100, 1, 11, 80, 26,158, 50, 4,244, 76, 61, +242, 47,147,104, 5,255,118, 13,138,244,228, 29, 26,185,211, 38, 11,131,182, 34,193,225,170,153, 3,122,155, 86,173,222, 99, 69, +254, 28,210,131,103,221,187,118, 13, 98, 39, 97, 69, 16, 51, 53,109,218,244,117,140,232,209,103, 57, 50,154,183,231, 52, 64,198, +105,130, 44, 38,216, 83,124, 36,209,130,141,137, 34,213, 66,231,163,129,171,222,241,203,208, 73, 85,159,189,124,177,236, 94,208, +238, 56,143,100, 95, 50,145,131,105, 69, 14,103, 22,233,249,189, 72,215, 36, 34,237, 99,201,171,166,177, 31,249,204,216,122,173, + 93,217, 22, 79, 65,144, 6,170,134, 15,148,119, 14,191, 19,101, 13, 98,131,230,121,245,234,213,180,209,154, 99,152,200,199, 25, +191,135,154,240,158, 86,220,203,255,200,198,208, 41,102, 15, 27,208,194,170, 67, 25,104, 9, 10, 65,228, 76,166, 76,153, 30,161, +190,168, 54,213,237, 36, 84, 23, 18, 96,169,169,127,255,254, 22,172,156, 45, 88,117, 91, 80,182, 59,104, 3,125,183,236,216,213, +125,193,216,177,181,110,236,220,222,219,114,226,232, 20,185,113,117, 33, 6,165,245,118, 18, 45,167,229,167,225, 55, 6,200,201, + 51, 23,174, 89, 89, 48,119,170,215, 37,127, 74,253,190, 90,169, 76, 65,245, 42,102, 15,106, 88, 49,107, 96,157,210, 25,223, 62, +127,252,120, 61,164, 90,215,172, 6,242,186,188, 96, 62, 76,180,115,230, 44, 94,183,113,241,234, 93,251,183,238, 62, 68, 48,173, +128, 44,251,132,247,223,209, 37,136, 12, 48, 46, 63,133,201,226, 47,239, 19,231,104,135,229,144,150,197,223,127, 42,164, 90, 39, +152,215, 8, 77,126, 59, 36,118,227,103,204, 91,181,220, 25,205,135,190,190,211, 33,213, 58, 97, 53,144,119, 73, 22,117,253, 10, +210, 16,129,244, 79, 0,214, 5,246,110,202,226,103,235,214,173,178, 99,199, 14,161, 74,161,102,205,154, 12, 19, 36,144,188, 9, +104, 82, 18,251,209,225, 10,104,233,130, 45, 29,160, 69,149,161, 51,176, 70,218,246,244, 93,216,106,169,229,110,171, 74,178, 8, +178,112,113, 51,193, 21, 0,111, 48,144,133,246, 99, 33,216,194,253, 22,174,152,136,182,211,191,121,243,230,130,252, 54,128,130, +252,106,152, 49, 74,109, 88,183, 74,250, 38, 78,250,253, 61,167,122,201,164,205, 15, 36,108,202, 50,192, 89,186, 64,203, 3,223, +183,117,230,176, 97, 55, 41,209,162,100,107,110,133, 10, 1, 67,187,116,185, 9, 9,163, 2,176, 32,193, 86, 64, 23,128,214, 86, + 87,229,132, 84,231,153, 22, 65,253,246,219,111,138,186,152,129,227,175,158, 94, 42,183,142,254, 38, 91, 39, 69, 53, 34,209, 50, +210, 84,149, 60, 81,147,122,100, 78,154, 39,226,189, 62, 71,178, 41, 32,171,225,148,212, 18, 55,125,216, 91, 17,227, 40, 70,237, +206,226,104,230, 34, 80,197,152, 33, 80,215,147,143, 61,172, 47,252, 72,117, 8,222,247, 99,249, 9, 22, 25,244, 30,249,114, 59, + 42, 28, 52, 32,155,239,223,191,239,141,239,245,198,184,171,128,172,205, 91,182,157, 74,151, 53,159,165,108,141, 22,129, 91,240, +252,169, 43,222,114,238,154,143,172,220,113, 78, 10, 87,168,253, 50, 66,140,196,135, 61,162,196, 11,110,140,172, 33,174, 5, 90, + 67,159, 36,151,165,143,154,202,154, 39, 29,100,246,149, 38,146,189,204,247,175,208, 7,189,218,181,107, 71,251, 47,175,198,109, +234,248, 85,155, 16, 91, 38,251,231,149,142,171,115, 73,148,228, 30,125, 13, 51,241, 51,103,196,130,122, 53, 53, 75,170,212, 9, +182,137, 47, 63, 17,104,173, 83,159,167,116,140,192,141, 52,241, 25,140, 67,155,242, 51,127,142, 34,236,177, 38,207,207,253,174, +127, 4,125, 26,190,195,184, 80, 17, 67,194,158, 64, 58,182,111,255,158,149,138,194, 37, 71, 74, 13,253,251,246,241,227,198, 5, +209, 16,143,186,119, 2, 15,128, 48,173,168,210,233,119, 96,226, 63,163, 5, 90, 48, 44,182,169, 14, 49, 97,248, 18,104,237,219, +183,143,118, 90,174,236, 44, 20,250,209, 99,121,204, 61,117,103,176, 92,148, 66,114,250, 93,116,255, 23,231, 51, 28,148, 35,185, +222,137, 23, 84,134,253,179, 73, 96,239,140,239,206, 55,108,115,112, 77,222,201,254,219,170, 44,148,245, 93, 23, 73,212,176,145, +245, 86,143,193,202, 78,117, 30,121, 1, 67,227,135, 40,223,101,156, 31, 16, 32,233,168,249,140,212,227,143, 88, 41,252,133,193, +248, 2,207,120,192,213,238, 22,123,122,180,137,162, 42,104, 28,207, 28,132, 89, 87, 80, 65, 8,212, 39, 2,245, 22, 69,189,202, +111,216, 82,113, 16, 35,136,163, 65, 99, 62,103, 5,163, 77, 22,165, 3,148,100, 17,100, 77,156, 56,209,130,201,192,114,234,212, + 41, 11,140, 88,159, 67, 13,176, 15, 82,135,229,190, 80, 23, 62,221,191,183, 67,224,213, 11,139,228,205,235,187,176,183,226, 46, + 68,173,141,150,211,111, 39,128, 0,239,102, 45, 94,186, 98,193, 79, 57,146,188, 61,177,109, 69,208,229, 61,235,228,246,161, 77, +242,240,192,242,160,230, 63,103,123,247,234,209,131,205,152,248,174,155, 1, 90,176,209, 88,180,106,245,186, 85,107, 55,237,221, +117, 96,207, 33,182,155, 79, 6, 90,216, 92, 48, 5, 82, 18,182, 21,135,180,222, 6, 4, 76,199,160,116,206, 12,208,130, 52, 99, +234,178,101, 43,231, 59,163,105,185,127,111, 22, 85,167,206,128,150,118,103,160, 22,104, 65,114,163, 72,157, 39,206, 90, 33, 69, +171,252, 38, 25,179,229, 21,174, 72, 1,116, 4,253,214, 37,208,114,102,163,101, 5, 65, 31,129, 33, 45,112,114, 6,140,180, 42, + 67, 87, 64,139,237, 86,121,143,117,231,163, 78,167,169, 76,131,119,218, 98, 65, 82,166, 72,178, 8,178,212,133, 1,234,203,194, +235,148,100, 17,140, 21, 46, 92,248, 49, 13,229, 65,179,188, 11,186,167,236, 69, 65, 4, 93,152, 96,133, 99, 27, 37, 92,148,218, + 99,162,151,158, 61,255,120,144,163,106, 31,161,173, 86,226,220,141,175, 26, 1, 90, 0, 72,219,208, 7,189, 9,182,134,102,207, +174,128,173, 89,101,203, 6,120,182,110,125, 19, 27, 63,188, 49,214,121, 99,172,243,198,162,210, 37,208,130, 84,199, 23, 82, 29, +129, 84, 71, 32,213,145, 81,163, 70, 41,118, 52, 88,180,200,245,243,235,229,238,201,158,114,123,127, 49, 5,108,241,112, 97,163, +101,100, 92,242,136,148,194,227,187,148, 5, 35, 63, 25,126, 37,143, 2,178,170, 12, 74, 46,145, 19,121,172,240, 8,231, 81, 0, + 4,236, 55,170,104,105,254,142, 13, 30,202,152, 3,105,214, 11,220, 80,109,207, 28,217,104, 69,197, 2,253, 21, 54,194,200,208, +161, 67, 57, 70,105,237,123,109, 52, 9,180,104,236, 78,112, 74,219, 54,208,247, 78,159, 45,191,101,204, 92, 44, 44,238,223, 22, +223,199,175,229,220,205, 23,178,231,204, 19,217,125,250,145,108,220,185, 74, 58,252,217, 37, 40, 74,220, 68, 92, 96, 58,148,108, + 65, 42, 53,245,207,131, 5, 20, 27, 45,166, 17,207,190,151,145,207, 82,137,231,213,228,146,163,252,119,168,254,151, 94, 88,156, +208,200,222,107,199,174,237, 71, 83,149,140,168,168, 16,199, 92, 42, 65,245, 33, 77, 18,254, 17, 7,237,166, 40,240,208, 72,157, +102,176,221,114,145,133, 2,114,231,161,217,195, 91, 5, 90,170, 54,139,255,105,183, 69,123, 48,179,196,220,249,117, 56,144, 56, +122,116,255, 71, 24,164,111,148, 46,173,168, 10, 33,189,161, 36, 40,149,230,177,140,176, 37,121,118,187,118,109,185,154, 37,139, +146, 39, 41, 12, 51,141, 48, 86, 11,180, 28,217,104, 65,138,226,139, 85,139, 33,160, 21, 59,190,135,207,131,119, 75,228,148, 36, +144, 19, 18, 83, 78, 75, 74,241,121,153,239,206,187, 11,213, 47, 62, 28,216,254,226,158,250,139,239,108, 42, 59, 71,214, 22,152, + 42,107, 11, 78,147,227, 35,247, 72,204,176,209,141,170,185,148,207,161,129, 58,129,150, 73,195,117, 35,172, 8,113, 30, 72,144, +252, 40,158,135,202,145, 29, 74, 49,128,101, 7,163,244,130,224,138,131, 23,127,179,147, 80,157, 68, 59,157,163, 71,143, 10,192, +203,113,103, 47,165,225, 59, 6, 24, 69, 93, 72, 73, 22, 58,175,101,211,134,117,150,170,197,243, 89, 42,149, 42,170,216,192, 0, + 20, 31, 2,136, 91,132,119,220,194, 42,106, 3,140,142, 55,113, 55, 34,104,218,187,120,112,246,154, 89, 27, 54,108,152, 11,233, +216,226,130, 89, 98,189,190,178,103, 69,208,157,177, 37,130, 30,206,172, 31, 20, 48,183, 81, 96,235, 74, 57,222,137, 37,224, 48, 164,168, 84,249, 24, 86,201, 65, 77,177, 4, 3,241,186,237, 59,118,175, 61,129,165,152,207, 49, 47, 74, 33, 20,128,244,234,216, -145,245,242, 50, 96, 39,120, 98,138, 38,232,205, 0,120, 89,120,227,214,237,133, 80, 23,110, 87,233,189,245,127,182,243,253, 3, -191,197, 0,153,235, 49, 1,211,158,202,112, 57,215,174, 93, 59, 11,223,190,104,211,150,237,139, 78,236,223,191,243,154,215,225, - 99,119,189,143, 28,127,118,226,232,174,151, 94,135,151, 74,128,255, 70,124,251, 62,103, 52, 9,108, 6, 15, 30, 92,153, 9,160, -250,141, 42,209,194,132,173,168,188,202, 55,238, 39, 21, 42, 53,146,162,105,211, 74,163, 82,197, 20,201, 22, 84,134,159, 4,180, +145,245,242, 50, 96, 39,120, 98,138, 38,232, 77, 7,120, 89,120,227,214,237,133, 80, 23,110, 87,233,189,245,127,182,243,253, 3, +191,197, 0,153,235, 49, 1,211,158,202,112, 57,215,174, 93, 59, 19,223,190,104,211,150,237,139, 78,236,223,191,243,154,215,225, + 99,119,189,143, 28,127,118,226,232,174,151, 94,135,151, 74,128,255, 70,124,251, 62,103, 52, 9,108, 6, 15, 30, 92,133, 9,160, +250,141, 42,209,194,132,173,168,188, 42, 52,233, 39, 21, 43, 55,150, 98,105,211, 74,227,210,197, 21,201, 22, 84,134,159, 4,180, 108, 96,200,129, 26,209, 21,208,114, 37,205, 34,176, 82,129,156, 74, 95,175, 51,208,133,131, 86,226, 74,117, 33, 37, 89,188, 6, - 3,117, 5,120,169,137, 82,216,247,239,223, 43,247,172,174, 31,156,145,183, 1,173,169, 83,167, 42,187, 55,121, 32,179, 54, 93, -198,255, 16, 73,180, 8,180, 64,206,155, 96,107,114,255,254, 55, 85, 53,226,204,146, 37, 3,186, 52,106,116,147, 70,221,148,208, + 3,117, 5,120,169,137, 82,216,247,239,223, 43,247,172,174, 31,156,145,183, 1,173, 41, 83,166, 40,187, 55,121, 32,179, 54, 93, +198,255, 16, 73,180, 8,180, 64,206,155, 96,107, 82,255,254, 55, 85, 53,226,140, 82,165, 2,186, 52,110,124,147, 70,221,148,208, 232, 1, 45,244, 77, 95,130, 61, 74,177,184,168,197, 51, 10,200,162,125,222,205,235, 39,228,254,181,101,242,240,188,167, 60, 62, -215, 73,134,119,140, 26, 64,149,161,147, 93,135, 90, 62,124, 3,163,246, 42, 48,242,166, 75, 25, 27, 32,137,149,210, 35,214,183, -153,195, 95, 30,112, 42,135, 2,178, 42, 13, 72, 70,144,197,157,192,105,244,250, 57,218,228, 84,238,126, 38, 40,196,194,251,144, -230,101,142,128,150,199, 79, 63,253,116,134, 26, 17,238, 72, 68,222,225,142, 42, 9,155,113,182, 0, 60, 43, 32,139,234,194, 46, - 80, 23,214,109, 95, 63,232,188,207, 49,233, 63,253,119,121,252,252,173, 92,190, 19, 32, 59, 79,250, 73,249,134,185,164, 76,205, -180, 50,123,209, 40, 41, 91,179,240,123,171, 26,241, 35,178,145,191,247, 72,142,111, 95, 22, 47, 99,152,203,241,210,135,125,152, -174, 80,226, 87, 89, 74,164,124, 85,172, 90,222,103, 43,214, 46, 57, 79,128,245,203, 47,191, 40, 64,107,239,222,189, 7,126,200, -147,216,210,235, 98, 82, 25,121, 45,159, 68, 77, 26,230,134, 94, 91,253,130,247, 43,113, 71, 32, 4, 31, 52,181, 72,201,196, 29, -131, 86, 80,196,255,206, 14,222, 27,141,180,218,154, 54,224, 76,183, 16,103, 20, 41,169,157,113, 61, 65,189,117, 39,226, 23,252, -180,175,238, 85,170, 45, 36, 37,169, 52,161,250,200,189, 67, 97,173, 49, 60, 63, 47, 97,180,104,207,252,176, 21,215,167, 80, 33, - 5, 68,165, 76,153,242, 9, 46,107, 13, 22,243, 20, 47, 94,252,185, 95,215,174,114, 45, 79,158, 15, 96, 44,118,108,251, 93, 9, - 14, 57,101, 4,104, 65,253, 97, 8,104,197,140,235,113,235,193,251,191,228,164,196,183, 1,173, 51,146,239,142,231,163, 41, 23, -107,141,120,124,113,113,147, 45,255, 7, 90, 0, 91,199,135,238,150,104, 97,163, 26, 42,167, 90,120, 0,172, 11, 92,213, 82,146, -165,149,104,193, 0,241,194,223,216, 20,246,115, 64,227,224,139, 50, 40,147, 3,197,199, 4, 91, 92,141,211,134, 78,181, 57,129, -141,149,192,230, 73, 89,157, 3,112, 57,221,149,200,221,133, 24, 88, 44, 88, 97, 91, 0,202, 44,219,183,110,182, 84, 45,148,195, -114,108,237, 92,203,226, 22,133, 44,149, 75, 21,177, 96,229,233,143,137,251,166,198,143, 22, 87,161,102,108,222,170, 97, 7,231, - 62,172,144,118, 85, 40,152,252,197,237,195,171,131, 30,142,200, 27,248, 98, 82,153,192,215,147,203, 5, 14,107, 83,149, 59, 47, -158,230,207,159,159,131,180, 51,159, 90,246,108,175, 6,155,185,125,248,246,125,220,117,120,222,235,200,170,187,199,142,110,127, -118,242,168, 2,142,130,110,223, 88, 70,246, 64, 34,103,111, 12,239,170,250,170,161,125,239, 2, 59, 54,209,240,253,201,253,251, - 54,201,214,251, 7,247,151, 6, 62,125, 60, 11, 52,239, 67, 53, 71, 80,100,184,156,116,225,128,114,110,166,225,251,153, 35,135, -230,223, 62,114,112,221, 19,239, 67, 27, 44,135,247,175,144,155,215,102,147, 38,190,157,131,166, 67,154, 4, 40, 4, 89,148, 18, -105,129, 22, 85,135,176,125,147, 98,101,170, 73,213,156,121,164, 83,174, 76, 50,185, 94,117, 69,229, 79,201,102,197,138, 21, 21, - 64,238,232,131,117,108,180,108, 2, 31,135,106, 68, 39,170, 67, 2, 48,167, 64,203,250,140, 22,104, 25, 4, 91,229, 40,161,162, - 68,139,160, 95,181,201,162, 36,139, 0, 11,192, 88, 49,140,231,239,201,147, 39, 91,144,247,137,213,229, 67, 37, 23, 21,109, 3, - 90, 4, 89,236, 59, 92,189,179,175,112, 76,204,150, 45, 91, 16, 54,229,100, 10,161,141,150,135, 10,180, 8,182,232,134,128, 54, - 90,148,104,209,102,107, 90,177, 98, 1,237,234,214,189,137, 5,141, 33,160, 69,219, 59,110,106,160,134, 65, 5, 89,148, 98, 82, -122,253,232,254,101,241,127,112, 88, 49,140, 47, 83, 40,238, 35, 26,192, 59,241,163,101, 99, 5, 0,214,160, 82,221, 18, 11, 19, -252, 69,113,247, 31, 23, 75, 97, 98,166,254,102, 71,215,237,153, 20,144,213,112, 70,106,130,172,149,184,206,157,139,186,253, 28, -227,194, 24, 46, 0, 55,110,220,200,197,249, 9, 13,223, 91,115,131, 6,237, 5,113,205, 83,189,142,221,219, 39, 57,134, 81,250, -138,107, 83, 28,213, 19,129, 22, 76, 54, 20, 73, 22, 55, 18,228, 44, 84,208,178, 97,255, 50,153,190,114,176,236,242,222, 43,151, - 0,178,246,158,125, 34, 43, 14,248, 73,143, 73,107,164,219,204,243,210,110,128,167,244, 26,210, 86, 34,197, 78,206,190,228,242, -128,253,233, 92,168,223,188,240,142,163, 24, 67,143, 98,172, 63, 74,128, 85,180,104, 81,111,254,198,120,184,127,210,140, 9,167, -146,231,139,242, 62,197, 79, 81, 2, 99,198,139,170,221,248,163, 71,254, 83,239,155,113,183, 96,248, 93, 58,110, 33,104,122, 65, -208, 69,240,181,218,154, 8,202, 82, 26,126, 65, 8, 51,162,207,125,132, 69, 66, 72,234,239,120, 76,181, 79,183, 63,127, 40,139, - 35, 3, 52, 84,196,190, 59,119,238, 8,109,146,184,106,250,179,111,223, 64, 12, 56,187,145, 61, 39, 82, 1, 52, 78,111, 78,224, -148,152, 80,196, 72, 26, 64,209,180, 61,209, 61,236,129, 22, 36, 13,190, 64,208,138, 93,214,154, 53,107,124, 33,241,240,133,132, -130, 64, 75,215,246, 37, 90, 76,143,197,199,239,244,144, 11,146, 71,142, 73, 12,255,161,207, 26, 28,202,116,101,227,187, 28,215, -182, 73, 14,207, 23,146,190,167,255,187, 50, 45,174, 31, 90, 88, 96,150,255,150,242,127,201,170,150,243, 36,114,216,200,234,246, - 98,221,178, 50, 3,108,151, 20, 63, 90,152, 84, 21, 27, 45, 72,113, 2,249, 31,182,108,115, 12, 17,112,158, 41, 31, 6,163,165, -224,199,117,158,145,205,209, 54,103,103, 79, 55,162, 17, 41,213,182, 88,205, 43, 0,139,245, 69,123, 58,130, 44,238, 6,165, 4, -139,117, 68,169, 6, 13, 83, 57, 32,235, 1, 45,170, 93, 48,160, 89,246,236,222,161,128,172,147,155, 22, 88,118,140,108, 99, 25, -254, 75, 26, 75,227, 95, 43, 88, 32,129,180, 96,103,143, 41,137,160,230, 3, 56,144, 39, 40, 95,190,252,243, 94,189,122, 61, 60, -188,111,227, 27,127,239,191, 2, 95, 76, 43,242,238,237,252,202,239,101,239,128,192, 71,247,239, 6,142, 25, 53,226,144, 3, 23, - 7,206,248,160,208,132, 74,229, 33, 38,222, 0,180,197, 19,176, 25,219,244,248,158,239,178,151, 15,238,175,144,215,175,118, 16, -188, 96,226,221,110,150, 38, 84, 7, 15,160, 62,189, 11, 85,210, 65,240,101,153,229,217,179, 89,239, 45, 1,179, 33,246, 88, 7, -177,161, 31, 12,153, 55, 56,112,239,224,178,156, 88, 37, 63,128,255,164,187,224,227, 33,212,221,242,199,119,239,204,126,117,255, -222, 92,121,101,217, 64,154, 19, 38, 76,216,228,170,156, 90,160,133,254,104,105,221,186,181, 96, 55, 37,119,194, 10, 84,184,178, -114,197, 74,233, 80,169,156,204,104,240,171, 92, 57,116, 64, 58,192, 21, 11,242, 9,118,171, 9, 36,143,175, 29, 21,206,153,131, - 82,123, 32,100,175,230, 83,213,152,142,104,186, 2, 90,170, 20,204, 25,125,157, 62,213, 92,117,225, 0,247, 26,138,141,150,170, - 70, 36,200,226,255, 1, 3, 6, 40,146, 44,158,241,191,173, 14, 61, 5,104, 17,100, 81,162, 69,144,165,149,104,129,103,205,168, - 34, 52,176,235,208,225,107,180, 64,139, 62,159,208, 63,189,135,117,237,122,147, 18, 45,130,173,169, 0, 91,221,126,251,237,166, -158, 68, 11, 96,227, 30,203,166,130, 44, 46,156, 40,181,102,159,231, 2,139,227, 18, 65, 34,164,120,130,254, 73, 51, 1,221, 35, -214, 15, 97,252, 8,166,152,234, 76,252, 94, 1, 91,144,242,180,170, 61,254,123,229, 26,213,134,176,201,242,129, 75,213, 92, 32, -102, 84, 98,221, 68, 29,115, 96, 20,255, 10,207,197,176, 22,132, 78, 74,233, 18,130,246, 93, 42,173,232,216,172,161,140,165, 86, -123,174,223, 28, 21,154, 64, 11, 64, 72, 1, 89,244,159,245, 93,214,100,129, 23,124, 46,139,247,165, 39,114,234,186,191,236, 56, -245, 88, 22,237,185, 39,101,234,254, 36, 37,106,230,146,162, 53,114, 74,197, 86,205,101,208,220,221, 18, 62,122,124,127, 61, 70, - 96,193,178, 29, 18, 27,111, 72,155,189, 8,172, 0,220,143,220,243,245, 61, 26, 51,124,120,239,235,139, 23,123, 97, 60, 60, 0, - 96,187, 31,121, 14,128,255,135,161,138,223,169, 71, 51, 20,239,155,113,183, 96,248,181, 38,220, 66, 24,166, 25, 26, 25,191,114, - 99,120,123, 73,150, 83,247, 14, 92, 85,120,208,160, 29,206, 72, 23,194,254,225, 13, 59, 55, 59, 51, 68,244, 50,111,238,220,160, -218,249,242, 61,111, 86,178,164,255, 81, 24, 59,178, 83, 51,209,166,161, 78,157, 58,216,153, 22,109, 10, 13,233,245, 24,142,193, -231, 44, 6, 51,197, 24, 30,131,131, 47, 12,132,125,233,180,148, 64, 11, 6,189,190,104,204,190, 96,184, 33,160,133,119,253, 54, -108,122,137,199,231,223,207,189,145,240,210,204, 71,177, 47,172,150,164,151,214, 73,170,203, 27, 37, 85, 87,127, 73,218,193, 95, - 98,183,122, 46, 17,126,123,246,104,210,216, 43,231,219, 21,110,254,144,207,232,149, 81,123, 31, 29,177, 40, 12,142, 31,170,126, -180, 56,121, 97,103,223, 3,228, 9,137,225,186, 66, 26, 64,182, 22, 86, 76,143, 56,168,171, 98, 90,254,231,117,131,101,139, 2, - 0,136,249,255,133,162,159,167,116,139, 32, 11, 59,235, 20,144, 69, 99, 84,172,196, 20,144,197,213, 37,213, 13, 28,152, 93, 1, - 45, 24, 61,250, 16,104, 97, 64,179,212, 46, 91,192, 6,178, 70, 86, 74, 99, 41,155, 43,173,229,250,213,203, 22, 0,107, 11, 38, - 72,211, 64,235,199,248, 81,179,100, 73, 18,227, 66,135,198, 53,223, 31, 0,248, 43, 91,182,236,179, 92,217,211,188, 62,181,118, - 76,224,219,187,199,130,222,222,241, 14, 58,190,113, 90, 96,222, 28,233, 2, 99, 69,245,160,241,165, 43, 59, 16,133, 69, 25, 64, - 51,115,146, 24,231, 59, 55,171,253, 2, 59, 98, 45, 4, 91,168, 39, 14,138,123, 96,204,122, 14,237,242, 10,213,133, 80, 79, 28, -116,226, 8,244, 35, 86,219,211, 4, 48,186, 79, 23, 14,220, 93, 8,122, 39,241,253,231,177, 2,223,135, 93, 95,123,157, 56, 44, -213,165, 89,161, 66,133,251,144,148,236, 69, 57,183,162,156, 39, 65,247, 2,234,110, 63,108, 90,246,233,149, 83, 85, 29, 82,162, -133, 9,245, 18, 37, 1,148, 90,209, 38,131, 18, 45,130,110,214, 57, 13,140,105,159,133, 69,129, 98,207, 3,155, 59,218,106,105, - 37, 12,186,205,204, 17, 16, 50, 40,121,242, 80,125,103,177,156,218,164, 85, 53,134,132, 62,253, 99,105, 92, 56,216,118, 23,170, - 42, 67, 43,184, 82,192, 22,175, 65, 10,173, 39,209, 56,197, 49,140,110, 18,216,151,232,114,133, 18, 22, 2,153,105,211,166, 81, -213,222,142, 64,203,128, 31, 45,135,252,196,120,184,157,210, 44, 85,162,133,190,169,128, 5,218,104, 77, 44, 92,216, 6,182,146, - 69,138, 68,251, 73,167, 18, 35,140, 11,247, 8,166,104,255,228, 10,100,177,126,140, 2,173, 40,137, 61,102, 18, 96,105,193,214, -143, 37,163, 6, 77,121, 90, 64,185,150,167, 65,220,160,240, 49,149,205, 4, 70, 60,185,171,223,159,145,237,142,234, 39, 0, 96, -242,111,162,179,134, 70, 53, 35,205, 26,152,176, 3,145,115, 79, 10, 71,121,233,241, 29,245,162,128, 84,204, 69,222,241,146, 37, - 15, 60,123,237,166,140, 89,184, 64,134,205,158, 41,211, 55, 92,144,193, 75,175, 75,153,134,101,164, 64,249,132, 74, 42, 93, 59, -167,116,155, 10,147, 9, 3, 64, 11, 27, 17, 22, 66,130,169,128, 44,104, 1,142, 18, 80,193,250,224,224,165,137, 19,189, 86,197, -140,233,125, 99,233, 82, 47,188,251, 0,198,128, 3, 24, 95, 15, 66,141,203, 69,241,151, 58,204,184, 91, 48, 83,166,148,200,108, -196, 45,132, 25,154,159,156, 87, 99, 12,175, 96,145,127,213, 97,143, 34,233,162,129,174, 26, 32, 81,122, 12, 16, 36,144, 16, 40, -146, 19, 14, 68,119, 26, 53,146,251,189,122, 41,146, 44, 14, 80, 92, 9,110,128, 62, 30,141,239,254,158,237, 91,215,211, 53,132, - 14,115,194, 65,205, 65,103,157, 10,208,162, 36, 11, 18, 24,122,123, 80,128, 22,118, 10,249, 2, 52, 40, 64,203,224,174,195,240, - 97,227, 70,187,210,233,204,238,160, 74, 55,161, 38, 57,183, 92, 98,156, 95, 37,113, 1,184,226,182,126, 46, 49, 90, 0,100, 53, -121, 38,249, 7,190,144,138,131, 47, 4,133,137, 20,143,158,216,195,135,160, 2,171,168,126,180, 48, 73,210,239, 75,245, 16,208, -176, 61, 2,144,116,130,131, 98,151, 46, 93, 30, 67, 53,121,141,103, 2, 46, 94, 55, 65,119, 2,164, 56,138, 63, 51, 62, 75,144, -197,109,252, 4, 89,144,140, 40,110, 55, 6, 13, 26,164,216,238,208,191, 18,243, 98,133,238,212,142, 14,171, 28, 31,250,204, 58, -176,111,175,165,118,238,100,150, 13,125,235, 88,236, 65, 22, 37, 5,102,129, 86,218, 4, 81, 51, 21,205,148,194,239,232,202,153, -178,164,117, 9,233,216,184,102, 32, 70,238,164,177, 98,120,244,143, 29,205,227, 66,148,136, 30,175,144,130, 74, 20,202, 29,216, -191,132,199,219, 98, 25, 61,232, 74,193,229, 65,154,197, 50,166,184,119,124,221, 92,203,146,150, 69, 44, 93,154,214, 14, 32, 77, - 60,100, 38,172, 79,176,119,232,209, 52, 24,130,199, 20, 77,131, 33,120,108, 52,181, 64, 11,192,191, 30, 38,213,115,168,183,135, -106,130,209,244, 19,216,107,248,195, 62,207, 2, 96,245, 20,101,190, 15,233,179, 47,126,211, 48,152,210,104,195,135, 61, 16,162, -196, 12,215, 60,121, 93,143,136, 10,180, 20,151, 13, 90,176,165, 81, 53,134,132, 62, 61,190,211,243, 59,222,191,144,187, 10,185, -187,144,134,239,170,186, 80, 35,201, 90, 8,143,248,180,201,171,164, 83,214, 83, 42,200,162, 68,139,210, 33, 30,112,237,192, 69, -201, 14,236, 72, 12, 79,160,101,192, 51,188,163,215,132, 1,208,179,249,128, 34, 80,160,107, 7, 72,150, 21,195,238,223, 42, 86, -188, 57,215,234,250,161,215, 15, 63, 60,163,223, 45, 16,113, 8,182, 8,180,216,207,245, 64, 22,203,142,141, 53,190,122,245, 99, -189,159, 32, 74, 18,143,141, 90,176, 53,246,238, 79, 10,200,106,181, 44,157, 68, 78,236, 65, 64,241,131, 65, 90,182,108,144, 64, -173,166, 43, 32, 26,196, 55,111,222,156,124,156,142,155,244,165,165, 30,177, 0,192,198,113,151, 44, 23,127,115,230,204,225,252, - 65, 79,228, 14, 15,180,109, 5,104, 17,100,113,247, 97,142,252, 37, 3,150,109, 63, 43, 61,134,181, 80, 64, 85,227,222, 67,164, -245,164,243, 82,119,216,113, 41,214,176,129,114,173, 78,247, 63,165,118,247,133, 70, 85,135, 61, 0,128,143,194, 14,151,210,171, - 67, 0, 90,251,169, 46,196, 66,232,224,149,201,147,189,214,198,139,231,253,248,225,195,195,152, 3, 15, 66,138, 77,160,245, 37, -119, 29,126, 46,119, 11,161,237, 22,194,108, 51,113,152,255, 43,151,104,185, 14, 42,109,255,113,170,195, 82, 58, 33, 77,153, 44, - 89, 0, 37, 38, 92,229, 41, 30, 98,211,167,151,107, 57,114, 40, 82, 44,130,172,237,232, 76,113, 99,199,246, 79,240,109,220,129, - 70, 28,150,194, 94,164,246, 31,127,252,113, 85, 5, 90,104,212, 10,176,194,138,194, 23,139, 8, 95,172,190, 21,208,197, 93,135, -152, 36, 28,249,192,113,228,204, 45,107,172, 20, 73,239,180, 58,187, 43,168,141,239,113,201,124,117,139,196,187,184, 70, 1, 90, -105,186,251, 75,245,137, 22,169, 52,244,106, 80,212,184,201,232, 11, 36,171,131, 26,214,115, 16,151, 22, 32,203,143,146, 1, 30, - 80,253, 80, 85, 67, 91, 39,103, 97,130,248, 10,151, 52,105,247, 69, 90,176,217,161,161,237,143, 60, 91, 61,195,187,178,251,178, -167,153,153,219,162, 89, 23, 28,128, 9,138,185, 10,135,241,166, 34,205,128, 10, 86,177,137,160,115, 67, 74, 60,172, 59,123,166, -218,125,191,141,166, 10,180,104,243, 82,167,124, 81, 75,141,108, 9, 45,191,228,207,100,147,100,113, 18, 51, 8,180,108, 52,127, - 72, 20, 45, 93, 17, 0,162, 99,235,230, 5,109, 30,210, 66, 70, 84, 76, 27,148, 62, 81, 52,218, 53, 5, 59,138,100,240,240,145, -139, 43,222,203, 0, 15, 75,177, 76, 30, 87, 93,213, 81, 70,208, 44,158, 41,197, 93, 85,173, 57,186,114, 90, 11,104,210, 40,221, -236, 97, 43,231,215, 66, 83,171, 58,180,151, 22,125,244,223,133,235, 5,189,246, 73, 70,218,237, 58, 84, 84,147, 58, 12, 14,214, - 62,179,193, 78, 11,125,166,162, 30,208, 82,223,227,132,190,195,126, 68,255, 88,148,190, 18,108,209,153, 46,129, 22,207, 6, 37, - 89, 54,154,152,240, 59,193,142, 43,136,198,219, 4, 89, 84,175, 83,122, 79,227,108,128,224,149,170, 31, 45,198, 56,100,172, 67, -198, 60, 52, 18,130,135,124,130, 45, 99,249,110,221,186,237, 83, 37, 90, 52,122, 39, 88,192,132,237,141,177,206, 27,125,212,123, - 76,175, 94, 55,167,151, 40, 17,240, 30,187, 17,233, 73,158, 30,229, 53, 60,182,149, 19, 0,243, 30,165,109,148, 90,171,182,153, - 28,143,105,183,165, 26,240, 43,131,147, 62,208,178,231,103,146,143,192,214,157,159, 36, 81,142,136,247,177,195,144,121, 29,121, -172,183,111, 6,246, 52,147, 65,226,251,138,106, 78,130, 45, 56, 47,165,227,210,183, 52,142,199, 78,237, 83, 53,107,214,124, 73, -137, 23,191,131, 38, 13,112, 65, 67,251,223, 68, 46,198, 37, 69,117, 72,144,197,115,255,193,195,111, 22,173,216, 56,112,199,209, -179, 82,170, 70, 26,169,215,111, 33, 60,183,159,146,178,125,142, 73,129,223, 39, 75,177, 42, 41,229,175,181, 43,229,187,172, 37, - 3,236,140,225,157,141,201, 63, 96, 60,223,134,113, 20,194, 53,175,131, 4, 89, 56, 19,104,237,135,166,229,192, 99, 63,191,195, -104, 27, 7, 49, 71, 29,132,173, 50,119,135,106,119,135,235,205, 29,102,199, 36,251,185, 35,180,220, 45, 4, 43,103, 40,185,133, - 8,245,111,255,202,129,150,185,186,214,134,224, 73, 16, 55,238,144, 88,177, 98, 62,132,106,240, 37,108, 35,108, 14, 75, 41, 33, -193,202, 50, 0,232,254,110,226,248,241,250, 25, 13,193,131,149,217, 17, 12, 14,116,235,239, 11,189,252, 29, 74,174,248, 27,157, -200, 23, 78, 2,111, 66,220,172,248,213,226,117, 26, 41,154, 0, 69, 25,191,137, 31,231, 82,158,126,157, 31,215,222,191, 74,218, -221,242,146,150,115,158, 73,197,126, 39, 36, 83,229, 33,143, 61, 34, 39,100, 28, 52,251,160,215, 42,121,151, 13, 6,246, 83,139, - 8, 52,105,163, 69, 59, 8,198, 58,180, 26,123, 46,114,193, 89, 61,160,165,120,134, 55,185,147,209, 17,205, 85,176,107, 83, 6, - 92,138,224,225,113, 95, 25,220, 48,225, 40,142, 44, 9, 10,177, 10,147,221,187,119, 11, 36,148, 28,208,156,198, 16, 84,129, 22, -248,111,193,160, 98,185,122,229,162, 37, 0,147, 25,213,133, 42,200, 50, 11,180, 50, 38,137,177,228,232,170,153, 10,200, 26,246, -203,143,129, 57,147,199,240,165, 26,209, 33,208, 58, 58,238, 29,129, 86,137, 76, 30,148, 58, 58, 29,204, 51, 38,137,185,228, 24, - 36, 89,180, 29,163,196, 45,103,178,232,190, 84,249,153,107,229, 74,238,255, 3,173,175,132,230,151, 6, 90,170,244, 74, 11,186, -140,182,121,123, 59, 45,251, 29,138,170, 31, 45,123, 80,231,108,194,181,187, 94,201,234,249,189, 45,212,248,231, 9,180,112, 38, - 64,111,110, 64,146,101,171,119,130, 38, 72, 0,211, 3,112,113,172,249,191,207, 44,128, 44, 72,134,190,253,191,195,210,210,213, - 99,101,170,121, 44,108,202,146,149,140, 2, 45,140,117,107,185, 91,142,137,113, 14,177,240, 81,128, 2,195,240,192,187,249, 97, -196,121,245,166,167,248,174, 24,247, 60,127,248,193,143,177, 17, 25, 35,209, 17,208, 66,223, 84,128,150, 30,200, 10, 1,208,226, -235,108, 96,107,210,163,252, 82,164,109, 2,129,175,172,206,184,158,210, 96,159,114, 52, 46, 21, 66, 28,212,167,244,233,198, 29, -146,112, 19,163,168,184,177, 83, 84,145,190, 83,226,197, 8, 6, 80,151,211,110,176,176,171,254,206, 64,209,140, 97,200,132, 58, -217, 12, 41,238,230, 40,177, 19, 63,111,214,115, 90,208,226, 29,167,164,213,224, 73, 82,169,255, 9, 41,218,195, 75,234, 15, 63, - 42,179,215,172,146,106,191,123,190,143, 16, 19,190,180,130, 75, 8,157,142,201,144, 0,183,192, 14,238,221,144,106, 29,133,106, -247, 16, 36,143, 7,250,245,235,119, 24,252, 62, 64, 73, 22,212,182, 7,177,168,221, 14, 45,139,189, 27,155, 80, 7, 27,218,113, - 9,191, 67,203,221, 66,176,114,134,146, 91,136,207,241,237, 6,155,220,191, 32,155,125, 80,233,157, 91, 55,109,128,253,213, 84, -172,170,150, 39,137, 21,235, 54,210, 77, 12, 34,139, 98, 68,139, 50,129,234, 66, 51, 65,165,177,202,219,129, 85,204, 21,172, 32, -174, 2,164,253,137,221, 98,151,104,159, 5, 87, 17, 87,129,178,135, 96,155,250, 69,136,111,125, 49,136,210,255, 77, 46, 87, 29, -208,193,189,112,184,214,192, 35, 90,212, 5, 30,177, 98,220,244,136, 20,247,166, 71,132, 24, 11,148,107, 30, 88,159, 57, 63, 92, - 54, 24, 6,122,182,250,209,122,132, 29,115,119,161,250,124,248, 9, 1,160,149, 82,112,199,162,213, 23, 23, 39,135, 52, 88,233, -225,175,226,155,139,182, 26,206, 14, 71,229,164,247,247,205,148, 90, 17,108,169,206,235, 56, 32,147, 30,213,133, 92, 89,194,214, -136,210,136,134,174,248,137,129,204,135, 0, 11, 3,186,226,139, 8,198,187, 31,129, 44,179, 64, 43,111,202, 88,199,230, 54,206, - 31, 68,144,149, 35, 89,140,187, 84,207, 57,250,184,220,105, 61,206, 80,170,197,244, 83, 58, 15, 71, 46, 40,108,223,158,247,251, -152,199, 22, 52, 47,160,128,172, 92,201,162,223,113, 70,211, 64, 87,252,234,104,106, 85,135,122, 18, 45, 29,231,159,166, 6,201, -144, 0, 45,242,159, 42, 68, 35, 62,178, 92,208, 55, 82,206, 74, 24, 55, 56,169,186,242,151,165,109, 14,193,128,150,209,120,135, -142,242,105,136,126, 84, 78, 72,239,151, 0,100,236,195,216,182, 31, 99,103, 79,140, 29,123,168, 54, 68,104,167,253,152,216,129, -173,126,216,197,120,135,216,121,119, 32,165,135, 71,247, 28, 97,195, 78,196, 74,176,164, 35,154, 4, 90,236,219,170,102,193,145, - 36, 43,132, 18, 45,245,117, 73,176,187,112, 62,118, 34,222,143, 28,223, 99, 34, 46,114, 99,142,158,231,123,245, 89,103,117,148, - 4, 99,202,126,248,202, 82,236,181,104,194,128, 13, 12,220, 53,203,197, 42,109, 6, 67, 30, 80, 59,114,220, 36, 0, 82,199,178, -254, 92,217,210,118,232, 26,233, 51,235,152,116,155,114, 84,106,117, 95, 32, 41, 51, 23, 9,112,226,176,212, 85, 91, 10, 11, 91, -173,182,152,151,182,194,152,255, 48, 36,143,135, 9,142, 49,142, 30,194,124,117, 16,117,181, 21, 11, 85,110,172,176,231,137,145, -246,105, 96, 40, 10,150, 69, 75,115, 36, 55,163,133,130,187, 5,251,114,134,212, 45,132,195,126,100,246, 3,221,249,173, 28, 32, -216,162,100,139,106, 68,218, 93, 57, 50,114,167,209, 60,237,185,152,135,121,249,140, 29, 3, 29, 53,194,212, 88, 21,108,196,192, -154,157,121,209,120, 43,193,174,228, 12,207,252, 15, 41, 86, 37,164,115, 16, 39, 55,117, 82, 25,159,187, 97,127,244, 90, 72,157, -106, 3,120,180,228,153, 55,121,134,147, 56,219,255,144,148, 19,252, 44, 14, 9, 84, 45,168, 15,170, 1, 92, 85,130, 45, 85, 53, - 12, 68,181,176,210,112, 4, 46,245, 6, 52,130,173,249, 52,116, 7,144,189,207,179,154, 96,107,226, 71,159, 91,184, 79,149,161, - 35,251, 15, 27, 63,185,211, 20, 43, 70, 31, 38,238, 44,100,162, 61,150,125,194,164,241,145,234,207, 89,189,167, 79, 20,253,231, -188, 41, 98,236,207,146, 56,250,190, 12, 9,163,165,255,132, 14,102, 43, 39,105,230, 73, 17, 11, 52, 99,236,253,175,209,212, 58, - 44,229,111,189,255, 46,248,109,186, 31, 89, 37, 80,158,161, 73, 83, 75,203, 9,125,211,229, 52,208,198,190, 20,205,212,152,188, - 23,193,238, 82, 29,235,126,193,216,183, 19,227,219, 47,214,177,238, 23, 72,211,118, 99,172,107,168, 55,134, 64,170,227, 5,208, -114,207,154,124,105,135,197,132,255,119,153, 0,196,238,168, 9,227,169,214,127,149, 61,105, 87,223,158, 0,153,233,208,152, 99, - 80, 76, 3,124,212, 27,151,212,251,244,191, 72,251, 51,142, 65, 67,144, 56,182,103,213,161,111,164,142,190, 9, 31, 37,110, 11, -186,112,160,209, 59, 83,164, 88,201,246,187, 8,193, 99,132,102, 58,240,122, 32,234,105, 21,234,110, 47,210,106,140,119,131, 80, -214,116,122,117,100,130, 95,122, 89,181,229,140,142,204,116, 60,250,169,238, 22,140,124,187, 94,185,204,180, 37,179,180,254, 13, -249,117,195, 15,126,174,143,252, 90, 42,215, 93,206,208,109, 1,110,126,186,249, 25, 90, 28,112,183,165,208,226,228, 7, 58,110, -126, 26,231,167, 17,151, 22,110,126, 26,231,231,191, 61,167,107, 99,248,207,248,245,238, 70, 24,186,204,117,243,211,205,207,208, -226,128,187, 45,133, 22, 39,221, 0,198,221,150,220,109, 41,116, 57,240,117, 82,115, 41,209, 98, 39,113,148,204,124,170, 51, 26, -174,174,235,209,119,211,116, 92, 47, 33,173, 47, 55, 63,221,252, 52,218, 6,220,125,211, 57, 7,140,242, 80,155,207,205, 79, 55, - 63, 29,113,224,191,220,150,244,250,132,251,190, 9, 14,184, 87, 58, 38,152,101, 32,171,155,159, 6,152,100, 34,139,155,159, 38, -152,101, 32,171,155,159, 6,152,100, 34,139,155,159, 38,152,101, 32,171,155,159, 6,152,100, 34,203,231,224,167,137,215,255,227, -178,186, 85,135, 58, 85,242, 57, 26,140,155,102,232,246, 3, 55, 63,221,252, 12, 45, 14,184,219, 82,104,113,242, 3, 29, 55, 63, -221,252, 12, 93, 14,124,221,212,190,184, 81,252,191,177, 3,210, 64,146, 49,187,246, 32,209, 3, 51,207,252,111,111, 56,105,244, -219,185,187,103, 48, 18,119,242,145, 30,207, 3,145,184,219,196,254, 48, 74,211, 76, 51,253, 42,105,114,187, 60,118,169, 13,103, -194,238, 43, 37, 97,215,213,112,236,156, 84, 18, 92,135, 12,199,206,161,158,159, 17, 96, 59,219,250,254, 17, 63,213,178,106,203, -169, 45,235,103, 46,167, 51, 22,124,149,245,110,166, 97,187,200,251, 79,248,246,180,216,221,230,141, 50,134,216,233,113, 8,121, -241, 79,248,118, 35, 69,119,151,211, 8,151,140,231,249,162,252,196,248,246, 59, 60, 9,112, 39,172,189,223, 49,227, 37,254, 58, -115,186, 6, 89,112, 16,186,155, 73,253, 54,108, 17, 62,128,129,192,207, 76,226, 51,118,188, 9, 86,185,188,143, 73,208,207, 62, - 97,162,121,233,236, 61,184,199,208, 33,218,227,139, 54, 24,187,119,211, 61,194, 6, 76,226,203, 39, 78,156,248, 43,124,224,116, -129,115,208, 14, 8,201,179, 12,215, 55, 35,105,193,150,145,114,230,131,247,233,203,240,179, 51, 4, 30,174, 91, 35, 8,116, 39, - 56, 66,253,179, 81,163, 70, 51,225, 64,145, 14, 86,115,253,131,190,221, 76,179, 55,242,237,102,232, 49,111, 48,154, 4, 88,112, -164, 58,149, 9,161,160,166,194,171,243, 84,132, 82,153,138,216,156, 83,225, 11,108, 42,188,123, 79, 37,216, 10,109,160, 5,151, - 23, 57,240,238, 67,240,131,246, 30,231,131, 72,217,244,234,200,190,172,240, 79,102, 43, 43,130, 32,124,150,114, 26, 96,238,103, -175, 35, 3,101, 48,146,197, 81, 57,155,192,141,201, 10,248,165,186, 3,215, 40,167,225,190,132, 33, 94,236, 61,139,187,162,173, -247,237,177,240,240, 40,196,226, 59, 8,215, 11,119,224, 15,235, 32,255, 35,241,186,179, 67,143,166,246,185,180,133, 11, 23,102, - 16,116,129, 87,122,198, 94,117, 6,182,204,208, 52,194,203,143,250,145,209,135, 66,187, 31, 25,120,175,251,219, 13, 48,201, 68, - 22,167,252,164,235, 38,140,149, 43,144,110,192, 85,200, 27,120,191,127, 3,255,150, 55, 16, 55,118, 37,156,206,186,138, 93,236, -148, 38,230,115, 58, 34,167, 67,238, 23,232, 67, 15,176,200,188, 9,250,116, 83,161,235, 54,196, 30,139,152,248,198,191, 59,171, -126, 8, 30,124, 92, 97, 38,181,164, 88,133,223,162, 83, 60, 4,112,181,197, 52, 68, 0, 92, 37,248, 42,175, 51,238, 33,226,226, - 41, 81,227,233,177, 24, 30,142,133,207,184,154,116,128,110,111, 99,146, 81,253,234, 41,103,254, 7,240, 10, 36, 93,251,131,215, - 24,227, 75,111, 34, 11, 5,238, 26,237,212,173,208,128, 22, 4, 4, 88,206, 63,124,244,244, 82,165, 90,191, 87, 93,190,114,101, - 83,120,139, 95,130,129,115, 53,202, 65,201,150,122,232,209,140, 5,144,117, 5, 33, 58,234,122,246, 27,212,190,226,175,205,154, -228,248,185,100,165,166, 77,127,175,140,208, 15, 3, 16, 78,103,154, 21,108,105, 37, 91,122, 52, 61,208,152, 55, 97, 98,191,200, -132,223, 91, 12,240, 70,151,166, 1, 26,246, 89,244,104, 58,114, 30,235,202,161,236, 71, 19,132, 10, 94,224,192,113, 42, 60, 57, - 79,197,164,197, 0,181, 83, 17,106,104, 42, 28, 12, 78,133,163,193,169, 0,246,161, 13,180,194, 97, 80,186,189, 96,193, 2, 25, - 49,124, 56,227,254, 49,217,251, 44,250,232,219,213,178, 18, 84,193,241,224, 84, 56,228,157, 10, 79,230, 83, 17,126,106, 42,188, -240,187,129,150,235, 6,102,207,207,238,136, 40,161, 56,112,164, 35, 71,134,157,162,179, 94, 56,148,124, 12, 50,169, 13,182, 85, - 87,237, 51, 62, 64,244,163,201,147, 39, 43,129,145, 25,160,157, 81, 21,224, 37,156,113, 72, 31,129,126,124, 39,239,208,107,243, -182,199, 40,201,130, 31, 62, 65,123, 80, 28, 12, 99,161,197, 0,245,142,192,150, 81,154, 97, 48, 78,182, 71, 90,135, 62,191, 21, -169, 31,232, 57, 11,157,227,138,102, 98,248,248, 58,136,197,173, 31, 19, 36, 18, 74, 2,189, 64,117, 33,204, 69, 50,198,121,193, -127,237,162,218,104, 57, 13, 86,143,146,205, 77,211, 12,183,244,243, 58,228, 39,234,179, 9, 22, 18,111,224, 47, 76, 0,176, 4, -206,115, 37, 75,150, 44,108,147,146, 63,127,126, 41, 94,188,248,155,162, 69,139, 54,209,107,243,249,178, 39,108,148, 47,103,162, -219, 63,231, 74,226,203, 84, 40, 95, 26, 70, 19, 17, 56,249, 85, 66,196, 49, 33,216,253,123,248,137,188, 9, 90, 78,193,150, 53, -168,116, 48, 44,162,255,105, 95, 73, 14, 53,190,144,182,184, 64,182,183, 24, 52,154, 97, 19, 16,251, 73, 55, 49,240,180, 30,208, - 2,170, 85,128, 22, 7, 48, 53,169, 64,139,128,206,254, 61, 12, 92,205, 24, 95, 95, 18,104, 85,207,232, 33, 76,244,102,205,164, -253, 95,240,135, 40, 12,113,243,235,253,135, 79,175, 32,157, 40, 84,170, 70,145,174,117,234,228,189,126,254,124, 43,120, 18,158, -135,114, 82,141,104, 20,104, 13,201,149, 43,215,224,158,127, 14,238,224,115,203,239,228,109,223, 7, 71,139, 84,168, 95,177, 84, -185,170,197,127,250,233,167,108,136,173, 53,102,248,240,225, 43, 65,108,160, 9,154, 30, 8, 23,116, 17, 82, 29,101, 0,199,111, - 74,197,244,142, 47, 61,160,209,121, 35,189,212, 43,206, 95,173, 7,127,243,154,226,216, 81,175, 83,243,190, 10, 94,192,247,169, -151, 47, 95,158,138, 9,113, 42,226,199, 77, 69, 32,237,169,107,215,174,157,138, 96,181,161, 14,180,146, 38, 77,154, 25,113, 58, - 95,143,131,151,107, 53,124, 12,206,239, 81, 28,173, 26,241, 35,126, 82,101, 72,201, 27, 1, 33, 60, 79,191,196, 10,239, 45,194, -197, 40, 9, 65,135, 95, 0, 80,115,162, 61,105, 77,140,165,102,127, 56,170,163, 84,112,118,185, 18,233, 38,158, 15,100,194, 96, -121, 19,255, 71,227, 97,109, 0, 95, 67,252,212,100, 74,142,223,244,176, 94,222, 73, 42, 7,207,222,206, 0,141,179,182, 20, 90, - 52,191, 3, 47,131, 16, 30, 69,241, 52, 94,162, 68,137,183, 21, 43, 86, 12,162,199,113,254, 71,121,219,233, 53,118,235,125, 87, -109,190,209,226,197,139, 5,139, 29, 37, 78, 40, 34, 42, 88, 16,240, 93, 24,114,139, 1,218,241,124, 67, 35,237, 83,167, 28,149, - 80,238,231, 92,176, 2,116, 11, 2, 76, 19,196, 57,138,157,234,170,156,116, 82,220, 21,105, 51, 36,122, 47, 59,119,238,236, 15, - 41,238, 43, 44, 48,252, 59,118,236,120, 18, 64,233, 50, 38, 81,163,230, 7,148,196, 15, 64, 8, 52, 95,132, 47,122,205,152,143, - 28,143, 25, 67,145,139,107,134, 29, 99,100, 12, 46,174,153, 56,182, 64,178,171, 93, 84, 87, 52,200,119, 51,217,190,200,184,132, -126,243, 22,133, 98,189,146,159, 30,122,255, 13,246, 77, 51,223,233, 40,239, 23,249,118,128,229, 22, 88,236, 43, 99, 25,164, 87, - 10,184,178, 79, 0, 90,130,240,123, 82,169, 82, 37, 71, 42, 64, 91, 57,243,231, 74,228,243,232,234, 12,145, 39, 75,149, 52,122, - 80,227, 0, 2, 45,132,233,147,209,163, 71, 11, 3,136,115, 81,132, 0,226,239,172,146, 45,135, 60,114,132, 69, 62,149,153, 95, -240,121,123,181, 97,240,255,206,128, 22, 59,218,145, 35, 71, 4,171,111,221, 68,160, 69,112,230,234,163,112,255, 14,165, 96, 20, -153,171,137,255, 41,209, 34,226,181,127, 15,175, 65, 10,102, 52, 18,189,250,234,134,152,108,198,226,143,209,213,109,176, 34, 19, - 92,161, 49,212,114,148, 48,160, 61,198, 0,220,233,215,223,255,172, 83,161, 90,179,146, 91,230,207,111,124, 99,199,230,214,143, - 14,236,170,139, 54,197,201,210, 76, 89, 15, 77,152, 48,161, 69,133, 58,157, 90,250, 61,124,114,254,209,147,231,231,250,244, 26, -244,219,140, 17, 67, 27, 44, 29, 49,180,154,247,193,125,213, 17, 99,107, 23,104,234,121, 97, 15, 86,126, 2, 45, 14,146,108,216, - 0, 6,142, 98, 6,126,193,118,247,209,171, 20,144,197,195, 58,184,241,191,163,107,124,208,165,132,139,224,133, 42, 67, 85,154, - 69, 0,163,130, 23, 21,192, 96, 16,209, 2,152,147,160,233, 8,196,232,242, 3, 3,209, 22, 14, 70, 88,141, 73,231,142, 29, 95, -243,172, 1, 90,174,188,112, 43,180,213,178, 18, 16, 18,100,177, 93, 59, 58, 88,111,200,206,114,234, 29,233, 17,112,253, 41, 36, - 98, 65,156,248, 72,143,147, 33,251, 79,229,202,149, 95,162,253, 19, 96,135,215, 35,226,228,126, 57, 4, 37, 47, 4,105, 75, 1, - 71, 9, 32,167, 48,202,238,108,133,235,236,149,161, 69,147,109,162, 34,248,191, 9, 17, 15, 70, 90,219, 72,118,134,120, 97,112, - 98,132,181, 97, 72,151, 79, 58, 48, 70,173, 97,248, 42, 72,154, 89, 23,197,173,196,138, 55,107,214, 76, 9,210, 14, 41,233,167, -190, 35,109,161, 66,133, 30,158, 58,117, 74,145,196, 81, 98,182,101,203, 22,129,233, 0,105,115, 81,233,202,102, 75,253,182,140, - 80,107,122, 35,150,233, 37, 0,181, 64, 6,148,231,162,152,225,121, 16,206, 76,209, 58,244,234,213,235, 56,164, 83, 43, 12, 48, -131, 32,107,208,212,169, 83,159,176, 77,214,173, 91,247, 61,191,159,113,109, 41,141, 32,136, 85,227, 21, 34, 52,141,192,188, 65, - 1, 91,118, 64,203,213,107,158,225, 38,121, 25,203, 64, 89,140,100, 33, 61,198, 71, 84, 18, 34, 96,188,198, 2,227, 53,234,237, - 53,192,234,107,244,131, 46,248, 12, 61,233,184,237, 61, 24,211,223, 89,203, 71,143,248, 97,244,254, 27, 41,224, 23,200,147, 12, - 99,219, 10,164,167, 72,207, 81,230, 53, 24, 99, 82,154,121, 47,198,175,120,144,100,189,197,124, 97, 3, 87, 88,248,115,252,144, -242,229,203, 11, 2,180,219,174, 99, 81, 32, 45, 91,182,124,139, 62, 16,207,217, 59,242,231, 72,244,123,254,156, 9,125, 11,230, - 73,226,199, 84, 36,127, 90, 69,162,213,179,103, 79, 37,174, 37,133, 40,140,121,201,112,112, 0,120,239, 81,238,229,160, 85,204, -158,222,191, 4,104,169, 0,235, 35,160,229,105,175, 23, 69,197,221,226, 0, 78, 20,170,149, 64, 57,251, 13, 80, 64, 80,116,219, - 85,101,163, 51,248, 50, 31,197,230,106,226,127, 72,173, 20,213,161, 61,109, 94, 11, 1,208,234,132, 65,114, 52, 80,243, 8,148, -197, 52,216, 82,129, 22,218, 8, 39,148, 96, 9, 52, 79, 66, 98,210,113,217,234,181,205,255,108,214,172,200,245,141,107, 90,191, -244, 58, 56, 74,174, 93,154, 13,160,185, 26,239,211, 74,180,244,218,253, 99, 76,140,157,114, 21,169, 81,163, 66,221, 46,181,250, -121, 14,253,125,229,212,233, 93, 14, 45, 89,208,235,236,178,133,237,175,237,221, 89, 21,239, 39,112, 51, 3,222, 60, 0,174, 20, -160,197,160,223, 80,115, 49,142,226, 63,229,224,224,167,224, 11,214,249,250,245,235, 85,176,165, 92,163, 10,154,170, 20,235,160, -167, 91,102,130, 23,218,101, 65,125, 52, 21,109, 84, 1, 48, 92,125, 59, 59, 40, 29, 5,209,147,186,132, 29,100,192,160, 84, 0, -224,237,117,219,182,109, 41, 37, 36,200,122,129,228,143,116,151, 54, 91,122, 52, 89, 86,218,101, 81,189,201,114,178,140,156, 16, - 17,247, 78,184, 64,225, 98,131, 64,201, 10, 64,117,203,136, 73,118, 22,250,107, 16, 37, 34,144, 98, 8,192,166,114,134,116, 79, - 81,225,195,174,194,130, 60,125,245,202,229,228,126,121,103, 32, 75,189,142,114,154,221, 85,227,144,230,173, 91,183,126, 70, 27, - 93,139,152,119, 55, 67, 64, 83, 45,254, 55,249,242,229,179, 48,144, 58,234,232,126, 8,191,217,246, 24, 65, 16,212,185,130,243, - 43, 92, 84, 39,236,112, 8,126,252,138,128, 8,106, 21,218, 84, 25, 61,210,194,214,229, 86,145, 34, 69, 30,193,180, 64, 73, 8, - 76,255,156,109,157,193,149,255,250,235, 47, 41, 93,186,180,192,222, 83, 1, 54,253,251,247, 23,128, 35, 26,200,187, 58, 34,195, - 62,237, 56,120,103, 33,184,226, 4, 70,224,195,122,231,248, 9,213,185, 34, 33, 67,155,184, 11,224,169,199,143, 96, 32,139, 96, - 11,237,230, 57,181, 12, 28, 63, 8,178,216, 79, 1,232,133, 32,139,139,110,190,131,239, 67,219,119,185,168,214,124,192, 51,107, -159, 22,128, 34, 6,182,143,101,148,121, 78,242, 17, 96, 41,227, 4,233, 81,229,133, 57,130, 18, 65,218, 3,209, 20,229,223, 14, -180,146, 18, 92,161, 13,188,193,124, 68, 33, 5, 23,212,111,208, 46, 95,148, 44, 89,242, 59,163,188, 5,168,223, 72,222,169,146, -172,218,181,107,203,176, 97,195, 40,197, 13,196, 56, 23, 88,175, 94, 61,249,249,231,159, 21,176, 69, 0,214,174, 93, 59,105,221, -186,245, 70,163,244, 49,167,251,105,129, 22,193, 22,251, 21,207,144,154, 42, 11, 11,168, 38,131, 64,175,158,150, 38,198,181,143, -176,136,209,119,254, 3,242,233,187,119,176,183,209, 34,208,226,196,197, 1,129, 98,116,189,100, 4,104, 49, 54, 23, 87, 93, 20, - 77,171,137,255,209, 81, 2, 57,105,216,191,131,226,106,130, 51,147, 12,236,228,233,233, 57, 21, 42, 30,238, 60, 51, 13,182,168, - 42,164, 52,203, 17,208,130,225,234, 68, 12,184,123, 81,174,133, 55,206,158,109,245,104,203,250, 6,114,249,194,108,121,251,250, - 97,185,114,229,182,161,156, 90, 27, 45,189, 98, 31,194, 74,177,119,237,250,141, 42,214,109,216,186,210,220, 33, 35,155, 31, 94, - 48,183,247,205,109,155,166,222, 91,191,170,223,203,179, 39,187, 1,104,158, 3, 17,151, 18, 45, 70,179,103, 32,110, 53, 97, 37, -226, 71, 80,193, 21, 62,130,215,222, 71,163,190,168, 38,230,213, 43, 20,239,163, 19,110, 6,128,184, 72,233, 24,129, 27, 6, 49, -133, 70,170, 84,169, 46,194,248,248, 34, 6,180,139,208,229, 95,196,196,198,235,134,104, 90,223,171, 72,175, 56,120,179,189, 80, - 29,195,131,170, 8, 78, 16,214, 1, 84,171, 82,116, 90, 92,130, 23, 26,191,163,125, 78,197, 42,123, 42,165, 88,164,133, 13, 10, -138,253, 14,129, 7,129, 27,129, 12, 39, 54, 19,210,162,143,222, 9,112,164, 76,130, 0, 5, 65,170, 36, 11,188,201, 2, 30, 56, -179,131, 9, 70, 67, 45,171, 10, 8, 89, 78,130, 34,246, 1,126, 59,219,190, 42,229,194,131, 39,245,234, 8,210, 44, 95, 78,172, - 4,106, 4, 89,152,116,149,111,101, 95, 34, 95, 41, 45,193,132,249, 14, 41, 0,131,233, 93, 0, 25,246, 3, 87, 70,173,218, 87, -126, 49,160, 5,155, 16,170,198,105, 27,178,230, 19,128,150, 7, 38,130, 39, 4, 90,152,108,158,232,241, 78,239, 62,192,208, 19, - 78, 8, 0,171,193,104, 97,194,121, 98, 5, 90,134,223,129,201,198,155,245,195, 67,149, 58,178,142, 86,175, 94, 45, 84, 79,206, -158, 61, 91,153,192,176,194,127, 73, 27, 48,180, 41, 71,234, 67,251, 34,119,135,106,252, 50, 65, 22, 77, 4, 72,131, 11, 82,218, -171, 65, 18,169,244, 41,242, 2,146,178,151,152,140,159,234,124,111, 95, 85,146,197, 51,242,238,194, 51, 47,154, 54,109,170, 0, -192,178,101,203, 42,210,141, 53,107,214,216, 64, 22,199,104,142,203,232, 7, 46, 23,213,154,247, 62, 99, 29, 67, 2, 73, 16,105, - 3, 69,168,115, 69, 85, 23,130, 35, 34,158,161, 36, 43, 24, 61,216,213,177,159,247, 0,171, 13, 75,179,248,110,141,170, 80,145, -104,233,253, 15, 65,121, 67,245, 17, 74,130, 8,178, 52, 18,117, 69,186,142,246,250, 6,224,104,131,209,151,209,246,142,128,135, - 64, 10,115,154,192, 76, 69,218,180,105,179, 2, 52,162, 2,176, 69, 69,253,175,192, 98,195, 38,213, 34,240,194,156,202,246,233, -240,208,147,104, 81,176,194,118, 10,243, 14, 10, 86,130, 90,181,106, 37,243,231,207,167,228,140,166, 23,140,133,105, 59,236,177, -136,209,111,250, 42,243, 81, 52,204,149, 13,197,210, 70, 18,118,122, 9,109,176, 92,125, 44, 6,148, 23, 4, 85, 14,146,162, 2, -177,127, 15,175,129,230, 93,147, 12, 84,128, 86, 72,193,150, 35,160,181,102,217,130,154,249,210, 37, 59, 95,161,120,161,119, 20, -109,194, 56,240, 32,196,235,127,161, 83,223,219,190,105,158, 84,168, 80,129, 13,156,201, 72,108, 44,245,115,134,161, 97, 79, 2, -194,239, 93,182,112,254,156,171, 7,255,249,235,185,133,115, 58, 61, 88,183,172,255,171,117, 75,187, 99,100,222,143, 85, 37,193, - 27, 93, 63, 56, 61, 8,126,236, 55, 18,176,222, 56,232,114, 2, 87, 15,254,102, 94, 35,188, 36,200,162,148,133, 7, 7, 85, 78, -222,234,196,174,130, 23, 14,242, 4, 47,152,220, 12,209,212,188, 87,177,199,226,132, 64, 21, 5,219, 13, 87,229,188,134,228,202, - 70, 43, 88,209, 9, 94,208, 62, 20,105, 22,236, 8,109, 64, 11,234, 57,241, 4, 45,130, 16, 21,200,240,127, 72,129, 22,118,182, - 41, 18, 39, 78,140,168, 47,170, 15,149, 65,206, 8, 31,213, 60,116,229,192,178,106, 1, 33, 39,115,110, 34, 97, 27,231,130,134, -229, 51, 42,209,194, 64, 27,192,103,249,141,170, 20,139,223, 74, 94, 18, 84,178,206, 88,223,172, 43,108, 16, 16,136,254,105,236, -186,208, 96,153, 63, 27,208,234,221,187,119, 93, 74,177, 40, 25, 67,187, 97,128, 97, 78, 18,219, 96, 79, 87, 48, 36, 64, 11, 3, -182, 23,218,170, 31,192,127, 0,192,193, 91, 76, 28, 1,224,181, 31, 19, 87,212,234,238,102, 7, 59,151, 29,178,130,244, 0,158, - 3, 48,161,188,197, 98, 34, 0,109,204, 15, 11, 61,133, 30, 22, 50, 1,176, 97,122, 11,128, 16,128, 73,202,126, 39,180, 51,214, -166,197,226,236, 1, 65, 22, 23, 63,108,155,156,104,184,168, 0, 45, 5,188,227,251,105, 96, 95,201, 42,201, 50,162, 54,220,132, -186,126,203, 5, 4,193, 22,108, 70,149,190,206,246, 64,201,211,230,205,155, 21,169, 1,212, 60, 15, 1,180, 93,246, 77, 72,188, - 78, 58, 21, 1,107,110,192,102, 84, 81,249, 16,100,113,140,102,219, 50, 3,180,160,218, 18,168,179, 57,193,114,177, 34, 4, 69, - 80,245, 11,233,154,149, 64,145,209, 0,109,175, 85,208,166,165, 23, 18, 90,214,138,227,184, 67,201,180, 58,126,235,253, 55,216, -149, 66, 63, 27,128,214, 35, 44,132,181,166, 11,202,111,236,124,167,186,251,133,209, 55,162,111,188,167,225, 59,129, 22,164,172, - 4, 81,239,209,102,108,230, 6,184, 30, 30,117,244, 30, 11, 88, 37, 15, 85,138,144, 66, 17, 20, 57, 60,156,217,104,193, 60, 70, -105, 73,156,163,174, 93,187, 70, 59,199,183, 16,128,204, 6,160,157,201, 77, 45, 67,134, 12,225, 88, 74,187,210,127,195,161,235, -218,129, 86,254,162,221,117,168, 2, 45, 50,199, 72, 98, 71,167, 13,150, 43,110, 81,220, 76,187, 47,237,193,255, 4, 94,156,184, -237,223,195,107, 84,207,152,172, 1, 27,208, 34,216, 2, 82, 31,130, 65, 18,115,173,177,195, 94,117, 72,144, 85, 38,103,154, 71, -199,214,206,149,197, 45, 10, 75,197, 18,133,222, 3,233,143,163, 26, 17,171,170,135,223,198, 86, 0, 66, 43, 36,186,126, 48,122, -176, 67,167,197, 74, 34, 0, 3,227,102, 76,186, 99,142,237,223, 95,227,218,134, 85,181,222, 92, 57,223, 77, 94,189, 60,130,201, -253, 4, 6,148,203,200,231,114, 59, 44, 37, 76,156, 80, 57, 16,218, 39, 14,184,218,196,188, 70, 10, 72, 73, 22,235,115,217,178, -101, 10, 32,226, 64, 78,149, 1, 39, 10,190, 75, 5, 89,172,199, 16, 0, 45,155, 77, 22, 1, 28, 39, 33, 78, 62, 40,151, 41,160, - 69,240, 66, 87, 14,234,238, 61,124,155,178,109, 21,147,182, 2,224,180, 64, 6,149, 31, 34,160,197,221, 55, 4, 45,156,188,102, -204,152,161,148,145,106, 68,218,108, 25,225,163,154,135,101, 5, 63, 21, 64,136, 73,230, 21,193, 16, 37, 16,148,188,169,229, 37, -104, 34,152,197, 51, 39,245,104,163, 93,188,101, 29,176, 46,248,157,156,116, 89, 95,188,198, 73,144, 64,155,253, 74, 5,111,164, - 11,169,150,209, 65,248,179, 0,173,246,237,219, 55, 38,255, 48, 49,110,128,221, 70,125, 76, 24,111, 1, 88, 78,194,230, 75,177, - 7, 11, 9,208, 66, 61, 40,234, 9,237, 65, 64, 67,224, 74, 62,144,207,228, 43,119,204,233,241,148,247,157,209, 83,165, 81,228, - 47,121,105,148,158,245,157,180,201,122,204, 50,145, 14,193,208,188,121,243,100,232,208,161, 2, 0,200, 58, 49, 2,174,180,197, - 63, 77,128,197,177,146,101,225,102, 37, 26, 43,115,252,166, 20,151,198,245, 11, 23, 46, 20,216,223, 4, 2,220, 20,210,249,110, - 79, 71, 18, 45,218,188, 81,146,133,141, 0, 52,130, 86, 36,100,164,203, 77, 8,124, 47, 39, 77,163, 64, 11, 19,234, 51, 72, 96, - 21, 21, 23,109, 27,209, 79,149, 93,109,144,182, 11, 84,170, 33, 2, 90,248,166,136,232, 83,175,181, 32, 43, 36,210, 44, 35,109, -226,159,150, 7,125,255, 17,230,230,143,128, 22,249,137, 13, 33, 70,251, 56, 77, 76, 2,213,221,133, 85,170, 84, 17, 72,152,222, - 96,190,212, 10, 10,194, 96,225,242, 6,155,117, 20,160,197, 60, 51,103,206, 12,116,198, 15,103,187, 14, 71,141, 26,165,204, 65, - 28,227, 9,178, 0, 18,125,172,115, 90, 92, 0,237,247, 84, 79, 3, 55,156, 85,233, 90,165, 89,193,176,200, 63,173, 14, 92,148, - 71,223,189, 3, 31,214, 26,162, 17, 20,113,192,166, 90,194, 72,226,160, 6,134,185, 4, 69,164,201, 65,130,131,159,154,248, 31, -207, 41, 64,203,254, 61,159, 10,180,128,166, 71, 2, 32, 76,234,218,181,107, 94,163,149,165, 5, 90, 42,200, 58,185,105,161,236, - 24,209, 70,134,255,242,163, 20,200,252,221, 97, 12,236,255,183,221,130,241,188, 81,218,204,151,254,219, 40,217,178, 36,137,225, -211,165, 89,157, 64, 54, 64,128, 45, 11,108, 52, 22, 3, 88,237,199,196,248, 8, 60,191, 12, 73,214, 22,172, 2,105,200,158, 79, -143, 54, 58,204,102, 76,222, 23,213,132, 21,244, 61, 14,234, 92,121, 22, 43, 86,236,190,246, 30,243,234,209,227,125,172, 60, 55, -187, 82, 23, 66,202,115,145, 0,139,201,164,234, 80,145,102,241, 32, 56, 32,128, 99, 7,228, 97, 86,170, 69,240, 66,215, 14,116, -143, 64,131,120, 74, 6, 72,199, 19,244,153, 8,226,182,244,232, 97,251,111, 84, 90,164,242,135, 43,110, 78, 40, 52, 48,167,170, -135,229, 54,194, 59, 7,121, 82, 99, 96, 60,139, 65,229, 41, 19, 64,236,107,170,160,248,237,252,102, 26, 68,115,162,164,152, 30, -106, 43, 1,128,167,155,130,239, 93,189,139, 6,187, 52,162,174, 89,179,166,178, 26,101, 59,162,100,140,118, 94,172,123,130, 56, -138,250,105,119,193,223, 60, 48, 64,115, 53,106, 68,173,242, 89,128,150,213, 30,139, 82, 95, 65,249, 45,152,128, 95, 15, 28, 56, -176,230, 39,216,125, 41,192,232,241,211,231,178,255,200, 41,217,125,224,152,108,223,115, 68, 54,239, 56, 32,235,183,236,145,213, - 27,118,200,242, 53,224,243, 65,111,195,192, 72,165,119,208,235,140,236, 61,116, 66,118,238,243,146,109,187, 15,201,166,237,251, -100,221,230, 93,178,106,253,118,217,119,232,184, 97,122,214, 58, 76, 6, 27,178,155, 48, 45, 8, 98,123,162, 4,114,250,244,233, -194, 9,136,234,155, 16,180,169,141,104,247,111,104,227, 71,201, 24,199, 76, 74,181, 56,209, 66, 98,173,216, 42, 97, 76, 9, 4, -144, 61,106,128,246, 71, 54, 90, 0,228,138, 13, 25,182,226, 43,109,148,246, 94, 42,200,226,194,128,239,227,188, 0, 94,185, 92, - 84,171,239, 6,200,122, 6, 96, 74, 59, 34,186,224, 16, 74,136,243,228,201,163, 2,172,206,104,154, 4,217,102, 52, 1, 10,105, -128,172,215,148,140,169,160,237, 19,164, 89, 6,216,100, 46,139,222,206, 69,251,251,102,168,227,187,151, 67,202,244,145,234, 16, -187, 78,223, 64,234,110, 88,117,152, 46, 93,186,135,170,125, 22, 85,135,245,235,215,151, 82,165, 74, 13, 69, 89, 40, 48,248, 6, -194,137,161, 88, 8, 40,146, 50, 2, 45,170,250, 38, 77,154,100,216, 62, 81,245,163, 69, 91, 86, 74,151,233,163,203,222,143, 22, -164,195,143,104, 70, 2,233,241, 51,149, 7, 42, 6,249, 74,141,226,117, 37, 90,202,138, 72,251,113,152, 16, 20, 27, 45,174,152, -141, 36,130, 34, 61,160,165,210,164,157,130,154,248, 14, 2, 45, 78, 20,246,239,225, 53,116, 80, 67, 29, 90,211, 88, 21,137,150, - 10,178, 32, 18, 53, 12,178, 72, 67,171, 58, 44,155, 55,237, 77, 21,100,141,172,148, 70,242,167,142,255,128,224, 43,164, 64, 43, -195,183, 81,179, 22,203,148,226,217,241,117,115,101, 73,203, 34,210,165,105,237, 32, 24,249,100,196,107,135, 33,113,247, 26, 39, - 89,158,135, 32,197, 50,211, 1,213,188,148, 90,113, 98,165, 84, 7, 3,209, 63,210, 24,158,106, 46,174,236, 57,233, 50, 17,112, -240, 32, 96,176, 94,203,165,247,237, 88, 25,245,212,122,129,167,139, 4,210,160,148,199, 19, 52, 57, 89,240, 76,201, 14,207,102, -128, 22, 7, 23, 74, 31, 8, 82,104, 4,108, 45,147, 94,145, 28,221,207, 12, 99,232,251,148, 60, 80, 50,198,246, 77, 91, 5,250, -167,225,228, 72,187, 8, 26,154,178,204,234,125, 78,102, 24,120,184,251,236, 71,103, 47,228, 64, 13,181,150, 34, 97,164,132,129, -210, 2,149,151, 60,187,184,103,196, 46,230,179, 0, 45, 2, 42,170, 8, 41,209, 98, 25, 97,155, 49, 78,107,116,255, 41, 18, 45, - 74,175,168, 54,229,226,141,180, 57, 22, 81,186, 75,105, 15,249, 99, 84, 2,165, 74,180, 56, 38, 81, 93,204, 49,138,244, 88, 55, - 4, 27, 84,195, 18,224, 24,165,135,103,147,195,214,229, 42,202,102, 25, 57,114,228, 43,128,161, 32,210,224,110,190, 1, 3, 6, -132, 20,104,117,197, 66,236, 60,203,199, 93,144,148,142,141, 24, 49, 66,153, 8,185, 21,159, 46, 41, 58,116,232, 64, 31, 87,116, -253, 96,228, 8, 6,182, 8,250,105,231,200,114, 18,204,115,119,184,118,227, 6,251, 21, 15,163,234,115,240,234,153, 22,100, 65, -242,218, 19,143, 19, 96, 25, 1,253, 46,203, 15,144,245,154, 0,243,159, 4,178, 88, 96,189,157,139,246,247,141, 84,146,154, 7, - 32, 53, 41,164,141,207,105, 14, 64,192,138,133, 53,119,246,189,193, 98,240, 5, 54, 43, 24, 54,134,199, 24,183,155,188, 83,119, - 23,114,161, 71, 90, 0,194,175, 1,128,184,147, 83,145, 64, 18,100, 49, 15, 85,128, 88, 28,236, 54, 90, 86, 3,158,225, 35,162, - 12,239,184,163, 21,160,206,182,224, 80,113,200, 87, 10,180, 92,179,199, 17,138, 36, 40,226,100,195, 1,204, 72,226, 96,164,103, - 79, 69,154, 92, 13, 81,205,161, 38,254,199,115,129,124,222,254, 61,188, 22, 18,160, 5, 17,234, 88, 74,178,204,130, 44,114, 73, - 5, 90, 75,231,207,171, 93, 59,119, 50,217,208,183,142, 56, 5, 89,144,108, 49,191,145,198,151, 38,126,212,204, 0, 89, 79, 85, -224, 54,186,114, 90, 73,159, 40,170,145, 85,167, 17,242,182, 60, 88,169, 40, 64,139,252,197, 36,255,143,116,239,160,217, 93,104, -115,239,160, 1, 89,134,237,180,236, 24,163,216,155,112,114, 36,176, 98,219,217,222,171, 87, 72, 36, 90,138, 61, 13,193, 32,129, -214, 39,128, 44, 15, 72,178,230, 17,100, 65,114,243, 12, 0,248, 42,196,240, 55,171, 87,175, 30, 4, 53,154, 2,176,152, 56, 73, - 98, 75,189,178, 50, 39, 0,235,222,189,251,123,172, 76,131,208, 39,198,185,170,120, 72, 18,183, 19,104,193, 48,154, 64,107,191, - 54,175,171,123, 6, 26, 83, 89, 72, 67,139, 56,219,121, 8, 73, 97, 81,176,217,172,123, 7, 27, 77, 74,182, 96, 0,254,155,106, -171,197,247,132,144,166, 67,137, 22,236, 37,197,239,193, 35, 69,162,181, 98,237, 22,217,182,235,160, 97, 96,228, 72,162, 69,122, -247, 31, 62,182, 73,180,118,236, 57,100,148, 30,141,138,207, 99,179,131, 5,128,200,130, 29, 93, 22, 44, 14,174, 98,242,122,200, - 29, 87, 86,213, 97, 72, 36, 90,145,160, 22,244,130,189,223, 35,170,157,169, 38,164,159,175,230,205,155, 11,252,155,113, 50,188, - 1,147, 6,218,144, 25, 1,213,106,115, 32,216,242,132,221,216, 93, 76,122,175,217,135,160,203, 81,220, 58,208,173,133,125,178, - 2, 45, 67,155,148, 48,230, 63,163,250, 41, 52, 1,150, 90,104, 72, 98, 94, 83, 10,252, 95, 2, 90,252,118,184, 90, 72,214,163, - 71,143, 21, 0,239, 79,225,198,231, 57,230,239, 53,176, 85, 77,105,160,111,219,178,128,119,223, 1,152,191, 39,255,180,190,179, - 48,103, 16,248, 40, 54,116,234,117,130,248, 21, 43, 86,188,135, 77,161, 97, 32,103,160, 44,109,105,243,202,241, 11,210, 87, 70, - 86, 81,142,127,129, 68,203, 94,125,248,127, 86, 56,250, 56, 0, 28,197,158,138, 29,142, 46, 30, 28,117, 56,237, 53,138,197, 29, -236, 16, 12,230,120,141, 52, 9,172,180,207,169, 64,139,106, 15,251,119,240, 26, 6, 38,123,137,150,158, 51,183,134, 0, 89,147, - 77,130, 44, 27, 77,173,234,176, 96,198,148,167,106,100, 75, 40, 5,210, 36,184,251,145, 36,203,170, 62,116, 1,180,108, 52,211, - 39,140,150,161,120,166, 20, 79,180,210,177,156,201, 98, 60,165, 26,209, 64,131,212,102,209,251,118, 15,236,144, 83,220, 59,112, - 85,142,223, 95,139,195, 82,213,137,169, 97,135,165, 14,248,166, 0, 45,130,117, 74, 66,217,174, 8,152,180, 7,158, 57,105,247, -156, 35,126, 42,210, 44, 2,213, 16,130, 44, 27, 77, 76,220,215, 41,161,130,202, 68,217, 10,143, 1,172, 61, 1,160,253,193,107, -216, 96,161, 0, 59,128,164, 87, 60,227,217, 11,154,178, 58,116, 88, 10,233,208,118,136,229,119, 35, 95, 26,187,239, 74,229,226, -158,154,213, 97, 91,130,180, 37, 53,129, 20, 37, 76, 78, 18,239,165,119,210,110,191, 24, 77,190, 95,149, 64,105, 37, 90,106,212, - 10,218, 20, 82, 45,205, 29,152, 14, 36, 80, 14,203,233, 72,162,165, 58,235, 84, 37, 90,148,240, 56,145,104, 5,163, 9,240, 59, - 21, 32,251, 5,164,106,150, 41, 83,166, 88, 0,186,185,131,152,147, 97, 90,168, 80,238,113,146,129, 65,247, 13,157,254,239,172, -191,103, 4,152, 58, 14,176,118, 4, 99,183, 31,118, 5,190,129,253,204,109, 76,136,123,160, 34, 62, 14,154,148,146, 59, 59, 92, -141, 33, 9, 24, 38, 13,234,242,247,108,255,220, 17, 75,201, 25,219,167,170,150,230,156, 64,149, 37, 22, 2, 90, 87, 54,221,156, -189, 12,109,165, 67, 8, 37, 88,186, 99,157,134,118, 65,131,227,168, 46, 77,131,116, 92,142,201,122, 59, 23,237,239, 59,120,231, - 23, 41, 39,128, 86, 95,154, 31,148, 41, 83,198,161,179, 82, 74,178, 90,180,104,161,104,186, 32,125,119,228, 46,198,108, 57, 41, -197,164, 77,226, 32,188,251, 29, 85,211,191,254,250, 43,199,217,210, 42, 15,190,114,160,165,126,134,113,247, 55, 16,253,237,199, - 46, 19,152, 80,189,183,133,224, 97, 39, 83,147,234, 86, 95, 61,195,191,212, 59,187,206,199,151, 6,171, 8,210,196,234, 78,113, -216,168, 38, 78, 68, 24,148,222, 81,165, 66,112,160, 77, 48, 66,126,135, 1,138, 98,112,151, 13, 59, 4,157,195,254, 17,135, 64, - 11, 29,185,240,166,245, 43,171, 63,123,244,168, 56,127, 59, 76,206,109,180,108, 52, 51, 36,141,177,250, 24,212,133,180,243,162, -116, 44, 87,178, 24, 79,168, 70, 12, 65,185,117, 27, 54,196,190,155, 52,246, 83, 70,140,182,117,105,126,134,114, 58, 82, 27,232, -169, 11,245,202,121,146,192, 74, 77,170, 33,184, 73,160,165,170, 24, 67, 10,178,130,181,121, 74,180,224, 84,210, 38,209,130, 13, -205, 77, 12, 44,111, 40,209,194,106,241, 45,210,187, 78,157, 58,209,150, 42, 8, 18,175,135, 80, 25, 94,131,193,232,115, 7, 18, - 45,189,111, 15, 65, 21,125,253, 33, 78, 8,140, 30, 61,121, 38,135,143,157,149,131, 94,167,101,223, 97,132,203,129,173,214,142, -189, 71,100,203,206, 15,182, 90,235, 54,237, 48, 5,180,104,243,117,248,216, 57,208, 59, 3,219,175,147,178,231,224,113,216,106, - 29,149,173,187, 14,201,198,109,251,100,195,150,221,186, 64, 11, 96,231,103,168, 90,238, 64, 50,100,129,196,242, 49,198,189, 19, -168,160, 20,154, 74, 74,107,112,151,161,171,122, 87, 61,195,175, 3,221,211, 72, 60, 83, 93,168, 39,201,210,107, 75,209, 0, 36, - 15,170,187, 55,185,235,146, 26, 7,238,192,228, 14, 79, 38,170,166,241,158,168,154,239,113, 10,180, 66,210, 48,173,207,232,149, - 51, 36,164,191, 36, 77,189,157,139,246,247,191,216, 28,167,125, 17, 54, 59,244, 7,152, 10, 36,160, 34,232, 81, 93,122,208,197, - 7, 37,175,216, 16, 21,136,157,129,253,157, 48, 59, 24, 63,177,139, 49, 53,198,177, 50, 24,199,218, 32,141,133,233,202, 6,156, - 47, 33, 61, 98,130,170,243, 29,129,221,216,177, 99, 21,119, 33,220,113, 8,208, 57, 43, 36, 21,249,165,159, 57,155,253,131,230, -234, 76, 78,143,194,252,205,179,147, 50, 24, 7, 89, 86, 2,209,208,217, 14,170,157, 75,239,140,206, 71,219, 34,109,231, 11, 54, -233, 56,163,137,119,220,192,189,178, 60,219,191, 3,157,252, 48,238, 69,179,251,160,207,218, 89, 92,249,209, 10, 41,208,202,251, -125,172,115, 11,154, 23, 80, 65,214, 99,170, 17, 67,216, 80, 62,235,183,135,176, 76,142, 30,251, 59,202, 73,175,239, 39,117,146, -189,103,120,135, 18,173, 79,228,131,150,166, 98,163, 69, 99,122, 46, 40,152,184,160,128, 29, 4, 85, 70,180,193,250,232,190, 19, - 27,173,191,131,159, 33, 97,195, 23, 45,167,234,222,193, 58,249,219, 92, 49, 24,112,239,224,176,156,164, 71,240,166,210,211,186, -119,160, 65,175,234, 50,194,137,123, 7, 27, 77,184,223, 88, 13, 85,248, 61,168,132,175, 65,122, 69, 55, 22,246,227,162, 81,222, -126, 81,126, 26, 45,148,131,124,157, 63,225, 89,103,143,126, 45,223,254,213,151, 19, 0, 43, 21,212,145, 7,161, 5,122, 10,219, -209, 32, 72, 71,131,176, 65,235, 25,212,208,135,160, 46, 12,230,227,202,213, 92, 12,187,190, 52, 72, 21, 1,162,186,226, 60, 19, -105, 63,250,193, 67,117,231, 59,237, 38,185,185,130,234,110,170, 45, 65,139,174,139, 12,249, 34,228,123, 49,255,230, 70, 42,111, - 61,171,191, 75,168,215, 62, 67, 27,180,145, 84,129,150,253,217,238,157,250, 14, 75, 63, 83, 33,191,186, 70,232, 44,206,161,125, -220, 67,237,127, 39,188,179,125,123,218,132,209, 10,231, 73, 17,211, 27,187, 13,143,166, 75, 16,205,149, 88, 95,175, 26,190, 58, -126,234,125,144,137,251, 95,235,183,167,134,157,202, 92,110, 82, 96,194,239,217,248,102,237,174, 66,189,251,100,209,215,250,237, - 38,170,215,105,214,175,241,219, 83, 16,108, 81,178,245,137, 12,248, 90,190,157,238,109, 66,251,248, 90,190,253, 95, 85, 78,216, -144,134,101, 50, 88,153, 31, 73,180,176,176, 44,131,212, 6,105, 44,210, 6,164, 75, 72,143,152, 96,206,112, 25, 27, 1, 86,129, -246, 0, 36,179,110, 77, 8,180, 24,127,149, 90, 7,130, 45,219,111,245,154,193, 50,135, 40, 27, 1,150,154, 72, 64, 5, 92, 33, - 34,246, 25, 30,250, 87, 53, 66,147,252,113,127,187, 73,134,233,100,119,243,211,205,207,208,226,128,187, 45,133, 22, 39, 63,208, -169, 19,186,228, 20,106,238, 58, 10, 93,166,126, 45,252,116,250,213,127, 39,208, 50, 81, 21, 90,169,150,137,199, 62, 45,235,215, - 82,185,238,114,126, 90, 61,219, 63,237,230,167,155,159,161,197, 1,119, 91, 10, 45, 78,126,160,243, 57,248, 89, 54,116,139,248, -217,202,249, 57,190,221, 77,243, 51, 84,190, 35,146,127, 39,208, 82,109,179, 84,169,150, 19, 27, 45,123,251,172, 96,255,217, 80, - 28, 37, 51,236,115, 70,195,213,117, 61,250,110,154,142,235, 37,164,245,229,230,167,155,159, 70,219,128,187,111, 58,231,128, 81, - 30,106,243,253,211,249, 89, 3, 5, 52, 98,208,206, 60,218,212, 0,255, 9,178,220,227,124,200,230,208,127, 99, 91, 82,191, 73, -175,205,155,190,255,119, 2, 45,155, 49,124,118, 15, 79, 22,220,137,234,208, 37,208, 50,253,193, 38, 30,112,163,125, 19,204, 50, -144,213,205, 79, 3, 76, 50,145,197,205, 79, 19,204, 50,144,213,205, 79, 3, 76, 50,145,197,205, 79, 19,204, 50,144,213,205, 79, - 3, 76, 50,145,229,115,240,211,233,235, 1,180,138,194,207, 96, 15,100, 80,118,133,243,183,157,173,150,137,162,155,203,106, 80, -162, 69,162,110,213,161, 11,214,126,142, 6,227,166,105,174, 45,235,229,118,243, 83,143, 67,230,238,187,249,105,142, 95,122,185, -221,252,212,227,144,185,251,110,126,154,227,151, 94,238,175,133,159,174,128, 86, 68, 0,171, 60,170, 49,188,117,247,161,250, 63, -183, 30, 3,254,205,247, 93, 85,110,146, 48,225, 34,116,143, 24, 37,198,214,136,145,163,221, 83, 82,212,152, 91,195,225, 26, 24, -146,228, 83, 64, 17,188, 41,102,168, 20, 59,202,213,210, 49, 34,222,194,239, 60, 6, 24,236,176,156,213, 61, 60, 10,212,139, 24, -209,210, 20,126, 99, 28, 37,222, 99, 30, 39,244,191,150,134,237, 46,167,129, 6, 98, 34,139,155,159, 38,152,101, 32,171,155,159, - 6,152,100, 34,139,155,159, 38,152,101, 32,235,215,202,207,104,112, 61,114, 24, 62, 44,253,212,164,186, 48,225, 89,245,163,166, -158,225, 91,141,142,112,191,181,227,135,253,183,135, 6, 77, 3, 44,255,251,179,132, 72,117,168,137, 47, 84, 56,148, 63,193, 97, - 35, 12, 27, 62, 82,211,216,223, 38,122,208,178,235,144,160,177,179,214,200,170,237,199,100,213,182, 99, 50,102,230,106,105,213, -109,104, 80,188,132, 73, 30,132,143, 20,169,105, 72, 0, 76, 6,248,221, 42, 27, 61,210,147,135, 67,155,202,211,161,141,164, 76, -244, 8, 79,120, 77,231,187, 62, 42, 39, 1, 84,179,120,241, 2, 30,195, 43,190,253, 65,103,152,116,228,250, 8,177,249,154,197, -141, 27,224, 4,108,125,173, 29, 48, 52,154,192,191,229,219, 19, 33,176,234, 80, 12, 68, 71, 17,251,235, 1, 6, 32,111, 12, 78, - 35,192,160,164,159,178, 16, 8, 1,131,255, 45,252, 12,193,167,127, 22,227,109, 67,252, 76,151, 40, 90,193, 42, 63,103,188,157, - 39,117,188,213,105,147, 68,143,107,118, 12, 9,201,199,234, 76,100,161, 64,242,139,243,211, 85, 76, 67, 87,247, 12,213,145, 73, -134, 4,163, 9,167,177, 94,232,223,126, 76, 12,240,205,132,254,173, 36,122,255,103,178, 7, 33,184,118, 64,167,142, 82, 35,207, - 86,198,120,196,179, 46, 19,243, 48, 47,232,165,118, 65, 51, 6,202, 51, 26,249,238,106,129,144,179,223,204,199,252,160, 23,195, - 85, 57,145,231, 16, 98,175, 6,125, 52,185, 57,184, 64, 39,229,240,239, 23, 4,218,231, 63, 55,205,207,136, 69, 76, 54,149, 16, -101,119,109,163,245, 25,221,222,127,212, 89, 34, 68,142,190,166,112,233,234, 47,150,108, 60, 44,221,134,204,150,178,245,186, 73, -254,202,237,164, 96,213, 14, 82,177, 81, 47,233, 54,116,174,252,181,246,144, 20, 45, 91,195, 63,114,180, 88,107, 28,124,174,203, - 14,152, 39,106,184,193,187, 27, 20,122, 43, 51, 26,139, 76,171, 47, 59,106,230,121,203,107,102, 6, 73, 27,200, 66, 80,213,243, -155, 55, 75,187,196,137,165, 83,252,248,210, 11,146,173,129,137, 18,201,168, 36, 73,100, 26,226,119,221, 70, 40,138,251,240,112, -235, 4,108,125,246,129, 34, 68, 77,225,227,135,220,229,116,192, 72, 12,194,141,224,205,248, 33,131, 74, 51, 94, 33,195,250, 48, -184, 46,162, 21, 4, 33,158,228, 67, 12,206,205, 67,178, 16, 8, 97,157,185,235, 40,132,140,251,148, 58, 74,147, 32,218,244,103, -123, 39,201,249,121,237,229,231,180,241, 47,166,139, 23, 37,145, 27, 96, 59,228,128,179,246,233, 42,180,150, 94,216, 45,135, 52, - 35, 71,142, 76,103,191,193,130,168,219,255,135, 15, 51,103, 49, 36,131,209, 36,192, 98,191,230,194,153, 96,130, 81, 73, 24, 74, - 78, 13,187,196,123,106, 98,160,114,134, 36,130, 51, 91, 37,156,150,230, 8, 70, 19, 11,178, 45, 92,132,107, 15,210,119,150, 16, -243, 83,248,140, 51,154, 4, 77,158,158,158,194, 8, 19, 76,240,212, 46, 75,150, 44, 81,156,126,206,159, 63, 95, 70,143, 30,173, - 68, 89, 81, 35,170,176,252, 8,201, 20,104, 5, 91, 78,203, 9, 16,120,143,101,212, 11,173,199,184,180,204, 99, 13,149,199, 96, -247,159,149,230,103,196, 34,159, 52,130, 24,244, 12,159, 24, 47,209,218,104,241,255,255,143,207,248,113,193, 26, 33, 36, 89,141, - 11, 20,175,226,191,108,179,151, 84,110, 62, 68,210, 21,168,249, 17,126,206, 89,178,161,212,239, 60, 94,254, 90,119, 84,138, 85, -168,237, 31, 62, 82,148,198,174, 42, 87,123, 15,146,171,132,191,198,141, 26,240,102, 82,107,185,189,176,184,188,223,252,139,188, - 29, 81, 79,170,199,138, 20,192,123, 70, 6, 73,123,144,213, 49,110, 92, 89,129, 72,230,251, 99,199,150, 67,113,226,200, 81, 36, -111, 92,219,199,235,201,147,203,157,221,187,229,238,129, 3,142,192,150,203,201, 49, 90,180,104,199,173,177,206,204, 56, 48,253, -187, 39,220,140, 44, 51,203,110, 6,184,126, 82, 11,255,255,195,174,190,157, 13,218,209,234,152, 94,135, 19, 24,169,119,109,158, - 72,144,166, 54,110,220, 56,128, 3, 46, 3,247,210,179, 49, 67, 70, 48,222,157,143,143,143,220,185,115,135, 97,115, 94, 96,128, -108,231,128,182,171,114,134, 67,140,186, 89,244, 56,142,160,173, 1, 24,180,239,227, 93,127,129,198,167,132, 77, 9, 3,154,245, -225, 12,117, 85,145, 34, 69, 14, 33,174,226, 90,208,252, 13, 52, 25, 40,216,213,161,215,150,200, 83,238, 40,171,111, 77,197, 17, -135,209, 21, 47,249, 46,179, 52,139,133,144, 38, 37,212, 27,144, 78,234, 36,230,113, 36,205,214, 43,167,194,183,116,241,163, 84, -234, 92, 37,123,208,203,181,237,228,202,212, 58, 82, 44, 67,124,159, 12,137, 35, 39,119,194, 84, 67, 52, 77,246,133,175,153,166, - 2,164,120,240,140,164,141, 99,234,234,158,202, 34,135,223,142, 0,196, 65, 4, 22,206, 14, 2, 35,230, 49, 82, 71, 4, 90, 12, -217,181, 96,193, 2, 65,140, 79, 89,181,106,149,192, 43,186, 18, 76,123,215,174, 93,194, 69, 22,130,119, 43,177,126,207,158, 61, -171,128, 46, 61,160, 21, 53,106,212,103, 44,155, 10,204, 16, 48, 93, 9,116,143, 64,237,114,225,194, 5,101,252, 96,244, 7,254, -103,220, 76,142, 41,124,198,174,188,182,111,167,132,106,250,244,233, 82,173, 90, 53, 97,128,115,251,196,128,244,170,231,117,158, - 89, 86,190,143,207, 57,163,201,235,144,136,249,178,156,234, 51, 44, 7,191,145,101,100,176,250,107,215,174, 41, 11,203,219,183, -111, 11,193, 22, 1, 28,190,221, 37,208, 10, 13,154,159, 17,139,152,236,122,193,179, 27,244, 12,239,250, 29, 95,232,227,146,196, -136,157,224,193,194,117, 7,165, 65,143, 25,146,189, 76, 11,167,157,165,120,173,110,210,126,232, 10,153,189,234,160,196, 75,144, -228, 1, 74,239,202,102,203,246,113,249, 99, 68,248,235, 68,203,210,129,143,198, 86,150,115,155, 17,158,240,106,117,145,201,149, -197,171, 94,222,247,249, 98, 68,152,103,132,211,180,187,162,186,144,146, 44,130,172,149, 81,163,202, 6,164,221, 0, 91, 42,200, - 58, 16, 51,166,108,137, 22, 77, 14, 1,124,237,250,238, 59, 5,108,221,130,116,139,207, 26,121, 7,243, 80, 60,189,115,231, 78, - 65, 92,194,135,248,155,211,232,115,127, 99,190,156,217,178,101,123,196,193,136,101, 15,141,114, 96,117, 90, 13,160,237, 1,207, - 33,164, 71, 48, 49,224,183,223,126,243, 5,192, 96,144, 91,109, 56,135,112,188,134,123, 28,112, 60,145,244,128,135, 90,132,164, -136, 73,248,128, 32,139,131, 22, 3,159, 50,108, 4,174, 41,255, 57, 56,114, 16,226, 0,132, 32,209,108,155, 41, 13,150, 61, 2, - 84, 19,215,176, 18,125, 1,218, 22, 4,191,182, 60,124,248,208,130,152,120, 47,176,186,188, 1, 26,122, 96,203,209,107,194, 32, -100,204, 28,196, 15, 61,140, 21,167, 55, 2, 1,123, 99, 96,247,158, 51,103,206, 33, 92,159,143, 7,140,122,120,182,167,157, 29, -131,127,253, 46, 93,186,148, 70, 80,228,162, 76, 88, 57, 23,111,208,160, 65,213,126,253,250,229, 48,248,189,246,217,114, 2,152, -214, 35, 77,240,180, 24, 2, 23, 23, 65, 28,192, 18, 77,154, 52,169, 54,112,224,192,172, 38,105,110, 96,176,102, 72, 3, 94,160, - 30,252,145,158, 51, 1, 0, 63,195,164,240, 20, 18,200, 39,152,108,158,236,222,189,219, 31,116, 29, 73,197, 63,122, 93,186,132, -209, 90,118,168, 93,194,242, 71,227,114,210,163,126, 73,233, 90,187,176,116,170,254,147,116,171,145, 91,118, 14,170, 36,175,151, -212,145, 91,147,202, 75,153, 44,223, 62,203, 20, 55,186,105,175,214, 38,191,239,107,207,206, 69,143, 50,190, 19,104,172, 95,191, - 94, 11,182,108, 32,235,217,179,103,202, 36,206,188, 72,174,212,136, 54,126,160, 15,109,157, 52,105, 82, 16,251, 39, 37, 76, 80, -127,201,205,155, 55, 21,112,128,254,164, 0, 35,140, 41,246,161,182, 28,242,147,170, 66,130, 54, 21,100, 49,222, 31,203,178,104, -209, 34, 5,100,113,113,197,224,228, 4, 32, 12,244, 78,160,133,126,101, 47,209, 10, 70, 27,239, 86,128, 22,203,166,126, 59,226, - 9, 74,243,230,205,165, 87,175, 94, 74,252, 64,210,229, 56,194,128,231,164,207,103,156, 85, 56, 1, 19,226,159, 74,149, 42, 85, - 12, 1, 45,210, 99, 89, 29, 0,173, 96,175, 80, 65, 17,199, 52,130, 44,150,135,224,207, 17,200, 34,112,115, 2,180, 66,157,230, - 23,194, 34,166,251, 87,168,120,134,255, 18,122, 81, 24,190,119,107,210, 97, 96,208,208, 25,155,164, 88,163, 17,146,171, 92, 43, - 27,208,202, 94,188,129,228, 46,213,200,246,191,100,221,158,210,176,247, 2, 25, 53,111,183,180,232, 54, 60, 48, 92,132,200,186, - 62, 94, 16, 60, 48,205,239, 73,226, 90,222, 77,106, 46, 39,103,253, 44, 97,195,124, 16, 47,203,222, 95, 36,112, 96, 69,105, 18, - 63,122, 0,243,232,113,152, 70,239, 60,168, 46, 92, 9,112,181, 62, 74, 20,121, 7,177,177, 87,227,198,178, 15,255, 15, 32,241, - 55,175,109,143, 30, 93,206, 37, 72, 32,103,178,103, 87, 86, 17,191, 65,189,168, 71, 95,189, 79,253, 63,223,243,224,193, 3, 6, - 24,126,132,112, 29,133,140, 62,107,159,143,177,215,180, 70,141,206,126, 59,137,209,166,251, 90,150,173, 64,129, 2,143,249,141, - 4, 24, 44,187,238, 67, 58, 25, 32,222, 47, 83,171, 86, 45,140,181,207,184, 90,123,198,255, 38,105, 18, 56, 13,154, 58,117,234, - 19,242,209, 10,168,180, 18,151,196, 4, 96,188,199, 60,204,139,164, 11,182, 32,177, 27,200,213, 44, 7,111, 21,100,113,213, 23, - 33, 66, 4,101, 0, 99,172, 66,174, 74, 57,192, 99,128,166,221,194, 24, 35,229,134,148,105, 14, 65, 22, 1, 22, 6,110,203,249, -243,231, 45,160, 99,193,128,108, 25, 54,108,152, 63, 6,219,197, 70,232,104,243, 80,146,133, 73,236,240,243,231,207,189, 49,192, -122,227, 29,222, 24,188,189, 3, 2, 2,188, 49,160, 31,196,127,211, 1, 78, 65, 63, 49, 64, 86, 67, 76, 6, 69, 1, 88,138,104, - 19,190,189, 48,212, 18,117, 1,114,180, 1,146,141, 20, 59, 41,129,219,190,125,251,138,151, 40, 81, 98, 8, 0,215, 69, 38,252, - 30, 10,192, 85, 18, 64,177,222,158, 61,123,146, 25, 33,100,205,115, 18,188,243,119,180,194,215, 94, 67,223, 98,189,159, 68,114, - 21,175, 77, 33, 89,229,167, 31,238,190, 59, 58, 93,222, 29,154, 40,111,247, 14,151,183,219, 61,229,237,198, 78,242,122,213,239, -242,102, 67, 71,121,179,250,119,121, 61,171,180,248, 79, 41, 40, 45, 10, 38, 14, 76,255,109, 12,179,237,213,196,231,253, 43,178, - 42,128,138, 32,203, 14,108, 41,227, 43,129, 8,234,220,145,180, 75,239,227,179,195, 64, 59, 64,149, 24,169, 64,139, 82, 34,170, -236,114,231,206,253, 18, 4,180,210, 51,167,244, 8,180, 8, 32,168,146, 35, 0, 98, 31, 39,168, 33, 88, 81, 65,214,153, 51,103, - 20, 0, 66,201, 54,250, 21,129,214,109, 87, 5, 84,129, 22, 65, 31,218,181,252, 90,163,134,120,123,121,201,101,140, 29, 76,103, - 65,143,223, 77,112,195,247, 32, 30,160, 75,160, 69, 21, 96,195,134, 13,165, 93,187,118,210,166, 77, 27, 65, 76, 66,249,253,247, -223,133, 65,159, 49,190, 41,137,227, 18, 37, 81, 44, 43,129, 38,238,191,115,160, 58, 12, 86,108,240, 80, 25, 27, 89,142,162, 69, -139, 74,190,124,249,108,137,239, 96, 26, 62,124,184,108,223,190, 93,169, 63,242, 9,225,195,124, 93,125,187,150,102,155,232, 30, -242, 91,180,255, 39, 44,170,132,137,106, 79,190,211, 25,205, 47,129, 69,244, 26,216, 87,125, 63, 98,148,152, 91,134, 76, 94, 33, - 45,251,205,151, 82, 77,199, 72,145, 58,158,146,175, 18,108, 31,170,118,148, 66,213, 59, 75,225, 42, 45,109, 64,171, 76,253,222, -210,196,115,137,252, 49, 97,163, 12,155,182, 70,162,197,140,107,175,195,254,136, 23, 63,199, 10,191,227, 90,167, 95,130,238,141, - 43, 43,151,119,148,180,233,240,229, 26,164, 90, 83, 75,201,133, 6, 57,131,152, 71,143,137, 42,208,234, 8,208,116,128, 18, 43, -128, 41, 2,171, 32,116, 98,158,181,191, 79, 64,141,120, 13, 54, 91, 87, 51,101, 82,236,120, 26,127,251,173, 97,160, 69, 48,164, -138,110, 57,113,231,202,149,235,113, 8,192,134,242, 57,177, 99,199,190,193,129,198,213,193,251,204,167,247,253,246,247, 89, 38, - 68,116,127,202, 21, 36, 59, 49, 1, 8,203,110,150,142, 54, 63, 0, 64, 33, 76,136, 79,185,154,164, 26, 14,146, 24, 1,144,123, -194,235, 6,233, 6, 3, 89, 86, 32,229,233,224,217, 1, 42, 16, 51, 10,182,176,210, 59, 72, 48,121, 18,246,121,148,100, 17,100, -113, 69,203, 65,248,238,221,187, 98,177, 88, 20,123, 14,174,110, 41,217,194,192,123,204, 72,153, 49, 8,221,133,212,201,178,109, -219, 54,203,188,121,243, 44, 24, 80, 44,144,184, 88, 80, 47, 22,124,191,133,106, 68, 35,116,180,121, 32,101, 91, 73, 73, 22, 6, -107,111, 12, 96,222,184,167,156, 33,242,247, 6,128,245, 78,154, 52,233,122,179, 52,145,191,116,135, 14, 29, 74,219,131, 44,245, - 63, 6,245, 50, 0,139, 85, 77,210, 45,219,173, 91,183, 82,104, 71,253, 57,249,106, 19,193, 22, 64,103, 57, 12,188,149, 77,208, - 60,137,137,239, 25,128,171,207,138, 21, 43,124,214,174, 93,235,179,101,203, 22, 31,240,211, 7,117,230,131, 9,204, 7,117,230, - 3,154,143, 65,243, 36, 18, 3,120,187, 60, 96,143,213,182, 65,225, 52,111, 91,149, 73, 47,151,167,213,146, 55,203, 26, 40, 0, - 43,232,137,143,173, 91, 5, 61,186, 42,175, 23, 84,149,151, 99, 50, 72,221,156,177, 95,167,142, 19,199,222,224, 88,239, 53,159, -227, 62,183,181,239, 71,226,216,150,247,115,188,224, 19,104, 6, 3, 91, 27, 55,110, 84,120,201,254, 30, 66,144,165, 20, 5,227, -216, 62,244,231, 32,173, 68,139, 11, 86,246, 89, 44,148,246, 25, 45, 47, 37,243,236,207,156,220, 17,135, 79,105,151,136,201, 39, -144,220,115,241, 43, 57,115,230,228,184,204, 0,200,130, 54,170,244,125,163, 64,139, 0, 16, 49, 3,131,129, 44, 21,108,241, 76, - 30,112, 60,229, 24,227, 74,162,133, 50,133,150, 49,124, 48,182,168,160,136,146, 44,130, 44,218,129,169,137, 32, 72, 77, 4,113, -228, 51,109,180, 48,158,216,171, 14,157,210, 36,200, 90,255,237,255,147,118,110, 98, 93, 25,165,105,180, 46,191,116, 62, 39,187, - 14, 85,105,191,106,171, 21,220, 70,235, 75, 20, 18, 70,240,183, 23,172, 59, 44,191,118,156, 38,229,126, 31, 47,191,180,154, 40, -149,219, 78,145,138, 45,199, 74,161,170,237,108,245, 48,101,246, 18, 41,215,176,175,252, 62, 96,185,116, 26,185, 78,230,173,243, -150, 40,209, 99,187, 92, 69,192,254, 42,127,159,180,137, 45,239,198, 55,144,227, 11,126,150,151,103, 43, 7, 7, 90, 94, 21, 37, -168, 79, 17,233,150, 44, 38,109,181,242,187,250, 94, 21,104,245,132,100, 75,177,201,162, 61,150, 85,138, 69,176,165, 2,174, 99, - 0, 97, 4, 89, 55, 32,249,186,147, 57,179, 2, 24, 66, 2,180,118,236,216, 33,140,106,206, 85, 19, 86, 99, 79, 66,168, 70,203, - 8,187,159,251, 48,212, 86,196,209,246,137,215,121, 31,223,109,198, 30,204,131,101,161,212,137,157,140,171, 16,150,149,122,251, - 79, 4, 90, 57, 97, 75,244,152,198,155, 4,109, 44, 43, 65, 32,193, 38, 6, 57,163,106,212,190,118, 0,106, 23,190,109, 50,210, - 36,187,196,107,187,236,242,118,117, 85,255, 24,196,125, 57, 8, 16, 96,165, 73,147,198,161,209, 45,236,138,132,182, 29, 4, 91, - 88,229,221, 49,210,127, 50,102,204,232, 15,201,147, 5, 3, 58,213,203,182,132,231, 45, 48,148,181, 96, 0, 15, 48, 66, 71,155, - 39,127,254,252, 7,169, 46, 68, 61, 41, 32, 75, 77,144,116, 41,106, 68,148,243,136, 89,154,200, 95, 15,245,252,145, 52, 75, 5, - 90,152, 64,138,161,179,118, 54, 73,183, 62,213,143,224,237,105, 78,102,218, 68,201, 22, 36,165,208,243, 75, 39, 19, 52, 9,180, -158, 16,100, 65, 98,226, 3,155,154, 96, 32, 11,147,135, 15, 84, 32, 62,224, 1,219,211, 73, 36, 93,160,133, 60, 97, 50, 36,140, - 62,123,109,255,106,242,102, 77, 11,121, 61,191, 50, 64,214,117, 57,118,241,190,212,234,189, 94, 73,252, 29,248,224,130,188, 28, -154, 92,188,219,198, 19, 4,136, 39,112,252,187, 15,170,204, 85,158,158,248,187, 11,227,224,253, 10,216, 34,200,226, 2, 6, 32, - 93, 32,217, 12,137, 36, 75, 75, 58, 31,250,203, 11,130, 1, 2, 26, 26,148, 83,218, 4,201, 12,251, 85, 62,163, 60, 32,208, 98, - 31,222,180,105,147, 36, 75,150, 76, 41, 19, 1, 22,141,191,169,234,163,228,136,234,196,250,245,235, 43, 42, 53, 74,117,240, 94, -151,253, 93,149,104, 81,194,212,174,109, 91, 69,138, 69,186, 42,200, 82,127,115,225, 74,105, 22,121,161, 3,180,140,126,142,169, -124, 92,248,113,210,229,188,227, 10,104,145,175,148, 30,114,188, 6,208,210,147,104,217,104,186, 2, 90,124,175, 81,154,166, 62, -234,239,207,172,106, 16,236,207, 31, 74, 6, 68, 95,216, 42,178, 43,252,185,202, 10, 63, 89,119,184,155,176, 78,151, 25, 0, 89, -147,164, 74,187,169, 82,189,227,116, 41, 90,179,155,156, 56,125, 65, 1, 90, 83,102, 47,149,242,141, 62,128,172, 86,131, 87, 73, -215, 49, 27,101,222,250, 99, 18, 37, 90,108,151,141,187, 72,172, 8,231,238,253, 81, 85,110, 79, 40, 33, 62,187, 75, 11,165, 88, -234,224,163, 72,180,152,102, 23,147, 91,245, 51, 10,243,186,250, 70, 21,104,245, 7,128, 34,200, 58, 22, 47,158, 77, 93,168, 5, - 90,148,102, 17,100,221,198, 14,196,219,144,104,177,179,155, 1, 90,220,158,203,111,230,138,134,137,171, 49,138,171,233, 70, 32, -132,117,144, 19, 29,225,193,193,131, 7, 21,245,150,154,248,159,215, 65,211,180, 29, 24,203, 66,213, 30, 7, 13,181,156, 4, 71, - 44,123, 8,203,152, 49, 79,158, 60,143, 8,220,168,134,212,150,147,252, 35,152, 75,145, 34,133, 46, 32,140, 18, 37,202, 73,151, -226, 59, 23, 55,241, 44, 87,255, 78, 15, 12, 64,135, 9,252,184,130,165, 36,139,223,203, 1, 29,146, 61,101, 48,231,193, 29, 68, - 28,120,104, 95, 2,222,158, 52,194, 11, 14,108,170,218,144,146, 44, 53, 81,125,200,235, 86, 32,108,132,148, 45, 79,202,148, 41, - 87, 2, 20,122, 99,176,244,198,100,161, 0, 45,216,208,121, 3,244, 43, 64, 11,147,194, 58, 83, 4, 63,100,174,141,178, 5, 83, - 25,106,165, 91, 86, 80, 68, 53,172,153,163, 14,109,178, 92, 0,173, 18, 96,235, 64, 19, 4, 79,162,142, 30,169, 32, 11,210, 17, -155, 36,139, 32, 11,247,124,208,158,124, 0,108,217,238, 89, 63,122, 64,235, 3,200,250,179, 50, 84,132, 45,228,233,244, 82,176, -201,170,171,212, 53, 1, 86,198,218,115,148,196,223, 60, 94,142,207, 38,150, 62,145,165,232, 15,209, 93,142, 37, 38,190,231, 83, -178,158, 82,199, 58,156,189, 62,133,208,103,122,214,102,147,197,126, 68, 41, 54,199, 36,107,153, 13,169,248, 28,149,139,102, 16, - 51,102,204, 80,128, 22,199, 18, 46,140, 48, 94,153,250,126, 2, 45,180, 17, 69, 61, 54,107,214, 44, 69,106, 93,174, 92, 57, 69, - 82,205,126, 79, 9, 54,105, 83, 2,195,178,115,220, 50, 3,180,168,134,116, 5,180, 56,166,162,175,233, 1,173, 24,248,214,209, - 40,171, 33,247, 14,204,199,252,224,153, 75,105,107,130, 4, 9,238,176, 45,115, 12,214, 3, 90, 4,133,172, 55, 44, 18, 93, 2, - 45, 45, 77, 61,160,229,140,230,151,192, 34, 33,105,231,170,103,120, 53,198,161, 19,137,150,189, 36, 43,184,233,198,151, 48, 64, -139, 20, 53,230,182, 65,147,150, 75,187,193, 75,172, 32,107,134,212,236, 50, 75, 74,212,166, 23,253, 15, 71,249, 70,158,210, 2, - 32,171, 53, 64, 86,187, 97,107,165,255,180,157, 50,108,250, 58,137, 17, 43,238, 54,103,204,201, 28,214,163,234,132,188,169, 95, -190, 25, 93, 83,142, 47, 45, 40,111, 46, 86,117, 12,180,206, 84, 22,233,158, 67,134,166,142,105,225, 51,206,232, 17,104,113, 34, - 29,145, 52,169, 2,178, 14,197,138,229, 80,117,232, 13, 53,226, 89,220, 87,129, 22, 37, 50,102,128, 22, 29,193,241,155, 85,233, - 19,237,129, 96,188,253, 40,132, 18, 45,229,115,168,122,131, 58,233, 33,197,193, 28, 36,120,230,127, 19, 42,185, 96,108, 97, 89, - 88, 38,150, 77, 45, 39, 87,165, 44,123, 72, 26, 43,236,153,110, 16,188, 16,188,177,124,246,137,131, 38, 36, 31,180, 1,187,161, - 67,223,243, 19, 36, 90, 29, 93,209,198, 78,164, 33, 80, 69, 5,113,160, 37,192,228, 64, 68,149, 1,129, 22, 87,180, 44, 59, 1, - 23,129, 22,242, 9, 6,151,241, 70,120,129, 58,152, 59,114,228, 72, 44,160, 95, 40,192,138,103,208,176,160, 9, 88,218,183,111, - 31, 82, 27,173,198, 83,166, 76, 57,132, 65,203, 27, 54, 33,138,141, 22,218,161, 55,104,122,119,238,220,249, 0, 64,101, 11, 35, -101,179,203,147, 31,246, 42,197,157,169, 14, 81,110,116, 48,105,107,146,238,207,164,233, 76,117,136,242, 99, 37, 36,173, 76,208, - 36,208,122, 73, 97,152, 73, 0, 0, 13, 65, 73, 68, 65, 84, 72, 73, 22, 65, 22, 64,156, 15,140,122,125, 0,142,125, 48, 73, 42, - 32, 11, 19,164, 15,234,141,237, 84, 15,104, 41, 32,107,157,103, 69,121,179,242, 55, 89,218, 26, 32,106, 98,110,121, 61,239, 23, -231, 64,107, 76, 70,121, 57,224, 91,169,157, 43, 14,141,237,255,238,163,136,245, 27,175,224, 92,244,239, 46,140,221,251,109, 32, -139, 54, 75, 28, 71, 8,178,120,132,130, 84,171, 40, 38,254, 23, 52,217, 32, 88, 42, 85,170, 20,165, 89,166,190,159,182,166,236, -207, 84, 99, 18,244, 64,189,173, 0, 64,218, 86,113,177,197, 49,128,139, 41,130, 44,190,131, 96, 3, 64,203,126, 55, 95,176, 79, - 86, 37, 90, 4,107, 4,111,231, 48,222,105, 85,134,252,125, 29,247, 56,134, 16,100, 17,228,185,146,104, 17, 52, 45, 95,190, 28, - 2,244,192,143,150,143,188,166,117, 75,193,113,138,223,131,177, 49,208, 10,182,156, 54, 7, 21, 20,209,246,140,246, 88, 90,117, -161, 86,141, 72,108,192,177,142,239, 50, 10,180, 72,147,246, 88,218, 67,171, 70, 60,221,169,153, 83,154, 95, 2,139,132,164,143, -132,218,174, 67,213, 8, 45, 36,133, 48,242, 12, 61,190,255,214, 97, 96,224,136,217,219,164, 70,199, 25, 82,171,203,108,169,219, -125,158,148,170,251,135,100, 47, 92, 77,114, 20,169, 46, 21,155,244,147,214, 67, 86, 75,187,225,107,165,211,168, 13, 50, 97,201, - 33,105,217,125,100, 96,132, 8,145,233, 45,254,163,163, 48,118,170,148,138, 30,241,222, 83,207,106,114,125, 82, 17,185,179,191, -236, 7,233,149,179,180,176,136, 60,168,155, 74, 74, 70,139,112,143,207, 58,162, 73,160, 69,163,202,169,240,147,181, 31, 64,106, - 43,118, 23,170,198,240, 84, 23, 82,146, 69,144,197,107,220,137,168, 0, 45,232,241,217,177,204, 0, 45, 52,116, 5,104,113, 34, -231,224, 3, 53,207,195,144,218,104,105,191, 3,147,107, 25,168,224, 30, 17, 36,240,204,255, 70,234,199, 89, 30,150,137,101, 83, - 37,101, 28,216, 88,246,144,208,132,202,209,139,174, 13,244, 18,243,233,208,119,100,163, 53,192,193, 51,246,128,204,136, 65,124, - 10,238, 58,164, 42,152,106, 82, 14,182, 28,204, 50, 65,106,201,129, 86, 5, 89, 92,221, 2,132, 82, 98, 98,239,108,208, 89,209, - 35, 1,196,221, 24, 48, 96, 0,119,201, 89,184,243, 16,180, 21,144,133,235, 55,241, 80,136,118, 29, 2,244,254, 5,163,213,131, -148,108,169, 59, 15, 9,178,176,178,165,113,189,161,157, 92,218, 2, 99,117, 27,191, 99,199,142, 85, 49,209,124, 36,213,194, 96, - 92, 20, 77,118, 40, 18, 52,240,198, 15,168, 99, 18,117,234,212,169, 10,108,167,138,217, 27,195, 67, 26, 7, 17,180,112, 84,214, -147, 58,105, 95,120, 18,253,237, 62, 38,110, 31, 72,129,125, 32, 13,182,129, 44,212,155, 15, 36, 16,148,102,249, 96,130,160, 77, -201, 73, 36,167,180,211, 39,138, 58,104, 93,159,242,138, 77,214,146,150,153, 37, 67,194,168,231, 79,117,255, 78, 94, 14, 75, 41, -129,247,207,125,172, 58,244, 59, 13,105, 86, 36, 9, 24,241,163,228,253, 62,246, 5,227, 92,248,207,229, 12, 6,178,184,195, 26, - 28, 80, 18, 65, 86,104,128, 45,244,155, 51,244, 39,197, 29,130,176,205, 58, 99,150,195, 4, 90, 52, 19,224,216, 70, 53, 30, 23, -147, 4, 62, 28,147,217,247, 9,178, 8, 16, 9, 94, 40,129, 33,216, 48, 10,180,104,219, 68, 41, 27,205, 66,174, 64,237,168,130, - 45, 21,100,113,183, 31,223, 5,219, 66, 61, 99,248,187,124, 47,203, 6,255,125,193, 92, 57,104,221, 58,240, 55,239, 83, 51, 66, - 9, 28, 37, 91,174,248, 1,155,208,219,172, 3,142,111,122, 64, 75,245, 11, 6,109,131, 75,137,150,150,166, 30,208,114, 70, 83, - 99, 12,111,216,222,217,108,189,135, 36,191, 86,130,165,238, 64,116, 64, 71,235, 67, 75,253,253,255,108, 95, 8, 69, 38,137,243, -109,226,251, 51,150,237,133,235,134,229, 82,175,199, 60,105,216,107,129,148,109,208,199, 6,124,171, 52, 27, 32,237,135,175, 83, - 64, 86,191,233, 59,101,214,170,163, 18, 63, 81,114, 78,234, 14,221, 59,100, 15, 31,166,245,178,210,153, 94,189, 28, 81, 81, 78, -172, 42, 44,239, 47, 87,179,129, 44,181, 83, 7, 3, 93,148,118,245,200, 34,115,179,197,125,201,103, 29, 49,156, 46, 26, 30,162, -211,221,194,106, 99, 25, 12, 36,233,194, 97, 27, 12,226,143, 3, 96, 93,183,218,100,157,135,209,251,110,184,120,184, 8,131,249, -219,104,220, 62,176,129, 58, 7,228,111,198,189,131, 10,180,216,193, 97, 31,240, 32,164, 82, 39, 71,223,128, 21, 82, 53,168,105, - 30,240, 28,146, 70,101,255, 12,203,198, 50,178,172, 92,249,132, 20,104,133, 70, 89, 52, 52,236,119, 29,114, 16,208, 26, 31, 38, -224, 78, 68, 54, 46,163,134,240, 42,109,240,173, 77,141, 26, 53, 8,136, 20,213, 1,237, 56, 56,216,169, 78, 1, 57,232,194,118, -205, 31, 60,118,105,239,229,224,123, 35,208,111, 22,109,220,192,195, 0,158, 33, 53, 36, 32, 10, 9,200, 82,201,135, 1,205, 70, -152, 0,214, 66,141,121, 4, 32, 22, 27,101,163,176,147,155, 6, 89, 42,193,137, 19, 39,102,197,228, 83, 27,223, 95, 22,147, 76, - 49,240,160, 36,120, 64,169,211, 16,164,138, 33,169,199,201,147, 39,103, 35, 77, 0,164,178,104, 67,197, 33,213, 43, 1,154,191, -130,175,195, 40,204, 54, 73,147,187, 14,239,193,152, 88, 1, 89, 88, 84,248, 96, 21,237, 3, 9, 41, 13,224, 21,144, 5,208,233, - 3,128,204,201,198, 37,208,170,144, 37,254,189,215,243, 43,201,146,223,211, 19,100,205, 78,155, 32, 74,249, 62, 37, 98,138,229, -207,152,242,106,124, 86, 9, 4,176, 82, 15,254,126, 53, 46, 11,108,180,146,201,166,246, 25, 36,109,194,168,195, 77,150,251,191, -146,221,230,222,129,147,190, 6,100, 17,124, 41, 0, 76, 5, 91, 4, 8,214,177, 58, 36,237,181, 68,152, 48, 97,222, 51,129,134, -105,159, 99,236,127, 52, 74,231,184, 70,128, 66, 13,128, 10,178, 40,109, 87, 65, 22, 37, 69,170,239, 46,163, 64,139,166, 7, 52, -133, 80,141,232, 57,102,144, 14, 23,106, 42,200,162,237, 44,165,103,174, 36, 90, 52,211,160,134,133, 32,202, 8,208, 98, 30,142, - 89,122,230, 29, 42, 40,226,130,146,187, 11, 93, 73,180,212,246, 15,160,101, 8,188,145, 38,119, 23,186,146,104, 57,163,249,133, -176,200,223,211, 15,191,212,199,193,249,104,211,159, 75, 85,247,159,179,250,176,116, 26,177, 90,126,235,187, 88, 42, 52,246,180, -213, 71,181,223, 7, 73,231,209, 27,165,255,244, 93, 50,119,253, 9, 41, 89,177,222,243, 72, 81,162, 55,117,198,149,202,113, 35, -157,121,218,167,138,188, 95, 88, 82, 94, 95,159, 44,114,111,177,126,218,208, 72, 30,214, 78, 37,149,226, 68,116,184, 2, 82, 28, -150, 34,172,142,223,225,195,114, 11,171,176,157, 48,124, 62, 15, 23, 14, 4, 89, 55, 85,155, 44, 74,177,152, 84,144,133, 45,204, - 77, 99,199,118, 22,138,199, 97,241, 41,213, 97, 71,134, 49, 52,109,146, 76,219, 79,253, 13, 45, 37, 39,203,202,193,131,101,255, - 27,222,239,232,149, 4, 91,158, 4, 84, 86, 63, 90,218,193, 58,130,213,143, 22, 1, 24,165, 93,186,174, 29,180, 47,128,232,189, - 13,252,100, 61,228,128, 65, 81, 56, 7, 73, 74,243,216, 87, 32,241,122,132, 65,218,140,241,246, 63,132, 93,198,139,129, 9, 39, - 41,128, 37, 86, 46, 66,221, 62,165, 88,237, 77, 74,157, 62,122,153,149, 38, 1, 27,105, 18, 96,181, 13, 33,205, 13,112,173,241, - 24, 82,135,251,152, 16,161,113,246,243, 3,112,187, 7,128,229,139,122,242, 69,185,239, 50,193, 88,158,187, 14,185, 27,207,169, - 68, 11,254,179, 90, 85,207, 30,239, 14, 36, 91, 99,173,109,228, 27, 0,168,205, 43,235,196, 16, 75,255,184, 98,233, 23, 83, 94, -142,205,172, 36,203,128,120,216,113,152, 81, 46, 13,254, 73,242,124, 23,203, 55,117,194,104,223, 26,231,232,127, 46,167, 2,168, - 52,126,178, 62,114, 88,170, 1, 89, 33,182,213,250, 20,174, 18,104,209, 56,159, 46, 65, 88, 78, 61,119, 33,156,168, 0,180, 92, - 74,117, 84,135,165, 28, 39, 9,168,248,141, 80,109, 43,246,183,148,156,209,117, 12,118, 30, 51,194,132, 2,178,224, 46,197,145, -195, 82,219,103, 81, 50, 69,147, 5,163, 18, 45,190,147,210, 56, 61,137, 22,119, 79,242,123, 56,166, 81,178, 70, 9, 28, 65, 32, -147, 86,170,132, 62,100,155,159,245,128,150,150, 38,191,159, 32, 91, 61,168, 46, 84,211,241,230,181,157,210,252, 82, 88,228, 83, -218,141,139,103, 93, 75,180, 62,211, 75, 29,146,133,173,214,166,159, 75, 86,123, 49,125,217,126, 25,245,215, 30,105,211,111,174, -252,218,106,176,212,106, 61, 84, 58, 13, 89, 40,227, 23, 31,146,153,171,142, 72,225, 50, 53, 94, 68,143, 17,103,147,171,178,149, -143, 21,225,192,149, 38, 69,131,100, 72, 37,145, 1,229, 68,254, 44, 41,210,187,136,200, 31, 5, 68,186, 33,168,119,167,236,152, - 30, 50, 97, 56, 79, 31, 44,157, 41,154, 40,136,207, 58,163,173,130, 45, 95,216, 11,221, 65,199, 56,137,237,190, 87,160, 58,226, -238, 66, 26,190, 43, 9,234, 66, 69,146, 21, 2,144,197,247, 98,197,225, 5,181,207, 13,252, 52,181, 19,240, 75,214,149,131,119, -101,100,153, 89,246,191,185, 28,246,175,167,255, 44,173,179, 82,245, 62,129,215,167,108,177,253, 14,223, 59, 13,192,242, 44,165, -120, 88, 5, 2,115, 39,152, 1,154, 63,252,195,190,255,191, 86, 28,213, 51, 60, 85,119,174,210,110,220,207,130,244,157, 25, 6, -101, 5,202, 78,155, 32,234,206,110,197,177, 25,166, 91, 42,121, 54, 6,118, 91,147,242,201,229,193,185,101, 98,221, 52,146, 45, - 73,140,155,105,226, 71,133, 91, 62,247,161,195, 1, 5,108, 33, 57, 2, 82,174,238,125, 17,198, 66,117,120, 24,210,172, 64, 74, -181,168, 66,164, 29, 22,119,195, 17,108, 80, 2, 69, 9, 54,205, 6,212, 3, 54, 85,239, 48, 22,112,151,167,211,131,225,116,104, -175, 75,192, 67, 73, 25, 65, 22,237, 78,105, 7, 70,201,158, 10,178,232, 95,140, 32,139, 94,233, 29,132,224,177,209,167,173, 21, -188,213, 7, 82,125,201,178,241,204,242, 82, 2, 69, 32, 67,233, 21,193, 18, 37,112,148,192,211,132,165,111,223,190,186, 54, 90, -116,188,202,239, 34, 13,130, 77,210,165,228, 94,253,110,251, 48, 66,204,139,205, 55, 46, 37, 90,159,131,230, 23,105, 8,161,255, -146,144,248, 47, 12,253, 82,132,143, 18,165, 85,220, 4, 73, 31, 52,235, 52, 36,104,240,228, 85, 50,123,141,151,204, 89,115, 76, -134, 76, 89, 35,191,119, 25, 22, 20, 63, 81,138, 7, 81,162, 68,211, 53,142,133,161, 72,234, 10, 49, 35, 28,175, 22, 45,194,203, -106, 81,195,127, 72, 81,194,217, 82,213,200, 97, 95,218,167, 42,184, 86, 62, 70,248, 99,124,214,213,151,169, 96,139, 30,223,217, -152,185,226,161, 72,148, 58,109,118, 36, 54,104,170, 11,205, 74,178, 66,159,155,110,138,110, 14,252,103, 57, 64, 71,164,148, 86, -185, 74, 4, 89, 33, 81, 75,125, 3,247, 13, 53,211, 38,136,182, 50,125,130, 40, 87, 51, 38,140,122, 27,224,107, 91,218,248, 81, - 59,231, 72,236, 17,229, 63,203,113,243, 31, 30,210,160,210,230,223,100,254,137,104, 4, 91,220,220,195,196,197,148,214,126, 20, - 11, 43, 46,174,252, 0, 32,148,132,123,135,240,138,168, 58,175, 73, 77,224, 68,201, 22, 85,130,174, 18,243, 88, 65,150,171,185, -232,179,236, 58,132, 52,239,138,118, 23, 53, 77, 35,212, 68, 85,165,253, 65,137, 23,120,225,227,234,219, 63, 7, 77,243, 85,250, -101,158,112,178,235,240,159, 35,209,210,176, 33, 73,132, 72,209,123, 70,143, 19,127, 71,212,232,113,124,163,198,136,227, 27, 51, -110,130, 29, 80, 21,246, 68, 30, 67, 33,119, 62, 55, 75, 9,182,104,119, 69,143,239, 52,116,183, 79,188,199, 60,159,187, 28,110, -250,110, 14,184, 57,224,230,128,155, 3,110, 14,132, 34, 7,210,114,119,183, 10, 44, 85, 80,169, 5,150, 42,192,228, 25, 64,148, - 32, 75, 47,244,212,231,160, 25,138,159,252, 21,145, 82,117,168, 6,139,108,200, 64,209,164,219,253,191,149,166,193,239,102, 54, -179,229, 52,178,203,194, 40, 77,213, 47,154,167,129,242, 26,165,105,211,221,135, 34, 77, 51,254,219,140,150, 51, 84,105,106,108, - 6,140,210,213, 45,167,182, 15, 25,236, 79,134,105,154,232, 75,127, 59, 77, 3,237,200, 80, 63,210,218,117, 24,220, 61,109,230, -219,141,246, 37, 51, 52,141,246, 37, 51, 52, 67,189,125,154,240,105,228,178,156,246,109,210, 32, 93, 83, 52,217, 80, 12,244, 37, - 83, 52, 13,246,165,127, 4, 77, 3,125, 41,164,229,116, 53, 47, 25,106,159, 90, 31,157,154,186, 55, 50, 55, 25,248,172, 47,155, - 69,221,113,168,250,211,178,123,123,232,168, 12, 13, 14, 98,218,119,235, 86,132, 54,179,129,142, 98,104,224,253, 92, 52, 77, 26, -234, 25,250,118,131,223,172,126,210,223, 70, 83, 45,128,193,242, 26, 45,231,110,235, 0,169,156,117, 14,163, 52,149,129, 33, 52, -202,169,109,239, 38,234,222,208,128,166,150, 49,180,203,105,162,158, 12,151,243,115,208,252, 92,252,212,107, 68,214,251,134,191, -221, 96,253,232,142, 75,142,198, 78, 3,180,205,148,211,104, 95, 50, 67,211,104, 95, 10, 81,223,212,249,126,211, 52, 63,149,159, -206,218,121,104,150,211, 96, 95, 50,253,237, 6,198,188, 16,209, 12,141, 49, 89, 91, 54, 3,117,100,176, 11,255,189,217, 62,187, -234,208, 36,163, 12, 85,174,102,210, 41,108,128,125,166,104, 26,160,167, 59, 72,106, 59,135, 9,176,105,168,156, 6, 87, 77,166, -129,150,118, 21, 17,154,157,133, 43, 18, 3, 60, 53,250,237, 70, 87,225,102,234, 72,165, 25, 42, 18, 66,123, 64, 96,160,253,235, -126,187,150,134, 1,122,134,190,221,158,166,129,122,250, 91,203,169,105,247,122,245,100,184,156, 38,250,210,223, 74,211,196,120, -103,166,156, 70,251, 82, 72,104,134, 74, 29,169,109,210, 90, 79,158,159, 10, 96,236,199, 56, 3,125,201,208,183,107,251,142,129, -113, 52, 68, 52, 63,117, 76,214,150,203, 96, 95, 50, 85, 78,131,125, 73,151,166,125, 91, 55, 72,215,192, 20,243,247,100,249, 34, - 18, 45, 3,168,217,254,235, 13, 87,132, 9,182, 25,162,105,112,229, 96, 10,192,124, 45, 52, 77, 72, 11, 12, 77,226, 38,191,219, - 48,205,207, 85, 78, 19,237, 84,183, 45,125,109, 64,203,192,100, 99,184,205,219,211, 50, 64,219, 48, 63, 77,180,169,191,149,166, -137, 54,106,170,156, 6,120,105,168, 31,125,238,246,105,176, 47,233, 74,201,180,227,187, 65,158,154,162,249, 57,203,249, 41,160, -200, 89, 61,127, 10,200,252, 90,104, 58,170, 19,131,117,111, 2, 14,252, 75,179, 26, 28, 32, 12, 15,230, 26,196,171,216, 45, 24, - 96,155,238,128,102, 71,179,112,104,209, 52, 49, 57, 24, 26, 36, 63, 87, 57,185, 34, 51,176, 18, 51, 85, 71, 6, 7, 50, 83, 52, - 63, 71, 57, 65, 83, 89, 41,107, 87,165, 46,234, 95,183, 45,105, 6, 6,163, 60, 53, 76,211, 4, 79, 13,211, 52,184,186, 53,212, - 62,181,131,162, 65,158, 26, 46,167,137,190,100,152,166,137,213,178, 25,154, 95, 75,189,135,122, 57, 77,244, 37, 93, 80,164,214, -141,181,205, 27, 41,171, 41,154, 6,251,146, 41,154, 6,251, 82, 72,105,186,154,151, 76,209, 52,216,151, 76,209, 52,216,151, 12, -245,163, 16,212,189,129, 41,251,235,202,242, 63,238, 43,130, 14,110,207,192,132, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, +215, 73,134,119,140, 26, 64,149,161,147, 93,135, 90, 62,124, 3,163,246,170, 48,242,166, 75, 25, 27, 32,137,149,210, 35,214,183, +153,195, 95, 30,112, 42,135, 2,178, 42, 15, 72, 70,144,197,157,192,105,244,250, 57,218,228, 20,238,126, 38, 40,196,194,251,144, +230,101,142,128,150, 71,190,124,249,206, 80, 35,194, 29,137,200, 59,220, 81, 37, 97, 51,206, 22,128,103, 5,100, 81, 93,216, 5, +234,194,122,237, 27, 4,157,247, 57, 38,253,167,253, 38,143,159,191,149,203,119, 2,100,231, 73, 63,169,208, 40,151,148,173,149, + 86,102, 45, 26, 37,229,106, 21,121,111, 85, 35,126, 68, 54,242,247, 30,201,241,237,203,226,101, 12,115, 57, 94,250,176, 15,211, + 21, 78,252, 42, 75,201,148,175,138, 87,207,251,108,197,218, 37,231, 9,176,126,254,249,103, 5,104,237,221,187,247,192, 15,121, + 18, 91,122, 93, 76, 42, 35,175,229,151,168, 73,195,220,208,107,171, 95,240,126,101,238, 8,132,224,131,166, 22, 41,153,184, 99, +208, 10,138,248,223,217,193,123,163,145, 86, 91,211, 6,156,233, 22,226,140, 34, 37,181, 51,174, 39,168,183,238, 68,252,130,159, +246,213,189, 74,181,133,164, 36,149, 38, 84, 31,185,119, 40,162, 53,134,231,231, 37,140, 22,237,153, 31,182,226,250, 20, 46,172, +128,168,148, 41, 83, 62,193,101,173,193, 98,158, 18, 37, 74, 60,247,235,218, 85,174,229,201,243, 1,140,197,142,109,191, 43,193, + 33,167,140, 0, 45,168, 63, 12, 1,173,152,113, 61,110, 61,120, 63, 79, 78, 74,124, 27,208, 58, 35,249,239,120, 62,154,124,177, +246,136,199, 23, 23, 55,221,242,127,160, 5,176,117,124,232,110,137, 22, 54,170,161,114,170,133, 7,192,186,192, 85, 45, 37, 89, + 90,137, 22, 12, 16, 47,252,141, 77, 97, 63, 7, 52, 14,190, 40,131, 50, 57, 80,124, 76,176,197,213, 56,109,232, 84,155, 19,216, + 88, 9,108,158,148,213, 57, 0,151,211, 93,137,220, 93,136,129,197,130, 21,182, 5,160,204,178,125,235,102, 75,181,194, 57, 44, +199,214,206,177, 44,110, 89,216, 82,165,116, 81, 11, 86,158,254,152,184,111,106,252,104,113, 21,106,198,230,173, 58,118,112,238, +195, 10,105, 87,197, 66,201, 95,220, 62,188, 58,232,225,136,188,129, 47, 38,150, 13,124, 61,169,124,224,176, 54,213,184,243,226, +105,129, 2, 5, 56, 72, 59,243,169,101,207,246,234,176,153,219,135,111,223,199, 93,135,231,189,142,172,186,123,236,232,246,103, + 39,143, 42,224, 40,232,246,141,101,100, 15, 36,114,246,198,240,174,170,175, 58,218,247, 46,176, 99, 19, 13,223,159,220,191,111, +147,108,189,127,112,127,105,224,211,199, 51, 65,243, 62, 84,115, 4, 69,134,203, 73, 23, 14, 40,231,102, 26,190,159, 57,114,104, +254,237, 35, 7,215, 61,241, 62,180,193,114,120,255, 10,185,121,109, 22,105,226,219, 57,104, 58,164, 73,128, 66,144, 69, 41,145, + 22,104, 81,117, 8,219, 55, 41, 94,182,186, 84,203,153, 71, 58,229,202, 36,147,234,215, 80, 84,254,148,108, 86,170, 84, 73, 1, +228,142, 62, 88,199, 70,203, 38,240,113,168, 70,116,162, 58, 36, 0,115, 10,180,172,207,104,129,150, 65,176, 85,158, 18, 42, 74, +180, 8,250, 85,155, 44, 74,178, 8,176, 0,140, 21,195,120,254,158, 52,105,146, 5,121,159, 88, 93, 62, 84,118, 81,209, 54,160, + 69,144,197,190,195,213, 59,251, 10,199,196,108,217,178, 5, 97, 83, 78,166, 16,218,104,121,168, 64,139, 96,139,110, 8,104,163, + 69,137, 22,109,182,166, 22, 47, 30,208,174, 94,189,155, 88,208, 24, 2, 90,180,189,227,166, 6,106, 24, 84,144, 69, 41, 38,165, +215,143,238, 95, 22,255, 7,135, 21,195,248,178,133,227, 62,162, 1,188, 19, 63, 90, 54, 86, 0, 96, 13, 42,221, 45,177, 48,193, + 95, 20,119,255,113,177, 20, 38,102,234,111,118,116,221,158, 73, 1, 89,141,166,167, 38,200, 90,137,235,220,185,168,219,207, 49, + 46,140,225, 2,112,227,198,141, 92,156,159,208,240,189, 53, 55,104,208, 94, 16,215, 60,213,235,216,189,125,146, 99, 24,165,175, +184, 54,217, 81, 61, 17,104,193,100, 67,145,100,113, 35, 65,206,194,133, 44, 27,246, 47,147,105, 43, 7,203, 46,239,189,114, 9, + 32,107,239,217, 39,178,226,128,159,244,152,184, 70,186,205, 56, 47,237, 6,120, 74,175, 33,109, 37, 82,236,228,236, 75, 46, 15, +216,159,206,129,250,205, 11,239, 56,138, 49,244, 40,198,250,163, 4, 88,197,138, 21,243,230,111,140,135,251, 39, 78, 31,127, 42, +121,254, 40,239, 83,228,139, 18, 24, 51, 94, 84,237,198, 31, 61,242,159,122,223,140,187, 5,195,239,210,113, 11, 65,211, 11,130, + 46,130,175,213,214, 68, 80,150,210,240, 11, 66,152, 17,125,238, 35, 44, 18, 66, 82,127,199, 99,170,125,186,253,249, 67, 89, 28, + 25,160,161, 34,246,221,185,115, 71,104,147,196, 85,211,159,125,251, 6, 98,192,217,141,236, 57,145, 10,162,113,122,115, 2,167, +196,132, 34, 70,210, 0,138,166,237,137,238, 97, 15,180, 32,105,240, 5,130, 86,236,178,214,172, 89,227, 11,137,135, 47, 36, 20, + 4, 90,186,182, 47,209, 98,122, 44, 62,126,167,135, 92,144, 60,114, 76, 98,248, 15,125,214,240, 80,166, 43, 27,223,229,184,182, + 77,114,120,190,144,244, 61,253,223,149,109,121,253,208,194,130, 51,253,183, 84,152, 39,171,126,159, 43,145,195, 70, 86,183, 23, +235,150,149, 25, 96,187,164,248,209,194,164,170,216,104, 65,138, 19,200,255,176,101,155,109,136,128,243, 76,249, 49, 24, 45, 5, + 63,174,243,140,108,142,182, 57, 59,123,186, 49,141, 72,169,182,197,106, 94, 1, 88,172, 47,218,211, 17,100,113, 55, 40, 37, 88, +172, 35, 74, 53,104,152,202, 1, 89, 15,104, 81,237,130, 1,205,178,103,247, 14, 5,100,157,220,180,192,178, 99,100, 27,203,240, +159,211, 88,154,252, 82,209, 2, 9,164, 5, 59,123, 76, 73, 4, 53, 31,192,129, 60, 65,133, 10, 21,158,247,234,213,235,225,225, +125, 27,223,248,123,207, 11,124, 49,181,232,187,183,243,171,188,151,189, 3, 2, 31,221,191, 27, 56,102,212,136, 67, 14, 92, 28, + 56,227,131, 66, 19, 42,149,135,152,120, 3,208, 22, 79,192,102,108,211,227,123,190,203, 94, 62,184,191, 66, 94,191,218, 65,240, +130,137,119,187, 89,154, 80, 29, 60,128,250,244, 46, 84, 73, 7,193,151,101,150,103,207,102,190,183, 4,204,130,216, 99, 29,196, +134,126, 48,100,222,224,192,189,131,203,114, 98,149,252, 0,254,147,238,130,143,135, 80,119,203, 31,223,189, 51,235,213,253,123, +115,228,149,101, 3,105,142, 31, 63,126,147,171,114,106,129, 22,250,163,165,117,235,214,130,221,148,220, 9, 43, 80,225,202,202, + 21, 43,165, 67,229,242, 50,189,225, 47,114,229,208, 1,233, 0, 87, 44,200, 39,216,173, 38,144, 60,190,118, 84, 56,103, 14, 74, +237,129,144,189,154, 79, 85, 99, 58,162,233, 10,104,169, 82, 48,103,244,117,250, 84, 11,213,133, 3,220,107, 40, 54, 90,170, 26, +145, 32,139,255, 7, 12, 24,160, 72,178,120,198,255,182, 58,244, 20,160, 69,144, 69,137, 22, 65,150, 86,162, 5,158, 53,167,138, +208,192,174, 67,135,175,209, 2, 45,250,124, 66,255,244, 30,214,181,235, 77, 74,180, 8,182,166, 0,108,117,251,245,215,155,122, + 18, 45,128,141,123, 44,155, 10,178,184,112,162,212,154,125,158, 11, 44,142, 75, 4,137,144,226, 9,250, 39,205, 4,116,143, 88, + 63,132,241, 35,152, 98,170, 59,225,123, 5,108, 65,202,211,170,206,184,239,149,107, 84, 27,194, 38,203, 7, 46, 85,115,129,152, + 81,137,117, 83,117,204,129, 81,252, 43, 60, 23,195, 90, 16, 58, 41,165, 75, 8,218,119,169,180,162, 99,179,134, 50,150, 90,237, +185,126,117, 84,104, 2, 45, 0, 33, 5,100,209,127,214,119, 89,147, 5, 94,240,185, 44,222,151,158,200,169,235,254,178,227,212, + 99, 89,180,231,158,148,173,151, 79, 74,214,202, 37,197,106,230,148, 74,173, 90,200,160, 57,187, 37,124,244,248,254,122,140,192, +130,101, 59, 36, 54,222,144, 54,123, 17, 88, 1,184, 31,185,231,235,123, 52,102,248,240,222,215, 23, 47,246,194,120,120, 0,192, +118, 63,242, 28, 0,255, 15, 67, 21,191, 83,143,102, 40,222, 55,227,110,193,240,107, 77,184,133, 48, 76, 51, 52, 50,126,229,198, +240,246,146, 44,167,238, 29,184,170,240,160, 65, 59,156,145, 46,132,253,195, 27,118,110,118,102,136,232,101,238,156, 57, 65,117, +242,231,127,222,188, 84, 41,255,163, 48,118,100,167,102,162, 77, 67,221,186,117,177, 51, 45,218,100, 26,210,235, 49, 28,131,207, + 89, 12,102,138, 49, 60, 6, 7, 95, 24, 8,251,210,105, 41,129, 22, 12,122,125,209,152,125,193,112, 67, 64, 11,239,250,117,216, +180,146,143,207,191,159,115, 35,225,165, 25,143, 98, 95, 88, 45, 73, 47,173,147, 84,151, 55, 74,170,174,254,146,180,131,191,196, +110,245, 92, 34,252,250,236,209,196,177, 87,206,183, 43,210,226, 33,159,209, 43,163,246, 62, 58, 98, 49, 24, 28, 63, 84,253,104, +113,242,194,206,190, 7,200, 19, 18,195,117,133, 52,128,108,109,172,152, 30,113, 80, 87,197,180,252,207,235, 6,203, 22, 5, 0, + 16,243,255, 11, 69, 63, 79,233, 22, 65, 22,118,214, 41, 32,139,198,168, 88,137, 41, 32,139,171, 75,170, 27, 56, 48,187, 2, 90, + 48,122,244, 33,208,194,128,102,169, 83,174,160, 13,100,141,172,156,198, 82, 46, 87, 90,203,245,171,151, 45, 0,214, 22, 76,144, +166,129,214,143,241,163,102,201,146, 36,198,133, 14, 77,106,189, 63, 0,240, 87,174, 92,185,103,185,178,167,121,125,106,237,152, +192,183,119,143, 5,189,189,227, 29,116,124,227,212,192,188, 57,210, 5,198,138,234, 65,227, 75, 87,118, 32, 10,139, 50,128,102, +230, 36, 49,206,119,110, 94,231, 5,118,196, 90, 8,182, 80, 79, 28, 20,247,192,152,245, 28,218,229, 21,170, 11,161,158, 56,232, +196, 17,232, 71,172,182,167, 9, 96,116,159, 46, 28,184,187, 16,244, 78,226,251,207, 99, 5,190, 15,187,190,246, 58,113, 88,170, + 75,179, 98,197,138,247, 33, 41,217,139,114,110, 69, 57, 79,130,238, 5,212,221,126,216,180,236,211, 43,167,170, 58,164, 68, 11, + 19,234, 37, 74, 2, 40,181,162, 77, 6, 37, 90, 4,221,172,115, 26, 24,211, 62, 11,139, 2,197,158, 7, 54,119,180,213,210, 74, + 24,116,155,153, 35, 32,100, 80,242,228,161,250,206, 98, 57,181, 73,171,106, 12, 9,125,250,199,210,184,112,176,237, 46, 84, 85, +134, 86,112,165,128, 45, 94,131, 20, 90, 79,162,113,138, 99, 24,221, 36,176, 47,209,229, 10, 37, 44, 4, 50, 83,167, 78,165,170, +189, 29,129,150, 1, 63, 90, 14,249,137,241,112, 59,165, 89,170, 68, 11,125, 83, 1, 11,180,209,154, 80,164,136, 13,108, 37,139, + 20,137,246,147, 78, 37, 70, 24, 23,238, 17, 76,209,254,201, 21,200, 98,253, 24, 5, 90, 81, 18,123,204, 32,192,210,130,173, 31, + 75, 69, 13,154,252,180,160,114, 45, 79,195,184, 65,225, 99, 42,155, 9,140,120,114, 87,191, 63, 35,219, 29,213, 79, 0,192,228, +223, 4,103, 13,141,106, 70,154, 53, 48, 97, 7, 34,231,158, 20,142,242,210,227, 59,234, 69, 1,169,152,139,188,227, 37, 75, 30, +120,246,218, 77, 25,179,112,129, 12,155, 53, 67,166,109,184, 32,131,151, 94,151,178,141,202, 74,193, 10, 9,149, 84,166, 78, 78, +233, 54, 5, 38, 19, 6,128, 22, 54, 34, 44,132, 4, 83, 1, 89,208, 2, 28, 37,160,130,245,193,193, 75, 19, 38,120,173,138, 25, +211,251,198,210,165, 94,120,247, 1,140, 1, 7, 48,190, 30,132, 26,151,139,226, 47,117,152,113,183, 96,166, 76, 41,145,217,136, + 91, 8, 51, 52, 63, 57,175,198, 24, 94,193, 34,255,170,195, 30, 69,210, 69, 3, 93, 53, 64,162,244, 24, 32, 72, 32, 33, 80, 36, + 39, 28,136,238, 52,110, 44,247,123,245, 82, 36, 89, 28,160,184, 18,220, 0,125, 60, 26,223,253, 61,219,183,174,167,107, 8, 29, +230,132,131,154,131,206, 58, 21,160, 69, 73, 22, 36, 48,244,246,160, 0, 45,236, 20,242, 5,104, 80,128,150,193, 93,135,225,195, +198,141,118,165,211,153,221, 65,149,111, 66, 77,114,110,185,196, 56,191, 74,226, 2,112,197,109,253, 92, 98,180, 4,200,106,250, + 76, 10, 12,124, 33,149, 6, 95, 8, 10, 19, 41, 30, 61,177,135, 15, 65, 5, 86, 85,253,104, 97,146,164,223,151, 26, 33,160, 97, +123, 4, 32,233, 4, 7,197, 46, 93,186, 60,134,106,242, 26,207, 4, 92,188,110,130,238,120, 72,113, 20,127,102,124,150, 32,139, +219,248, 9,178, 32, 25, 81,220,110, 12, 26, 52, 72,177,221,161,127, 37,230,197, 10,221,169, 29, 29, 86, 57, 62,244,153,117, 96, +223, 94, 75,157,220,201, 44, 27,250,214,181,216,131, 44, 74, 10,204, 2,173,180, 9,162,102, 42,150, 41,133,223,209,149, 51,100, + 73,235,146,210,177, 73,173, 64,140,220, 73, 99,197,240,232, 31, 59,154,199,133, 40, 17, 61, 94, 33, 5,149, 44,156, 59,176,127, + 73,143,183,197, 51,122,208,149,130,203,131, 52,139,103, 76,113,239,248,186, 57,150, 37,191, 23,181,116,105, 86, 39,128, 52,241, +144,153,176, 62,193,222,161, 71,211, 96, 8, 30, 83, 52, 13,134,224,177,209,212, 2, 45, 0,255,250,152, 84,207,161,222, 30,170, + 9, 70,211, 79, 96,175,225, 15,251, 60, 11,128,213, 83,148,249, 62,164,207,190,248, 77,195, 96, 74,163, 13, 31,246, 64,136, 18, + 51, 92,243,228,117, 61, 34, 42,208, 82, 92, 54,104,193,150, 70,213, 24, 18,250,244,248, 78,207,239,120,255, 66,238, 42,228,238, + 66, 26,190,171,234, 66,141, 36,107, 33, 60,226,211, 38,175,178, 78, 89, 79,169, 32,139, 18, 45, 74,135,120,192,181, 3, 23, 37, + 59,176, 35, 49, 60,129,150, 1,207,240,142, 94, 19, 6, 64,207,230, 3,138, 64,129,174, 29, 32, 89, 86, 12,187,127,173, 84,233, +230, 28,171,235,135, 94, 63,252,240,140,126,183, 64,196, 33,216, 34,208, 98, 63,215, 3, 89, 44, 59, 54,214,248,234,213,143,245, +126,130, 40, 73, 60, 54,106,193,214,216,187,249, 20,144,213,106, 89, 58,137,156,216,131,128,226, 7,131,180,108,217, 32,129, 90, + 77, 87, 64, 52,136,111,209,162, 5,249, 56, 13, 55,233, 75, 75, 61, 98, 1,128,253,197, 93,178, 92,252,205,158, 61,155,243, 7, + 61,145, 59, 60,208,182, 21,160, 69,144,197,221,135, 57, 10,148, 10, 88,182,253,172,244, 24,214, 82, 1, 85, 77,122, 15,145,214, + 19,207, 75,189, 97,199,165,120,163,134,202,181,186,221,255,148, 58,221, 23, 26, 85, 29,246, 0, 0, 62, 10, 59, 92, 74,175, 14, + 1,104,237,167,186, 16, 11,161,131, 87, 38, 77,242, 90, 27, 47,158,247,227,135, 15, 15, 99, 14, 60, 8, 41, 54,129,214,151,220, +117,248,185,220, 45,132,182, 91, 8,179,205,196, 97,254,175, 92,162,229, 58,168,180,253,199,169, 14, 75,233,132, 52,101,178,100, + 1,148,152,112,149,167,120,136, 77,159, 94,174,229,200,161, 72,177, 8,178,182,163, 51,197,141, 29,219, 63,193,183,113, 7, 26, +113, 88, 10,123,145, 58,127,252,241,199, 85, 21,104,161, 81, 43,192, 10, 43, 10, 95, 44, 34,124,177,250, 86, 64, 23,119, 29, 98, +146,112,228, 3,199,145, 51,183,172,177, 82, 36,189,211,234,236,174,160, 54,190,199, 37,243,213, 45, 18,239,226, 26, 5,104,165, +233,238, 47, 53, 38, 88,164,242,208,171, 65, 81,227, 38,163, 47,144,172, 14,106, 88,207, 65, 92, 90,128, 44, 63, 74, 6,120, 64, +245, 67, 85, 13,109,157,156,133, 9,226, 43, 92,210,164,221, 23,105,193,102,135,134,182, 63,242,108,245, 12,239,202,238,203,158, +102,102,110,139,102, 93,112, 0, 38, 40,230, 42, 28,198,155,138, 52, 3, 42, 88,197, 38,130,206, 13, 41,241,176,238,236,153, 98, +247,253, 54,154, 42,208,162,205, 75,221, 10,197, 44, 53,179, 37,180,252, 92, 32,147, 77,146,197, 73,204, 32,208,178,209,252, 33, + 81,180,116, 69, 1,136,142,173,155, 27,180,121, 72, 75, 25, 81, 41,109, 80,250, 68,209,104,215, 20,236, 40,154,193,195, 71, 46, +174,120, 47, 3, 60, 44,197, 51,121, 92,117, 85, 71, 25, 65,179, 68,166, 20,119, 85,181,230,232, 42,105, 45,160, 73,163,116,179, +135,173,156, 95, 11, 77,173,234,208, 94, 90,244,209,127, 23,174, 23,244,218, 39, 25,105,183,235, 80, 81, 77,234, 48, 56, 88,251, +204, 6, 59, 45,244,153, 74,122, 64, 75,125,143, 19,250, 14,251, 17,253, 99, 81,250, 74,176, 69,103,186, 4, 90, 60, 27,148,100, +217,104, 98,194,239, 4, 59,174, 32, 26,111, 19,100, 81,189, 78,233, 61,141,179, 1,130, 87,170,126,180, 24,227,144,177, 14, 25, +243,208, 72, 8, 30,242, 9,182,140, 21,186,117,235,182, 79,149,104,209,232,157, 96, 1, 19,182, 55,198, 58,111,244, 81,239, 49, +189,122,221,156, 86,178,100,192,123,236, 70,164, 39,121,122,148,215,240,216, 86, 78, 0,204,123,148,182, 81,106,173,218,102,114, + 60,166,221,150,106,192,175, 12, 78,250, 64,203,158,159, 73, 62, 2, 91,119,242, 73,162, 28, 17,239, 99,135, 33,243, 58,242, 88, +111,223, 12,236,105, 38,131,196,247, 21,213,156, 4, 91,112, 94, 74,199,165,111,105, 28,143,157,218,167,106,213,170,245,146, 18, + 47,126, 7, 77, 26,224,130,134,246,191,137, 92,140, 75,138,234,144, 32,139,231,254,131,135,223, 44, 86,169, 73,224,142,163,103, +165,116,205, 52, 82,191,223, 66,120,110, 63, 37,229,250, 28,147,130,191, 77,146,226, 85, 83,202,188,181, 43,229,187,172,165, 2, +236,140,225,157,141,201, 63, 96, 60,223,134,113, 20,194, 53,175,131, 4, 89, 56, 19,104,237,135,166,229,192, 99, 63,191,195,104, + 27, 7, 49, 71, 29,132,173, 50,119,135,106,119,135,235,205, 29,102,199, 36,251,185, 35,180,220, 45, 4, 43,103, 40,185,133, 8, +245,111,255,202,129,150,185,186,214,134,224, 73, 16, 55,238,144, 88,177, 98, 62,132,106,240, 37,108, 35,108, 14, 75, 41, 33,193, +202, 50, 0,232,254,110,226,248,241,250, 25, 13,193,131,149,217, 17, 12, 14,116,235,239, 11,189,252, 29, 74,174,248, 27,157,200, + 23, 78, 2,111, 66,220,172,248,213,226,117, 26, 41,154, 0, 69, 25,191,137, 31,231, 82,158,126,157, 31,215,217,191, 74,218,221, +242,146,223,103, 63,147, 74,253, 78, 72,166, 42, 67, 30,123, 68, 78,200, 56,104,246, 65,175, 85,242, 46, 27, 12,236,167, 22, 17, +104,210, 70,139,118, 16,140,117,104, 53,246, 92,228,130,179,122, 64, 75,241, 12,111,114, 39,163, 35,154,171, 96,215,166, 12,184, + 20,193,195,227,190, 50,184, 97,194, 81, 28, 89, 18, 20, 98, 21, 38,187,119,239, 22, 72, 40, 57,160, 57,141, 33,168, 2, 45,240, +223,130, 65,197,114,245,202, 69, 75, 0, 38, 51,170, 11, 85,144,101, 22,104,101, 76, 18, 99,201,209, 85, 51, 20,144, 53,236,231, + 31, 3,115, 38,143,225, 75, 53,162, 67,160,117,244,175,119, 4, 90, 37, 51,121, 80,234,232,116, 48,207,152, 36,230,146, 99,144, +100,209,118,140, 18,183,156,201,162,251, 82,229,103,174,149, 43,185,255, 15,180,190, 18,154, 95, 26,104,169,210, 43, 45,232, 50, +218,230,237,237,180,236,119, 40,170,126,180,236, 65,157,179, 9,215,238,122,101,171,231,247,182, 80,227,159, 39,208,194,153, 0, +189,133, 1, 73,150,173,222, 9,154, 32, 1, 76, 15,192,197,177,230,255, 62,179, 0,178, 32, 25,250,246,255, 14, 75,203,212,136, +149,169,214,177,176, 41, 75, 85, 54, 10,180, 48,214,173,229,110, 57, 38,198, 57,196,194, 71, 1, 10, 12,195, 3,239,230,135, 17, +231,213,155,158,226,187, 98,220,243,252,225, 7, 63,198, 70,100,140, 68, 71, 64, 11,125, 83, 1, 90,122, 32, 43, 4, 64,139,175, +179,129,173,137,143, 10, 72,209,182, 9, 4,190,178, 58,227,122, 74,131,125,202,209,184, 84, 24,113, 80,159,210,167, 27,119, 72, +194, 77,140,162,226,198, 78, 81, 69,250, 78,137, 23, 35, 24, 64, 93, 78,187,193, 34,174,250, 59, 3, 69, 51,134, 33, 19,234,100, + 51,164,184,155,163,196, 78,252,188,121,207,169, 65,139,119,156,146, 86,131, 39, 74,229,254, 39,164, 88, 15, 47,105, 48,252,168, +204, 90,179, 74,170,255,230,249, 62, 66, 76,248,210, 10, 46, 33,116, 58, 38, 67, 2,220, 18, 59,184,119, 67,170,117, 20,170,221, + 67,144, 60, 30,232,215,175,223, 97,240,251, 0, 37, 89, 80,219, 30,196,162,118, 59,180, 44,246,110,108, 66, 29,108,104,199, 37, +252, 14, 45,119, 11,193,202, 25, 74,110, 33, 62,199,183, 27,108,114,255,130,108,246, 65,165,119,110,221,180, 1,246, 87, 83,176, +170, 90,158, 36, 86,172,219, 72, 55, 49,136, 44,138, 17, 45,202,120,170, 11,205, 4,149,198, 42,111, 7, 86, 49, 87,176,130,184, + 10,144,246, 39,118,139, 93,162,125, 22, 92, 69, 92, 5,202, 30,130,109,234, 23, 33,190,245,197, 32, 74,255, 55,185, 92,117, 64, + 7,247,194,225, 90, 67,143,104, 81, 23,120,196,138,113,211, 35, 82,220,155, 30, 17, 98, 44, 80,174,121, 96,125,230,252,112,217, + 96, 24,232,217,234, 71,235, 17,118,204,221,133,234,243,225, 39, 4,128, 86, 74,193, 29,139, 86, 95, 92,156, 28,210, 96,165,135, +191,138,111, 46,218,106, 56, 59, 28,149,147,222,223, 55, 83,106, 69,176,165, 58,175,227,128, 76,122, 84, 23,114,101, 9, 91, 35, + 74, 35, 26,185,226, 39, 6, 50, 31, 2, 44, 12,232,138, 47, 34, 24,239,126, 4,178,204, 2,173,188, 41, 99, 29,155,211,164, 64, + 16, 65, 86,142,100, 49,238, 82, 61,231,232,227,114,167,245, 56, 67,169, 22, 83,190,116, 30,142, 92, 80,216,190, 61,239,247, 49, +143, 45,104, 81, 80, 1, 89,185,146, 69,191,227,140,166,129,174,248,213,209,212,170, 14,245, 36, 90, 58,206, 63, 77, 13,146, 33, + 1, 90,228, 63, 85,136, 70,124,100,185,160,111,164,156,149, 49,110,112, 82,117,229, 47, 75,219, 28,130, 1, 45,163,241, 14, 29, +229,211, 16,253,168,156,144,222, 47, 1,200,216,135,177,109, 63,198,206,158, 24, 59,246, 80,109,136,208, 78,251, 49,177, 3, 91, +253,176,139,241, 14,177,243,238, 64, 74, 15,143,238, 57,194,134,157,128,149, 96, 41, 71, 52, 9,180,216,183, 85,205,130, 35, 73, + 86, 8, 37, 90,234,235,146, 96,119,225,124,236, 68,188, 31, 57,190,199, 4, 92,228,198, 28, 61,207,247,234,179,206,234, 40, 9, +198,148,253,240,149,165,216,107,209,132, 1, 27, 24,184,107,150,139, 85,218, 12,134, 60,160,118,228,184, 73, 0,164,142,101,253, +169,138,165,237,208, 53,210,103,230, 49,233, 54,249,168,212,238,190, 64, 82,102, 46, 26,224,196, 97,169,171,182, 20, 22,182, 90, +109, 49, 47,109,133, 49,255, 97, 72, 30, 15, 19, 28, 99, 28, 61,132,249,234, 32,234,106, 43, 22,170,220, 88, 97,207, 19, 35,237, +211,192, 80, 20, 44,139,150,230, 72,110, 70, 11, 5,119, 11,246,229, 12,169, 91, 8,135,253,200,236, 7,186,243, 91, 57, 64,176, + 69,201, 22,213,136,180,187,114,100,228, 78,163,121,218,115, 49, 15,243,242, 25, 59, 6, 58,106,132,169,177, 42,216,136,129, 53, + 59,243,162,241, 86,134, 93,201, 25,158,249, 31, 82,172,202, 72,231, 32, 78,110,230,164, 50, 62,119,195,254,232,181,144, 58,213, + 1,240,248,157,103,222,228, 25, 78,226,108,255, 67, 82, 78,240,179, 4, 36, 80,181,161, 62,168, 14,112, 85, 25,182, 84,213, 49, + 16,213,198, 74,195, 17,184,212, 27,208, 8,182,230,211,208, 29, 64,246, 62,207,106,130,173,137, 31,125,110,225, 62, 85,134,142, +236, 63,108,252,228, 78, 83,172, 24,125,152,184,179,144,137,246, 88,246, 9,147,198, 71,170, 63,103,245,158, 62, 81,244,159,242, +166,136,177, 63, 75,226,232,251, 50, 36,140,150,254, 19, 58,152,173,156,164,153, 39, 69, 44,208,140,177,247,191, 70, 83,235,176, +148,191,245,254,187,224,183,233,126,100,149, 64,121,134, 38, 77, 45, 45, 39,244, 77,151,211, 64, 27,251, 82, 52, 83, 99,242, 94, + 4,187, 75,117,172,251, 25, 99,223, 78,140,111, 63, 91,199,186,159, 33, 77,219,141,177,174,145,222, 24, 2,169,142, 23, 64,203, + 61,107,242,165, 29, 22, 19,254,223,101, 2, 16,187,163, 38,140,167, 90,255, 85,246,164, 93,125,123, 2,100,166, 67, 99,142, 65, + 49, 13,240, 81,111, 92, 82,239,211,255, 34,237,207, 56, 6, 13, 65,226,216,158, 85,135,190,145, 58,250, 38,124,148,184, 45,233, +194,129, 70,239, 76,145, 98, 37,219,239, 34, 4,143, 17,154,233,192,235,129,168,167, 85,168,187,189, 72,171, 49,222, 13, 66, 89, +211,233,213,145, 9,126,233,101,213,150, 51, 58, 50,211,241,232,167,186, 91, 48,242,237,122,229, 50,211,150,204,210,250, 55,228, +215, 13, 63,248,185, 62,242,107,169, 92,119, 57, 67,183, 5,184,249,233,230,103,104,113,192,221,150, 66,139,147, 31,232,184,249, +105,156,159, 70, 92, 90,184,249,105,156,159,255,246,156,174,141,225, 63,227,215,187, 27, 97,232, 50,215,205, 79, 55, 63, 67,139, + 3,238,182, 20, 90,156,116, 3, 24,119, 91,114,183,165,208,229,192,215, 73,205,165, 68,139,157,196, 81, 50,243,169,206,104,184, +186,174, 71,223, 77,211,113,189,132,180,190,220,252,116,243,211,104, 27,112,247, 77,231, 28, 48,202, 67,109, 62, 55, 63,221,252, +116,196,129,255,114, 91,210,235, 19,238,251, 38, 56,224, 94,233,152, 96,150,129,172,110,126, 26, 96,146,137, 44,110,126,154, 96, +150,129,172,110,126, 26, 96,146,137, 44,110,126,154, 96,150,129,172,110,126, 26, 96,146,137, 44,159,131,159, 38, 94,255,143,203, +234, 86, 29,234, 84,201,231,104, 48,110,154,161,219, 15,220,252,116,243, 51,180, 56,224,110, 75,161,197,201, 15,116,220,252,116, +243, 51,116, 57,240,117, 83,251,226, 70,241,255,198, 14, 72, 3, 73,198,236,218,131, 68, 15,204, 60,243,191,189,225,164,209,111, +231,238,158,193, 72,220,201, 71,122, 60, 15, 68,226,110, 19,251,195, 40, 77, 51,205,244,171,164,201,237,242,216,165, 54,156, 9, +187,175,148,132, 93, 87,195,177,115, 82, 73,112, 29, 50, 28, 59,135,122,126, 70,128,237,108,235,251, 71,252, 84,203,170, 45,167, +182,172,159,185,156,206, 88,240, 85,214,187,153,134,237, 34,239, 63,225,219,211, 98,119,155, 55,202, 24, 98,167,199, 33,228,197, + 63,225,219,141, 20,221, 93, 78, 35, 92, 50,158,231,139,242, 19,227,219,111,240, 36,192,157,176,246,126,199,140,151,248,235,204, +233, 26,100,193, 65,232,110, 38,245,219,176, 69,248, 0, 6, 2, 63, 51,137,207,216,241, 38, 88,229,242, 62, 38, 65, 63,251,132, +137,230,165,179,247,224, 30, 67,135,104,143, 47,218, 96,236,222, 77,247, 8, 27, 48,137, 47,159, 48, 97,194, 47,240,129,211, 5, +206, 65, 59, 32, 36,207, 50, 92,223,140,164, 5, 91, 70,202,153, 31,222,167, 47,195,207,206, 16,120,184,110,141, 32,208,157,224, + 8,245,207,198,141, 27,207,128, 3, 69, 58, 88,205,245, 15,250,118, 51,205,222,200,183,155,161,199,188,193,104, 18, 96,193,145, +234, 20, 38,132,130,154, 2,175,206, 83, 16, 74,101, 10, 98,115, 78,129, 47,176, 41,240,238, 61,133, 96, 43,180,129, 22, 92, 94, +228,192,187, 15,193, 15,218,123,156, 15, 34,101,211,171, 35,251,178,194, 63,153,173,172, 8,130,240, 89,202,105,128,185,159,189, +142, 12,148,193, 72, 22, 71,229,108, 10, 55, 38, 43,224,151,234, 14, 92,163,156,134,251, 18,134,120,177,247, 44,238,138,182,222, +183,199,194,195,163, 16,139,239, 32, 92, 47,220,129, 63,172,131,252,143,196,235,206, 14, 61,154,218,231,210, 22, 41, 82,132, 65, +208, 5, 94,233, 25,123,213, 25,216, 50, 67,211, 8, 47, 63,234, 71, 70, 31, 10,237,126,100,224,189,238,111, 55,192, 36, 19, 89, +156,242,147,174,155, 48, 86,174, 64,186, 1, 87, 33,111,224,253,254, 13,252, 91,222, 64,220,216,149,112, 58,235, 42,118,177, 83, +154,152,207,233,136,156, 14,185, 95,160, 15, 61,192, 34,243, 38,232,211, 77,133,174,219, 16,123, 44, 98,226, 27,255,238,172,250, + 33,120,240,113, 69,152,212,146, 98, 21,126,139, 78,241, 16,192,213, 22,211, 16, 1,112,149,224,171,188,206,184,135,136,139,167, + 68,141,167,199, 98,120, 56, 22, 62,227,106,210, 1,186,189,141, 73, 70,245,171,167,156,249, 31,192, 43,144,116,237, 15, 94, 99, +140, 47,189,137, 44, 20,184,107,180, 83,183, 66, 3, 90, 16, 16, 96, 57,255,240,209,211, 75,149,107,255, 86,109,249,202,149,205, +224, 45,126, 9, 6,206,213, 40, 7, 37, 91,234,161, 71, 51, 22, 64,214, 21,132,232,168,231,217,111, 80,251, 74,191, 52,111,154, +227,167, 82,149,155, 53,251,173, 10, 66, 63, 12, 64, 56,157,169, 86,176,165,149,108,233,209,244, 64, 99,222,132,137,253, 34, 19, +126,111, 49,192, 27, 93,154, 6,104,216,103,209,163,233,200,121,172, 43,135,178, 31, 77, 16, 42,120,129, 3,199, 41,240,228, 60, + 5,147, 22, 3,212, 78, 65,168,161, 41,112, 48, 56, 5,142, 6,167, 0,216,135, 54,208, 10,135, 65,233,246,130, 5, 11,100,196, +240,225,140,251,199,100,239,179,232,163,111, 87,203, 74, 80, 5,199,131, 83,224,144,119, 10, 60,153, 79, 65,248,169, 41,240,194, +239, 6, 90,174, 27,152, 61, 63,187, 35,162,132,226,192,145,142, 28, 25,118,138,206,122,225, 80,242, 49,200,164, 54,216, 86, 93, +181,207,248, 0,209,143, 38, 77,154,164, 4, 70,102,128,118, 70, 85,128,151,112,198, 33,125, 4,250,241,157,188, 67,175,205,219, + 30,163, 36, 11,126,248, 4,237, 65,113, 48,140,133, 22, 3,212, 59, 2, 91, 70,105,134,193, 56,217, 30,105, 29,250,252, 86,164, +126,160,231, 44,116,142, 43,154,137,225,227,235, 32, 22,183,126, 76,144, 72, 40, 9,244, 2,213,133, 48, 23,201, 24,231, 5,255, +181,139,106,163,229, 52, 88, 61, 74, 54, 55, 77, 51,220,210,207,235,144,159,168,207,166, 88, 72,188,129,191, 48, 1,192, 18, 56, +207,149, 44, 89,178,176, 77, 74,129, 2, 5,164, 68,137, 18,111,138, 21, 43,214, 84,175,205,231,207,158,176,113,254,156,137,110, +255,148, 43,137, 47, 83,225,252,105, 24, 77, 68,224,228, 87, 9, 17,199,132, 96,247,239,225, 39,242, 38,104, 57, 5, 91,214,160, +210,193,176,136,254,167,125, 37, 57,212,248, 66,218,226, 2,217,222, 98,208,104,134, 77, 64,236, 39,221,196,192,211,122, 64, 11, +168, 86, 1, 90, 28,192,212,164, 2, 45, 2, 58,251,247, 48,112, 53, 99,124,125, 73,160, 85, 35,163,135, 48,209,155, 53,147,246, +127,161, 31,162, 48,196,205, 47,247, 31, 62,189,130,116,162,112,233,154, 69,187,214,173,155,247,250,249,243,173,224, 73,120, 46, +202, 73, 53,162, 81,160, 53, 36, 87,174, 92,131,123,254, 57,184,131,207, 45,191,147,183,125, 31, 28, 45, 90,177, 65,165,210,229, +171,149,200,151, 47, 95, 54,196,214, 26, 51,124,248,240,149, 32, 54,208, 4, 77, 15,132, 11,186, 8,169,142, 50,128,227, 55,165, + 98,122,199,151, 30,208,232,188,145, 94,234, 21,231,175,214,131,191,121, 77,113,236,168,215,169,121, 95, 5, 47,224,251,148,203, +151, 47, 79,193,132, 56, 5,241,227,166, 32,144,246,148,181,107,215, 78, 65,176,218, 80, 7, 90, 73,147, 38,205,140, 56,157,175, +255,130,151,107, 53,124, 12,206,239, 81, 28,173, 26,241, 35,126, 82,101, 72,201, 27, 1, 33, 60, 79,191,196, 10,239, 45,194,197, + 40, 9, 65,135, 95, 0, 80,115,162, 61,105, 77,140,165,102,127, 56,170,163, 84,112,118,185, 18,233, 38,158, 15,100,194, 96,121, + 19,255, 71,227, 97,109, 0, 95, 67,252,212,100, 74,142,223,244,176, 94,193, 73, 42, 15,207,222,206, 0,141,179,182, 20, 90, 52, +191, 3, 47,131, 16, 30, 69,241, 52, 94,178,100,201,183,149, 42, 85, 10,162,199,113,254, 71,121,219,233, 53,118,235,125, 87,109, +190,241,226,197,139, 5,139, 29, 37, 78, 40, 34, 42, 88, 16,240, 93, 24,114,139, 1,218,241,124, 35, 35,237, 83,167, 28,149, 81, +238,231, 92,176, 2,116, 11, 2, 76, 19,196, 57,138,157,234,170,156,116, 82,220, 21,105, 51, 36,122, 47, 59,119,238,236, 15, 41, +238, 43, 44, 48,252, 59,118,236,120, 18, 64,233, 50, 38, 81,163,230, 7,148,196, 15, 64, 8, 52, 95,132, 47,122,205,152,143, 28, +143, 25, 67,145,139,107,134, 29, 99,100, 12, 46,174,153, 56,182, 64,178,171, 93, 84, 87, 50,200,119, 51,217,190,200,184,132,126, +243, 22,133, 98,189,146,159, 30,122,255, 13,246, 77, 51,223,233, 40,239, 23,249,118,128,229,150, 88,236, 43, 99, 25,164, 87, 10, +184,178, 79, 0, 90,130,240,123, 82,185,114,101, 71, 42, 64, 91, 57, 11,228, 74,228,243,232,234,116,145, 39, 75,149, 52,122, 80, +147, 0, 2, 45,132,233,147,209,163, 71, 11, 3,136,115, 81,132, 0,226,239,172,146, 45,135, 60,114,132, 69, 62,149,153, 95,240, +121,123,181, 97,240,255,206,128, 22, 59,218,145, 35, 71, 4,171,111,221, 68,160, 69,112,230,234,163,112,255, 14,165, 96, 20,153, +171,137,255, 41,209, 34,226,181,127, 15,175, 65, 10,102, 52, 18,189,250,234, 70,152,108,198,226,143,209,213,109,176, 34, 19, 92, +161, 49,212,118,148, 48,160, 61,198, 0,220,233,151,223,254,172, 91,177,122,243, 82, 91,230,207,111,114, 99,199,230,214,143, 14, +236,170,135, 54,197,201,210, 76, 89, 15,141, 31, 63,190,101,197,186,157,126,247,123,248,228,252,163, 39,207,207,245,233, 53,232, +215,233, 35,134, 54, 92, 58, 98,104,117,239,131,251,106, 32,198,214, 46,208,212,243,194, 30,172,252, 4, 90, 28, 36,217,176, 1, + 12, 28,197, 12,252,130,237,238,163, 87, 41, 32,139,135,117,112,227,127, 71,215,248,160, 75, 9, 23,193, 11, 85,134,170, 52,139, + 0, 70, 5, 47, 42,128,193, 32,162, 5, 48, 39, 65,211, 17,136,209,229, 7, 6,162, 45, 28,140,176, 26,147,206, 29, 59,190,230, + 89, 3,180, 92,121,225, 86,104,171,101, 37, 32, 36,200, 98,187,118,116,176,222,144,157,229,212, 59,210, 35,224,250, 83, 72,196, +130, 56,241,145, 30, 39, 67,246,159, 42, 85,170,188, 68,251, 39,192, 14,175, 71,196,201,253,242, 8, 74, 94, 24,210,150,130,142, + 18, 64, 78, 17,148,221,217, 10,215,217, 43, 67,139, 38,219, 68, 37,240,127, 19, 34, 30,140,180,182,145,236, 12,241,194,224,196, + 8,107,195,144, 46,159,116, 96,140, 90,195,240, 85,144, 52,179, 46, 74, 88,137,149,104,222,188,185, 18,164, 29, 82,210, 79,125, + 71,218,194,133, 11, 63, 60,117,234,148, 34,137,163,196,108,203,150, 45, 2,211, 1,210,230,162,210,149,205,150,250,109, 25,161, +214,244, 70, 44,211, 75, 0,106,129, 12, 40,207, 69, 49,195,243, 32,156,153,162,117,232,213,171,215,113, 72,167, 86, 24, 96, 6, + 65,214,160, 41, 83,166, 60, 97,155,172, 87,175,222,123,126, 63,227,218, 82, 26, 65, 16,171,198, 43, 68,104, 26,129,121,131, 2, +182,236,128,150,171,215, 60,195, 77,242, 50,150,129,178, 24,201, 66,122,140,143,168, 36, 68,192,120,141, 5,198,107,212,219,107, +128,213,215,232, 7, 93,240, 25,122,210,113,219,123, 48,166,191,179,150,143, 30,241,195,232,253, 55, 82,192, 47,144, 39, 25,198, +182, 21, 72, 79,145,158,163,204,107, 48,198,164, 52,243, 94,140, 95,241, 32,201,122,139,249,194, 6,174,176,240,231,248, 33, 21, + 42, 84, 16, 4,104,183, 93,199,162, 64,126,255,253,247,183,232, 3,241,156,189,163, 64,142, 68,191, 21,200,153,208,183, 80,158, + 36,126, 76, 69, 11,164, 85, 36, 90, 61,123,246, 84,226, 90, 82,136,194,152,151, 12, 7, 7,128,247, 30,229, 94, 14, 90,197,237, +233,253, 75,128,150, 10,176, 62, 2, 90,158,246,122, 81, 84,220, 45, 14,224, 68,161, 90, 9,148,179,223, 0, 5, 4, 69,183, 93, + 85, 54, 58,131, 47,243, 81,108,174, 38,254,135,212, 74, 81, 29,218,211,230,181, 16, 0,173, 78, 24, 36, 71, 3, 53,143, 64, 89, + 76,131, 45, 21,104,161,141,112, 66, 9,150, 64,243, 36, 36, 38, 29,151,173, 94,219,226,207,230,205,139, 94,223,184,166,245, 75, +175,131,163,228,218,165, 89, 0,154,171,241, 62,173, 68, 75,175,221, 63,198,196,216, 41, 87,209,154, 53, 43,214,235, 82,187,159, +231,208,223, 86, 78,153,214,229,208,146, 5,189,206, 46, 91,216,254,218,222,157,213,240,126, 2, 55, 51,224,205, 3,224, 74, 1, + 90, 12,250, 13, 53, 23,227, 40,254, 83, 14, 14,126, 10,190, 96,157,175, 95,191, 94, 5, 91,202, 53,170,160,169, 74,177, 14,122, +186,101, 38,120,161, 93, 22,212, 71, 83,208, 70, 21, 0,195,213,183,179,131,210, 81, 16, 61,169, 75,216, 65, 6, 12, 74, 5, 1, +222, 94,183,109,219,150, 82, 66,130,172, 23, 72,254, 72,119,105,179,165, 71,147,101,165, 93, 22,213,155, 44, 39,203,200, 9, 17, +113,239,132, 11, 20, 46, 54, 8,148,172, 0, 84,183,140,152,100,103,162,191, 6, 81, 34, 2, 41,134, 0,108, 42,103, 72,247, 20, + 21, 62,236, 42, 44,200,211, 87,175, 92, 78,238, 87,112, 6,178,212,235, 40,167,217, 93, 53, 14,105,222,186,117,235, 39,180,209, +181,136,121,119, 51, 4, 52,213,226,127,147, 63,127,126, 11, 3,169,163,142,238,135,240,155,109,143, 17, 4, 65,157, 43, 56,191, +194, 69,117,194, 14,135,224,199,175, 8,136,160, 86,161, 77,149,209, 35, 45,108, 93,110, 21, 45, 90,244, 17, 76, 11,148,132,192, +244,207,217,214, 25, 92,121,222,188,121, 82,166, 76, 25,129,189,167, 2,108,250,247,239, 47, 0, 71, 52,144,119,117, 68,134,125, +218,113,240,206, 66,112,197, 9,140,192,135,245,206,241, 19,170,115, 69, 66,134, 54,113, 23,192, 83,143, 31,193, 64, 22,193, 22, +218,205,115,106, 25, 56,126, 16,100,177,159, 2,208, 11, 65, 22, 23,221,124, 7,223,135,182,239,114, 81,173,249,128,103,214, 62, + 45, 0, 69, 12,108, 31,203, 40,243,156,228, 35,192, 82,198, 9,210,163,202, 11,115, 4, 37,130,180, 7,162, 41,202,191, 29,104, + 37, 37,184, 66, 27,120,131,249,136, 66, 10, 46,168,223,160, 93,190, 40, 85,170,212,119, 70,121, 11, 80,191,145,188, 83, 37, 89, +117,234,212,145, 97,195,134, 81,138, 27,136,113, 46,176,126,253,250,242,211, 79, 63, 41, 96,139, 0,172, 93,187,118,210,186,117, +235,141, 70,233, 99, 78,247,211, 2, 45,130, 45,246, 43,158, 33, 53, 85, 22, 22, 80, 77, 6,129, 94,125, 45, 77,140,107, 31, 97, + 17,163,239,252, 7,228,211,119,239, 96,111,163, 69,160,197,137,139, 3, 2,197,232,122,201, 8,208, 98,108, 46,174,186, 40,154, + 86, 19,255,163,163, 4,114,210,176,127, 7,197,213, 4,103, 38, 25,216,201,211,211,115, 10, 84, 60,220,121,102, 26,108, 81, 85, + 72,105,150, 35,160, 5,195,213, 9, 24,112,247,162, 92, 11,111,156, 61,219,234,209,150,245, 13,229,242,133, 89,242,246,245,195, +242,229,203,111, 67, 57,181, 54, 90,122,197, 62,132,149, 98,239, 58, 13, 26, 87,170,215,168,117,229, 57, 67, 70,182, 56,188, 96, + 78,239,155,219, 54, 77,185,183,126, 85,191,151,103, 79,118, 3,208, 60, 7, 34, 46, 37, 90,140,102,207, 64,220,106,194, 74,196, +143,160,130, 43,124, 4,175,189,143, 70,125, 81, 77,204,171, 87, 40,222, 71, 39,220, 12, 0,113,145,210, 49, 2, 55, 12, 98, 10, +141, 84,169, 82, 93,132,241,241, 69, 12,104, 23,161,203,191,136,137,141,215, 13,209,180,190, 87,145, 94,113,240,102,123,161, 58, +134, 7, 85, 17,156, 32,172, 3,168, 86,165,232,180,184, 4, 47, 52,126, 71,251,156,130, 85,246, 20, 74,177, 72, 11, 27, 20, 20, +251, 29, 2, 15, 2, 55, 2, 25, 78,108, 38,164, 69, 31,189, 19,224, 72,153, 4, 1, 10,130, 84, 73, 22,120,147, 5, 60,112,102, + 7, 19,140,134, 90, 86, 21, 16,178,156, 4, 69,236, 3,252,118,182,125, 85,202,133, 7, 79,234,213, 17,164, 89,190,156, 88, 9, +212, 8,178, 48,233, 42,223,202,190, 68,190, 82, 90,130, 9,243, 29, 82, 0, 6,211,187, 0, 50,236, 7,174,140, 90,181,175,252, + 98, 64, 11, 54, 33, 84,141,211, 54,100,205, 39, 0, 45, 15, 76, 4, 79, 8,180, 48,217, 60,209,227,157,222,125,128,161, 39,156, + 16, 0, 86,131,209,194,132,243,196, 10,180, 12,191, 3,147,141, 55,235,135,135, 42,117,100, 29,173, 94,189, 90,168,158,156, 53, +107,150, 50,129, 97,133,255,146, 54, 96,104, 83,142,212,135,246, 69,238, 14,213,248,101,130, 44,154, 8,144, 6, 23,164,180, 87, +131, 36, 82,233, 83,228, 5, 36,101, 47, 49, 25, 63,213,249,222,190,170, 36,139,103,228,221,133,103, 94, 52,107,214, 76, 1,128, +229,202,149, 83,164, 27,107,214,172,177,129, 44,142,209, 28,151,209, 15, 92, 46,170, 53,239,125,198, 58,134, 4,146, 32,210, 6, +138, 80,231,138,170, 46, 4, 71, 68, 60, 67, 73, 86, 48,122,176,171, 99, 63,239, 1, 86, 27,150,102,241,221, 26, 85,161, 34,209, +210,251, 31,130,242,134,234, 35,148, 4, 17,100,105, 36,234,138,116, 29,237,245, 13,192,209, 6,163, 47,163,237, 29, 1, 15,129, + 20,230, 52,129,153,138,180,105,211,102, 5,104, 68, 5, 96,139,138,250, 95,129,197,134, 77,170, 69,224,133, 57,149,237,211,225, +161, 39,209,162, 96,133,237, 20,230, 29, 20,172, 4,181,106,213, 74,230,207,159, 79,201, 25, 77, 47, 24, 11,211,118,216, 99, 17, +163,223,244, 85,230,163,104,152, 43, 27,138,165,141, 36,236,244, 18,218, 96,185,250, 88, 12, 40, 47, 8,170, 28, 36, 69, 5, 98, +255, 30, 94, 3,205,187, 38, 25,168, 0,173,144,130, 45, 71, 64,107,205,178, 5,181,242,167, 75,118,190, 98,137,194,239, 40,218, +132,113,224, 65,136,215,231,161, 83,223,219,190,105,174, 84,172, 88,145, 13,156,201, 72,108, 44,245,115,134,161, 97, 79, 4,194, +239, 93,174, 72,129,156,171, 7,255,249,203,185,133,179, 59, 61, 88,183,172,255,171,117, 75,187, 99,100,222,143, 85, 37,193, 27, + 93, 63, 56, 61, 8,126,236, 55, 18,176,222, 56,232,114, 2, 87, 15,254,102, 94, 35,188, 36,200,162,148,133, 7, 7, 85, 78,222, +234,196,174,130, 23, 14,242, 4, 47,152,220, 12,209,212,188, 87,177,199,226,132, 64, 21, 5,219, 13, 87,229,188,134,228,202, 70, + 43, 88,209, 9, 94,208, 62, 20,105, 22,236, 8,109, 64, 11,234, 57,241, 4, 45,130, 16, 21,200,240,127, 72,129, 22,118,182, 41, + 18, 39, 78,140,168, 47,170, 15,149, 65,206, 8, 31,213, 60,116,229,192,178,106, 1, 33, 39,115,110, 34, 97, 27,231,130,134,229, + 51, 42,209,194, 64, 27,192,103,249,141,170, 20,139,223, 74, 94, 18, 84,178,206, 88,223,172, 43,108, 16, 16,136,254,105,236,186, +208, 96,153, 63, 27,208,234,221,187,119, 61, 74,177, 40, 25, 67,187, 97,128, 97, 78, 18,219, 96, 79, 87, 40, 36, 64, 11, 3,182, + 23,218,170, 31,192,127, 0,192,193, 91, 76, 28, 1,224,181, 31, 19, 87,212,234,238,102, 7, 59,151, 29,178,130,244, 0,158, 3, + 48,161,188,197, 98, 34, 0,109,204, 15, 11, 61,133, 30, 22, 50, 1,176, 97,122, 11,128, 16,128, 73,202,126, 39,180, 51,214,166, +197,226,236, 1, 65, 22, 23, 63,108,155,156,104,184,168, 0, 45, 5,188,227,251,105, 96, 95,217, 42,201, 50,162, 54,220,132,186, +126,203, 5, 4,193, 22,108, 70,149,190,206,246, 64,201,211,230,205,155, 21,169, 1,212, 60, 15, 1,180, 93,246, 77, 72,188, 78, + 58, 21, 1,107,110,192,102, 84, 81,249, 16,100,113,140,102,219, 50, 3,180,160,218, 18,168,179, 57,193,114,177, 34, 4, 69, 80, +245, 11,233,154,149, 64,145,209, 0,109,175, 85,208,166,165, 23, 18, 90,214,138,227,184, 67,201,180, 58,126,235,253, 55,216,149, + 66, 63, 27,128,214, 35, 44,132,181,166, 11,202,111,236,124,167,186,251,133,209, 55,162,111,188,167,225, 59,129, 22,164,172, 4, + 81,239,209,102,108,230, 6,184, 30, 30,117,244, 30, 11, 88, 37, 15, 85,138,144, 66, 17, 20, 57, 60,156,217,104,193, 60, 70,105, + 73,156,163,174, 93,187, 70, 59,199,183, 16,128,204, 2,160,157,193, 77, 45, 67,134, 12,225, 88, 74,187,210,127,195,161,235,218, +129, 86,254,162,221,117,168, 2, 45, 50,199, 72, 98, 71,167, 13,150, 43,110, 81,220, 76,187, 47,237,193,255, 4, 94,156,184,237, +223,195,107, 84,207,152,172, 1, 27,208, 34,216, 2, 82, 31,130, 65, 18,115,173,177,195, 94,117, 72,144, 85, 54,103,154, 71,199, +214,206,145,197, 45,139, 72,165,146,133,223, 3,233,255, 69, 53, 34, 86, 85, 15,191,141,173, 0,132, 86, 72,116,253, 96,244, 96, +135, 78,139,149, 68, 0, 6,198,205,152,116,199, 28,219,191,191,230,181, 13,171,106,191,185,114,190,155,188,122,121, 4,147,251, + 9, 12, 40,151,145,207,229,118, 88, 74,152, 56,161,114, 32,180, 79, 28,112,181,137,121,141, 20,144,146, 44,214,231,178,101,203, + 20, 64,196,129,156, 42, 3, 78, 20,124,151, 10,178, 88,143, 33, 0, 90, 54,155, 44, 2, 56, 78, 66,156,124, 80, 46, 83, 64,139, +224,133,174, 28,212,221,123,248, 54,101,219, 42, 38,109, 5,192,105,129, 12, 42, 63, 68, 64,139,187,111, 8, 90, 56,121, 77,159, + 62, 93, 41, 35,213,136,180,217, 50,194, 71, 53, 15,203, 10,126, 42,128, 16,147,204, 43,130, 33, 74, 32, 40,121, 83,203, 75,208, + 68, 48,139,103, 78,234,209, 70,187,120,203, 58, 96, 93,240, 59, 57,233,178,190,120,141,147, 32,129, 54,251,149, 10,222, 72, 23, + 82, 45,163,131,240,103, 1, 90,237,219,183,111, 66,254, 97, 98,220, 0,187,141, 6,152, 48,222, 2,176,156,132,205,151, 98, 15, + 22, 18,160,133,122, 80,212, 19,218,131,128,134,192,149,124, 32,159,201, 87,238,152,211,227, 41,239, 59,163,167, 74,163,200, 95, +242,210, 40, 61,235, 59,105,147,245,152,101, 34, 29,130,161,185,115,231,202,208,161, 67, 5, 0,144,117, 98, 4, 92,105,139,127, +154, 0,139, 99, 37,203,194,205, 74, 52, 86,230,248, 77, 41, 46,141,235, 23, 46, 92, 40,176,191, 9, 4,184, 41,172,243,221,158, +142, 36, 90,180,121,163, 36, 11, 27, 1,104, 4,173, 72,200, 72,151,155, 16,248, 94, 78,154, 70,129, 22, 38,212,103,144,192, 42, + 42, 46,218, 54,162,159, 42,187,218, 32,109, 23,168, 84, 67, 4,180,240, 77, 17,209,167, 94,107, 65, 86, 72,164, 89, 70,218,196, + 63, 45, 15,250,254, 35,204,205, 31, 1, 45,242, 19, 27, 66,140,246,113,154,152, 4,170,187, 11,171, 86,173, 42,144, 48,189,193, +124,169, 21, 20,132,193,194,229, 13, 54,235, 40, 64,139,121,102,204,152, 17,232,140, 31,206,118, 29,142, 26, 53, 74,153,131, 56, +198, 19,100, 1, 36,250, 88,231,180,184, 0,218,239,169,158, 6,110, 56,171,210,181, 74,179,130, 97,145,127, 90, 29,184, 40,143, +190,123, 7, 62,172, 53, 68, 35, 40,226,128, 77,181,132,145,196, 65, 13, 12,115, 9,138, 72,147,131, 4, 7, 63, 53,241, 63,158, + 83,128,150,253,123, 62, 21,104, 1, 77,143, 4, 64,152,216,181,107,215,188, 70, 43, 75, 11,180, 84,144,117,114,211, 66,217, 49, +162,141, 12,255,249, 71, 41,152,249,187,195, 24,216,255,111,187, 5,227,121,163,180,153, 47,253,183, 81,178,101, 73, 18,195,167, + 75,243,186,129,108,128, 0, 91, 22,216,104, 44, 6,176,218,143,137,241, 17,120,126, 25,146,172, 45, 88, 5,210,144, 61,191, 30, +109,116,152,205,152,188, 47,170, 9, 43,232,123, 28,212,185,242, 44, 94,188,248,125,237, 61,230,213,163,199,251, 88,121,110,118, +165, 46,132,148,231, 34, 1, 22,147, 73,213,161, 34,205,226, 65,112, 64, 0,199, 14,200,195,172, 84,139,224,133,174, 29,232, 30, +129, 6,241,148, 12,144,142, 39,232, 51, 17,196,109,233,209,195,246,223,168,180, 72,229, 15, 87,220,156, 80,104, 96, 78, 85, 15, +203,109,132,119, 14,242,164,198,192,120, 22,131,202, 83, 38,128,216,215, 84, 65,241,219,249,205, 52,136,230, 68, 73, 49, 61,212, + 86, 2, 0, 79, 55, 5,223,187,122, 23, 13,118,105, 68, 93,171, 86, 45,101, 53,202,118, 68,201, 24,237,188, 88,247, 4,113, 20, +245,211,238,130,191,121, 96,128,230,106,212,136, 90,229,179, 0, 45,171, 61, 22,165,190,130,242, 91, 48, 1,191, 30, 56,112, 96, +173, 79,176,251, 82,128,209,227,167,207,101,255,145, 83,178,251,192, 49,217,190,231,136,108,222,113, 64,214,111,217, 35,171, 55, +236,144,229,107,192,231,131,222,134,129,145, 74,239,160,215, 25,217,123,232,132,236,220,231, 37,219,118, 31,146, 77,219,247,201, +186,205,187,100,213,250,237,178,239,208,113,195,244,172,117,152, 12, 54,100, 55, 97, 90, 16,196,246, 68, 9,228,180,105,211,132, + 19, 16,213, 55, 33,104, 83, 27,209,238,223,208,198,143,146, 49,142,153,148,106,113,162,133,196, 90,177, 85,194,152, 18, 8, 32, +123,212, 0,237,143,108,180, 0,200, 21, 27, 50,108,197, 87,218, 40,237,189, 84,144,197,133, 1,223,199,121, 1,188,114,185,168, + 86,223, 13,144,245, 12,192,148,118, 68,116,193, 33,148, 16,231,201,147, 71, 5, 88,157,209, 52, 9,178,205,104, 2, 20,210, 0, + 89,175, 41, 25, 83, 65,219, 39, 72,179, 12,176,201, 92, 22,189,157,139,246,247,205, 80,199,119, 47,135,148,233, 35,213, 33,118, +157,190,129,212,221,176,234, 48, 93,186,116, 15, 85,251, 44,170, 14, 27, 52,104, 32,165, 75,151, 30,138,178, 80, 96,240, 13,132, + 19, 67,177, 16, 80, 36,101, 4, 90, 84,245, 77,156, 56,209,176,125,162,234, 71,139,182,172,148, 46,211, 71,151,189, 31, 45, 72, +135, 31,209,140, 4,210,227,103, 42, 15, 84, 12,242,149, 26,197,235, 74,180,148, 21,145,246,227, 48, 33, 40, 54, 90, 92, 49, 27, + 73, 4, 69,122, 64, 75,165, 73, 59, 5, 53,241, 29, 4, 90,156, 40,236,223,195,107,232,160,134, 58,180,166,177, 42, 18, 45, 21, +100, 65, 36,106, 24,100,145,134, 86,117, 88, 46,111,218,155, 42,200, 26, 89, 57,141, 20, 72, 29,255, 1,193, 87, 72,129, 86,134, +111,163,102, 45,158, 41,197,179,227,235,230,200,146,223,139, 74,151,102,117,130, 96,228,147, 17,175, 29,134,196,221,107,156,100, +121, 30,130, 20,203, 76, 7, 84,243, 82,106,197,137,149, 82, 29, 12, 68,255, 72, 99,120,170,185,184,178,231,164,203, 68,192,193, +131,128,193,122, 45,151,222,183, 99,101,212, 83,235, 5,158, 46, 18, 72,131, 82, 30, 79,208,228,100,193, 51, 37, 59, 60,155, 1, + 90, 28, 92, 40,125, 32, 72,161, 17,176,181, 76,122, 69,114,116, 63, 51,140,161,239, 83,242, 64,201, 24,219, 55,109, 21,232,159, +134,147, 35,237, 34,104,104,202, 50,171,247, 57,153, 97,224,225,238,179, 31,157,189,144, 3, 53,212, 90,138,132,145, 18, 6, 74, + 11, 84, 94,242,236,226,158, 17,187,152,207, 2,180, 8,168,168, 34,164, 68,139,101,132,109,198, 95, 90,163,251, 79,145,104, 81, +122, 69,181, 41, 23,111,164,205,177,136,210, 93, 74,123,200, 31,163, 18, 40, 85,162,197, 49,137,234, 98,142, 81,164,199,186, 33, +216,160, 26,150, 0,199, 40, 61, 60,155, 28,182, 46, 87, 81, 54,203,200,145, 35, 95, 1, 12, 5,145, 6,119,243, 13, 24, 48, 32, +164, 64,171, 43, 22, 98,231, 89, 62,238,130,164,116,108,196,136, 17,202, 68,200,173,248,116, 73,209,161, 67, 7,250,184,162,235, + 7, 35, 71, 48,176, 69,208, 79, 59, 71,150,147, 96,158,187,195,181, 27, 55,216,175,120, 24, 85,159,131, 87,207,180, 32, 11,146, +215,158,120,156, 0,203, 8,232,119, 89,126,128,172,215, 4,152,255, 36,144,197, 2,235,237, 92,180,191,111,164,146,212, 60, 0, +169, 73, 33,109,124, 78,115, 0, 2, 86, 44,172,185,179,239, 13, 22,131, 47,176, 89,193,176, 49, 60,198,184,221,228,157,186,187, +144, 11, 61,210, 2, 16,126, 13, 0,196,157,156,138, 4,146, 32,139,121,168, 2,196,226, 96,183,209,178, 26,240, 12, 31, 17,101, +120,199, 29,173, 0,117,182, 5,135,138, 67,190, 82,160,229,154, 61,142, 80, 36, 65, 17, 39, 27, 14, 96, 70, 18, 7, 35, 61,123, + 42,210,228,106,136,106, 14, 53,241, 63,158, 11,228,243,246,239,225,181,144, 0, 45,136, 80,199, 82,146,101, 22,100,145, 75, 42, +208, 90, 58,127,110,157, 58,185,147,201,134,190,117,197, 41,200,130,100,139,249,141, 52,190, 52,241,163,102, 6,200,122,170, 2, +183,209, 85,210, 74,250, 68, 81,141,172, 58,141,144,183,229,193, 74, 69, 1, 90,228, 47, 38,249,127,164,123, 7,205,238, 66,155, +123, 7, 13,200, 50,108,167,101,199, 24,197,222,132,147, 35,129, 21,219,206,246, 94,189, 66, 34,209, 82,236,105, 8, 6, 9,180, + 62, 1,100,121, 64,146, 53,151, 32, 11,146,155,103, 0,192, 87, 33,134,191, 89,163, 70,141, 32,168,209, 20,128,197,196, 73, 18, + 91,234,149,149, 57, 1, 88,247,238,221,223, 99,101, 26,132, 62,241,151,171,138,135, 36,113, 59,129, 22, 12,163, 9,180,246,107, +243,186,186,103,160, 49,149,131, 52,180,168,179,157,135,144, 20, 22, 3,155,205,186,119,176,209,164,100, 11, 6,224,191,170,182, + 90,124, 79, 8,105, 58,148,104,193, 94, 82,252, 30, 60, 82, 36, 90, 43,214,110,145,109,187, 14, 26, 6, 70,142, 36, 90,164,119, +255,225, 99,155, 68,107,199,158, 67, 70,233,209,168,248, 60, 54, 59, 88, 0,136, 44,216,209,101,193,226,224, 42, 38,175,135,220, +113,101, 85, 29,134, 68,162, 21, 9,106, 65, 47,216,251, 61,162,218,153,106, 66,250,249,106,209,162,133,192,191, 25, 39,195, 27, + 48,105,160, 13,153, 17, 80,173, 54, 7,130, 45, 79,216,141,221,197,164,247,154,125, 8,186, 28,197,173, 3,221, 90,216, 39, 43, +208, 50,180, 73, 9, 99,254, 51,170,159, 66, 19, 96,169,133,134, 36,230, 53,165,192,255, 37,160,197,111,135,171,133,100, 61,122, +244, 88, 1,240,254, 20,110,124,158, 99,254, 94, 3, 91,213,148, 6,250,182, 45, 11,120,247, 29,128,249,123,242, 79,235, 59, 11, +115, 6,129,143, 98, 67,167, 94, 39,136, 95,177, 98,197,123,216, 20, 26, 6,114, 6,202,210,150, 54,175, 28,191, 32,125,101,100, + 21,229,248, 23, 72,180,236,213,135,255,103,133,163,143, 3,192, 81,236,169,216,225,232,226,193, 81,135,211, 94,163, 88,220,193, + 14,193, 96,142,215, 72,147,192, 74,251,156, 10,180,168,246,176,127, 7,175, 97, 96,178,151,104,233, 57,115,107, 4,144, 53,201, + 36,200,178,209,212,170, 14, 11,101, 76,121,170,102,182,132, 82, 48, 77,130,187, 31, 73,178,172,234, 67, 23, 64,203, 70, 51,125, +194,104, 25, 74,100, 74,241, 68, 43, 29,203,153, 44,198, 83,170, 17, 13, 52, 72,109, 22,189,111,247,192, 14, 57,197,189, 3, 87, +229,248,253,181, 56, 44, 85,157,152, 26,118, 88,234,128,111, 10,208, 34, 88,167, 36,148,237,138,128, 73,123,224,153,147,118,207, + 57,226,167, 34,205, 34, 80, 13, 33,200,178,209,196,196,125,157, 18, 42,168, 76,148,173,240, 24,192,218, 19, 0,218, 31,188,134, + 13, 22, 10,176, 3, 72,122,197, 51,158,189,160, 41,171, 67,135,165,144, 14,109,135, 88,126, 55,242,165,177,251,174, 84, 46,238, +169, 89, 29,182, 37, 72, 91, 82, 19, 72, 81,194,228, 36,241, 94,122, 39,237,246,139,209,228,251, 85, 9,148, 86,162,165, 70,173, +160, 77, 33,213,210,220,129,233, 64, 2,229,176,156,142, 36, 90,170,179, 78, 85,162, 69, 9,143, 19,137, 86, 48,154, 0,191, 83, + 0,178, 95, 64,170,102,153, 60,121,178, 5,160,155, 59,136, 57, 25,166,133, 10,229, 30, 39, 25, 24,116,223,208,233,255,206,250, +123, 70,128,169,227, 0,107, 71, 48,118,251, 97, 87,224, 27,216,207,220,198,132,184, 7, 42,226,227,160, 73, 41,185,179,195,213, + 24,146,128, 97,210,160, 46,127,207,246,207, 29,177,148,156,177,125,170,106,105,206, 9, 84, 89, 98, 33,160,117,101,211,205,217, +203,208, 86, 58,132, 80,130,165, 59,214,105,104, 23, 50, 56,142,234,210, 52, 72,199,229,152,172,183,115,209,254,190,131,119,126, +145,114, 2,104,245,165,249, 65,217,178,101, 29, 58, 43,165, 36,171,101,203,150,138,166, 11,210,119, 71,238, 98,204,150,147, 82, + 76,218, 36, 14,194,187,223, 81, 53,253,203, 47,191,112,156, 45,163,242,224, 43, 7, 90,234,103, 24,119,127, 3,209,223,126,236, + 50,129, 9,213,123, 91, 8, 30,118, 50, 53,169,110,245,213, 51,252, 75,189,179,235,124,124,105,176,138, 32, 77,172,238, 20,135, +141,106,226, 68,132, 65,233, 29, 85, 42, 4, 7,218, 4, 35,228,119, 24,160, 40, 6,119,217,176, 67,208, 57,236, 31,113, 8,180, +208,145,139,108, 90,191,178,198,179, 71,143, 74,240,183,195,228,220, 70,203, 70, 51, 67,210, 24,171,143, 65, 93, 72, 59, 47, 74, +199,114, 37,139,241,132,106,196, 16,148, 91,183, 97, 67,236,187, 73, 99, 63,101,196,104, 91,151,230,103, 40,167, 35,181,129,158, +186, 80,175,156, 39, 9,172,212,164, 26,130,155, 4, 90,170,138, 49,164, 32, 43, 88,155,167, 68, 11, 78, 37,109, 18, 45,216,208, +220,196,192,242,134, 18, 45,172, 22,223, 34,189,235,212,169, 19,109,169,130, 32,241,122, 8,149,225, 53, 24,140, 62,119, 32,209, +210,251,246, 16, 84,209,215, 31,226,132,192,232,209,147,103,114,248,216, 89, 57,232,117, 90,246, 29, 70,184, 28,216,106,237,216, +123, 68,182,236,252, 96,171,181,110,211, 14, 83, 64,139, 54, 95,135,143,157, 3,189, 51,176,253, 58, 41,123, 14, 30,135,173,214, + 81,217,186,235,144,108,220,182, 79, 54,108,217,173, 11,180, 0,118,126,130,170,229, 14, 36, 67, 22, 72, 44, 31, 99,220, 59,129, + 10, 74,161,169,164,180, 6,119, 25,186,170,119,213, 51,252, 58,208, 61,141,196, 51,213,133,122,146, 44,189,182, 20, 13, 64,242, +160,186,123,147,187, 46,169,113,224, 14, 76,238,240,100,162,106, 26,239,137,170,249, 30,167, 64, 43, 36, 13,211,250,140, 94, 57, + 67, 66,250, 75,210,212,219,185,104,127,255,139,205,113,218, 23, 97,179, 67,127,128,169, 64, 2, 42,130, 30,213,165, 7, 93,124, + 80,242,138, 13, 81,129,216, 25,216,223, 9,179,131,241, 19,187, 24, 83, 99, 28, 43,139,113,172, 13,210, 88,152,174,108,192,249, + 18,210, 35, 38,168, 58,223, 17,216,141, 29, 59, 86,113, 23,194, 29,135, 0,157, 51, 67, 82,145, 95,250,153,179,217, 63,104,174, +206,228,244, 40,194,223, 60, 59, 41,131,113,144,101, 37, 16, 13,157,237,160,218,185,244,206,232,124,180, 45,210,118,190, 96,147, +142, 51,154,120,199, 13,220, 43,199,179,253, 59,208,201, 15,227, 94, 52,187, 15,250,172,157,197,149, 31,173,144, 2,173,188,223, +199, 58,183,160, 69, 65, 21,100, 61,166, 26, 49,132, 13,229,179,126,123, 8,203,228,232,177,191,163,156,244,250,126, 82, 39,217, +123,134,119, 40,209,250, 68, 62,104,105, 42, 54, 90, 52,166,231,130,130,137, 11, 10,216, 65, 80,101, 68, 27,172,143,238, 59,177, +209,250, 59,248, 25, 18, 54,124,209,114,170,238, 29,172,147,191,205, 21,131, 1,247, 14, 14,203, 73,122, 4,111, 42, 61,173,123, + 7, 26,244,170, 46, 35,156,184,119,176,209,132,251,141,213, 80,133,223,131, 74,248, 26,164, 87,116, 99, 97, 63, 46, 26,229,237, + 23,229,167,209, 66, 57,200,215,249, 19,158,117,246,232,215,242,237, 95,125, 57, 1,176, 82, 65, 29,121, 16, 90,160,167,176, 29, + 13,130,116, 52, 8, 27,180,158, 65, 13,125, 8,234,194, 96, 62,174, 92,205,197,176,235, 75,131, 84, 9, 32,170, 43,206, 51,144, +246,163, 31, 60, 84,119,190,211,110,146,155, 43,168,238,166,218, 18,180,232,186,200,144, 47, 66,190, 23,243,111,110,164, 10,214, +179,250,187,164,122,237, 51,180, 65, 27, 73, 21,104,217,159,237,222,169,239,176,244, 51, 21,242,171,107,132,206,226, 28,218,199, + 61,212,254,119,194, 59,219,183,167, 77, 24,173, 72,158, 20, 49,189,177,219,240,104,186, 4,209, 92,137,245,245,170,225,171,227, +167,222, 7,153,184,255,181,126,123,106,216,169,204,225, 38, 5, 38,252,158,133,111,214,238, 42,212,187, 79, 22,125,173,223,110, +162,122,157,102,253, 26,191, 61, 5,193, 22, 37, 91,159,200,128,175,229,219,233,222, 38,180,143,175,229,219,255, 85,229,132, 13, +105, 88, 38,131,149,249,145, 68, 11, 11,203,178, 72,109,144,198, 34,109, 64,186,132,244,136, 9,230, 12,151,177, 17, 96, 21,104, + 15, 64, 50,235,214,132, 64,139,241, 87,169,117, 32,216,178,253, 86,175, 25, 44,115,136,178, 17, 96,169,137, 4, 84,192, 21, 34, + 98,159,225,161,127, 85, 35, 52,201, 31,247,183,155,100,152, 78,118, 55, 63,221,252, 12, 45, 14,184,219, 82,104,113,242, 3,157, +186,161, 75, 78,161,230,174,163,208,101,234,215,194, 79,167, 95,253,119, 2, 45, 19, 85,161,149,106,153,120,236,211,178,126, 45, +149,235, 46,231,167,213,179,253,211,110,126,186,249, 25, 90, 28,112,183,165,208,226,228, 7, 58,159,131,159,229, 66,183,136,159, +173,156,159,227,219,221, 52, 63, 67,229, 59, 34,249,119, 2, 45,213, 54, 75,149,106, 57,177,209,178,183,207, 10,246,159, 13,197, + 81, 50,195, 62,103, 52, 92, 93,215,163,239,166,233,184, 94, 66, 90, 95,110,126,186,249,105,180, 13,184,251,166,115, 14, 24,229, +161, 54,223, 63,157,159, 53, 81, 64, 35, 6,237,204,163, 77, 13,241,159, 32,203, 61,206,135,108, 14,253, 55,182, 37,245,155,244, +218,188,233,251,127, 39,208,178, 25,195,103,247,240,100,193,157,168, 14, 93, 2, 45,211, 31,108,226, 1, 55,218, 55,193, 44, 3, + 89,221,252, 52,192, 36, 19, 89,220,252, 52,193, 44, 3, 89,221,252, 52,192, 36, 19, 89,220,252, 52,193, 44, 3, 89,221,252, 52, +192, 36, 19, 89, 62, 7, 63,157,190, 30, 64,171, 24,252, 12,246, 64, 6,101, 87, 56,127,219,217,106,153, 40,186,185,172, 6, 37, + 90, 36,234, 86, 29,186, 96,237,231,104, 48,110,154,230,218,178, 94,110, 55, 63,245, 56,100,238,190,155,159,230,248,165,151,219, +205, 79, 61, 14,153,187,239,230,167, 57,126,233,229,254, 90,248,233, 10,104, 69, 4,176,202,163, 26,195, 91,119, 31,170,255,115, +235, 49,224,223,124,223, 85,229, 38, 9, 19, 46, 66,247,136, 81, 98,108,141, 24, 57,218, 61, 37, 69,141,185, 53, 28,174,129, 33, + 73, 62, 5, 20,193,155, 98,134,202,177,163, 92, 45, 19, 35,226, 45,252,206, 99,128,193, 14,203, 89,195,195,163, 96,253,136, 17, + 45,205,224, 55,198, 81,226, 61,230,113, 66,255,107,105,216,238,114, 26,104, 32, 38,178,184,249,105,130, 89, 6,178,186,249,105, +128, 73, 38,178,184,249,105,130, 89, 6,178,126,173,252,140, 6,215, 35,135,225,195,210, 79, 77,170, 11, 19,158, 85, 63,106,234, + 25,190,213,232, 8,247, 91, 59,126,216,127,123,104,208, 52,192,242,191, 63, 75,136, 84,135,154,248, 66, 69, 66,249, 19, 28, 54, +194,176,225, 35, 53,139,253,109,162, 7,191,119, 29, 18, 52,118,230, 26, 89,181,253,152,172,218,118, 76,198,204, 88, 45,173,186, + 13, 13,138,151, 48,201,131,240,145, 34, 53, 11, 9,128,201, 0,191, 91,229,162, 71,122,242,112,104, 51,121, 58,180,177,148,141, + 30,225, 9,175,233,124,215, 71,229, 36,128,106, 30, 47, 94,192, 99,120,197,183, 63,232, 12,147,142, 92, 31, 33, 54, 95,243,184, +113, 3,156,128,173,175,181, 3,134, 70, 19,248,183,124,123, 34, 4, 86, 29,138,129,232, 40, 98,127, 61,192, 0,228,141,193,105, + 4, 24,148,244, 83, 22, 2, 33, 96,240,191,133,159, 33,248,244,207, 98,188,109,136,159,233, 18, 69, 43, 84,245,167,140,183,243, +164,142,183, 58,109,146,232,113,205,142, 33, 33,249, 88,157,137, 44, 20, 72,126,113,126,186,138,105,232,234,158,161, 58, 50,201, +144, 96, 52,225, 52,214, 11,253,219,143,137, 1,190,153,208,191,149, 68,239,255, 76,246, 32, 4,215, 14,232,212, 81,106,228,217, +202, 24,143,120,214,101, 98, 30,230, 5,189,212, 46,104,198, 64,121, 70, 35,223, 93, 45, 16,114,246,155,249,152, 31,244, 98,184, + 42, 39,242, 28, 66,236,213,160,143, 38, 55, 7, 23,232,164, 28,254,253,130, 64,251,252,231,166,249, 25,177,136,201,166, 18,162, +236,174,109,180, 62,163,219,251,143, 58, 75,132,200,209,215, 20, 41, 83,227,197,146,141,135,165,219,144, 89, 82,174,126, 55, 41, + 80,165,157, 20,170,214, 65, 42, 53,238, 37,221,134,206,145,121,107, 15, 73,177,114, 53,253, 35, 71,139,181,198,193,231,186,236, +128,121,162,134, 27,188,187, 97,225,183, 50,189,137,200,212, 6,178,163, 86,158,183,188,102,102,144,180,129, 44, 4, 85, 61,191, +121,179,180, 75,156, 88, 58,197,143, 47,189, 32,217, 26,152, 40,145,140, 74,146, 68,166, 34,126,215,109,132,162,184, 15, 15,183, + 78,192,214,103, 31, 40, 66,212, 20, 62,126,200, 93, 78, 7,140,196, 32,220, 24,222,140, 31, 50,168, 52,227, 21, 50,172, 15,131, +235, 34, 90, 65, 16,226, 73, 62,196,224,220, 34, 36, 11,129, 16,214,153,187,142, 66,200,184, 79,169,163, 52, 9,162, 77,123,182, +119,162,156,159,219, 94,126, 74, 27,255, 98,186,120, 81, 18,185, 1,182, 67, 14, 56,107,159,174, 66,107,233,133,221,114, 72, 51, +114,228,200,116,246, 27, 44,136,186,253,127,248, 48,115, 22, 67, 50, 24, 77, 2, 44,246,107, 46,156, 9, 38, 24,149,132,161,228, +212,176, 75,188,167, 38, 6, 42,103, 72, 34, 56,179, 85,194,105,105,142, 96, 52,177, 32,219,194, 69,184,246, 32,125,103, 9, 49, + 63,133,207, 56,163, 73,208,228,233,233, 41,140, 48,193, 4, 79,237,178,100,201, 18,197,233,231,252,249,243,101,244,232,209, 74, +148, 21, 53,162, 10,203,143,144, 76,129, 86,176,229,180,156, 0,129,247, 88, 70,189,208,122,140, 75,203, 60,214, 80,121, 12,118, +255, 89,105,126, 70, 44,242, 73, 35,136, 65,207,240,137,241, 18,173,141, 22,255,255,255,248,140, 31, 23,172, 17, 66,146,213,164, + 96,137,170,254,203, 54,123, 73,149, 22, 67, 36, 93,193, 90, 31,225,231,156,165, 26, 73,131,206,227,100,222,186,163, 82,188, 98, + 29,255,240,145,162, 52,113, 85,185,218,123,144, 92, 37,252, 37,110,212,128, 55, 19, 91,203,237,133, 37,228,253,230,159,229,237, +136,250, 82, 35, 86,164, 0,222, 51, 50, 72,218,131,172,142,113,227,202, 10, 68, 50,223, 31, 59,182, 28,138, 19, 71,142, 34,121, +227,218, 62, 94, 79,158, 92,238,236,222, 45,119, 15, 28,112, 4,182, 92, 78,142,209,162, 69, 59,110,141,117,102,198,129,233,223, + 61,225,102,100,153, 89,118, 51,192,245,147, 90,248,255, 31,118,245,237,108,208,142, 86,199,244, 58,156,192, 72,189,107,243, 68, +130, 52,181, 73,147, 38, 1, 28,112, 25,184,151,158,141, 25, 50,130,241,238,124,124,124,228,206,157, 59, 12,155,243, 2, 3,100, + 59, 7,180, 93,149, 51, 28, 98,212,205,164,199,113, 4,109, 13,192,160,125, 31,239,154, 7, 26,159, 18, 54, 37, 12,104, 54,128, + 51,212, 85, 69,139, 22, 61,132,184,138,107, 65,243, 87,208,100,160, 96, 87,135, 94, 91, 34, 79,185,163,172,129, 53,149, 64, 28, + 70, 87,188,228,187,204,210, 44, 30, 66,154,148, 80,111, 64, 58,169,147,152,199,145, 52, 91,175,156, 10,223,210,197,143, 82,185, +115,213,236, 65, 47,215,182,147, 43, 83,234, 74,241, 12,241,125, 50, 36,142,156,220, 9, 83, 13,209, 52,217, 23,190,102,154, 10, +144,226,193, 51,146, 54,142,169,171,123, 42,139, 28,126, 59, 2, 16, 7, 17, 88, 56, 59, 8,140,152,199, 72, 29, 17,104, 49,100, +215,130, 5, 11, 4, 49, 62,101,213,170, 85, 2,175,232, 74, 48,237, 93,187,118, 9, 23, 89, 8,222,173,196,250, 61,123,246,172, + 2,186,244,128, 86,212,168, 81,159,177,108, 42, 48, 67,192,116, 37,208, 61, 2,181,203,133, 11, 23,148,241,131,209, 31,248,159, +113, 51, 57,166,240, 25,187,242,218,190,157, 18,170,105,211,166, 73,245,234,213,133, 1,206,237, 19, 3,210,171,158,215,121,102, + 89,249, 62, 62,231,140, 38,175, 67, 34,230,203,114,170,207,176, 28,252, 70,150,145,193,234,175, 93,187,166, 44, 44,111,223,190, + 45, 4, 91, 4,112,248,118,151, 64, 43, 52,104,126, 70, 44, 98,178,235, 5,207,110,208, 51,188,235,119,124,161,143, 75, 18, 35, +118,130, 7, 11,215, 29,148,134, 61,166, 75,246,178, 45,157,118,150, 18,181,187, 73,251,161, 43,100,214,170,131, 18, 47, 65,146, + 7, 40,189, 43,155, 45,219,199, 21,136, 17, 97,222,137,223,203, 4, 62, 26, 91, 69,206,109, 70,120,194,171, 53, 68, 38, 85, 17, +175,250,121,223,231,143, 17, 97,174, 17, 78,211,238,138,234, 66, 74,178, 8,178, 86, 70,141, 42, 27,144,118, 3,108,169, 32,235, + 64,204,152,178, 37, 90, 52, 57, 4,240,181,235,187,239, 20,176,117, 11,210, 45, 62,107,228, 29,204, 67,241,244,206,157, 59, 5, +113, 9, 31,226,111, 78,163,207,253,141,249,114,102,203,150,237, 17, 7, 35,150, 61, 52,202,129,213,105,117,128,182, 7, 60,135, +144, 30,193,196,128, 95,127,253,213, 23, 0,131, 65,110,181,225, 28,194,241, 26,238,113,192,241, 68,210, 3, 30,106, 17,146, 34, + 38,225, 3,130, 44, 14, 90, 12,124,202,176, 17,184,166,252,231,224,200, 65,136, 3, 16,130, 68,179,109,166, 52, 88,246, 8, 80, + 77, 92,195, 74,244, 5,104, 91, 16,252,218,242,240,225, 67, 11, 98,226,189,192,234,242, 6,104,232,129, 45, 71,175, 9,131,144, + 49,179, 17, 63,244, 48, 86,156,222, 8, 4,236,141,129,221,123,246,236,217,135,112,125, 62, 30, 48,234,225,217,158,118,118, 12, +254, 13,186,116,233, 82, 6, 65,145,139, 49, 97,229, 92,162, 97,195,134,213,250,245,235,151,195,224,247,218,103,203, 9, 96, 90, +159, 52,193,211,226, 8, 92, 92, 20,113, 0, 75, 54,109,218,180,250,192,129, 3,179,154,164,185,129,193,154, 33, 13,120,129,122, +240, 71,122,206, 4, 0,252, 12,147,194, 83, 72, 32,159, 96,178,121,178,123,247,110,127,208,117, 36, 21,255,232,117,233, 18, 70, +251,189, 67,157,146,150, 63,154,148,151, 30, 13, 74, 73,215, 58, 69,164, 83,141,124,210,173,102,110,217, 57,168,178,188, 94, 82, + 87,110, 77,172, 32,101,179,124,251, 44, 83,220,232,166,189, 90,155,252,190,175, 61, 59, 23, 61,202,248, 78,160,177,126,253,122, + 45,216,178,129,172,103,207,158, 41,147, 56,243, 34,185, 82, 35,218,248,129, 62,180,117,226,196,137, 65,236,159,148, 48, 65,253, + 37, 55,111,222, 84,192, 1,250,147, 2,140, 48,166,216,135,218,114,200, 79,170, 10, 9,218, 84,144,197,120,127, 44,203,162, 69, +139, 20,144,197,197, 21,131,147, 19,128, 48,208, 59,129, 22,250,149,189, 68, 43, 24,109,188, 91, 1, 90, 44,155,250,237,136, 39, + 40, 45, 90,180,144, 94,189,122, 41,241, 3, 73,151,227, 8, 3,158,147, 62,159,113, 86,225, 4, 76,136,127, 42, 85,171, 86, 53, + 4,180, 72,143,101,117, 0,180,130,189, 66, 5, 69, 28,211, 8,178, 88, 30,130, 63, 71, 32,139,192,205, 9,208, 10,117,154, 95, + 8,139,152,238, 95,161,226, 25,254, 75,232, 69, 97,248,222,173,105,135,129, 65, 67,167,111,146,226,141, 71, 72,174,242,173,108, + 64, 43,123,137,134,146,187,116, 99,219,255, 82,245,122, 74,163,222, 11,100,212,220,221,210,178,219,240,192,112, 17, 34,235,250, +120, 65,240,192, 52,191, 37,137,107,121, 55,177,133,156,156,249,147,132, 13,243, 65,188, 44,123,127,150,192,129,149,164,105,252, +232, 1,204,163,199, 97, 26,189,243,160,186,112, 37,192,213,250, 40, 81,228, 29,196,198, 94, 77,154,200, 62,252, 63,128,196,223, +188,182, 61,122,116, 57,151, 32,129,156,201,158, 93, 89, 69,252, 10,245,162, 30,125,245, 62,245,255,124,207,131, 7, 15, 24, 96, +248, 17,194,117, 20, 54,250,172,125, 62,198, 94,211, 26, 53, 58,251,237, 36, 70,155,238,107, 89,182,130, 5, 11, 62,230, 55, 18, + 96,176,236,186, 15,233,100,128,120,191,108,237,218,181, 49,214, 62,227,106,237, 25,255,155,164, 73,224, 52,104,202,148, 41, 79, +200, 71, 43,160,210, 74, 92, 18, 19,128,241, 30,243, 48, 47,146, 46,216,130,196,110, 32, 87,179, 28,188, 85,144,197, 85, 95,132, + 8, 17,148, 1,140,177, 10,185, 42,229, 0,143, 1,154,118, 11, 99,140,148, 27, 82,166,217, 4, 89, 4, 88, 24,184, 45,231,207, +159,183,128,142, 5, 3,178,101,216,176, 97,254, 24,108, 23, 27,161,163,205, 67, 73, 22, 38,177,195,207,159, 63,247,198, 0,235, +141,119,120, 99,240,246, 14, 8, 8,240,198,128,126, 16,255, 77, 7, 56, 5,253,196, 0, 89,141, 48, 25, 20, 3, 96, 41,170, 77, +248,246, 34, 80, 75,212, 3,200,209, 6, 72, 54, 82,236,164, 4,110,251,246,237, 43, 81,178,100,201, 33, 0, 92, 23,153,240,123, + 40, 0, 87, 41, 0,197,250,123,246,236, 73,102,132,144, 53,207, 73,240,206,223,209, 10, 95,123, 13,125,139,245,126, 18,201, 85, +188, 54,133,100,213,124, 63,220,125,119,116,154,188, 59, 52, 65,222,238, 29, 46,111,183,123,202,219,141,157,228,245,170,223,228, +205,134,142,242,102,245,111,242,122,102, 25,241,159, 92, 72, 90, 22, 74, 28,152,254,219, 24,102,219,171,137,207,251, 87,100, 85, + 0, 21, 65,150, 29,216, 82,198, 87, 2, 17,212,185, 35,105,151,222,199,103,135,129,118,128, 42, 49, 82,129, 22,165, 68, 84,217, +229,206,157,251, 37, 8,104,165,103, 78,233, 17,104, 17, 64, 80, 37, 71, 0,196, 62, 78, 80, 67,176,162,130,172, 51,103,206, 40, + 0,132,146,109,244, 43, 2,173,219,174, 10,168, 2, 45,130, 62,180,107,249,165,102, 77,241,246,242,146,203, 24, 59,152,206,130, + 30,191,155,224,134,239, 65, 60, 64,151, 64,139, 42,192, 70,141, 26, 73,187,118,237,164, 77,155, 54,130,152,132,242,219,111,191, + 9,131, 62, 99,124, 83, 18,199, 37, 74,162, 88, 86, 2, 77,220,127,231, 64,117, 24,172,216,224,161, 50, 54,178, 28,197,138, 21, +147,252,249,243,219, 18,223,193, 52,124,248,112,217,190,125,187, 82,127,228, 19,194,135,249,186,250,118, 45,205, 54,209, 61,228, +215,104,255, 79, 88, 84, 9, 19,213,158,124,167, 51,154, 95, 2,139,232, 53,176,175,250,126,196, 40, 49,183, 12,153,180, 66,126, +239, 55, 95, 74, 55, 27, 35, 69,235,122, 74,254,202,176,125,168,214, 81, 10,215,232, 44, 69,170,254,110, 3, 90,101, 27,244,150, +166,158, 75,228,143,241, 27,101,216,212, 53, 18, 45,102, 92,123, 29,246, 71,188,248, 41, 86,248, 29,215, 58,253, 28,116,239,175, +114,114,121, 71, 41,155, 14, 95,174, 65,170, 53,165,180, 92,104,152, 51,136,121,244,152,168, 2,173,142, 0, 77, 7, 40,177, 2, +152, 34,176, 10, 66, 39,230, 89,251,251, 4,212,136,215, 96,179,117, 53, 83, 38,197,142,167,201,183,223, 26, 6, 90, 4, 67,170, +232,150, 19,119,174, 92,185, 30,135, 0,108, 40,159, 19, 59,118,236, 27, 28,104, 92, 29,188,207,124,122,223,111,127,159,101, 66, + 68,247,167, 92, 65,178, 19, 19,128,176,236,102,233,104,243, 3, 0, 20,198,132,248,148,171, 73,170,225, 32,137, 17, 0,185, 39, +188,110,144,110, 48,144,101, 5, 82,158, 14,158, 29,160, 2, 49,163, 96, 11, 43,189,131, 4,147, 39, 97,159, 71, 73, 22, 65, 22, + 87,180, 28,132,239,222,189, 43, 22,139, 69,177,231,224,234,150,146, 45, 12,188,199,140,148, 25,131,208, 93, 72,157, 44,219,182, +109,179,204,157, 59,215,130, 1,197, 2,137,139, 5,245, 98,193,247, 91,168, 70, 52, 66, 71,155, 7, 82,182,149,148,100, 97,176, +246,198, 0,230,141,123,202, 25, 34,127,111, 0, 88,239,164, 73,147,174, 55, 75, 19,249,203,116,232,208,161,140, 61,200, 82,255, + 99, 80, 47, 11,176, 88,205, 36,221,114,221,186,117, 43,141,118,212,159,147,175, 54, 17,108, 1,116,150,199,192, 91,197, 4,205, +147,152,248,158, 1,184,250,172, 88,177,194,103,237,218,181, 62, 91,182,108,241, 1, 63,125, 80,103, 62,152,192,124, 80,103, 62, +160,249, 24, 52, 79, 34, 49,128,183,203, 3,246, 88,109, 27, 22, 73,243,182, 85,217,244,114,121,106,109,121,179,172,161, 2,176, +130,158,248,216,186, 85,208,163,171,242,122, 65, 53,121, 57, 38,131,212,203, 25,251,117,234, 56,113,236, 13,142,245, 94,243, 57, +238,115, 91,251,126, 36,142,109,121, 63,199, 11, 62,129,102, 48,176,181,113,227, 70,133,151,236,239, 33, 4, 89, 74, 81, 48,142, +237, 67,127, 14,210, 74,180,184, 96,101,159,197, 66,105,159,209,242, 82, 50,207,254,204,201, 29,113,248,148,118,137,152,124, 2, +201, 61, 23,191,146, 51,103, 78,142,203, 12,128, 44,104,163, 74,223, 55, 10,180, 8, 0, 17, 51, 48, 24,200, 82,193, 22,207,228, + 1,199, 83,142, 49,174, 36, 90, 40, 83,104, 25,195, 7, 99,139, 10,138, 40,201, 34,200,162, 29,152,154, 8,130,212, 68, 16, 71, + 62,211, 70, 11,227,137,189,234,208, 41, 77,130,172,245,223,254, 63,105,231, 38,214,149, 81,154, 70,235,242, 75,231,115,178,235, + 80,149,246,171,182, 90,193,109,180,190, 68, 33, 97, 4,127,123,193,186,195,242, 75,199,169, 82,254,183,113,242,115,171, 9, 82, +165,237,100,169,244,251, 88, 41, 92,173,157,173, 30, 38,207, 90, 34,229, 27,245,149,223, 6, 44,151, 78, 35,215,201,220,117,222, + 18, 37,122,108,151,171, 8,216, 95, 21,232,147, 54,177,229,221,184,134,114,124,193, 79,242,242,108,149,224, 64,203,171,146, 4, +245, 41, 42,221,146,197,164,173, 86, 1, 87,223,171, 2,173,158,144,108, 41, 54, 89,180,199,178, 74,177, 8,182, 84,192,117, 12, + 32,140, 32,235, 6, 36, 95,119, 50,103, 86, 0, 67, 72,128,214,142, 29, 59,132, 81,205,185,106,194,106,236, 73, 8,213,104, 25, + 97,247,115, 31,134,218,138, 56,218, 62,241, 58,239,227,187,205,216,131,121,176, 44,148, 58,177,147,113, 21,194,178, 82,111,255, +137, 64, 43, 39,108,137, 30,211,120,147,160,141,101, 37, 8, 36,216,196, 32,103, 84,141,218,215, 14, 64,237,194,183, 77, 66,154, +104,151,120,109,151, 93,222,174,174,234, 31,131,184, 47, 7, 1, 2,172, 52,105,210, 56, 52,186,133, 93,145,208,182,131, 96, 11, +171,188, 59, 70,250, 79,198,140, 25,253, 33,121,178, 96, 64,167,122,217,150,240,188, 5,134,178, 22, 12,224, 1, 70,232,104,243, + 20, 40, 80,224, 32,213,133,168, 39, 5,100,169, 9,146, 46, 69,141,136,114, 30, 49, 75, 19,249,235,163,158, 63,146,102,169, 64, + 11, 19, 72,113,116,214,206, 38,233, 54,160,250, 17,188, 61,205,201, 76,155, 40,217,130,164, 20,122,126,233,100,130, 38,129,214, + 19,130, 44, 72, 76,124, 96, 83, 19, 12,100, 97,242,240,129, 10,196, 7, 60, 96,123, 58,137,164, 11,180,144, 39, 76,134,132,209, +103,173,237, 95, 93,222,172,105, 41,175,231, 87, 1,200,186, 46,199, 46,222,151,218,189,215, 43,137,191, 3, 31, 92,144,151, 67, +147,139,119,219,120,130, 0,241, 4,142,127,247, 65,149,185,202,211, 19,127,119, 97, 28,188, 95, 1, 91, 4, 89, 92,192, 0,164, + 11, 36,155, 33,145,100,105, 73,231, 71,127,121, 65,125, 24,145,170, 0, 0, 17, 55, 73, 68, 65, 84, 48, 64, 64, 67,131,114, 74, +155, 32,153, 97,191,202,111,148, 7, 4, 90,236,195,155, 54,109,146,100,201,146, 41,101, 34,192,162,241, 55, 85,125,148, 28, 81, +157,216,160, 65, 3, 69,165, 70,169, 14,222,235,178,191,171, 18, 45, 74,152,218,181,109,171, 72,177, 72, 87, 5, 89,234,111, 46, + 92, 41,205, 34, 47,116,128,150,209,207, 49,149,143, 11, 63, 78,186,156,119, 92, 1, 45,242,149,210, 67,142,215, 0, 90,122, 18, + 45, 27, 77, 87, 64,139,239, 53, 74,211,212, 71,253,253,153, 85, 13,130,253,249, 67,201,128,232,139, 88, 69,118, 69, 62, 87, 89, +225, 39,235, 14,119, 19,214,237, 50, 29, 32,107,162, 84,109, 55, 69,106,116,156, 38,197,106,117,147, 19,167, 47, 40, 64,107,242, +172,165, 82,161,241, 7,144,213,106,240, 42,233, 58,102,163,204, 93,127, 76,162, 68,139,237,178,113, 23,141, 21,225,220,189, 63, +170,201,237,241, 37,197,103,119, 25,161, 20, 75, 29,124, 20,137, 22,211,172,226,114,171, 65, 70, 97, 94, 87,223,168, 2,173,254, + 0, 80, 4, 89,199,226,197,179,169, 11,181, 64,139,210, 44,130,172,219,216,129,120, 27, 18, 45,118,118, 51, 64,139,219,115,249, +205, 92,209, 48,113, 53, 70,113, 53,221, 8,132,176, 14,114,162, 35, 60, 56,120,240,160,162,222, 82, 19,255,243, 58,104,154,182, + 3, 99, 89,168,218,227,160,161,150,147,224,136,101, 15, 97, 25, 51,230,201,147,231, 17,129, 27,213,144,218,114,146,127, 4,115, + 41, 82,164,208, 5,132, 81,162, 68, 57,233, 82,124,231,226, 38,158,229,234,223,233,129, 1,232, 48,129, 31, 87,176,148,100,241, +123, 57,160, 67,178,167, 12,230, 60,184,131,136, 3, 15,237, 75,192,219,147, 70,120,193,129, 77, 85, 27, 82,146,165, 38,170, 15, +121,221, 10,132,141,144,178,229, 73,153, 50,229, 74,128, 66,111, 12,150,222,152, 44, 20,160, 5, 27, 58,111,128,126, 5,104, 97, + 82, 88,103,138,224,135,204,117, 80,182, 96, 42, 67,173,116,203, 10,138,168,134, 53,115,212,165, 77,150, 11,160, 85, 18,108, 29, +104,130,224, 73,212,209, 35, 21,100, 65, 58, 98,147,100, 17,100,225,158, 15,218,147, 15,128, 45,219, 61,235, 71, 15,104,125, 0, + 89,127, 86,129,138,176,165, 60,157, 86, 26, 54, 89,245,148,186, 38,192,202, 88,103,182,146,248,155,199,203,113,217,196,210, 39, +178, 20,251, 33,186,203,177,196,196,247,124, 74,214, 83,234, 88,135,179,215,167, 16,250, 76,207,218,108,178,216,143, 40,197,230, +152,100, 45,179, 33, 21,159,163,114,209, 12, 98,250,244,233, 10,208,226, 88,194,133, 17,198, 43, 83,223, 79,160,133, 54,162,168, +199,102,206,156,169, 72,173,203,151, 47,175, 72,170,217,239, 41,193, 38,109, 74, 96, 88,118,142, 91,102,128, 22,213,144,174,128, + 22,199, 84,244, 53, 61,160, 21, 3,223, 58, 26,101, 53,228,222,129,249,152, 31, 60,115, 41,109, 77,144, 32,193, 29,182,101,142, +193,122, 64,139,160,144,245,134, 69,162, 75,160,165,165,169, 7,180,156,209,252, 18, 88, 36, 36,237, 92,245, 12,175,198, 56,116, + 34,209,178,151,100, 5, 55,221,248, 18, 6,104,145,162,198,220, 54,104,226,114,105, 55,120,137, 21,100, 77,151, 90, 93,102, 74, +201, 58,244,162,255,225,168,208,216, 83, 90, 2,100,181, 6,200,106, 55,108,173,244,159,186, 83,134, 77, 91, 39, 49, 98,197,221, +230,140, 57,153,195,122, 84, 27,159, 55,245,203, 55,163,107,201,241,165,133,228,205,197,106,142,129,214,153, 42, 34,221,115,200, +208,212, 49, 45,124,198, 25, 61, 2, 45, 78,164, 35,146, 38, 85, 64,214,161, 88,177, 28,170, 14,189,161, 70, 60,139,251, 42,208, +162, 68,198, 12,208,162, 35, 56,126,179, 42,125,162, 61, 16,140,183, 31,133, 80,162,165,124, 14, 85,111, 80, 39, 61,164, 56,152, +131, 4,207,252,111, 66, 37, 23,140, 45, 44, 11,203,196,178,169,229,228,170,148,101, 15, 73, 99,133, 61,211, 13,130, 23,130, 55, +150,207, 62,113,208,132,228,131, 54, 96, 55,116,232,123,126,130, 68,171,163, 43,218,216,137, 52, 4,170,168, 32, 14,180, 4,152, + 28,136,168, 50, 32,208,226,138,150,101, 39,224, 34,208, 66, 62,193,224, 50,206, 8, 47, 80, 7,115, 70,142, 28,137, 5,244, 11, + 5, 88,241, 12, 26, 22, 52, 1, 75,251,246,237, 67,106,163,213,100,242,228,201,135, 48,104,121,195, 38, 68,177,209, 66, 59,244, + 6, 77,239,206,157, 59, 31, 0,168,108,105,164,108,118,121, 10,192, 94,165,132, 51,213, 33,202,141, 14, 38,109, 77,210,253,137, + 52,157,169, 14, 81,126,172,132,164,149, 9,154, 4, 90, 15, 41,201, 34,200, 2,136,243,129, 81,175, 15,192,177, 15, 38, 73, 5, +100, 97,130,244, 65,189,177,157,234, 1, 45, 5,100,173,243,172, 36,111, 86,254, 42, 75, 91, 3, 68, 77,200, 45,175,231,254,236, + 28,104,141,201, 40, 47, 7,124, 43,117,114,197,161,177,253,223,125, 20,181,126,227, 21,156,139,253,221,133,177,123,191, 13,100, +209,102,137,227, 8, 65, 22,143, 80,144,106, 21,195,196,255,130, 38, 27, 4, 75,165, 75,151,166, 52,203,212,247,211,214,148,253, +153,106, 76,130, 30,168,183, 21, 0, 72,219, 42, 46,182, 56, 6,112, 49, 69,144,197,119, 16,108, 0,104,217,239,230, 11,246,201, +170, 68,139, 96,141,224,237, 28,198, 59,173,202,144,191,175,227, 30,199, 16,130, 44,130, 60, 87, 18, 45,130,166,229,203,151, 67, +128, 30,248,209,242,145,215,180,110, 41, 56, 78,241,123, 48, 54, 6, 90,193,150,211,230,160,130, 34,218,158,209, 30, 75,171, 46, +212,170, 17,137, 13, 56,214,241, 93, 70,129, 22,105,210, 30, 75,123,104,213,136,167, 59, 53,119, 74,243, 75, 96,145,144,244,145, + 80,219,117,168, 26,161,133,164, 16, 70,158,161,199,247, 95, 59, 12, 12, 28, 49,107,155,212,236, 56, 93,106,119,153, 37,245,186, +207,149,210,245,254,144,236, 69,170, 75,142,162, 53,164, 82,211,126,210,122,200,106,105, 55,124,173,116, 26,181, 65,198, 47, 57, + 36,191,119, 31, 25, 24, 33, 66,100,122,139,255,232, 40,130,157, 42,165,163, 71,188,247,212,179,186, 92,159, 88, 84,238,236, 47, +247, 65,122,229, 44, 45, 44, 42, 15,234,165,146, 82,209, 34,220,227,179,142,104, 18,104,209,168,114, 10,252,100,237, 7,144,218, +138,221,133,170, 49, 60,213,133,148,100, 17,100,241, 26,119, 34, 42, 64, 11,122,124,118, 44, 51, 64, 11, 13, 93, 1, 90,156,200, + 57,248, 64,205,243, 48,164, 54, 90,218,239,192,228, 90, 22, 42,184, 71, 4, 9, 60,243,191,145,250,113,150,135,101, 98,217, 84, + 73, 25, 7, 54,150, 61, 36, 52,161,114,244,162,107, 3,189,196,124, 58,244, 29,217,104, 13,112,240,140, 61, 32, 51, 98, 16,159, +130,187, 14,169, 10,166,154,148,131, 45, 7,179, 76,144, 90,114,160, 85, 65, 22, 87,183, 0,161,148,152,216, 59, 27,116, 86,244, + 72, 0,113, 55, 6, 12, 24,192, 93,114, 22,238, 60, 4,109, 5,100,225,250, 77, 60, 20,162, 93,135, 0,189,243, 96,180,122,144, +146, 45,117,231, 33, 65, 22, 86,182, 52,174, 55,180,147, 75, 91, 96,172,110,227,119,236,216,177, 26, 38,154,143,164, 90, 24,140, +139,161,201, 14, 69,130, 6,222,248, 1,117, 76,162, 78,157, 58, 85,133,237, 84,113,123, 99,120, 72,227, 32,130, 22,142,202,122, + 82, 39,237, 11, 79,162,191,221,199,196,237, 3, 41,176, 15,164,193, 54,144,133,122,243,129, 4,130,210, 44, 31, 76, 16,180, 41, + 57,137,228,148,118,250, 68, 81, 7,173,235, 83, 65,177,201, 90,242,123,102,201,144, 48,234,249, 83,221,191,147,151,195, 82, 74, +224,253,115, 31,171, 14,253, 78, 67,154, 21, 73, 2, 70,252, 40,121,191,143,125,193, 56, 23,254,115, 57,131,129, 44,238,176, 6, + 7,148, 68,144, 21, 26, 96, 11,253,230, 12,253, 73,113,135, 32,108,179,206,152,229, 48,129, 22,205, 4, 56,182, 81,141,199,197, + 36,129, 15,199,100,246,125,130, 44, 2, 68,130, 23, 74, 96, 8, 54,140, 2, 45,218, 54, 81,202, 70,179,144, 43, 80, 59,170, 96, + 75, 5, 89,220,237,199,119,193,182, 80,207, 24,254, 46,223,203,178,193,127, 95, 48, 87, 14, 90,183, 14,252,205,251,212,140, 80, + 2, 71,201,150, 43,126,192, 38,244, 54,235,128,227,155, 30,208, 82,253,130, 65,219,224, 82,162,165,165,169, 7,180,156,209,212, + 24,195, 27,182,119, 54, 91,239, 33,201,175,149, 96,169, 59, 16, 29,208,209,250,208, 82,127,255, 63,219, 23, 66,145, 73,226,124, +155,248,254,244,101,123,225,186, 97,185,212,239, 49, 87, 26,245, 90, 32,229, 26,246,177, 1,223,170,205, 7, 72,251,225,235, 20, +144,213,111,218, 78,153,185,234,168,196, 79,148,156,147,186, 67,247, 14,217,195,135,105,189,172, 76,166, 87, 47, 71, 84,146, 19, +171,138,200,251,203,213,109, 32, 75,237,212,193, 64, 23,165, 93, 61,178,200,156,108,113, 95,242, 89, 71, 12,167,139,134,135,232, +116,183,176,218, 88, 6, 3, 73,186,112,216, 6,131,248,227, 0, 88,215,173, 54, 89,231, 97,244,190, 27, 46, 30, 46,194, 96,254, + 54, 26,183, 15,108,160,206, 1,249,155,113,239,160, 2, 45,118,112,216, 7, 60, 8,169,212,201,209, 55, 96,133, 84, 29,106,154, + 7, 60,135,164, 81,217, 63,195,178,177,140, 44, 43, 87, 62, 33, 5, 90,161, 81, 22, 13, 13,251, 93,135, 28, 4,180,198,135, 9, +184, 19,145,141,203,168, 33,188, 74, 27,124,107, 83,179,102, 77, 2, 34, 69,117, 64, 59, 14, 14,118,170, 83, 64, 14,186,176, 93, +243, 7,143, 93,218,123, 57,248,222, 8,244,155, 69, 27, 55,240, 48,128,103, 72, 13, 9,136, 66, 2,178, 84,242, 97, 64,179, 49, + 38,128,181, 80, 99, 30, 1,136,197, 70,217, 40,236,228,166, 65,150, 74,112,194,132, 9, 89, 49,249,212,193,247,151,195, 36, 83, + 28, 60, 40, 5, 30, 80,234, 52, 4,169, 82, 72,234,113,210,164, 73,217, 72, 19, 0,169, 28,218, 80, 9, 72,245, 74,130,230, 47, +224,235, 48, 10,179, 77,210,228,174,195,123, 48, 38, 86, 64, 22, 22, 21, 62, 88, 69,251, 64, 66, 74, 3,120, 5,100, 1,116,250, + 0, 32,115,178,113, 9,180, 42,102,137,127,239,245,252,202,178,228,183,244, 4, 89,179,210, 38,136, 82,161, 79,201,152, 98,249, + 51,166,188, 26,151, 85, 2, 1,172,212,131,191, 95,253,149, 5, 54, 90,201,100, 83,251, 12,146, 54, 97,212,225, 38,203,253, 95, +201,110,115,239,192, 73, 95, 3,178, 8,190, 20, 0,166,130, 45, 2, 4,235, 88, 29,146,246, 90, 50, 76,152, 48,239,153, 64,195, +180,207, 49,246, 63, 26,165,115, 92, 35, 64,161, 6, 64, 5, 89,148,182,171, 32,139,146, 34,213,119,151, 81,160, 69,211, 3,154, + 66,168, 70,244, 28, 51, 72,135, 11, 53, 21,100,209,118,150,210, 51, 87, 18, 45,154,105, 80,195, 66, 16,101, 4,104, 49, 15,199, + 44, 61,243, 14, 21, 20,113, 65,201,221,133,174, 36, 90,106,251, 7,208, 50, 4,222, 72,147,187, 11, 93, 73,180,156,209,252, 66, + 88,228,239,233,135, 95,234,227,224,124,180,217, 79,165,107,248,207, 94,125, 88, 58,141, 88, 45,191,246, 93, 44, 21,155,120,218, +234,163,250,111,131,164,243,232,141,210,127,218, 46,153,179,254,132,148,170, 84,255,121,164, 40,209,155, 57,227, 74,149,184,145, +206, 60,237, 83, 85,222, 47, 44, 37,175,175, 79, 18,185,183, 88, 63,109,104, 44, 15,235,164,146,202,113, 34, 58, 92, 1, 41, 14, + 75, 17, 86,199,239,240, 97,185,133, 85,216, 78, 24, 62,159,135, 11, 7,130,172,155,170, 77, 22,165, 88, 76, 42,200,194, 22,230, +102,177, 99, 59, 11,197,227,176,248,148,234,176, 35,195, 24,154, 54, 73,166,237,167,254,134,150,146,147,101,229,224,193,178,255, + 13,239,119,244, 74,130, 45, 79, 2, 42,171, 31, 45,237, 96, 29,193,234, 71,139, 0,140,210, 46, 93,215, 14,218, 23, 64,244,222, + 6,126,178, 30,114,192,160, 40,156,131, 36,165,121,236, 43,144,120, 61,194, 32,109,198,120,251, 31,194, 46,227,197,192,132,147, + 20,192, 18, 43, 23,161,110,159, 82,172,246, 38,165, 78, 31,189,204, 74,147,128,141, 52, 9,176,218,134,144,230, 6,184,214,120, + 12,169,195,125, 76,136,208, 56,251,249, 1,184,221, 3,192,242, 69, 61,249,162,220,119,153, 96, 44,207, 93,135,220,141,231, 84, +162, 5,255, 89,173,106,100,143,119, 7,146,173,177,214, 54,242, 13, 0,212,230,149,117, 99,136,165,127, 92,177,244,139, 41, 47, +199,102, 86,146,101, 64, 60,236, 56,204, 40,151, 6,231,147, 60,223,197,242, 77,157, 48,218,183,198, 57,250,159,203,169, 0, 42, +141,159,172,143, 28,150,106, 64, 86,136,109,181, 62,133,171, 4, 90, 52,206,167, 75, 16,150, 83,207, 93, 8, 39, 42, 0, 45,151, + 82, 29,213, 97, 41,199, 73, 2, 42,126, 35, 84,219,138,253, 45, 37,103,116, 29,131,157,199,140, 48,161,128, 44,184, 75,113,228, +176,212,246, 89,148, 76,209,100,193,168, 68,139,239,164, 52, 78, 79,162,197,221,147,252, 30,142,105,148,172, 81, 2, 71, 16,200, +164,149, 42,161, 15,217,230,103, 61,160,165,165,201,239, 39,200, 86, 15,170, 11,213,116,188, 69, 29,167, 52,191, 20, 22,249,148, +118,227,226, 89,215, 18,173,207,244, 82,135,100, 97,171,181,233,167, 82,213, 95, 76, 91,182, 95, 70,205,219, 35,109,250,205,145, + 95, 90, 13,150,218,173,135, 74,167, 33, 11,101,220,226, 67, 50, 99,213, 17, 41, 82,182,230,139,232, 49,226,108,114, 85,182, 10, +177, 34, 28,184,210,180, 88,144, 12,169, 44, 50,160,188,200,159,165, 68,122, 23, 21,249,163,160, 72, 55, 4,245,238,148, 29,211, + 67, 38, 12,231,233,131,165, 51,197, 18, 5,241, 89,103,180, 85,176,229, 11,123,161, 59,232, 24, 39,177,221,247, 10, 84, 71,220, + 93, 72,195,119, 37, 65, 93,168, 72,178, 66, 0,178,248, 94,172, 56,188,160,246,185,129,159,166,118, 2,126,201,186,114,240,174, +140, 44, 51,203,254, 55,151,195,254,245,244,159,165,117, 86,170,222, 39,240,250,148, 45,182,223,225,123,167, 2, 88,158,165, 20, + 15,171, 64, 96,238, 4,211, 65,243,135,127,216,247,255,215,138,163,122,134,167,234,206, 85,218,141,251, 89,144,190, 51,195,160, +172, 64,217,105, 19, 68,221,217,173, 4, 54,195,116, 75, 37,207,198,192,110,107, 98,126,185, 60, 56,183, 76,168,151, 70,178, 37, +137,113, 51, 77,252,168,112,203,231, 62,116, 56,160,128, 45, 36, 71, 64,202,213,189, 47,194, 88,168, 14, 15, 67,154, 21, 72,169, + 22, 85,136,180,195,226,110, 56,130, 13, 74,160, 40,193,166,217,128,122,192,166,234, 29,198, 2,238,242,116,122, 48,156, 14,237, +117, 9,120, 40, 41, 35,200,162,221, 41,237,192, 40,217, 83, 65, 22,253,139, 17,100,209, 43,189,131, 16, 60, 54,250,180,181,130, +183,250, 64,170, 47, 89, 54,158, 89, 94, 74,160, 8,100, 40,189, 34, 88,162, 4,142, 18,120,154,176,244,237,219, 87,215, 70,139, +142, 87,249, 93,164, 65,176, 73,186,148,220,171,223,109, 31, 70,136,121,177,249,198,165, 68,235,115,208,252, 34, 13, 33,244, 95, + 18, 18,255,133,161, 95,138,240, 81,162,180,138,155, 32,233,131,230,157,134, 4, 13,158,180, 74,102,173,241,146,217,107,142,201, +144,201,107,228,183, 46,195,130,226, 39, 74,241, 32, 74,148,104,186,198,177, 48, 20, 73, 93, 49,102,132,227,213,163, 69,120, 89, + 61,106,248, 15, 41, 74, 56, 91,170, 22, 57,236, 75,251, 84, 21,215, 42,196, 8,127,140,207,186,250, 50, 21,108,209,227, 59, 27, + 51, 87, 60, 20,137, 82,167,205,142,196, 6, 77,117,161, 89, 73, 86,232,115,211, 77,209,205,129,255, 44, 7,232,136,148,210, 42, + 87,137, 32, 43, 36,106,169,111,224,190,161, 86,218, 4,209, 86,166, 79, 16,229,106,198,132, 81,111, 3,124,109, 75, 27, 63,106, +231, 28,137, 61,162,252,103, 57,110,254,195, 67, 26, 84,218,252,155,204, 63, 17,141, 96,139,155,123,152,184,152,210,218,143, 98, + 97,197,197,149, 31, 0,132,146,112,239, 16, 94, 17, 85,231, 53,169, 9,156, 40,217,162, 74,208, 85, 98, 30, 43,200,114, 53, 23, +125,150, 93,135,144,230, 93,209,238,162,166,105,132,154,168,170,180, 63, 40,241, 2, 47,124, 92,125,251,231,160,105,190, 74,191, +204, 19, 78,118, 29,254,115, 36, 90, 26, 54, 36,137, 16, 41,122,207,232,113,226,239,136, 26, 61,142,111,212, 24,113,124, 99,198, + 77,176, 3,170,194,158,200, 99, 40,228,206,231,102, 41,193, 22,237,174,232,241,157,134,238,246,137,247,152,231,115,151,195, 77, +223,205, 1, 55, 7,220, 28,112,115,192,205,129, 80,228, 64, 90,238,238, 86,129,165, 10, 42,181,192, 82, 5,152, 60, 3,136, 18, +100,233,133,158,250, 28, 52, 67,241,147,191, 34, 82,170, 14,213, 96,145, 13, 25, 40,154,116,187,255,183,210, 52,248,221,204,102, +182,156, 70,118, 89, 24,165,169,250, 69,243, 52, 80, 94,163, 52,109,186,251, 80,164,105,198,127,155,209,114,134, 42, 77,141,205, +128, 81,186,186,229,212,246, 33,131,253,201, 48, 77, 19,125,233,111,167,105,160, 29, 25,234, 71, 90,187, 14,131,187,167,205,124, +187,209,190,100,134,166,209,190,100,134,102,168,183, 79, 19, 62,141, 92,150,211,190, 77, 26,164,107,138, 38, 27,138,129,190,100, +138,166,193,190,244,143,160,105,160, 47,133,180,156,174,230, 37, 67,237, 83,235,163, 83, 83,247, 70,230, 38, 3,159,245,101,179, +168, 59, 14, 85,127, 90,118,111, 15, 29,149,161,193, 65, 76,251,110,221,138,208,102, 54,208, 81, 12, 13,188,159,139,166, 73, 67, + 61, 67,223,110,240,155,213, 79,250,219,104,170, 5, 48, 88, 94,163,229,220,109, 29, 32,149,179,206, 97,148,166, 50, 48,132, 70, + 57,181,237,221, 68,221, 27, 26,208,212, 50,134,118, 57, 77,212,147,225,114,126, 14,154,159,139,159,122,141,200,122,223,240,183, + 27,172, 31,221,113,201,209,216,105,128,182,153,114, 26,237, 75,102,104, 26,237, 75, 33,234,155, 58,223,111,154,230,167,242,211, + 89, 59, 15,205,114, 26,236, 75,166,191,221,192,152, 23, 34,154,161, 49, 38,107,203,102,160,142, 12,118,225,191, 55,219,103, 87, + 29,154,100,148,161,202,213, 76, 58, 69, 12,176,207, 20, 77, 3,244,116, 7, 73,109,231, 48, 1, 54, 13,149,211,224,170,201, 52, +208,210,174, 34, 66,179,179,112, 69, 98,128,167, 70,191,221,232, 42,220, 76, 29,169, 52, 67, 69, 66,104, 15, 8, 12,180,127,221, +111,215,210, 48, 64,207,208,183,219,211, 52, 80, 79,127,107, 57, 53,237, 94,175,158, 12,151,211, 68, 95,250, 91,105,154, 24,239, +204,148,211,104, 95, 10, 9,205, 80,169, 35,181, 77, 90,235,201,243, 83, 1,140,253, 24,103,160, 47, 25,250,118,109,223, 49, 48, +142,134,136,230,167,142,201,218,114, 25,236, 75,166,202,105,176, 47,233,210,180,111,235, 6,233, 26,152, 98,254,158, 44, 95, 68, +162,101, 0, 53,219,127,189,225,138, 48,193, 54, 67, 52, 13,174, 28, 76, 1,152,175,133,166, 9,105,129,161, 73,220,228,119, 27, +166,249,185,202,105,162,157,234,182,165,175, 13,104, 25,152,108, 12,183,121,123, 90, 6,104, 27,230,167,137, 54,245,183,210, 52, +209, 70, 77,149,211, 0, 47, 13,245,163,207,221, 62, 13,246, 37, 93, 41,153,118,124, 55,200, 83, 83, 52, 63,103, 57, 63, 5, 20, + 57,171,231, 79, 1,153, 95, 11, 77, 71,117, 98,176,238, 77,192,129,127,105, 86,131, 3,132,225,193, 92,131,120, 21,187, 5, 3, +108,211, 29,208,236,104, 22, 9, 45,154, 38, 38, 7, 67,131,228,231, 42, 39, 87,100, 6, 86, 98,166,234,200,224, 64,102,138,230, +231, 40, 39,104, 42, 43,101,237,170,212, 69,253,235,182, 37,205,192, 96,148,167,134,105,154,224,169, 97,154, 6, 87,183,134,218, +167,118, 80, 52,200, 83,195,229, 52,209,151, 12,211, 52,177, 90, 54, 67,243,107,169,247, 80, 47,167,137,190,164, 11,138,212,186, +177,182,121, 35,101, 53, 69,211, 96, 95, 50, 69,211, 96, 95, 10, 41, 77, 87,243,146, 41,154, 6,251,146, 41,154, 6,251,146,161, +126, 20,130,186, 55, 48,101,127, 93, 89,254, 7, 92, 51,104,174,242,165, 70,254, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, 0}; diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 64da61f8f55..081d604819d 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -693,6 +693,7 @@ void draw_gpencil_2dimage (bContext *C, ImBuf *ibuf) /* calculate rect */ switch (sa->spacetype) { case SPACE_IMAGE: /* image */ + case SPACE_CLIP: /* clip */ { /* just draw using standard scaling (settings here are currently ignored anyways) */ @@ -766,7 +767,7 @@ void draw_gpencil_view2d (bContext *C, short onlyv2d) /* special hack for Image Editor */ // FIXME: the opengl poly-strokes don't draw at right thickness when done this way, so disabled - if (sa->spacetype == SPACE_IMAGE) + if (ELEM(sa->spacetype, SPACE_IMAGE, SPACE_CLIP)) dflag |= GP_DRAWDATA_IEDITHACK; /* draw it! */ diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c index 56210864593..81a5f6777e7 100644 --- a/source/blender/editors/gpencil/editaction_gpencil.c +++ b/source/blender/editors/gpencil/editaction_gpencil.c @@ -422,6 +422,7 @@ void paste_gpdata (Scene *scene) case SPACE_NODE: /* Nodes Editor: either screen-aligned or view-aligned */ case SPACE_IMAGE: /* Image Editor: either screen-aligned or view\image-aligned */ + case SPACE_CLIP: /* Image Editor: either screen-aligned or view\image-aligned */ if ((gps->flag == 0) || (gps->flag & GP_STROKE_2DSPACE)) stroke_ok= 1; break; diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index c915bc9ea37..65db5e27ed7 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -69,6 +69,7 @@ #include "ED_gpencil.h" #include "ED_view3d.h" +#include "ED_clip.h" #include "gpencil_intern.h" @@ -137,6 +138,19 @@ bGPdata **gpencil_data_get_pointers (bContext *C, PointerRNA *ptr) } break; + case SPACE_CLIP: /* Nodes Editor */ + { + SpaceClip *sc= (SpaceClip *)CTX_wm_space_data(C); + MovieClip *clip= ED_space_clip(sc); + + if(clip) { + /* for now, as long as there's a clip, default to using that in Clip Editor */ + if (ptr) RNA_id_pointer_create(&clip->id, ptr); + return &clip->gpd; + } + } + break; + default: /* unsupported space */ return NULL; } @@ -183,7 +197,10 @@ static int gp_data_add_exec (bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } else { - /* just add new datablock now */ + /* decrement user count and add new datablock */ + bGPdata *gpd= (*gpd_ptr); + + id_us_min(&gpd->id); *gpd_ptr= gpencil_data_addnew("GPencil"); } @@ -231,7 +248,7 @@ static int gp_data_unlink_exec (bContext *C, wmOperator *op) /* just unlink datablock now, decreasing its user count */ bGPdata *gpd= (*gpd_ptr); - gpd->id.us--; + id_us_min(&gpd->id); *gpd_ptr= NULL; } @@ -552,8 +569,8 @@ static void gp_layer_to_curve (bContext *C, bGPdata *gpd, bGPDlayer *gpl, short * - must clear transforms set on object, as those skew our results */ ob= add_object(scene, OB_CURVE); - ob->loc[0]= ob->loc[1]= ob->loc[2]= 0; - ob->rot[0]= ob->rot[1]= ob->rot[2]= 0; + zero_v3(ob->loc); + zero_v3(ob->rot); cu= ob->data; cu->flag |= CU_3D; @@ -570,6 +587,9 @@ static void gp_layer_to_curve (bContext *C, bGPdata *gpd, bGPDlayer *gpl, short case GP_STROKECONVERT_CURVE: gp_stroke_to_bezier(C, gpl, gps, cu, subrect_ptr); break; + default: + BLI_assert(!"invalid mode"); + break; } } } @@ -599,17 +619,7 @@ static int gp_convert_layer_exec (bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - /* handle conversion modes */ - switch (mode) { - case GP_STROKECONVERT_PATH: - case GP_STROKECONVERT_CURVE: - gp_layer_to_curve(C, gpd, gpl, mode); - break; - - default: /* unsupoorted */ - BKE_report(op->reports, RPT_ERROR, "Unknown conversion option"); - return OPERATOR_CANCELLED; - } + gp_layer_to_curve(C, gpd, gpl, mode); /* notifiers */ WM_event_add_notifier(C, NC_OBJECT|NA_ADDED, NULL); diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index ff3b69c2bf6..bd02df2ddba 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -103,6 +103,11 @@ typedef struct tGPsdata { short radius; /* radius of influence for eraser */ short flags; /* flags that can get set during runtime */ + + float imat[4][4]; /* inverted transformation matrix applying when converting coords from screen-space + to region space */ + + float custom_color[3]; /* custom color for */ } tGPsdata; /* values for tGPsdata->status */ @@ -277,6 +282,7 @@ static void gp_stroke_convertcoords (tGPsdata *p, const int mval[2], float out[3 /* 2d - on 'canvas' (assume that p->v2d is set) */ else if ((gpd->sbuffer_sflag & GP_STROKE_2DSPACE) && (p->v2d)) { UI_view2d_region_to_view(p->v2d, mval[0], mval[1], &out[0], &out[1]); + mul_v3_m4v3(out, p->imat, out); } #if 0 @@ -658,7 +664,7 @@ static void gp_stroke_newfrombuffer (tGPsdata *p) found_depth= TRUE; } - VECCOPY2D(mval_prev, mval); + copy_v2_v2_int(mval_prev, mval); } if (found_depth == FALSE) { @@ -997,6 +1003,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p) /* pass on current scene and window */ p->scene= CTX_data_scene(C); p->win= CTX_wm_window(C); + + unit_m4(p->imat); switch (curarea->spacetype) { /* supported views first */ @@ -1097,6 +1105,33 @@ static int gp_session_initdata (bContext *C, tGPsdata *p) #endif } break; + case SPACE_CLIP: + { + SpaceClip *sc= curarea->spacedata.first; + + /* set the current area */ + p->sa= curarea; + p->ar= ar; + p->v2d= &ar->v2d; + //p->ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser); + + invert_m4_m4(p->imat, sc->unistabmat); + + /* custom color for new layer */ + p->custom_color[0]= 1.0f; + p->custom_color[1]= 0.0f; + p->custom_color[2]= 0.5f; + p->custom_color[3]= 0.9f; + + /* check that gpencil data is allowed to be drawn */ + if ((sc->flag & SC_SHOW_GPENCIL)==0) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: In active view, Grease Pencil not shown \n"); + return 0; + } + } + break; /* unsupported views */ default: @@ -1182,8 +1217,12 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode) { /* get active layer (or add a new one if non-existent) */ p->gpl= gpencil_layer_getactive(p->gpd); - if (p->gpl == NULL) + if (p->gpl == NULL) { p->gpl= gpencil_layer_addnew(p->gpd); + + if(p->custom_color[3]) + copy_v3_v3(p->gpl->color, p->custom_color); + } if (p->gpl->flag & GP_LAYER_LOCKED) { p->status= GP_STATUS_ERROR; if (G.f & G_DEBUG) @@ -1299,6 +1338,12 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode) p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE; } break; + + case SPACE_CLIP: + { + p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE; + } + break; } } } @@ -1336,9 +1381,12 @@ static void gp_paint_strokeend (tGPsdata *p) /* finish off stroke painting operation */ static void gp_paint_cleanup (tGPsdata *p) { - /* finish off a stroke */ - if(p->gpd) + /* p->gpd==NULL happens when stroke failed to initialize, + for example. when GP is hidden in current space (sergey) */ + if (p->gpd) { + /* finish off a stroke */ gp_paint_strokeend(p); + } /* "unlock" frame */ if (p->gpf) @@ -1724,8 +1772,6 @@ static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op) if (gp_session_initdata(C, p)) gp_paint_initstroke(p, p->paintmode); - p= op->customdata; - if(p->status != GP_STATUS_ERROR) p->status= GP_STATUS_PAINTING; diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 0ac5a9e46ce..6b449f68e1d 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -462,10 +462,8 @@ enum { DRAWCFRA_SHOW_NUMBOX = (1<<0), /* time indication in seconds or frames */ DRAWCFRA_UNIT_SECONDS = (1<<1), - /* show time-offset line */ - DRAWCFRA_SHOW_TIMEOFS = (1<<2), /* draw indicator extra wide (for timeline) */ - DRAWCFRA_WIDE = (1<<3) + DRAWCFRA_WIDE = (1<<2) } eAnimEditDraw_CurrentFrame; /* main call to draw current-frame indicator in an Animation Editor */ diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 121c53f7c65..2e9186b6c2f 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -141,7 +141,7 @@ void create_vgroups_from_armature(struct ReportList *reports, struct Scene *scen void auto_align_armature(struct Scene *scene, struct View3D *v3d, short mode); void unique_editbone_name(struct ListBase *ebones, char *name, EditBone *bone); /* if bone is already in list, pass it as param to ignore it */ -void ED_armature_bone_rename(struct bArmature *arm, char *oldnamep, char *newnamep); +void ED_armature_bone_rename(struct bArmature *arm, const char *oldnamep, const char *newnamep); void undo_push_armature(struct bContext *C, const char *name); @@ -163,7 +163,7 @@ void BIF_deleteSketch(struct bContext *C); void BIF_selectAllSketch(struct bContext *C, int mode); /* -1: deselect, 0: select, 1: toggle */ void BIF_makeListTemplates(const struct bContext *C); -char *BIF_listTemplates(const struct bContext *C); +const char *BIF_listTemplates(const struct bContext *C); int BIF_currentTemplate(const struct bContext *C); void BIF_freeTemplates(struct bContext *C); void BIF_setTemplate(struct bContext *C, int index); diff --git a/source/blender/editors/include/ED_clip.h b/source/blender/editors/include/ED_clip.h new file mode 100644 index 00000000000..7d36159f47e --- /dev/null +++ b/source/blender/editors/include/ED_clip.h @@ -0,0 +1,64 @@ +/* + * ***** 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) 2009 Blender Foundation. + * All rights reserved. + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file ED_clip.h + * \ingroup editors + */ + +#ifndef ED_MOVIECLIP_H +#define ED_MOVIECLIP_H + +struct ARegion; +struct bContext; +struct ImBuf; +struct Main; +struct MovieClip; +struct SpaceClip; +struct wmEvent; + +/* clip_editor.c */ +int ED_space_clip_poll(struct bContext *C); + +void ED_space_clip_set(struct bContext *C, struct SpaceClip *sc, struct MovieClip *clip); +struct MovieClip *ED_space_clip(struct SpaceClip *sc); +void ED_space_clip_size(struct SpaceClip *sc, int *width, int *height); +void ED_space_clip_zoom(struct SpaceClip *sc, ARegion *ar, float *zoomx, float *zoomy); +void ED_space_clip_aspect(struct SpaceClip *sc, float *aspx, float *aspy); + +struct ImBuf *ED_space_clip_get_buffer(struct SpaceClip *sc); +struct ImBuf *ED_space_clip_get_stable_buffer(struct SpaceClip *sc, float loc[2], float *scale, float *angle); + +void ED_clip_update_frame(const struct Main *mainp, int cfra); +int ED_clip_view_selection(struct SpaceClip *sc, struct ARegion *ar, int fit); + +void ED_clip_point_undistorted_pos(SpaceClip *sc, float co[2], float nco[2]); +void ED_clip_point_stable_pos(struct bContext *C, float x, float y, float *xr, float *yr); +void ED_clip_mouse_pos(struct bContext *C, struct wmEvent *event, float co[2]); + +/* clip_ops.c */ +void ED_operatormacros_clip(void); + +#endif /* ED_TEXT_H */ diff --git a/source/blender/editors/include/ED_fluidsim.h b/source/blender/editors/include/ED_fluidsim.h index f48b5df56c0..d47ba2bfba9 100644 --- a/source/blender/editors/include/ED_fluidsim.h +++ b/source/blender/editors/include/ED_fluidsim.h @@ -48,9 +48,4 @@ void fluidsimSettingsFree(struct FluidsimSettings* sb); /* duplicate internal data */ struct FluidsimSettings* fluidsimSettingsCopy(struct FluidsimSettings* sb); -/* memory estimate */ -void fluidsimEstimateMemory(struct Object *ob, struct FluidsimSettings *fs, char *value); - #endif /* ED_FLUIDSIM_H */ - - diff --git a/source/blender/editors/include/ED_logic.h b/source/blender/editors/include/ED_logic.h index e6026eb5fee..ce1f2b8faac 100644 --- a/source/blender/editors/include/ED_logic.h +++ b/source/blender/editors/include/ED_logic.h @@ -34,6 +34,3 @@ void ED_operatortypes_logic(void); #endif /* ED_LOGIC_H */ - - - diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h index 48232acf562..3035aa44735 100644 --- a/source/blender/editors/include/ED_particle.h +++ b/source/blender/editors/include/ED_particle.h @@ -51,7 +51,7 @@ int PE_start_edit(struct PTCacheEdit *edit); struct PTCacheEdit *PE_get_current(struct Scene *scene, struct Object *ob); struct PTCacheEdit *PE_create_current(struct Scene *scene, struct Object *ob); void PE_current_changed(struct Scene *scene, struct Object *ob); -int PE_minmax(struct Scene *scene, float *min, float *max); +int PE_minmax(struct Scene *scene, float min[3], float max[3]); struct ParticleEditSettings *PE_settings(struct Scene *scene); /* update calls */ @@ -72,7 +72,7 @@ void PE_undo(struct Scene *scene); void PE_redo(struct Scene *scene); int PE_undo_valid(struct Scene *scene); void PE_undo_number(struct Scene *scene, int nr); -char *PE_undo_get_name(struct Scene *scene, int nr, int *active); +const char *PE_undo_get_name(struct Scene *scene, int nr, int *active); #endif /* ED_PARTICLE_H */ diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h index 8e445ab1cee..b5a1ca193db 100644 --- a/source/blender/editors/include/ED_space_api.h +++ b/source/blender/editors/include/ED_space_api.h @@ -54,6 +54,7 @@ void ED_spacetype_sequencer(void); void ED_spacetype_logic(void); void ED_spacetype_console(void); void ED_spacetype_userpref(void); +void ED_spacetype_clip(void); /* calls for instancing and freeing spacetype static data called in WM_init_exit */ diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index c644b1d27b4..37f647abfd9 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -94,6 +94,7 @@ enum { #define CTX_AUTOCONFIRM 32 #define CTX_BMESH 64 #define CTX_NDOF 128 +#define CTX_MOVIECLIP 256 /* Standalone call to get the transformation center corresponding to the current situation * returns 1 if successful, 0 otherwise (usually means there's no selection) @@ -107,10 +108,12 @@ struct Base; struct Scene; struct Object; +#if 0 /* UNUSED, deprecate? */ void BIF_setSingleAxisConstraint(float vec[3], char *text); void BIF_setDualAxisConstraint(float vec1[3], float vec2[3], char *text); void BIF_setLocalAxisConstraint(char axis, char *text); void BIF_setLocalLockConstraint(char axis, char *text); +#endif int BIF_snappingSupported(struct Object *obedit); @@ -132,7 +135,7 @@ struct EnumPropertyItem *BIF_enumTransformOrientation(struct bContext *C); const char * BIF_menustringTransformOrientation(const struct bContext *C, const char *title); /* the returned value was allocated and needs to be freed after use */ int BIF_countTransformOrientation(const struct bContext *C); -void BIF_TransformSetUndo(char *str); +void BIF_TransformSetUndo(const char *str); void BIF_selectOrientation(void); diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index e43ad964c9c..82a1e6f1f00 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -290,4 +290,6 @@ void ED_view3d_camera_lock_init(struct View3D *v3d, struct RegionView3D *rv3d); /* copy the view to the camera, return TRUE if */ int ED_view3d_camera_lock_sync(struct View3D *v3d, struct RegionView3D *rv3d); +struct BGpic *ED_view3D_background_image_add(struct View3D *v3d); + #endif /* ED_VIEW3D_H */ diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index f310b8b78f8..4ac5a6eed4a 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -173,6 +173,7 @@ DEF_ICON(NODETREE) DEF_ICON(LOGIC) DEF_ICON(CONSOLE) DEF_ICON(PREFERENCES) +DEF_ICON(CLIP) DEF_ICON(ASSET_MANAGER) #ifndef DEF_ICON_BLANK_SKIP DEF_ICON(BLANK057) @@ -180,7 +181,6 @@ DEF_ICON(ASSET_MANAGER) DEF_ICON(BLANK059) DEF_ICON(BLANK060) DEF_ICON(BLANK061) - DEF_ICON(BLANK061b) #endif /* MODES */ @@ -642,6 +642,8 @@ DEF_ICON(DRIVER) /* ANIMATION */ DEF_ICON(SOLO_OFF) DEF_ICON(SOLO_ON) +DEF_ICON(FRAME_PREV) +DEF_ICON(FRAME_NEXT) #ifndef DEF_ICON_BLANK_SKIP /* available */ DEF_ICON(BLANK186) @@ -666,8 +668,6 @@ DEF_ICON(SOLO_ON) DEF_ICON(BLANK205) DEF_ICON(BLANK206) DEF_ICON(BLANK207) - DEF_ICON(BLANK208) - DEF_ICON(BLANK208b) #endif /* EDITING */ diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index cb18ea37ffc..942252bc00f 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -222,18 +222,19 @@ typedef struct uiLayout uiLayout; #define TOGBUT (37<<9) #define OPTION (38<<9) #define OPTIONN (39<<9) +#define TRACKPREVIEW (40<<9) /* buttons with value >= SEARCH_MENU don't get undo pushes */ -#define SEARCH_MENU (40<<9) -#define BUT_EXTRA (41<<9) -#define HSVCIRCLE (42<<9) -#define LISTBOX (43<<9) -#define LISTROW (44<<9) -#define HOTKEYEVT (45<<9) -#define BUT_IMAGE (46<<9) -#define HISTOGRAM (47<<9) -#define WAVEFORM (48<<9) -#define VECTORSCOPE (49<<9) -#define PROGRESSBAR (50<<9) +#define SEARCH_MENU (41<<9) +#define BUT_EXTRA (42<<9) +#define HSVCIRCLE (43<<9) +#define LISTBOX (44<<9) +#define LISTROW (45<<9) +#define HOTKEYEVT (46<<9) +#define BUT_IMAGE (47<<9) +#define HISTOGRAM (48<<9) +#define WAVEFORM (49<<9) +#define VECTORSCOPE (50<<9) +#define PROGRESSBAR (51<<9) #define BUTTYPE (63<<9) @@ -506,8 +507,6 @@ uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, const char *str, int x1, i uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, int x1, int y1, short x2, short y2, float a1, float a2, const char *tip); -void uiBlockPickerButtons(struct uiBlock *block, float *col, float *hsv, float *old, char *hexcol, char mode, short retval); - uiBut *uiDefAutoButR(uiBlock *block, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, const char *name, int icon, int x1, int y1, int x2, int y2); int uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, int (*check_prop)(struct PropertyRNA *), const char label_align); @@ -751,6 +750,10 @@ void uiTemplateKeymapItemProperties(uiLayout *layout, struct PointerRNA *ptr); void uiTemplateList(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *activeptr, const char *activeprop, const char *prop_list, int rows, int maxrows, int type); +void uiTemplateMovieClip(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, int compact); +void uiTemplateTrack(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname); +void uiTemplateMarker(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname, PointerRNA *userptr, PointerRNA *trackptr, int cmpact); + /* items */ void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname); void uiItemEnumO(uiLayout *layout, const char *opname, const char *name, int icon, const char *propname, int value); diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 9c46a5d28de..4b1371c532c 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -247,7 +247,18 @@ enum { TH_DRAWEXTRA_FACEAREA, TH_DRAWEXTRA_FACEANG, - TH_NODE_CURVING + TH_NODE_CURVING, + + TH_MARKER_OUTLINE, + TH_MARKER, + TH_ACT_MARKER, + TH_SEL_MARKER, + TH_BUNDLE_SOLID, + TH_DIS_MARKER, + TH_PATH_BEFORE, + TH_PATH_AFTER, + TH_CAMERA_PATH, + TH_LOCK_MARKER }; /* XXX WARNING: previous is saved in file, so do not change order! */ diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index eff4d1f6397..e5092c82304 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -766,7 +766,7 @@ static void ui_menu_block_set_keyaccels(uiBlock *block) { uiBut *but; - unsigned int meny_key_mask= 0; + unsigned int menu_key_mask= 0; unsigned char menu_key; const char *str_pt; int pass; @@ -788,8 +788,8 @@ static void ui_menu_block_set_keyaccels(uiBlock *block) if(but->str) { for(str_pt= but->str; *str_pt; ) { menu_key= tolower(*str_pt); - if((menu_key >= 'a' && menu_key <= 'z') && !(meny_key_mask & 1<<(menu_key-'a'))) { - meny_key_mask |= 1<<(menu_key-'a'); + if((menu_key >= 'a' && menu_key <= 'z') && !(menu_key_mask & 1<<(menu_key-'a'))) { + menu_key_mask |= 1<<(menu_key-'a'); break; } @@ -816,7 +816,7 @@ static void ui_menu_block_set_keyaccels(uiBlock *block) } /* if all keys have been used just exit, unlikely */ - if(meny_key_mask == (1<<26)-1) { + if(menu_key_mask == (1<<26)-1) { return; } } @@ -1224,7 +1224,7 @@ void ui_get_but_vectorf(uiBut *but, float vec[3]) int a, tot; if(but->editvec) { - VECCOPY(vec, but->editvec); + copy_v3_v3(vec, but->editvec); } if(but->rnaprop) { @@ -1248,7 +1248,7 @@ void ui_get_but_vectorf(uiBut *but, float vec[3]) } else if(but->pointype == FLO) { float *fp= (float *)but->poin; - VECCOPY(vec, fp); + copy_v3_v3(vec, fp); } else { if (but->editvec==NULL) { diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 3d08e761090..4bc0963aad4 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -34,6 +34,7 @@ #include "DNA_color_types.h" #include "DNA_object_types.h" #include "DNA_screen_types.h" +#include "DNA_movieclip_types.h" #include "BLI_math.h" #include "BLI_rect.h" @@ -1501,6 +1502,114 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect fdrawbox(rect->xmin, rect->ymin, rect->xmax, rect->ymax); } +static ImBuf *scale_trackpreview_ibuf(ImBuf *ibuf, float zoomx, float zoomy) +{ + ImBuf *scaleibuf; + int x, y, w= ibuf->x*zoomx, h= ibuf->y*zoomy; + scaleibuf= IMB_allocImBuf(w, h, 32, IB_rect); + + for(y= 0; y<scaleibuf->y; y++) { + for (x= 0; x<scaleibuf->x; x++) { + int pixel= scaleibuf->x*y + x; + int orig_pixel= ibuf->x*(int)(((float)y)/zoomy) + (int)(((float)x)/zoomx); + char *rrgb= (char*)scaleibuf->rect + pixel*4; + char *orig_rrgb= (char*)ibuf->rect + orig_pixel*4; + rrgb[0]= orig_rrgb[0]; + rrgb[1]= orig_rrgb[1]; + rrgb[2]= orig_rrgb[2]; + rrgb[3]= orig_rrgb[3]; + } + } + + return scaleibuf; +} + +void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *recti) +{ + rctf rect; + int ok= 0; + GLint scissor[4]; + MovieClipScopes *scopes = (MovieClipScopes *)but->poin; + + rect.xmin = (float)recti->xmin+1; + rect.xmax = (float)recti->xmax-1; + rect.ymin = (float)recti->ymin+SCOPE_RESIZE_PAD+2; + rect.ymax = (float)recti->ymax-1; + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + + /* need scissor test, preview image can draw outside of boundary */ + glGetIntegerv(GL_VIEWPORT, scissor); + glScissor(ar->winrct.xmin + (rect.xmin-1), ar->winrct.ymin+(rect.ymin-1), (rect.xmax+1)-(rect.xmin-1), (rect.ymax+1)-(rect.ymin-1)); + + if(scopes->track_disabled) { + glColor4f(0.7f, 0.3f, 0.3f, 0.3f); + uiSetRoundBox(15); + uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); + + ok= 1; + } + else if(scopes->track_preview) { + int a, off_x, off_y; + float zoomx, zoomy; + ImBuf *drawibuf; + + glPushMatrix(); + + /* draw content of pattern area */ + glScissor(ar->winrct.xmin+rect.xmin, ar->winrct.ymin+rect.ymin, scissor[2], scissor[3]); + + zoomx= (rect.xmax-rect.xmin) / (scopes->track_preview->x-2.f); + zoomy= (rect.ymax-rect.ymin) / (scopes->track_preview->y-2.f); + + off_x= ((int)scopes->track_pos[0]-scopes->track_pos[0]-0.5)*zoomx; + off_y= ((int)scopes->track_pos[1]-scopes->track_pos[1]-0.5)*zoomy; + + drawibuf= scale_trackpreview_ibuf(scopes->track_preview, zoomx, zoomy); + glaDrawPixelsSafe(off_x+rect.xmin, off_y+rect.ymin, rect.xmax-rect.xmin+1.f-off_x, rect.ymax-rect.ymin+1.f-off_y, drawibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, drawibuf->rect); + + IMB_freeImBuf(drawibuf); + + /* draw cross for pizel position */ + glTranslatef(off_x+rect.xmin+scopes->track_pos[0]*zoomx, off_y+rect.ymin+scopes->track_pos[1]*zoomy, 0.f); + glScissor(ar->winrct.xmin + rect.xmin, ar->winrct.ymin+rect.ymin, rect.xmax-rect.xmin, rect.ymax-rect.ymin); + + for(a= 0; a< 2; a++) { + if(a==1) { + glLineStipple(3, 0xaaaa); + glEnable(GL_LINE_STIPPLE); + UI_ThemeColor(TH_SEL_MARKER); + } + else { + UI_ThemeColor(TH_MARKER_OUTLINE); + } + + glBegin(GL_LINES); + glVertex2f(-10.0f, 0.0f); + glVertex2f(10.0f, 0.0f); + glVertex2f(0.0f, -10.0f); + glVertex2f(0.0f, 10.0f); + glEnd(); + } + + glDisable(GL_LINE_STIPPLE); + glPopMatrix(); + + ok= 1; + } + + if(!ok) { + glColor4f(0.f, 0.f, 0.f, 0.3f); + uiSetRoundBox(15); + uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); + } + + /* outline, scale gripper */ + draw_scope_end(&rect, scissor); + + glDisable(GL_BLEND); +} /* ****************************************************** */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 0ba141163b3..c871c87983c 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -56,6 +56,7 @@ #include "BKE_idprop.h" #include "BKE_report.h" #include "BKE_texture.h" +#include "BKE_tracking.h" #include "BKE_unit.h" #include "ED_screen.h" @@ -259,7 +260,7 @@ static uiBut *ui_but_last(uiBlock *block) static int ui_is_a_warp_but(uiBut *but) { if(U.uiflag & USER_CONTINUOUS_MOUSE) - if(ELEM3(but->type, NUM, NUMABS, HSVCIRCLE)) + if(ELEM4(but->type, NUM, NUMABS, HSVCIRCLE, TRACKPREVIEW)) return TRUE; return FALSE; @@ -922,6 +923,13 @@ static void ui_apply_but_WAVEFORM(bContext *C, uiBut *but, uiHandleButtonData *d data->applied= 1; } +static void ui_apply_but_TRACKPREVIEW(bContext *C, uiBut *but, uiHandleButtonData *data) +{ + ui_apply_but_func(C, but); + data->retval= but->retval; + data->applied= 1; +} + static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, int interactive) { @@ -944,7 +952,7 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut data->origstr= NULL; data->value= data->origvalue; data->origvalue= 0.0; - VECCOPY(data->vec, data->origvec); + copy_v3_v3(data->vec, data->origvec); data->origvec[0]= data->origvec[1]= data->origvec[2]= 0.0f; } else { @@ -1051,6 +1059,9 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut case WAVEFORM: ui_apply_but_WAVEFORM(C, but, data); break; + case TRACKPREVIEW: + ui_apply_but_TRACKPREVIEW(C, but, data); + break; default: break; } @@ -2121,7 +2132,7 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data break; case COL: ui_get_but_vectorf(but, data->origvec); - VECCOPY(data->vec, data->origvec); + copy_v3_v3(data->vec, data->origvec); but->editvec= data->vec; handlefunc= ui_block_func_COL; @@ -4254,6 +4265,88 @@ static int ui_do_but_LINK(bContext *C, uiBut *but, uiHandleButtonData *data, wmE return WM_UI_HANDLER_CONTINUE; } +static int ui_numedit_but_TRACKPREVIEW(bContext *C, uiBut *but, uiHandleButtonData *data, int mx, int my, int shift) +{ + MovieClipScopes *scopes = (MovieClipScopes *)but->poin; + int changed= 1; + float dx, dy; + + dx = mx - data->draglastx; + dy = my - data->draglasty; + + if(shift) { + dx /= 5.0f; + dy /= 5.0f; + } + + if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) { + /* resize preview widget itself */ + scopes->track_preview_height = (but->y2 - but->y1) + (data->dragstarty - my); + } else { + if(scopes->marker) { + if(scopes->marker->framenr!=scopes->framenr) + scopes->marker= BKE_tracking_ensure_marker(scopes->track, scopes->framenr); + + scopes->marker->flag&= ~(MARKER_DISABLED|MARKER_TRACKED); + scopes->marker->pos[0]+= -dx*scopes->slide_scale[0] / (but->block->maxx-but->block->minx); + scopes->marker->pos[1]+= -dy*scopes->slide_scale[1] / (but->block->maxy-but->block->miny); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, NULL); + } + + scopes->ok= 0; + } + + data->draglastx= mx; + data->draglasty= my; + + return changed; +} + +static int ui_do_but_TRACKPREVIEW(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event) +{ + int mx, my; + + mx= event->x; + my= event->y; + ui_window_to_block(data->region, block, &mx, &my); + + if(data->state == BUTTON_STATE_HIGHLIGHT) { + if(event->type==LEFTMOUSE && event->val==KM_PRESS) { + data->dragstartx= mx; + data->dragstarty= my; + data->draglastx= mx; + data->draglasty= my; + button_activate_state(C, but, BUTTON_STATE_NUM_EDITING); + + /* also do drag the first time */ + if(ui_numedit_but_TRACKPREVIEW(C, but, data, mx, my, event->shift)) + ui_numedit_apply(C, block, but, data); + + return WM_UI_HANDLER_BREAK; + } + } + else if(data->state == BUTTON_STATE_NUM_EDITING) { + if(event->type == ESCKEY) { + data->cancel= 1; + data->escapecancel= 1; + button_activate_state(C, but, BUTTON_STATE_EXIT); + } + else if(event->type == MOUSEMOVE) { + if(mx!=data->draglastx || my!=data->draglasty) { + if(ui_numedit_but_TRACKPREVIEW(C, but, data, mx, my, event->shift)) + ui_numedit_apply(C, block, but, data); + } + } + else if(event->type==LEFTMOUSE && event->val!=KM_PRESS) { + button_activate_state(C, but, BUTTON_STATE_EXIT); + } + return WM_UI_HANDLER_BREAK; + } + + return WM_UI_HANDLER_CONTINUE; +} + static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event)) { uiBut *but = (uiBut *)arg1; @@ -4791,6 +4884,9 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event) case INLINK: retval= ui_do_but_LINK(C, but, data, event); break; + case TRACKPREVIEW: + retval= ui_do_but_TRACKPREVIEW(C, block, but, data, event); + break; } return retval; @@ -5727,7 +5823,7 @@ static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut * /* copy over return values from the closing menu */ if(menu->menuretval == UI_RETURN_OK || menu->menuretval == UI_RETURN_UPDATE) { if(but->type == COL) - VECCOPY(data->vec, menu->retvec) + copy_v3_v3(data->vec, menu->retvec); else if(ELEM3(but->type, MENU, ICONROW, ICONTEXTROW)) data->value= menu->retvalue; } diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 9c5fafaf167..29447d492c5 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -454,6 +454,7 @@ void ui_draw_but_COLORBAND(uiBut *but, struct uiWidgetColors *wcol, rcti *rect); void ui_draw_but_NORMAL(uiBut *but, struct uiWidgetColors *wcol, rcti *rect); void ui_draw_but_CURVE(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect); void ui_draw_but_IMAGE(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect); +void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect); /* interface_handlers.c */ extern void ui_button_activate_do(struct bContext *C, struct ARegion *ar, uiBut *but); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 4791d2652dc..edbd5c5684e 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2126,7 +2126,7 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT); - VECCOPY(handle->retvec, but->editvec); + copy_v3_v3(handle->retvec, but->editvec); uiBlockPicker(block, handle->retvec, &but->rnapoin, but->rnaprop); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 730a2ccb0bd..6a3e6025653 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2483,6 +2483,7 @@ void uiTemplateOperatorSearch(uiLayout *layout) #define B_STOPANIM 3 #define B_STOPCOMPO 4 #define B_STOPSEQ 5 +#define B_STOPCLIP 6 static void do_running_jobs(bContext *C, void *UNUSED(arg), int event) { @@ -2502,6 +2503,9 @@ static void do_running_jobs(bContext *C, void *UNUSED(arg), int event) case B_STOPSEQ: WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL); break; + case B_STOPCLIP: + WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL); + break; } } @@ -2527,6 +2531,10 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C) if(WM_jobs_test(wm, sa)) owner = sa; handle_event = B_STOPSEQ; + } else if(sa->spacetype==SPACE_CLIP) { + if(WM_jobs_test(wm, sa)) + owner = sa; + handle_event= B_STOPCLIP; } else { Scene *scene; /* another scene can be rendering too, for example via compositor */ diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index c5ac4f5aa88..8ab48ac8ffa 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1510,7 +1510,7 @@ static void widget_state(uiWidgetType *wt, int state) wt->wcol= *(wt->wcol_theme); if(state & UI_SELECT) { - QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel) + copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel); if(state & UI_BUT_ANIMATED_KEY) widget_state_blend(wt->wcol.inner, wcol_state->inner_key_sel, wcol_state->blend); @@ -1519,7 +1519,7 @@ static void widget_state(uiWidgetType *wt, int state) else if(state & UI_BUT_DRIVEN) widget_state_blend(wt->wcol.inner, wcol_state->inner_driven_sel, wcol_state->blend); - VECCOPY(wt->wcol.text, wt->wcol.text_sel); + copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel); if(state & UI_SELECT) SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown); @@ -1604,7 +1604,7 @@ static void widget_state_option_menu(uiWidgetType *wt, int state) else { bTheme *btheme= U.themes.first; /* XXX */ - VECCOPY(wt->wcol.text, btheme->tui.wcol_menu_back.text); + copy_v3_v3_char(wt->wcol.text, btheme->tui.wcol_menu_back.text); } } @@ -1619,11 +1619,11 @@ static void widget_state_pulldown(uiWidgetType *wt, int state) { wt->wcol= *(wt->wcol_theme); - QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel); - VECCOPY(wt->wcol.outline, wt->wcol.inner); + copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel); + copy_v3_v3_char(wt->wcol.outline, wt->wcol.inner); if(state & UI_ACTIVE) - VECCOPY(wt->wcol.text, wt->wcol.text_sel); + copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel); } /* special case, menu items */ @@ -1637,8 +1637,8 @@ static void widget_state_menu_item(uiWidgetType *wt, int state) wt->wcol.text[2]= 0.5f*(wt->wcol.text[2]+wt->wcol.text_sel[2]); } else if(state & UI_ACTIVE) { - QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel); - VECCOPY(wt->wcol.text, wt->wcol.text_sel); + copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel); + copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel); } } @@ -1874,38 +1874,38 @@ void ui_draw_gradient(rcti *rect, float *hsv, int type, float alpha) break; case UI_GRAD_H: hsv_to_rgb(0.0, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]); - VECCOPY(col1[1], col1[0]); - VECCOPY(col1[2], col1[0]); - VECCOPY(col1[3], col1[0]); + copy_v3_v3(col1[1], col1[0]); + copy_v3_v3(col1[2], col1[0]); + copy_v3_v3(col1[3], col1[0]); break; case UI_GRAD_S: hsv_to_rgb(1.0, 0.0, 1.0, &col1[1][0], &col1[1][1], &col1[1][2]); - VECCOPY(col1[0], col1[1]); - VECCOPY(col1[2], col1[1]); - VECCOPY(col1[3], col1[1]); + copy_v3_v3(col1[0], col1[1]); + copy_v3_v3(col1[2], col1[1]); + copy_v3_v3(col1[3], col1[1]); break; case UI_GRAD_V: hsv_to_rgb(1.0, 1.0, 0.0, &col1[2][0], &col1[2][1], &col1[2][2]); - VECCOPY(col1[0], col1[2]); - VECCOPY(col1[1], col1[2]); - VECCOPY(col1[3], col1[2]); + copy_v3_v3(col1[0], col1[2]); + copy_v3_v3(col1[1], col1[2]); + copy_v3_v3(col1[3], col1[2]); break; default: assert(!"invalid 'type' argument"); hsv_to_rgb(1.0, 1.0, 1.0, &col1[2][0], &col1[2][1], &col1[2][2]); - VECCOPY(col1[0], col1[2]); - VECCOPY(col1[1], col1[2]); - VECCOPY(col1[3], col1[2]); + copy_v3_v3(col1[0], col1[2]); + copy_v3_v3(col1[1], col1[2]); + copy_v3_v3(col1[3], col1[2]); } /* old below */ for(dx=0.0f; dx<1.0f; dx+= 0.05f) { // previous color - VECCOPY(col0[0], col1[0]); - VECCOPY(col0[1], col1[1]); - VECCOPY(col0[2], col1[2]); - VECCOPY(col0[3], col1[3]); + copy_v3_v3(col0[0], col1[0]); + copy_v3_v3(col0[1], col1[1]); + copy_v3_v3(col0[2], col1[2]); + copy_v3_v3(col0[3], col1[3]); // new color switch(type) { @@ -1929,21 +1929,21 @@ void ui_draw_gradient(rcti *rect, float *hsv, int type, float alpha) break; case UI_GRAD_H: hsv_to_rgb(dx, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]); - VECCOPY(col1[1], col1[0]); - VECCOPY(col1[2], col1[0]); - VECCOPY(col1[3], col1[0]); + copy_v3_v3(col1[1], col1[0]); + copy_v3_v3(col1[2], col1[0]); + copy_v3_v3(col1[3], col1[0]); break; case UI_GRAD_S: hsv_to_rgb(h, dx, 1.0, &col1[1][0], &col1[1][1], &col1[1][2]); - VECCOPY(col1[0], col1[1]); - VECCOPY(col1[2], col1[1]); - VECCOPY(col1[3], col1[1]); + copy_v3_v3(col1[0], col1[1]); + copy_v3_v3(col1[2], col1[1]); + copy_v3_v3(col1[3], col1[1]); break; case UI_GRAD_V: hsv_to_rgb(h, 1.0, dx, &col1[2][0], &col1[2][1], &col1[2][2]); - VECCOPY(col1[0], col1[2]); - VECCOPY(col1[1], col1[2]); - VECCOPY(col1[3], col1[2]); + copy_v3_v3(col1[0], col1[2]); + copy_v3_v3(col1[1], col1[2]); + copy_v3_v3(col1[3], col1[2]); break; } @@ -2197,7 +2197,7 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int stat SWAP(short, wcol->shadetop, wcol->shadedown); - QUATCOPY(wcol->inner, wcol->item); + copy_v4_v4_char(wcol->inner, wcol->item); if(wcol->shadetop>wcol->shadedown) wcol->shadetop+= 20; /* XXX violates themes... */ @@ -2369,9 +2369,9 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s if(!(state & UI_TEXTINPUT)) { /* slider part */ - VECCOPY(outline, wcol->outline); - VECCOPY(wcol->outline, wcol->item); - VECCOPY(wcol->inner, wcol->item); + copy_v3_v3_char(outline, wcol->outline); + copy_v3_v3_char(wcol->outline, wcol->item); + copy_v3_v3_char(wcol->inner, wcol->item); if(!(state & UI_SELECT)) SWAP(short, wcol->shadetop, wcol->shadedown); @@ -2397,7 +2397,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT), &rect1, offs); widgetbase_draw(&wtb1, wcol); - VECCOPY(wcol->outline, outline); + copy_v3_v3_char(wcol->outline, outline); if(!(state & UI_SELECT)) SWAP(short, wcol->shadetop, wcol->shadedown); @@ -2624,7 +2624,7 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED( widget_init(&wtb); - VECCOPY(old_col, wcol->inner); + copy_v3_v3_char(old_col, wcol->inner); /* abuse but->hsv - if it's non-zero, use this color as the box's background */ if (but->col[3]) { @@ -2643,7 +2643,7 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED( /* XXX, this doesnt work right since the color applies to buttons outside the box too. */ glClearColor(wcol->inner[0]/255.0, wcol->inner[1]/255.0, wcol->inner[2]/255.0, 1.0); - VECCOPY(wcol->inner, old_col); + copy_v3_v3_char(wcol->inner, old_col); } static void widget_but(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign) @@ -3078,6 +3078,10 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct wt= widget_type(UI_WTYPE_SCROLL); break; + case TRACKPREVIEW: + ui_draw_but_TRACKPREVIEW(ar, but, &tui->wcol_regular, rect); + break; + default: wt= widget_type(UI_WTYPE_REGULAR); } diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 921a1879bb7..5f392daeec6 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -153,6 +153,9 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo case SPACE_LOGIC: ts= &btheme->tlogic; break; + case SPACE_CLIP: + ts= &btheme->tclip; + break; default: ts= &btheme->tv3d; break; @@ -409,6 +412,27 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo case TH_PREVIEW_BACK: cp= ts->preview_back; break; + + case TH_MARKER_OUTLINE: + cp= ts->marker_outline; break; + case TH_MARKER: + cp= ts->marker; break; + case TH_ACT_MARKER: + cp= ts->act_marker; break; + case TH_SEL_MARKER: + cp= ts->sel_marker; break; + case TH_BUNDLE_SOLID: + cp= ts->bundle_solid; break; + case TH_DIS_MARKER: + cp= ts->dis_marker; break; + case TH_PATH_BEFORE: + cp= ts->path_before; break; + case TH_PATH_AFTER: + cp= ts->path_after; break; + case TH_CAMERA_PATH: + cp= ts->camera_path; break; + case TH_LOCK_MARKER: + cp= ts->lock_marker; break; } } } @@ -533,6 +557,7 @@ static void ui_theme_init_new(bTheme *btheme) ui_theme_init_new_do(&btheme->tlogic); ui_theme_init_new_do(&btheme->tuserpref); ui_theme_init_new_do(&btheme->tconsole); + ui_theme_init_new_do(&btheme->tclip); } @@ -639,7 +664,9 @@ void ui_theme_init_default(void) SETCOL(btheme->tv3d.bone_solid, 200, 200, 200, 255); SETCOL(btheme->tv3d.bone_pose, 80, 200, 255, 80); // alpha 80 is not meant editable, used for wire+action draw - + + SETCOL(btheme->tv3d.bundle_solid, 200, 200, 200, 255); + SETCOL(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255); /* space buttons */ /* to have something initialized */ @@ -777,6 +804,23 @@ void ui_theme_init_default(void) /* space logic */ btheme->tlogic= btheme->tv3d; SETCOL(btheme->tlogic.back, 100, 100, 100, 255); + + /* space clip */ + btheme->tclip= btheme->tv3d; + + SETCOL(btheme->tclip.marker_outline, 0x00, 0x00, 0x00, 255); + SETCOL(btheme->tclip.marker, 0x7f, 0x7f, 0x00, 255); + SETCOL(btheme->tclip.act_marker, 0xff, 0xff, 0xff, 255); + SETCOL(btheme->tclip.sel_marker, 0xff, 0xff, 0x00, 255); + SETCOL(btheme->tclip.dis_marker, 0x7f, 0x00, 0x00, 255); + SETCOL(btheme->tclip.lock_marker, 0x7f, 0x7f, 0x7f, 255); + SETCOL(btheme->tclip.path_before, 0xff, 0x00, 0x00, 255); + SETCOL(btheme->tclip.path_after, 0x00, 0x00, 0xff, 255); + SETCOL(btheme->tclip.grid, 0x5e, 0x5e, 0x5e, 255); + SETCOL(btheme->tclip.cframe, 0x60, 0xc0, 0x40, 255); + SETCOL(btheme->tclip.handle_vertex, 0x00, 0x00, 0x00, 0xff); + SETCOL(btheme->tclip.handle_vertex_select, 0xff, 0xff, 0, 0xff); + btheme->tclip.handle_vertex_size= 4; } @@ -1590,6 +1634,35 @@ void init_userdef_do_versions(void) } } + { + bTheme *btheme; + for(btheme= U.themes.first; btheme; btheme= btheme->next) { + if(btheme->tv3d.bundle_solid[3] == 0) + SETCOL(btheme->tv3d.bundle_solid, 200, 200, 200, 255); + + if(btheme->tv3d.camera_path[3] == 0) + SETCOL(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255); + + if((btheme->tclip.back[3]) == 0) { + btheme->tclip= btheme->tv3d; + + SETCOL(btheme->tclip.marker_outline, 0x00, 0x00, 0x00, 255); + SETCOL(btheme->tclip.marker, 0x7f, 0x7f, 0x00, 255); + SETCOL(btheme->tclip.act_marker, 0xff, 0xff, 0xff, 255); + SETCOL(btheme->tclip.sel_marker, 0xff, 0xff, 0x00, 255); + SETCOL(btheme->tclip.dis_marker, 0x7f, 0x00, 0x00, 255); + SETCOL(btheme->tclip.lock_marker, 0x7f, 0x7f, 0x7f, 255); + SETCOL(btheme->tclip.path_before, 0xff, 0x00, 0x00, 255); + SETCOL(btheme->tclip.path_after, 0x00, 0x00, 0xff, 255); + SETCOL(btheme->tclip.grid, 0x5e, 0x5e, 0x5e, 255); + SETCOL(btheme->tclip.cframe, 0x60, 0xc0, 0x40, 255); + SETCOL(btheme->tclip.handle_vertex, 0x00, 0x00, 0x00, 0xff); + SETCOL(btheme->tclip.handle_vertex_select, 0xff, 0xff, 0, 0xff); + btheme->tclip.handle_vertex_size= 4; + } + } + } + /* GL Texture Garbage Collection (variable abused above!) */ if (U.textimeout == 0) { U.texcollectrate = 60; diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 85ac87d8bcb..f6aae0e20ae 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1181,8 +1181,9 @@ void load_editMesh(Scene *scene, Object *obedit) eve= em->verts.first; mvert = me->mvert; while(eve) { - if(eve->keyindex>=0) - VECSUB(ofs[i], mvert->co, fp[eve->keyindex]); + if(eve->keyindex>=0) { + sub_v3_v3v3(ofs[i], mvert->co, fp[eve->keyindex]); + } eve= eve->next; i++; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 99af17c161e..1852d90eed0 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -1387,6 +1387,8 @@ static void delete_mesh(EditMesh *em, wmOperator *op, int event) } } + recalc_editnormals(em); + EM_fgon_flags(em); // redo flags and indices for fgons } diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 7ff233fa609..8d4d29dbe50 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -48,12 +48,14 @@ #include "DNA_vfont_types.h" #include "BLI_math.h" +#include "BLI_string.h" #include "BLI_listbase.h" #include "BLI_utildefines.h" #include "BKE_anim.h" #include "BKE_animsys.h" #include "BKE_armature.h" +#include "BKE_camera.h" #include "BKE_constraint.h" #include "BKE_context.h" #include "BKE_curve.h" @@ -62,6 +64,7 @@ #include "BKE_displist.h" #include "BKE_effect.h" #include "BKE_group.h" +#include "BKE_lamp.h" #include "BKE_lattice.h" #include "BKE_library.h" #include "BKE_key.h" @@ -1006,23 +1009,21 @@ static void copy_object_set_idnew(bContext *C, int dupflag) /********************* Make Duplicates Real ************************/ -static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base) +static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, + const short use_base_parent, + const short use_hierarchy) { - Base *basen; - Object *ob; ListBase *lb; DupliObject *dob; - - if(!base && !(base = BASACT)) - return; - + if(!(base->object->transflag & OB_DUPLI)) return; lb= object_duplilist(scene, base->object); for(dob= lb->first; dob; dob= dob->next) { - ob= copy_object(dob->ob); + Base *basen; + Object *ob= copy_object(dob->ob); /* font duplis can have a totcol without material, we get them from parent * should be implemented better... */ @@ -1049,22 +1050,85 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base) object_apply_mat4(ob, ob->obmat, FALSE, FALSE); } + if (use_hierarchy) { + for(dob= lb->first; dob; dob= dob->next) { + /* original parents */ + Object *ob_src= dob->ob; + Object *ob_src_par= ob_src->parent; + + Object *ob_dst= (Object *)ob_src->id.newid; + + if (ob_src_par && ob_src_par->id.newid) { + /* the parent was also made real, parent newly real duplis */ + Object *ob_dst_par= (Object *)ob_src_par->id.newid; + + /* allow for all possible parent types */ + ob_dst->partype= ob_src->partype; + BLI_strncpy(ob_dst->parsubstr, ob_src->parsubstr, sizeof(ob_dst->parsubstr)); + ob_dst->par1= ob_src->par1; + ob_dst->par2= ob_src->par2; + ob_dst->par3= ob_src->par3; + + copy_m4_m4(ob_dst->parentinv, ob_src->parentinv); + + ob_dst->parent= ob_dst_par; + } + else if (use_base_parent) { + ob_dst->parent= base->object; + ob_dst->partype= PAROBJECT; + } + + if (ob_dst->parent) { + invert_m4_m4(ob_dst->parentinv, dob->mat); + + /* note, this may be the parent of other objects, but it should + * still work out ok */ + object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE); + + /* to set ob_dst->orig and incase theres any other discrepicies */ + DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB); + } + } + } + else if (use_base_parent) { + /* since we are ignoring the internal hierarchy - parent all to the + * base object */ + for(dob= lb->first; dob; dob= dob->next) { + /* original parents */ + Object *ob_src= dob->ob; + Object *ob_dst= (Object *)ob_src->id.newid; + + ob_dst->parent= base->object; + ob_dst->partype= PAROBJECT; + + /* similer to the code above, see comments */ + invert_m4_m4(ob_dst->parentinv, dob->mat); + object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE); + DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB); + + + } + } + copy_object_set_idnew(C, 0); free_object_duplilist(lb); - base->object->transflag &= ~OB_DUPLI; + base->object->transflag &= ~OB_DUPLI; } -static int object_duplicates_make_real_exec(bContext *C, wmOperator *UNUSED(op)) +static int object_duplicates_make_real_exec(bContext *C, wmOperator *op) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); + + const short use_base_parent= RNA_boolean_get(op->ptr, "use_base_parent"); + const short use_hierarchy= RNA_boolean_get(op->ptr, "use_hierarchy"); clear_id_newpoins(); CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) { - make_object_duplilist_real(C, scene, base); + make_object_duplilist_real(C, scene, base, use_base_parent, use_hierarchy); /* dependencies were changed */ WM_event_add_notifier(C, NC_OBJECT|ND_PARENT, base->object); @@ -1094,6 +1158,9 @@ void OBJECT_OT_duplicates_make_real(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "use_base_parent", 0, "Parent", "Parent newly created objects to the original duplicator"); + RNA_def_boolean(ot->srna, "use_hierarchy", 0, "Keep Hierarchy", "Maintain parent child relationships"); } /**************************** Convert **************************/ diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 50b798c5bea..b36416151a9 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -55,6 +55,7 @@ #include "BKE_main.h" #include "BKE_object.h" #include "BKE_report.h" +#include "BKE_tracking.h" #include "BIK_api.h" #ifdef WITH_PYTHON @@ -402,6 +403,23 @@ static void test_constraints (Object *owner, bPoseChannel *pchan) data->flag &= ~CONSTRAINT_SPLINEIK_BOUND; } } + else if (curcon->type == CONSTRAINT_TYPE_FOLLOWTRACK) { + bFollowTrackConstraint *data = curcon->data; + + if((data->flag&CAMERASOLVER_ACTIVECLIP)==0) { + if(data->clip != NULL && data->track[0]) { + if (!BKE_tracking_named_track(&data->clip->tracking, data->track)) + curcon->flag |= CONSTRAINT_DISABLE; + } + else curcon->flag |= CONSTRAINT_DISABLE; + } + } + else if (curcon->type == CONSTRAINT_TYPE_CAMERASOLVER) { + bCameraSolverConstraint *data = curcon->data; + + if((data->flag&CAMERASOLVER_ACTIVECLIP)==0 && data->clip == NULL) + curcon->flag |= CONSTRAINT_DISABLE; + } /* Check targets for constraints */ if (cti && cti->get_constraint_targets) { @@ -1368,7 +1386,9 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase BPY_pyconstraint_update(ob, con); } #endif + break; } + default: break; } diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index f2997dc743d..4fbb5e0d51c 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1130,19 +1130,19 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) base->object->recalc |= OB_RECALC_OB; if(event==1) { /* loc */ - VECCOPY(base->object->loc, ob->loc); - VECCOPY(base->object->dloc, ob->dloc); + copy_v3_v3(base->object->loc, ob->loc); + copy_v3_v3(base->object->dloc, ob->dloc); } else if(event==2) { /* rot */ - VECCOPY(base->object->rot, ob->rot); - VECCOPY(base->object->drot, ob->drot); + copy_v3_v3(base->object->rot, ob->rot); + copy_v3_v3(base->object->drot, ob->drot); - QUATCOPY(base->object->quat, ob->quat); - QUATCOPY(base->object->dquat, ob->dquat); + copy_qt_qt(base->object->quat, ob->quat); + copy_qt_qt(base->object->dquat, ob->dquat); } else if(event==3) { /* size */ - VECCOPY(base->object->size, ob->size); - VECCOPY(base->object->dsize, ob->dsize); + copy_v3_v3(base->object->size, ob->size); + copy_v3_v3(base->object->dsize, ob->dsize); } else if(event==4) { /* drawtype */ base->object->dt= ob->dt; @@ -1331,7 +1331,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) base->object->index= ob->index; } else if(event==31) { /* object color */ - QUATCOPY(base->object->col, ob->col); + copy_v4_v4(base->object->col, ob->col); } } } diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c index 25c1e32f4ae..cac167ad84f 100644 --- a/source/blender/editors/object/object_lattice.c +++ b/source/blender/editors/object/object_lattice.c @@ -35,6 +35,7 @@ #include "MEM_guardedalloc.h" #include "BLI_listbase.h" +#include "BLI_math.h" #include "BLI_utildefines.h" #include "DNA_curve_types.h" @@ -132,7 +133,7 @@ void load_editLatt(Object *obedit) bp= editlt->def; while(tot--) { - VECCOPY(fp, bp->vec); + copy_v3_v3(fp, bp->vec); fp+= 3; bp++; } diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 129d9df86a5..ad2280baba2 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -357,7 +357,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene * key= cache[a]; kmax= key->steps; for(k=0; k<=kmax; k++,key++,cvert++,mvert++) { - VECCOPY(mvert->co,key->co); + copy_v3_v3(mvert->co,key->co); if(k) { medge->v1= cvert-1; medge->v2= cvert; @@ -376,7 +376,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene * key=cache[a]; kmax=key->steps; for(k=0; k<=kmax; k++,key++,cvert++,mvert++) { - VECCOPY(mvert->co,key->co); + copy_v3_v3(mvert->co,key->co); if(k) { medge->v1=cvert-1; medge->v2=cvert; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 74da705965a..94e2f0aae00 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -56,6 +56,7 @@ #include "BKE_action.h" #include "BKE_animsys.h" #include "BKE_armature.h" +#include "BKE_camera.h" #include "BKE_context.h" #include "BKE_constraint.h" #include "BKE_curve.h" @@ -63,6 +64,7 @@ #include "BKE_displist.h" #include "BKE_global.h" #include "BKE_fcurve.h" +#include "BKE_lamp.h" #include "BKE_lattice.h" #include "BKE_library.h" #include "BKE_main.h" @@ -653,7 +655,7 @@ static int parent_set_exec(bContext *C, wmOperator *op) data = con->data; data->tar = par; - get_constraint_target_matrix(scene, con, 0, CONSTRAINT_OBTYPE_OBJECT, NULL, cmat, scene->r.cfra - give_timeoffset(ob)); + get_constraint_target_matrix(scene, con, 0, CONSTRAINT_OBTYPE_OBJECT, NULL, cmat, scene->r.cfra); sub_v3_v3v3(vec, ob->obmat[3], cmat[3]); ob->loc[0] = vec[0]; diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index a82ed95079f..e2039739be2 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -133,7 +133,7 @@ static void object_clear_rot(Object *ob) float eul[3], oldeul[3], quat1[4] = {0}; if (ob->rotmode == ROT_MODE_QUAT) { - QUATCOPY(quat1, ob->quat); + copy_qt_qt(quat1, ob->quat); quat_to_eul(oldeul, ob->quat); } else if (ob->rotmode == ROT_MODE_AXISANGLE) { diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 3694102fa5b..52e6d4f6ab8 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -390,7 +390,7 @@ static void PE_set_view3d_data(bContext *C, PEData *data) /*************************** selection utilities *******************************/ -static int key_test_depth(PEData *data, float co[3]) +static int key_test_depth(PEData *data, const float co[3]) { View3D *v3d= data->vc.v3d; double ux, uy, uz; @@ -407,7 +407,7 @@ static int key_test_depth(PEData *data, float co[3]) return 0; gluProject(co[0],co[1],co[2], data->mats.modelview, data->mats.projection, - (GLint *)data->mats.viewport, &ux, &uy, &uz); + (GLint *)data->mats.viewport, &ux, &uy, &uz); x=wco[0]; y=wco[1]; @@ -434,7 +434,7 @@ static int key_test_depth(PEData *data, float co[3]) return 1; } -static int key_inside_circle(PEData *data, float rad, float co[3], float *distance) +static int key_inside_circle(PEData *data, float rad, const float co[3], float *distance) { float dx, dy, dist; int sco[2]; @@ -461,7 +461,7 @@ static int key_inside_circle(PEData *data, float rad, float co[3], float *distan return 0; } -static int key_inside_rect(PEData *data, float co[3]) +static int key_inside_rect(PEData *data, const float co[3]) { int sco[2]; @@ -477,7 +477,7 @@ static int key_inside_rect(PEData *data, float co[3]) return 0; } -static int key_inside_test(PEData *data, float co[3]) +static int key_inside_test(PEData *data, const float co[3]) { if(data->mval) return key_inside_circle(data, data->rad, co, NULL); @@ -719,7 +719,7 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys) LOOP_PARTICLES { key = pa->hair; psys_mat_hair_to_orco(ob, psmd->dm, psys->part->from, pa, mat); - VECCOPY(co, key->co); + copy_v3_v3(co, key->co); mul_m4_v3(mat, co); BLI_kdtree_insert(tree, p, co, NULL); } @@ -733,7 +733,7 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys) LOOP_PARTICLES { key = pa->hair; psys_mat_hair_to_orco(ob, psmd->dm, psys->part->from, pa, mat); - VECCOPY(co, key->co); + copy_v3_v3(co, key->co); mul_m4_v3(mat, co); co[0]= -co[0]; @@ -818,7 +818,7 @@ static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys key= point->keys; mkey= mpoint->keys; for(k=0; k<pa->totkey; k++, hkey++, mhkey++, key++, mkey++) { - VECCOPY(mhkey->co, hkey->co); + copy_v3_v3(mhkey->co, hkey->co); mul_m4_v3(mat, mhkey->co); mhkey->co[0]= -mhkey->co[0]; mul_m4_v3(immat, mhkey->co); @@ -918,7 +918,7 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit) sub_v3_v3v3(dvec, key->co, vec); dot=dot_v3v3(dvec,nor); - VECCOPY(dvec,nor); + copy_v3_v3(dvec,nor); if(dot>0.0f) { if(dot<dist_1st) { @@ -1019,7 +1019,7 @@ static void pe_iterate_lengths(Scene *scene, PTCacheEdit *edit) add_v3_v3((key-1)->co, dv1); } - VECADD(dv1,dv0,dv2); + add_v3_v3v3(dv1, dv0, dv2); } } } @@ -1071,20 +1071,20 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys) MVert *mvert; mvert=dm->getVertData(dm,mface->v1,CD_MVERT); - VECCOPY(vec,mvert->co); + copy_v3_v3(vec,mvert->co); VECCOPY(nor,mvert->no); mvert=dm->getVertData(dm,mface->v2,CD_MVERT); - VECADD(vec,vec,mvert->co); + add_v3_v3v3(vec,vec,mvert->co); VECADD(nor,nor,mvert->no); mvert=dm->getVertData(dm,mface->v3,CD_MVERT); - VECADD(vec,vec,mvert->co); + add_v3_v3v3(vec,vec,mvert->co); VECADD(nor,nor,mvert->no); if(mface->v4) { mvert=dm->getVertData(dm,mface->v4,CD_MVERT); - VECADD(vec,vec,mvert->co); + add_v3_v3v3(vec,vec,mvert->co); VECADD(nor,nor,mvert->no); mul_v3_fl(vec,0.25); @@ -1144,7 +1144,7 @@ static void update_world_cos(Object *ob, PTCacheEdit *edit) psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles+p, hairmat); LOOP_KEYS { - VECCOPY(key->world_co,key->co); + copy_v3_v3(key->world_co,key->co); if(!(psys->flag & PSYS_GLOBAL_HAIR)) mul_m4_v3(hairmat, key->world_co); } @@ -1170,13 +1170,13 @@ static void update_velocities(PTCacheEdit *edit) if(dfra <= 0.0f) continue; - VECSUB(key->vel, (key+1)->co, key->co); + sub_v3_v3v3(key->vel, (key+1)->co, key->co); if(point->totkey>2) { - VECSUB(vec1, (key+1)->co, (key+2)->co); + sub_v3_v3v3(vec1, (key+1)->co, (key+2)->co); project_v3_v3v3(vec2, vec1, key->vel); - VECSUB(vec2, vec1, vec2); - VECADDFAC(key->vel, key->vel, vec2, 0.5f); + sub_v3_v3v3(vec2, vec1, vec2); + madd_v3_v3fl(key->vel, vec2, 0.5f); } } else if(k==point->totkey-1) { @@ -1185,13 +1185,13 @@ static void update_velocities(PTCacheEdit *edit) if(dfra <= 0.0f) continue; - VECSUB(key->vel, key->co, (key-1)->co); + sub_v3_v3v3(key->vel, key->co, (key-1)->co); if(point->totkey>2) { - VECSUB(vec1, (key-2)->co, (key-1)->co); + sub_v3_v3v3(vec1, (key-2)->co, (key-1)->co); project_v3_v3v3(vec2, vec1, key->vel); - VECSUB(vec2, vec1, vec2); - VECADDFAC(key->vel, key->vel, vec2, 0.5f); + sub_v3_v3v3(vec2, vec1, vec2); + madd_v3_v3fl(key->vel, vec2, 0.5f); } } else { @@ -1200,7 +1200,7 @@ static void update_velocities(PTCacheEdit *edit) if(dfra <= 0.0f) continue; - VECSUB(key->vel, (key+1)->co, (key-1)->co); + sub_v3_v3v3(key->vel, (key+1)->co, (key-1)->co); } mul_v3_fl(key->vel, frs_sec/dfra); } @@ -1623,7 +1623,7 @@ int PE_lasso_select(bContext *C, int mcords[][2], short moves, short extend, sho if(pset->selectmode==SCE_SELECT_POINT) { LOOP_KEYS { - VECCOPY(co, key->co); + copy_v3_v3(co, key->co); mul_m4_v3(mat, co); project_int(ar, co, vertco); if((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1]) && key_test_depth(&data, co)) { @@ -1641,7 +1641,7 @@ int PE_lasso_select(bContext *C, int mcords[][2], short moves, short extend, sho else if(pset->selectmode==SCE_SELECT_END) { key= point->keys + point->totkey - 1; - VECCOPY(co, key->co); + copy_v3_v3(co, key->co); mul_m4_v3(mat, co); project_int(ar, co,vertco); if((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1]) && key_test_depth(&data, co)) { @@ -1934,8 +1934,8 @@ static void rekey_particle(PEData *data, int pa_index) okey = pa->hair; /* root and tip stay the same */ - VECCOPY(key->co, okey->co); - VECCOPY((key + data->totrekey - 1)->co, (okey + pa->totkey - 1)->co); + copy_v3_v3(key->co, okey->co); + copy_v3_v3((key + data->totrekey - 1)->co, (okey + pa->totkey - 1)->co); sta= key->time= okey->time; end= (key + data->totrekey - 1)->time= (okey + pa->totkey - 1)->time; @@ -1945,7 +1945,7 @@ static void rekey_particle(PEData *data, int pa_index) for(k=1,key++; k<data->totrekey-1; k++,key++) { state.time= (float)k / (float)(data->totrekey-1); psys_get_particle_on_path(&sim, pa_index, &state, 0); - VECCOPY(key->co, state.co); + copy_v3_v3(key->co, state.co); key->time= sta + k * dval; } @@ -2038,7 +2038,7 @@ static void rekey_particle_to_time(Scene *scene, Object *ob, int pa_index, float for(k=1, key++; k < pa->totkey; k++, key++) { state.time= path_time * (float)k / (float)(pa->totkey-1); psys_get_particle_on_path(&sim, pa_index, &state, 0); - VECCOPY(key->co, state.co); + copy_v3_v3(key->co, state.co); } /* replace hair keys */ @@ -2188,7 +2188,7 @@ static void remove_tagged_keys(Object *ob, ParticleSystem *psys) } if(hkey < pa->hair + pa->totkey) { - VECCOPY(nhkey->co, hkey->co); + copy_v3_v3(nhkey->co, hkey->co); nhkey->editflag = hkey->editflag; nhkey->time= hkey->time; nhkey->weight= hkey->weight; @@ -2199,7 +2199,7 @@ static void remove_tagged_keys(Object *ob, ParticleSystem *psys) nkey->flag = key->flag; nkey->ftime = key->ftime; nkey->length = key->length; - VECCOPY(nkey->world_co, key->world_co); + copy_v3_v3(nkey->world_co, key->world_co); } nkey++; nhkey++; @@ -2275,7 +2275,7 @@ static void subdivide_particle(PEData *data, int pa_index) nkey->time= (key->time + (key+1)->time)*0.5f; state.time= (endtime != 0.0f)? nkey->time/endtime: 0.0f; psys_get_particle_on_path(&sim, pa_index, &state, 0); - VECCOPY(nkey->co, state.co); + copy_v3_v3(nkey->co, state.co); nekey->co= nkey->co; nekey->time= &nkey->time; @@ -2365,7 +2365,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op) /* insert particles into kd tree */ LOOP_SELECTED_POINTS { psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, psys->particles+p, mat); - VECCOPY(co, point->keys->co); + copy_v3_v3(co, point->keys->co); mul_m4_v3(mat, co); BLI_kdtree_insert(tree, p, co, NULL); } @@ -2375,7 +2375,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op) /* tag particles to be removed */ LOOP_SELECTED_POINTS { psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, psys->particles+p, mat); - VECCOPY(co, point->keys->co); + copy_v3_v3(co, point->keys->co); mul_m4_v3(mat, co); totn= BLI_kdtree_find_n_nearest(tree,10,co,NULL,nearest); @@ -2747,10 +2747,10 @@ static void brush_comb(PEData *data, float UNUSED(mat[][4]), float imat[][4], in fac= (float)pow((double)(1.0f - data->dist / data->rad), (double)data->combfac); - VECCOPY(cvec,data->dvec); + copy_v3_v3(cvec,data->dvec); mul_mat3_m4_v3(imat,cvec); mul_v3_fl(cvec, fac); - VECADD(key->co, key->co, cvec); + add_v3_v3(key->co, cvec); (data->edit->points + point_index)->flag |= PEP_EDIT_RECALC; } @@ -2861,13 +2861,13 @@ static void brush_length(PEData *data, int point_index) LOOP_KEYS { if(k==0) { - VECCOPY(pvec,key->co); + copy_v3_v3(pvec,key->co); } else { - VECSUB(dvec,key->co,pvec); - VECCOPY(pvec,key->co); + sub_v3_v3v3(dvec,key->co,pvec); + copy_v3_v3(pvec,key->co); mul_v3_fl(dvec,data->growfac); - VECADD(key->co,(key-1)->co,dvec); + add_v3_v3v3(key->co,(key-1)->co,dvec); } } @@ -2904,14 +2904,14 @@ static void brush_puff(PEData *data, int point_index) LOOP_KEYS { if(k==0) { /* find root coordinate and normal on emitter */ - VECCOPY(co, key->co); + copy_v3_v3(co, key->co); mul_m4_v3(mat, co); mul_v3_m4v3(kco, data->ob->imat, co); /* use 'kco' as the object space version of worldspace 'co', ob->imat is set before calling */ point_index= BLI_kdtree_find_nearest(edit->emitter_field, kco, NULL, NULL); if(point_index == -1) return; - VECCOPY(rootco, co); + copy_v3_v3(rootco, co); copy_v3_v3(nor, &edit->emitter_cosnos[point_index*6+3]); mul_mat3_m4_v3(data->ob->obmat, nor); /* normal into worldspace */ @@ -2926,19 +2926,19 @@ static void brush_puff(PEData *data, int point_index) else { /* compute position as if hair was standing up straight. * */ - VECCOPY(lastco, co); - VECCOPY(co, key->co); + copy_v3_v3(lastco, co); + copy_v3_v3(co, key->co); mul_m4_v3(mat, co); length += len_v3v3(lastco, co); if((data->select==0 || (key->flag & PEK_SELECT)) && !(key->flag & PEK_HIDE)) { - VECADDFAC(kco, rootco, nor, length); + madd_v3_v3v3fl(kco, rootco, nor, length); /* blend between the current and straight position */ - VECSUB(dco, kco, co); - VECADDFAC(co, co, dco, fac); + sub_v3_v3v3(dco, kco, co); + madd_v3_v3fl(co, dco, fac); /* re-use dco to compare before and after translation and add to the offset */ - VECCOPY(dco, key->co); + copy_v3_v3(dco, key->co); mul_v3_m4v3(key->co, imat, co); @@ -2965,7 +2965,7 @@ static void brush_puff(PEData *data, int point_index) /* Move the unselected point on a vector based on the * hair direction and the offset */ float c1[3], c2[3]; - VECSUB(dco, lastco, co); + sub_v3_v3v3(dco, lastco, co); mul_mat3_m4_v3(imat, dco); /* into particle space */ /* move the point along a vector perpendicular to the @@ -2979,7 +2979,7 @@ static void brush_puff(PEData *data, int point_index) /* Move the unselected point on a vector based on the * the normal of the closest geometry */ float oco[3], onor[3]; - VECCOPY(oco, key->co); + copy_v3_v3(oco, key->co); mul_m4_v3(mat, oco); mul_v3_m4v3(kco, data->ob->imat, oco); /* use 'kco' as the object space version of worldspace 'co', ob->imat is set before calling */ @@ -3028,7 +3028,7 @@ static void brush_smooth_get(PEData *data, float mat[][4], float UNUSED(imat[][4 sub_v3_v3v3(dvec,key->co,(key-1)->co); mul_mat3_m4_v3(mat,dvec); - VECADD(data->vec,data->vec,dvec); + add_v3_v3(data->vec, dvec); data->tot++; } } @@ -3038,57 +3038,61 @@ static void brush_smooth_do(PEData *data, float UNUSED(mat[][4]), float imat[][4 float vec[3], dvec[3]; if(key_index) { - VECCOPY(vec,data->vec); + copy_v3_v3(vec, data->vec); mul_mat3_m4_v3(imat,vec); sub_v3_v3v3(dvec,key->co,(key-1)->co); - VECSUB(dvec,vec,dvec); + sub_v3_v3v3(dvec,vec,dvec); mul_v3_fl(dvec,data->smoothfac); - VECADD(key->co,key->co,dvec); + add_v3_v3(key->co, dvec); } (data->edit->points + point_index)->flag |= PEP_EDIT_RECALC; } /* convert from triangle barycentric weights to quad mean value weights */ -static void intersect_dm_quad_weights(float *v1, float *v2, float *v3, float *v4, float *w) +static void intersect_dm_quad_weights(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float w[4]) { float co[3], vert[4][3]; - VECCOPY(vert[0], v1); - VECCOPY(vert[1], v2); - VECCOPY(vert[2], v3); - VECCOPY(vert[3], v4); + copy_v3_v3(vert[0], v1); + copy_v3_v3(vert[1], v2); + copy_v3_v3(vert[2], v3); + copy_v3_v3(vert[3], v4); co[0]= v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2] + v4[0]*w[3]; co[1]= v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2] + v4[1]*w[3]; co[2]= v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2] + v4[2]*w[3]; - interp_weights_poly_v3( w,vert, 4, co); + interp_weights_poly_v3(w, vert, 4, co); } /* check intersection with a derivedmesh */ -static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, float *vert_cos, float *co1, float* co2, float *min_d, int *min_face, float *min_w, - float *face_minmax, float *pa_minmax, float radius, float *ipoint) +static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, + float *vert_cos, + const float co1[3], const float co2[3], + float *min_d, int *min_face, float *min_w, + float *face_minmax, float *pa_minmax, + float radius, float *ipoint) { - MFace *mface=0; - MVert *mvert=0; + MFace *mface= NULL; + MVert *mvert= NULL; int i, totface, intersect=0; float cur_d, cur_uv[2], v1[3], v2[3], v3[3], v4[3], min[3], max[3], p_min[3],p_max[3]; float cur_ipoint[3]; - if(dm==0){ + if(dm == NULL){ psys_disable_all(ob); dm=mesh_get_derived_final(scene, ob, 0); - if(dm==0) + if(dm == NULL) dm=mesh_get_derived_deform(scene, ob, 0); psys_enable_all(ob); - if(dm==0) + if(dm == NULL) return 0; } @@ -3100,8 +3104,8 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, floa DO_MINMAX(co2,p_min,p_max); } else{ - VECCOPY(p_min,pa_minmax); - VECCOPY(p_max,pa_minmax+3); + copy_v3_v3(p_min,pa_minmax); + copy_v3_v3(p_max,pa_minmax+3); } totface=dm->getNumFaces(dm); @@ -3111,18 +3115,18 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, floa /* lets intersect the faces */ for(i=0; i<totface; i++,mface++){ if(vert_cos){ - VECCOPY(v1,vert_cos+3*mface->v1); - VECCOPY(v2,vert_cos+3*mface->v2); - VECCOPY(v3,vert_cos+3*mface->v3); + copy_v3_v3(v1,vert_cos+3*mface->v1); + copy_v3_v3(v2,vert_cos+3*mface->v2); + copy_v3_v3(v3,vert_cos+3*mface->v3); if(mface->v4) - VECCOPY(v4,vert_cos+3*mface->v4) + copy_v3_v3(v4,vert_cos+3*mface->v4); } else{ - VECCOPY(v1,mvert[mface->v1].co); - VECCOPY(v2,mvert[mface->v2].co); - VECCOPY(v3,mvert[mface->v3].co); + copy_v3_v3(v1,mvert[mface->v1].co); + copy_v3_v3(v2,mvert[mface->v2].co); + copy_v3_v3(v3,mvert[mface->v3].co); if(mface->v4) - VECCOPY(v4,mvert[mface->v4].co) + copy_v3_v3(v4,mvert[mface->v4].co); } if(face_minmax==0){ @@ -3136,8 +3140,8 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, floa continue; } else{ - VECCOPY(min, face_minmax+6*i); - VECCOPY(max, face_minmax+6*i+3); + copy_v3_v3(min, face_minmax+6*i); + copy_v3_v3(max, face_minmax+6*i+3); if(isect_aabb_aabb_v3(min,max,p_min,p_max)==0) continue; } @@ -3146,7 +3150,7 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, floa if(isect_sweeping_sphere_tri_v3(co1, co2, radius, v2, v3, v1, &cur_d, cur_ipoint)){ if(cur_d<*min_d){ *min_d=cur_d; - VECCOPY(ipoint,cur_ipoint); + copy_v3_v3(ipoint,cur_ipoint); *min_face=i; intersect=1; } @@ -3155,7 +3159,7 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, floa if(isect_sweeping_sphere_tri_v3(co1, co2, radius, v4, v1, v3, &cur_d, cur_ipoint)){ if(cur_d<*min_d){ *min_d=cur_d; - VECCOPY(ipoint,cur_ipoint); + copy_v3_v3(ipoint,cur_ipoint); *min_face=i; intersect=1; } @@ -3363,27 +3367,27 @@ static int brush_add(PEData *data, short number) key3[1].time= key3[0].time; psys_get_particle_on_path(&sim, ptn[1].index, &key3[1], 0); mul_v3_fl(key3[1].co, weight[1]); - VECADD(key3[0].co, key3[0].co, key3[1].co); + add_v3_v3(key3[0].co, key3[1].co); if(maxw>2) { key3[2].time= key3[0].time; psys_get_particle_on_path(&sim, ptn[2].index, &key3[2], 0); mul_v3_fl(key3[2].co, weight[2]); - VECADD(key3[0].co, key3[0].co, key3[2].co); + add_v3_v3(key3[0].co, key3[2].co); } } if(k==0) - VECSUB(co1, pa->state.co, key3[0].co); + sub_v3_v3v3(co1, pa->state.co, key3[0].co); - VECADD(thkey->co, key3[0].co, co1); + add_v3_v3v3(thkey->co, key3[0].co, co1); thkey->time= key3[0].time; } } else { for(k=0, hkey=pa->hair; k<pset->totaddkey; k++, hkey++) { - VECADDFAC(hkey->co, pa->state.co, pa->state.vel, k * framestep * timestep); + madd_v3_v3v3fl(hkey->co, pa->state.co, pa->state.vel, k * framestep * timestep); hkey->time += k * framestep; hkey->weight = 1.f - (float)k/(float)(pset->totaddkey-1); } @@ -4023,7 +4027,7 @@ void PE_undo_number(Scene *scene, int nr) /* get name of undo item, return null if no item with this index */ /* if active pointer, set it to 1 if true */ -char *PE_undo_get_name(Scene *scene, int nr, int *active) +const char *PE_undo_get_name(Scene *scene, int nr, int *active) { PTCacheEdit *edit= PE_get_current(scene, OBACT); PTCacheUndo *undo; @@ -4043,7 +4047,7 @@ char *PE_undo_get_name(Scene *scene, int nr, int *active) /************************ utilities ******************************/ -int PE_minmax(Scene *scene, float *min, float *max) +int PE_minmax(Scene *scene, float min[3], float max[3]) { Object *ob= OBACT; PTCacheEdit *edit= PE_get_current(scene, ob); @@ -4065,7 +4069,7 @@ int PE_minmax(Scene *scene, float *min, float *max) psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles+p, mat); LOOP_SELECTED_KEYS { - VECCOPY(co, key->co); + copy_v3_v3(co, key->co); mul_m4_v3(mat, co); DO_MINMAX(co, min, max); ok= 1; diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 101a6744e9a..bbff2239a38 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -688,7 +688,7 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys) psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); invert_m4_m4(imat,hairmat); - VECSUB(vec, nearest.co, key->co); + sub_v3_v3v3(vec, nearest.co, key->co); if(point) { ekey = point->keys; @@ -696,7 +696,7 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys) } for(k=0,key=pa->hair; k<pa->totkey; k++,key++) { - VECADD(key->co, key->co, vec); + add_v3_v3(key->co, vec); mul_m4_v3(imat,key->co); if(ekey) { diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 9da160948cc..feff1e05d60 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -70,6 +70,7 @@ #include "BKE_idprop.h" #include "BKE_image.h" #include "BKE_icons.h" +#include "BKE_lamp.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_material.h" diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 9d6d663df5c..e6ae8698b14 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1366,6 +1366,7 @@ static const char *editortype_pup(void) "|UV/Image Editor %x6" "|Video Sequence Editor %x8" + "|Movie Clip Editor %x20" "|Text Editor %x9" "|Node Editor %x16" "|Logic Editor %x17" diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 72fb0a019b6..a76be0c3c42 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -58,6 +58,7 @@ #include "ED_screen.h" #include "ED_screen_types.h" #include "ED_fileselect.h" +#include "ED_clip.h" #include "UI_interface.h" @@ -1809,6 +1810,8 @@ void ED_update_for_newframe(Main *bmain, Scene *scene, bScreen *screen, int UNUS * call before scene_update_for_newframe so modifiers with textuers dont lag 1 frame */ ED_image_update_frame(bmain, scene->r.cfra); + ED_clip_update_frame(bmain, scene->r.cfra); + /* this function applies the changes too */ /* XXX future: do all windows */ scene_update_for_newframe(bmain, scene, BKE_screen_visible_layers(screen, scene)); /* BKE_scene.h */ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index e86dd8dbde3..007a8f7e4d7 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2783,10 +2783,23 @@ static int match_region_with_redraws(int spacetype, int regiontype, int redraws) if(redraws & TIME_ALL_IMAGE_WIN) return 1; break; + case SPACE_CLIP: + if(redraws & TIME_CLIPS) + return 1; + break; } } else if(regiontype==RGN_TYPE_UI) { + if(spacetype==SPACE_CLIP) { + /* Track Preview button is on Properties Editor in SpaceClip, + and it's very common case when users want it be refreshing + during playback, so asking people to enable special option + for this is a bit ticky, so add exception here for refreshing + Properties Editor for SpaceClip always */ + return 1; + } + if(redraws & TIME_ALL_BUTS_WIN) return 1; } @@ -2800,6 +2813,8 @@ static int match_region_with_redraws(int spacetype, int regiontype, int redraws) if(redraws & (TIME_SEQ|TIME_ALL_ANIM_WIN)) return 1; break; + case SPACE_CLIP: + return 1; } } return 0; diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 6b6003fb098..ce603ce80b6 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -65,6 +65,7 @@ #include "DNA_scene_types.h" #include "DNA_texture_types.h" +#include "BKE_camera.h" #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_DerivedMesh.h" @@ -104,12 +105,30 @@ #define IMAPAINT_CHAR_TO_FLOAT(c) ((c)/255.0f) -#define IMAPAINT_FLOAT_RGB_TO_CHAR(c, f) { (c)[0]=FTOCHAR((f)[0]); (c)[1]=FTOCHAR((f)[1]); (c)[2]=FTOCHAR((f)[2]); } -#define IMAPAINT_FLOAT_RGBA_TO_CHAR(c, f) { (c)[0]=FTOCHAR((f)[0]); (c)[1]=FTOCHAR((f)[1]); (c)[2]=FTOCHAR((f)[2]); (c)[3]=FTOCHAR((f)[3]); } +#define IMAPAINT_FLOAT_RGB_TO_CHAR(c, f) { \ + (c)[0]= FTOCHAR((f)[0]); \ + (c)[1]= FTOCHAR((f)[1]); \ + (c)[2]= FTOCHAR((f)[2]); \ +} +#define IMAPAINT_FLOAT_RGBA_TO_CHAR(c, f) { \ + (c)[0]= FTOCHAR((f)[0]); \ + (c)[1]= FTOCHAR((f)[1]); \ + (c)[2]= FTOCHAR((f)[2]); \ + (c)[3]= FTOCHAR((f)[3]); \ +} +#define IMAPAINT_CHAR_RGB_TO_FLOAT(f, c) { \ + (f)[0]= IMAPAINT_CHAR_TO_FLOAT((c)[0]); \ + (f)[1]= IMAPAINT_CHAR_TO_FLOAT((c)[1]); \ + (f)[2]= IMAPAINT_CHAR_TO_FLOAT((c)[2]); \ +} +#define IMAPAINT_CHAR_RGBA_TO_FLOAT(f, c) { \ + (f)[0]= IMAPAINT_CHAR_TO_FLOAT((c)[0]); \ + (f)[1]= IMAPAINT_CHAR_TO_FLOAT((c)[1]); \ + (f)[2]= IMAPAINT_CHAR_TO_FLOAT((c)[2]); \ + (f)[3]= IMAPAINT_CHAR_TO_FLOAT((c)[3]); \ +} -#define IMAPAINT_CHAR_RGB_TO_FLOAT(f, c) { (f)[0]=IMAPAINT_CHAR_TO_FLOAT((c)[0]); (f)[1]=IMAPAINT_CHAR_TO_FLOAT((c)[1]); (f)[2]=IMAPAINT_CHAR_TO_FLOAT((c)[2]); } -#define IMAPAINT_CHAR_RGBA_TO_FLOAT(f, c) { (f)[0]=IMAPAINT_CHAR_TO_FLOAT((c)[0]); (f)[1]=IMAPAINT_CHAR_TO_FLOAT((c)[1]); (f)[2]=IMAPAINT_CHAR_TO_FLOAT((c)[2]); (f)[3]=IMAPAINT_CHAR_TO_FLOAT((c)[3]); } -#define IMAPAINT_FLOAT_RGB_COPY(a, b) VECCOPY(a, b) +#define IMAPAINT_FLOAT_RGB_COPY(a, b) copy_v3_v3(a, b) #define IMAPAINT_TILE_BITS 6 #define IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS) @@ -606,7 +625,7 @@ static int project_paint_PickFace(const ProjPaintState *ps, float pt[2], float w best_face_index = face_index; best_side = 0; z_depth_best = z_depth; - VECCOPY(w, w_tmp); + copy_v3_v3(w, w_tmp); } } else if (mf->v4) { @@ -620,7 +639,7 @@ static int project_paint_PickFace(const ProjPaintState *ps, float pt[2], float w best_face_index = face_index; best_side= 1; z_depth_best = z_depth; - VECCOPY(w, w_tmp); + copy_v3_v3(w, w_tmp); } } } @@ -721,7 +740,7 @@ static int project_paint_PickColor(const ProjPaintState *ps, float pt[2], float if (rgba_fp) { if (ibuf->rect_float) { - QUATCOPY(rgba_fp, ((float *)ibuf->rect_float + ((xi + yi * ibuf->x) * 4))); + copy_v4_v4(rgba_fp, ((float *)ibuf->rect_float + ((xi + yi * ibuf->x) * 4))); } else { char *tmp_ch= ((char *)ibuf->rect) + ((xi + yi * ibuf->x) * 4); @@ -1430,7 +1449,7 @@ static ProjPixel *project_paint_uvpixel_init( } /* screenspace unclamped, we could keep its z and w values but dont need them at the moment */ - VECCOPY2D(projPixel->projCoSS, pixelScreenCo); + copy_v2_v2(projPixel->projCoSS, pixelScreenCo); projPixel->x_px = x_px; projPixel->y_px = y_px; @@ -1529,8 +1548,8 @@ static int line_clip_rect2f( if (fabsf(l1[0]-l2[0]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/ if (BLI_in_rctf(rect, l1[0], l1[1])) { - VECCOPY2D(l1_clip, l1); - VECCOPY2D(l2_clip, l2); + copy_v2_v2(l1_clip, l1); + copy_v2_v2(l2_clip, l2); return 1; } else { @@ -1538,8 +1557,8 @@ static int line_clip_rect2f( } } - VECCOPY2D(l1_clip, l1); - VECCOPY2D(l2_clip, l2); + copy_v2_v2(l1_clip, l1); + copy_v2_v2(l2_clip, l2); CLAMP(l1_clip[0], rect->xmin, rect->xmax); CLAMP(l2_clip[0], rect->xmin, rect->xmax); return 1; @@ -1557,8 +1576,8 @@ static int line_clip_rect2f( if (fabsf(l1[1]-l2[1]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/ if (BLI_in_rctf(rect, l1[0], l1[1])) { - VECCOPY2D(l1_clip, l1); - VECCOPY2D(l2_clip, l2); + copy_v2_v2(l1_clip, l1); + copy_v2_v2(l2_clip, l2); return 1; } else { @@ -1566,8 +1585,8 @@ static int line_clip_rect2f( } } - VECCOPY2D(l1_clip, l1); - VECCOPY2D(l2_clip, l2); + copy_v2_v2(l1_clip, l1); + copy_v2_v2(l2_clip, l2); CLAMP(l1_clip[1], rect->ymin, rect->ymax); CLAMP(l2_clip[1], rect->ymin, rect->ymax); return 1; @@ -1581,12 +1600,12 @@ static int line_clip_rect2f( /* are either of the points inside the rectangle ? */ if (BLI_in_rctf(rect, l1[0], l1[1])) { - VECCOPY2D(l1_clip, l1); + copy_v2_v2(l1_clip, l1); ok1 = 1; } if (BLI_in_rctf(rect, l2[0], l2[1])) { - VECCOPY2D(l2_clip, l2); + copy_v2_v2(l2_clip, l2); ok2 = 1; } @@ -1911,14 +1930,14 @@ static void project_bucket_clip_face( if (inside_bucket_flag == ISECT_ALL3) { /* all screenspace points are inside the bucket bounding box, this means we dont need to clip and can simply return the UVs */ if (flip) { /* facing the back? */ - VECCOPY2D(bucket_bounds_uv[0], uv3co); - VECCOPY2D(bucket_bounds_uv[1], uv2co); - VECCOPY2D(bucket_bounds_uv[2], uv1co); + copy_v2_v2(bucket_bounds_uv[0], uv3co); + copy_v2_v2(bucket_bounds_uv[1], uv2co); + copy_v2_v2(bucket_bounds_uv[2], uv1co); } else { - VECCOPY2D(bucket_bounds_uv[0], uv1co); - VECCOPY2D(bucket_bounds_uv[1], uv2co); - VECCOPY2D(bucket_bounds_uv[2], uv3co); + copy_v2_v2(bucket_bounds_uv[0], uv1co); + copy_v2_v2(bucket_bounds_uv[1], uv2co); + copy_v2_v2(bucket_bounds_uv[2], uv3co); } *tot = 3; @@ -1982,33 +2001,33 @@ static void project_bucket_clip_face( (*tot) = 0; - if (inside_face_flag & ISECT_1) { VECCOPY2D(isectVCosSS[*tot], bucket_bounds_ss[0]); (*tot)++; } - if (inside_face_flag & ISECT_2) { VECCOPY2D(isectVCosSS[*tot], bucket_bounds_ss[1]); (*tot)++; } - if (inside_face_flag & ISECT_3) { VECCOPY2D(isectVCosSS[*tot], bucket_bounds_ss[2]); (*tot)++; } - if (inside_face_flag & ISECT_4) { VECCOPY2D(isectVCosSS[*tot], bucket_bounds_ss[3]); (*tot)++; } + if (inside_face_flag & ISECT_1) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[0]); (*tot)++; } + if (inside_face_flag & ISECT_2) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[1]); (*tot)++; } + if (inside_face_flag & ISECT_3) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[2]); (*tot)++; } + if (inside_face_flag & ISECT_4) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[3]); (*tot)++; } - if (inside_bucket_flag & ISECT_1) { VECCOPY2D(isectVCosSS[*tot], v1coSS); (*tot)++; } - if (inside_bucket_flag & ISECT_2) { VECCOPY2D(isectVCosSS[*tot], v2coSS); (*tot)++; } - if (inside_bucket_flag & ISECT_3) { VECCOPY2D(isectVCosSS[*tot], v3coSS); (*tot)++; } + if (inside_bucket_flag & ISECT_1) { copy_v2_v2(isectVCosSS[*tot], v1coSS); (*tot)++; } + if (inside_bucket_flag & ISECT_2) { copy_v2_v2(isectVCosSS[*tot], v2coSS); (*tot)++; } + if (inside_bucket_flag & ISECT_3) { copy_v2_v2(isectVCosSS[*tot], v3coSS); (*tot)++; } if ((inside_bucket_flag & (ISECT_1|ISECT_2)) != (ISECT_1|ISECT_2)) { if (line_clip_rect2f(bucket_bounds, v1coSS, v2coSS, v1_clipSS, v2_clipSS)) { - if ((inside_bucket_flag & ISECT_1)==0) { VECCOPY2D(isectVCosSS[*tot], v1_clipSS); (*tot)++; } - if ((inside_bucket_flag & ISECT_2)==0) { VECCOPY2D(isectVCosSS[*tot], v2_clipSS); (*tot)++; } + if ((inside_bucket_flag & ISECT_1)==0) { copy_v2_v2(isectVCosSS[*tot], v1_clipSS); (*tot)++; } + if ((inside_bucket_flag & ISECT_2)==0) { copy_v2_v2(isectVCosSS[*tot], v2_clipSS); (*tot)++; } } } if ((inside_bucket_flag & (ISECT_2|ISECT_3)) != (ISECT_2|ISECT_3)) { if (line_clip_rect2f(bucket_bounds, v2coSS, v3coSS, v1_clipSS, v2_clipSS)) { - if ((inside_bucket_flag & ISECT_2)==0) { VECCOPY2D(isectVCosSS[*tot], v1_clipSS); (*tot)++; } - if ((inside_bucket_flag & ISECT_3)==0) { VECCOPY2D(isectVCosSS[*tot], v2_clipSS); (*tot)++; } + if ((inside_bucket_flag & ISECT_2)==0) { copy_v2_v2(isectVCosSS[*tot], v1_clipSS); (*tot)++; } + if ((inside_bucket_flag & ISECT_3)==0) { copy_v2_v2(isectVCosSS[*tot], v2_clipSS); (*tot)++; } } } if ((inside_bucket_flag & (ISECT_3|ISECT_1)) != (ISECT_3|ISECT_1)) { if (line_clip_rect2f(bucket_bounds, v3coSS, v1coSS, v1_clipSS, v2_clipSS)) { - if ((inside_bucket_flag & ISECT_3)==0) { VECCOPY2D(isectVCosSS[*tot], v1_clipSS); (*tot)++; } - if ((inside_bucket_flag & ISECT_1)==0) { VECCOPY2D(isectVCosSS[*tot], v2_clipSS); (*tot)++; } + if ((inside_bucket_flag & ISECT_3)==0) { copy_v2_v2(isectVCosSS[*tot], v1_clipSS); (*tot)++; } + if ((inside_bucket_flag & ISECT_1)==0) { copy_v2_v2(isectVCosSS[*tot], v2_clipSS); (*tot)++; } } } @@ -2537,8 +2556,8 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i //fac = line_point_factor_v2(uv, uv_seam_quad[0], uv_seam_quad[1]); fac = line_point_factor_v2(uv, seam_subsection[0], seam_subsection[1]); - if (fac < 0.0f) { VECCOPY(pixelScreenCo, edge_verts_inset_clip[0]); } - else if (fac > 1.0f) { VECCOPY(pixelScreenCo, edge_verts_inset_clip[1]); } + if (fac < 0.0f) { copy_v3_v3(pixelScreenCo, edge_verts_inset_clip[0]); } + else if (fac > 1.0f) { copy_v3_v3(pixelScreenCo, edge_verts_inset_clip[1]); } else { interp_v3_v3v3(pixelScreenCo, edge_verts_inset_clip[0], edge_verts_inset_clip[1], fac); } if (!is_ortho) { @@ -3034,7 +3053,7 @@ static void project_paint_begin(ProjPaintState *ps) normalize_v3(ps->viewDir); /* viewPos - object relative */ - VECCOPY(ps->viewPos, viewinv[3]); + copy_v3_v3(ps->viewPos, viewinv[3]); copy_m3_m4(mat, ps->ob->imat); mul_m3_v3(mat, ps->viewPos); add_v3_v3(ps->viewPos, ps->ob->imat[3]); @@ -3392,7 +3411,7 @@ static void project_paint_end(ProjPaintState *ps) if (is_float) { float *rgba_fp = (float *)tilerect + (((projPixel->x_px - x_round) + (projPixel->y_px - y_round) * IMAPAINT_TILE_SIZE)) * 4; - QUATCOPY(rgba_fp, projPixel->origColor.f); + copy_v4_v4(rgba_fp, projPixel->origColor.f); } else { ((unsigned int *)tilerect)[ (projPixel->x_px - x_round) + (projPixel->y_px - y_round) * IMAPAINT_TILE_SIZE ] = projPixel->origColor.uint; @@ -3727,7 +3746,7 @@ static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, flo srgb_to_linearrgb_v3_v3(rgba, ps->brush->rgb); } else { - VECCOPY(rgba, ps->brush->rgb); + copy_v3_v3(rgba, ps->brush->rgb); } rgba[3] = 1.0; } diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index b1c0b571d49..ed2956ff054 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -124,7 +124,7 @@ float paint_get_tex_pixel(Brush* br, float u, float v) static void imapaint_project(Object *ob, float *model, float *proj, float *co, float *pco) { - VECCOPY(pco, co); + copy_v3_v3(pco, co); pco[3]= 1.0f; mul_m4_v3(ob->obmat, pco); @@ -166,7 +166,7 @@ static void imapaint_tri_weights(Object *ob, float *v1, float *v2, float *v3, fl invert_m3_m3(invwmat, wmat); mul_m3_v3(invwmat, h); - VECCOPY(w, h); + copy_v3_v3(w, h); /* w is still divided by perspdiv, make it sum to one */ divw= w[0] + w[1] + w[2]; diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index c26a4d52a9e..ac2efcb2ec2 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -2297,8 +2297,9 @@ void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3]) ofs= key_to_vertcos(ob, kb); /* calculate key coord offsets (from previous location) */ - for (a= 0; a < me->totvert; a++) - VECSUB(ofs[a], vertCos[a], ofs[a]); + for (a= 0; a < me->totvert; a++) { + sub_v3_v3v3(ofs[a], vertCos[a], ofs[a]); + } /* apply offsets on other keys */ currkey = me->key->block.first; @@ -2319,7 +2320,7 @@ void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3]) MVert *mvert= me->mvert; for (a= 0; a < me->totvert; a++, mvert++) - VECCOPY(mvert->co, vertCos[a]); + copy_v3_v3(mvert->co, vertCos[a]); mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL); } diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 905f7bc80b6..fbf8af514b6 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -61,6 +61,7 @@ #include "ED_uvedit.h" #include "ED_mball.h" #include "ED_logic.h" +#include "ED_clip.h" /* only call once on startup, storage is global in BKE kernel listbase */ void ED_spacetypes_init(void) @@ -89,6 +90,7 @@ void ED_spacetypes_init(void) ED_spacetype_logic(); ED_spacetype_console(); ED_spacetype_userpref(); + ED_spacetype_clip(); // ... /* register operator types for screen and all spaces */ @@ -129,6 +131,7 @@ void ED_spacetypes_init(void) ED_operatormacros_file(); ED_operatormacros_graph(); ED_operatormacros_action(); + ED_operatormacros_clip(); /* register dropboxes (can use macros) */ spacetypes = BKE_spacetypes_list(); diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 39fae43a877..05fdcd50067 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -100,7 +100,7 @@ static int file_browse_exec(bContext *C, wmOperator *op) { FileBrowseOp *fbo= op->customdata; ID *id; - char *base, *str, path[FILE_MAX]; + char *str, path[FILE_MAX]; const char *path_prop= RNA_struct_find_property(op->ptr, "directory") ? "directory" : "filepath"; if (RNA_property_is_set(op->ptr, path_prop)==0 || fbo==NULL) @@ -113,10 +113,9 @@ static int file_browse_exec(bContext *C, wmOperator *op) char name[FILE_MAX]; id = fbo->ptr.id.data; - base = (id && id->lib)? id->lib->filepath: G.main->name; BLI_strncpy(path, str, FILE_MAX); - BLI_path_abs(path, base); + BLI_path_abs(path, id ? ID_BLEND_PATH(G.main, id) : G.main->name); if(BLI_is_dir(path)) { str = MEM_reallocN(str, strlen(str)+2); diff --git a/source/blender/editors/space_clip/CMakeLists.txt b/source/blender/editors/space_clip/CMakeLists.txt new file mode 100644 index 00000000000..4f9819e8e77 --- /dev/null +++ b/source/blender/editors/space_clip/CMakeLists.txt @@ -0,0 +1,56 @@ +# ***** 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. +# +# Contributor(s): Blender Foundation, +# Sergey Sharybin +# +# ***** END GPL LICENSE BLOCK ***** + +set(INC + ../include + ../../blenkernel + ../../blenloader + ../../blenfont + ../../blenlib + ../../imbuf + ../../makesdna + ../../makesrna + ../../windowmanager + ../../../../intern/guardedalloc + ${GLEW_INCLUDE_PATH} +) + +set(INC_SYS +) + +set(SRC + space_clip.c + clip_draw.c + clip_toolbar.c + clip_ops.c + clip_graph_ops.c + clip_graph_draw.c + clip_editor.c + clip_buttons.c + clip_utils.c + tracking_ops.c + + clip_intern.h +) + +blender_add_lib(bf_editor_space_clip "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_clip/SConscript b/source/blender/editors/space_clip/SConscript new file mode 100644 index 00000000000..70331b0ec4a --- /dev/null +++ b/source/blender/editors/space_clip/SConscript @@ -0,0 +1,9 @@ +#!/usr/bin/python +Import ('env') + +sources = env.Glob('*.c') +defs = [] +incs = '../include ../../blenkernel ../../blenloader ../../blenfont ../../blenlib ../../imbuf ../../makesdna' +incs += ' ../../makesrna ../../windowmanager #/intern/guardedalloc #/extern/glew/include' + +env.BlenderLib ( 'bf_editors_space_clip', sources, Split(incs), defs, libtype=['core'], priority=[95] ) diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c new file mode 100644 index 00000000000..149aa9106b0 --- /dev/null +++ b/source/blender/editors/space_clip/clip_buttons.c @@ -0,0 +1,436 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/editors/space_clip/clip_buttons.c + * \ingroup spclip + */ + +#include <string.h> +#include <stdio.h> + +#include "MEM_guardedalloc.h" + +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_space_types.h" + +#include "BLI_math.h" +#include "BLI_utildefines.h" +#include "BLI_listbase.h" + +#include "BKE_context.h" +#include "BKE_depsgraph.h" +#include "BKE_screen.h" +#include "BKE_movieclip.h" +#include "BKE_tracking.h" + +#include "ED_clip.h" +#include "ED_gpencil.h" + +#include "UI_interface.h" +#include "UI_resources.h" + +#include "RNA_access.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "clip_intern.h" // own include + +/* Panels */ + +void ED_clip_buttons_register(ARegionType *art) +{ + PanelType *pt; + + pt= MEM_callocN(sizeof(PanelType), "spacetype clip panel gpencil"); + strcpy(pt->idname, "CLIP_PT_gpencil"); + strcpy(pt->label, "Grease Pencil"); + pt->draw= gpencil_panel_standard; + pt->flag|= PNL_DEFAULT_CLOSED; + BLI_addtail(&art->paneltypes, pt); +} + +/********************* MovieClip Template ************************/ + +void uiTemplateMovieClip(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, int compact) +{ + PropertyRNA *prop; + PointerRNA clipptr; + MovieClip *clip; + uiLayout *row, *split; + uiBlock *block; + + if(!ptr->data) + return; + + prop= RNA_struct_find_property(ptr, propname); + if(!prop) { + printf("uiTemplateMovieClip: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname); + return; + } + + if(RNA_property_type(prop) != PROP_POINTER) { + printf("uiTemplateMovieClip: expected pointer property for %s.%s\n", RNA_struct_identifier(ptr->type), propname); + return; + } + + clipptr= RNA_property_pointer_get(ptr, prop); + clip= clipptr.data; + + uiLayoutSetContextPointer(layout, "edit_movieclip", &clipptr); + + if(!compact) + uiTemplateID(layout, C, ptr, propname, NULL, "CLIP_OT_open", NULL); + + if(clip) { + row= uiLayoutRow(layout, 0); + block= uiLayoutGetBlock(row); + uiDefBut(block, LABEL, 0, "File Path:", 0, 19, 145, 19, NULL, 0, 0, 0, 0, ""); + + row= uiLayoutRow(layout, 0); + split = uiLayoutSplit(row, 0.0, 0); + row= uiLayoutRow(split, 1); + + uiItemR(row, &clipptr, "filepath", 0, "", ICON_NONE); + uiItemO(row, "", ICON_FILE_REFRESH, "clip.reload"); + } +} + +/********************* Track Template ************************/ + +void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname) +{ + PropertyRNA *prop; + PointerRNA scopesptr; + uiBlock *block; + rctf rect; + MovieClipScopes *scopes; + + if(!ptr->data) + return; + + prop= RNA_struct_find_property(ptr, propname); + if(!prop) { + printf("uiTemplateTrack: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname); + return; + } + + if(RNA_property_type(prop) != PROP_POINTER) { + printf("uiTemplateTrack: expected pointer property for %s.%s\n", RNA_struct_identifier(ptr->type), propname); + return; + } + + scopesptr= RNA_property_pointer_get(ptr, prop); + scopes= (MovieClipScopes *)scopesptr.data; + + rect.xmin= 0; rect.xmax= 200; + rect.ymin= 0; rect.ymax= 120; + + block= uiLayoutAbsoluteBlock(layout); + + scopes->track_preview_height= (scopes->track_preview_height<=UI_UNIT_Y)?UI_UNIT_Y:scopes->track_preview_height; + + uiDefBut(block, TRACKPREVIEW, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, scopes->track_preview_height, scopes, 0, 0, 0, 0, ""); +} + +/********************* Marker Template ************************/ + +#define B_MARKER_POS 3 +#define B_MARKER_OFFSET 4 +#define B_MARKER_PAT_DIM 5 +#define B_MARKER_SEARCH_POS 6 +#define B_MARKER_SEARCH_DIM 7 +#define B_MARKER_FLAG 8 + +typedef struct { + int compact; /* compact mode */ + + MovieClip *clip; + MovieClipUser *user; /* user of clip */ + MovieTrackingTrack *track; + + int framenr; /* current frame number */ + float marker_pos[2]; /* position of marker in pixel coords */ + float track_pat[2]; /* position and dimensions of marker pattern in pixel coords */ + float track_offset[2]; /* offset of "parenting" point */ + float track_search_pos[2], track_search[2]; /* position and dimensions of marker search in pixel coords */ + int marker_flag; /* marker's flags */ +} MarkerUpdateCb; + +static void to_pixel_space(float r[2], float a[2], int width, int height) +{ + copy_v2_v2(r, a); + r[0]*= width; + r[1]*= height; +} + +static void marker_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg)) +{ + MarkerUpdateCb *cb= (MarkerUpdateCb*) arg_cb; + MovieTrackingMarker *marker; + + if(!cb->compact) + return; + + marker= BKE_tracking_ensure_marker(cb->track, cb->framenr); + + marker->flag= cb->marker_flag; + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, NULL); +} + +static void marker_block_handler(bContext *C, void *arg_cb, int event) +{ + MarkerUpdateCb *cb= (MarkerUpdateCb*) arg_cb; + MovieTrackingMarker *marker; + int width, height, ok= 0; + + BKE_movieclip_get_size(cb->clip, cb->user, &width, &height); + + marker= BKE_tracking_ensure_marker(cb->track, cb->framenr); + + if(event==B_MARKER_POS) { + marker->pos[0]= cb->marker_pos[0]/width; + marker->pos[1]= cb->marker_pos[1]/height; + + /* to update position of "parented" objects */ + DAG_id_tag_update(&cb->clip->id, 0); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + ok= 1; + } + else if(event==B_MARKER_PAT_DIM) { + float dim[2], pat_dim[2]; + + sub_v2_v2v2(pat_dim, cb->track->pat_max, cb->track->pat_min); + + dim[0]= cb->track_pat[0]/width; + dim[1]= cb->track_pat[1]/height; + + sub_v2_v2(dim, pat_dim); + mul_v2_fl(dim, 0.5f); + + cb->track->pat_min[0]-= dim[0]; + cb->track->pat_min[1]-= dim[1]; + + cb->track->pat_max[0]+= dim[0]; + cb->track->pat_max[1]+= dim[1]; + + BKE_tracking_clamp_track(cb->track, CLAMP_PAT_DIM); + + ok= 1; + } + else if(event==B_MARKER_SEARCH_POS) { + float delta[2], side[2]; + + sub_v2_v2v2(side, cb->track->search_max, cb->track->search_min); + mul_v2_fl(side, 0.5f); + + delta[0]= cb->track_search_pos[0]/width; + delta[1]= cb->track_search_pos[1]/height; + + sub_v2_v2v2(cb->track->search_min, delta, side); + add_v2_v2v2(cb->track->search_max, delta, side); + + BKE_tracking_clamp_track(cb->track, CLAMP_SEARCH_POS); + + ok= 1; + } + else if(event==B_MARKER_SEARCH_DIM) { + float dim[2], search_dim[2]; + + sub_v2_v2v2(search_dim, cb->track->search_max, cb->track->search_min); + + dim[0]= cb->track_search[0]/width; + dim[1]= cb->track_search[1]/height; + + sub_v2_v2(dim, search_dim); + mul_v2_fl(dim, 0.5f); + + cb->track->search_min[0]-= dim[0]; + cb->track->search_min[1]-= dim[1]; + + cb->track->search_max[0]+= dim[0]; + cb->track->search_max[1]+= dim[1]; + + BKE_tracking_clamp_track(cb->track, CLAMP_SEARCH_DIM); + + ok= 1; + } else if(event==B_MARKER_FLAG) { + marker->flag= cb->marker_flag; + + ok= 1; + } else if(event==B_MARKER_OFFSET) { + float offset[2], delta[2]; + int i; + + offset[0]= cb->track_offset[0]/width; + offset[1]= cb->track_offset[1]/height; + + sub_v2_v2v2(delta, offset, cb->track->offset); + copy_v2_v2(cb->track->offset, offset); + + for(i=0; i<cb->track->markersnr; i++) + sub_v2_v2(cb->track->markers[i].pos, delta); + + /* to update position of "parented" objects */ + DAG_id_tag_update(&cb->clip->id, 0); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + ok= 1; + } + + if(ok) + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, cb->clip); +} + +void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *userptr, PointerRNA *trackptr, int compact) +{ + PropertyRNA *prop; + uiBlock *block; + uiBut *bt; + PointerRNA clipptr; + MovieClip *clip; + MovieClipUser *user; + MovieTrackingTrack *track; + MovieTrackingMarker *marker; + MarkerUpdateCb *cb; + + if(!ptr->data) + return; + + prop= RNA_struct_find_property(ptr, propname); + if(!prop) { + printf("uiTemplateMarker: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname); + return; + } + + if(RNA_property_type(prop) != PROP_POINTER) { + printf("uiTemplateMarker: expected pointer property for %s.%s\n", RNA_struct_identifier(ptr->type), propname); + return; + } + + clipptr= RNA_property_pointer_get(ptr, prop); + clip= (MovieClip *)clipptr.data; + user= userptr->data; + track= trackptr->data; + + marker= BKE_tracking_get_marker(track, user->framenr); + + cb= MEM_callocN(sizeof(MarkerUpdateCb), "uiTemplateMarker update_cb"); + cb->compact= compact; + cb->clip= clip; + cb->user= user; + cb->track= track; + cb->marker_flag= marker->flag; + cb->framenr= user->framenr; + + if(compact) { + block= uiLayoutGetBlock(layout); + + bt= uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, 20, 20, &cb->marker_flag, 0, 0, 1, 0, "Marker is disabled for current frame."); + uiButSetNFunc(bt, marker_update_cb, cb, NULL); + } else { + int width, height, step, digits; + float pat_dim[2], pat_pos[2], search_dim[2], search_pos[2]; + uiLayout *col; + + BKE_movieclip_get_size(clip, user, &width, &height); + + if(track->flag&TRACK_LOCKED) { + uiLayoutSetActive(layout, 0); + block= uiLayoutAbsoluteBlock(layout); + uiDefBut(block, LABEL, 0, "Track is locked", 0, 0, 300, 19, NULL, 0, 0, 0, 0, ""); + + return; + } + + step= 100; + digits= 2; + + sub_v2_v2v2(pat_dim, track->pat_max, track->pat_min); + sub_v2_v2v2(search_dim, track->search_max, track->search_min); + + add_v2_v2v2(search_pos, track->search_max, track->search_min); + mul_v2_fl(search_pos, 0.5); + + add_v2_v2v2(pat_pos, track->pat_max, track->pat_min); + mul_v2_fl(pat_pos, 0.5); + + to_pixel_space(cb->marker_pos, marker->pos, width, height); + to_pixel_space(cb->track_pat, pat_dim, width, height); + to_pixel_space(cb->track_search, search_dim, width, height); + to_pixel_space(cb->track_search_pos, search_pos, width, height); + to_pixel_space(cb->track_offset, track->offset, width, height); + + cb->marker_flag= marker->flag; + + block= uiLayoutAbsoluteBlock(layout); + uiBlockSetHandleFunc(block, marker_block_handler, cb); + uiBlockSetNFunc(block, marker_update_cb, cb, NULL); + + uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG, "Enabled", 10, 190, 145, 19, &cb->marker_flag, + 0, 0, 0, 0, "Marker is disabled for current frame."); + + col= uiLayoutColumn(layout, 1); + uiLayoutSetActive(col, (cb->marker_flag&MARKER_DISABLED)==0); + + block= uiLayoutAbsoluteBlock(col); + uiBlockBeginAlign(block); + + uiDefBut(block, LABEL, 0, "Position:", 0, 190, 300, 19, NULL, 0, 0, 0, 0, ""); + uiDefButF(block, NUM, B_MARKER_POS, "X:", 10, 171, 145, 19, &cb->marker_pos[0], + -10*width, 10.0*width, step, digits, "X-position of marker at frame in screen coordinates."); + uiDefButF(block, NUM, B_MARKER_POS, "Y:", 165, 171, 145, 19, &cb->marker_pos[1], + -10*height, 10.0*height, step, digits, "Y-position of marker at frame in screen coordinates."); + + uiDefBut(block, LABEL, 0, "Offset:", 0, 152, 300, 19, NULL, 0, 0, 0, 0, ""); + uiDefButF(block, NUM, B_MARKER_OFFSET, "X:", 10, 133, 145, 19, &cb->track_offset[0], + -10*width, 10.0*width, step, digits, "X-offset to parenting point."); + uiDefButF(block, NUM, B_MARKER_OFFSET, "Y:", 165, 133, 145, 19, &cb->track_offset[1], + -10*height, 10.0*height, step, digits, "Y-offset to parenting point."); + + uiDefBut(block, LABEL, 0, "Pattern Area:", 0, 114, 300, 19, NULL, 0, 0, 0, 0, ""); + uiDefButF(block, NUM, B_MARKER_PAT_DIM, "Width:", 10, 95, 300, 19, &cb->track_pat[0], 3.0f, + 10.0*width, step, digits, "Width of marker's pattern in screen soordinates."); + uiDefButF(block, NUM, B_MARKER_PAT_DIM, "Height:", 10, 76, 300, 19, &cb->track_pat[1], 3.0f, + 10.0*height, step, digits, "Height of marker's pattern in screen soordinates."); + + uiDefBut(block, LABEL, 0, "Search Area:", 0, 57, 300, 19, NULL, 0, 0, 0, 0, ""); + uiDefButF(block, NUM, B_MARKER_SEARCH_POS, "X:", 10, 38, 145, 19, &cb->track_search_pos[0], + -width, width, step, digits, "X-position of search at frame relative to marker's position"); + uiDefButF(block, NUM, B_MARKER_SEARCH_POS, "Y:", 165, 38, 145, 19, &cb->track_search_pos[1], + -height, height, step, digits, "X-position of search at frame relative to marker's position"); + uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, "Width:", 10, 19, 300, 19, &cb->track_search[0], 3.0f, + 10.0*width, step, digits, "Width of marker's search in screen soordinates."); + uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, "Height:", 10, 0, 300, 19, &cb->track_search[1], 3.0f, + 10.0*height, step, digits, "Height of marker's search in screen soordinates."); + + uiBlockEndAlign(block); + } +} diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c new file mode 100644 index 00000000000..9eb96a9a4c5 --- /dev/null +++ b/source/blender/editors/space_clip/clip_draw.c @@ -0,0 +1,1325 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/editors/space_clip/clip_draw.c + * \ingroup spclip + */ + +#include "DNA_gpencil_types.h" +#include "DNA_movieclip_types.h" +#include "DNA_scene_types.h" +#include "DNA_object_types.h" /* SELECT */ + +#include "MEM_guardedalloc.h" + +#include "BKE_context.h" +#include "BKE_movieclip.h" +#include "BKE_tracking.h" + +#include "IMB_imbuf_types.h" +#include "IMB_imbuf.h" + +#include "BLI_utildefines.h" +#include "BLI_math.h" +#include "BLI_string.h" +#include "BLI_rect.h" +#include "BLI_math_base.h" + +#include "ED_screen.h" +#include "ED_clip.h" +#include "ED_gpencil.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "RNA_access.h" + +#include "BLF_api.h" + +#include "clip_intern.h" // own include + +/*********************** main area drawing *************************/ + +void clip_draw_curfra_label(SpaceClip *sc, float x, float y) +{ + uiStyle *style= UI_GetStyle(); + int fontid= style->widget.uifont_id; + char str[32]; + float fontsize, fontwidth; + + /* frame number */ + BLF_size(fontid, 11.0f, U.dpi); + BLI_snprintf(str, sizeof(str), "%d", sc->user.framenr); + fontsize= BLF_height(fontid, str); + fontwidth= BLF_width(fontid, str); + + glRecti(x, y, x+fontwidth+6, y+fontsize+4); + + UI_ThemeColor(TH_TEXT); + BLF_position(fontid, x+2.0f, y+2.0f, 0.0f); + BLF_draw(fontid, str, strlen(str)); +} + +static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Scene *scene) +{ + float x; + int *points, totseg, i, a; + float sfra= SFRA, efra= EFRA, framelen= ar->winx/(efra-sfra+1); + + glEnable(GL_BLEND); + + /* cache background */ + glColor4ub(128, 128, 255, 64); + glRecti(0, 0, ar->winx, 8); + + /* cached segments -- could be usefu lto debug caching strategies */ + BKE_movieclip_get_cache_segments(clip, &sc->user, &totseg, &points); + if(totseg) { + glColor4ub(128, 128, 255, 128); + + for(a= 0; a<totseg; a++) { + float x1, x2; + + x1= (points[a*2]-sfra)/(efra-sfra+1)*ar->winx; + x2= (points[a*2+1]-sfra+1)/(efra-sfra+1)*ar->winx; + + glRecti(x1, 0, x2, 8); + } + } + + /* track */ + if(clip->tracking.act_track) { + MovieTrackingTrack *track= clip->tracking.act_track; + + for(i= sfra, a= 0; i <= efra; i++) { + int framenr; + MovieTrackingMarker *marker; + + while(a<track->markersnr) { + if(track->markers[a].framenr>=i) + break; + + if(a<track->markersnr-1 && track->markers[a+1].framenr>i) + break; + + a++; + } + + if(a<track->markersnr) marker= &track->markers[a]; + else marker= &track->markers[track->markersnr-1]; + + if((marker->flag&MARKER_DISABLED)==0) { + framenr= marker->framenr; + + if(framenr!=i) glColor4ub(128, 128, 0, 96); + else if((marker->flag&MARKER_TRACKED)==0) glColor4ub(255, 255, 0, 196); + else glColor4ub(255, 255, 0, 96); + + glRecti((i-sfra)*framelen, 0, (i-sfra+1)*framelen, 4); + } + } + } + + /* failed frames */ + if(clip->tracking.reconstruction.flag&TRACKING_RECONSTRUCTED) { + int n= clip->tracking.reconstruction.camnr; + MovieReconstructedCamera *cameras= clip->tracking.reconstruction.cameras; + + glColor4ub(255, 0, 0, 96); + + for(i= sfra, a= 0; i <= efra; i++) { + int ok= 0; + + while(a<n) { + if(cameras[a].framenr==i) { + ok= 1; + break; + } + else if(cameras[a].framenr>i) { + break; + } + + a++; + } + + if(!ok) + glRecti((i-sfra)*framelen, 0, (i-sfra+1)*framelen, 8); + } + } + + glDisable(GL_BLEND); + + /* current frame */ + x= (sc->user.framenr-sfra)/(efra-sfra+1)*ar->winx; + + UI_ThemeColor(TH_CFRAME); + glRecti(x, 0, x+framelen, 8); + + clip_draw_curfra_label(sc, x, 8.0f); +} + +static void draw_movieclip_notes(SpaceClip *sc, ARegion *ar) +{ + char str[256]= {0}; + + if(sc->flag&SC_LOCK_SELECTION) + strcpy(str, "Locked"); + + if(str[0]) { + uiStyle *style= UI_GetStyle(); + int fontsize, fontwidth; + int fontid= style->widget.uifont_id; + + BLF_size(fontid, 11.0f, U.dpi); + fontsize= BLF_height(fontid, str); + fontwidth= BLF_width(fontid, str); + + glEnable(GL_BLEND); + + glColor4f(0.0f, 0.0f, 0.0f, 0.6f); + glRecti(0, ar->winy-fontsize-9, fontwidth+12, ar->winy); + + glColor3f(1.0f, 1.0f, 1.0f); + BLF_position(fontid, 6.0f, ar->winy-fontsize-5.0f, 0.0f); + BLF_draw(fontid, str, strlen(str)); + + glDisable(GL_BLEND); + } +} + +static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf, + int width, int height, float zoomx, float zoomy) +{ + int x, y; + MovieClip *clip= ED_space_clip(sc); + + /* set zoom */ + glPixelZoom(zoomx*width/ibuf->x, zoomy*height/ibuf->y); + + /* find window pixel coordinates of origin */ + UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x, &y); + + if(sc->flag&SC_MUTE_FOOTAGE) { + glColor3f(0.0f, 0.0f, 0.0f); + glRectf(x, y, x+zoomx*width, y+zoomy*height); + } else { + if(ibuf->rect_float && !ibuf->rect) { + IMB_rect_from_float(ibuf); + } + + if(ibuf->rect) + glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); + } + + /* draw boundary border for frame if stabilization is enabled */ + if(sc->flag&SC_SHOW_STABLE && clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) { + glColor3f(0.0f, 0.0f, 0.0f); + glLineStipple(3, 0xaaaa); + glEnable(GL_LINE_STIPPLE); + glEnable(GL_COLOR_LOGIC_OP); + glLogicOp(GL_NOR); + + glPushMatrix(); + glTranslatef(x, y, 0); + + glScalef(zoomx, zoomy, 0); + glMultMatrixf(sc->stabmat); + + glBegin(GL_LINE_LOOP); + glVertex2f(0.0f, 0.0f); + glVertex2f(ibuf->x, 0.0f); + glVertex2f(ibuf->x, ibuf->y); + glVertex2f(0.0f, ibuf->y); + glEnd(); + + glPopMatrix(); + + glDisable(GL_COLOR_LOGIC_OP); + glDisable(GL_LINE_STIPPLE); + } + + + /* reset zoom */ + glPixelZoom(1.0f, 1.0f); +} + +static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackingTrack *track) +{ + int count= sc->path_length; + int i, a, b, curindex= -1; + float path[102][2]; + int tiny= sc->flag&SC_SHOW_TINY_MARKER, framenr; + MovieTrackingMarker *marker; + + if(count==0) + return; + + marker= BKE_tracking_get_marker(track, sc->user.framenr); + if(marker->framenr!=sc->user.framenr || marker->flag&MARKER_DISABLED) + return; + + framenr= marker->framenr; + + a= count; + i= framenr-1; + while(i>=framenr-count) { + marker= BKE_tracking_get_marker(track, i); + + if(!marker || marker->flag&MARKER_DISABLED) + break; + + if(marker->framenr==i) { + add_v2_v2v2(path[--a], marker->pos, track->offset); + ED_clip_point_undistorted_pos(sc, path[a], path[a]); + + if(marker->framenr==sc->user.framenr) + curindex= a; + } else + break; + + i--; + } + + b= count; + i= framenr; + while(i<=framenr+count) { + marker= BKE_tracking_get_marker(track, i); + + if(!marker || marker->flag&MARKER_DISABLED) + break; + + if(marker->framenr==i) { + if(marker->framenr==sc->user.framenr) + curindex= b; + + add_v2_v2v2(path[b++], marker->pos, track->offset); + ED_clip_point_undistorted_pos(sc, path[b-1], path[b-1]); + } else + break; + + i++; + } + + if(!tiny) { + UI_ThemeColor(TH_MARKER_OUTLINE); + + if(TRACK_VIEW_SELECTED(sc, track)) { + glPointSize(5.0f); + glBegin(GL_POINTS); + for(i= a; i<b; i++) { + if(i!=curindex) + glVertex2f(path[i][0], path[i][1]); + } + glEnd(); + } + + glLineWidth(3.0f); + glBegin(GL_LINE_STRIP); + for(i= a; i<b; i++) + glVertex2f(path[i][0], path[i][1]); + glEnd(); + glLineWidth(1.0f); + } + + UI_ThemeColor(TH_PATH_BEFORE); + + if(TRACK_VIEW_SELECTED(sc, track)) { + glPointSize(3.0f); + glBegin(GL_POINTS); + for(i= a; i<b; i++) { + if(i==count+1) + UI_ThemeColor(TH_PATH_AFTER); + + if(i!=curindex) + glVertex2f(path[i][0], path[i][1]); + } + glEnd(); + } + + UI_ThemeColor(TH_PATH_BEFORE); + + glBegin(GL_LINE_STRIP); + for(i= a; i<b; i++) { + if(i==count+1) + UI_ThemeColor(TH_PATH_AFTER); + + glVertex2f(path[i][0], path[i][1]); + } + glEnd(); + glPointSize(1.0f); +} + +static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker, float marker_pos[2], int width, int height) +{ + int tiny= sc->flag&SC_SHOW_TINY_MARKER; + int show_search= 0; + float px[2]; + + UI_ThemeColor(TH_MARKER_OUTLINE); + + px[0]= 1.0f/width/sc->zoom; + px[1]= 1.0f/height/sc->zoom; + + if((marker->flag&MARKER_DISABLED)==0) { + float pos[2]; + rctf r; + + BLI_init_rctf(&r, track->pat_min[0], track->pat_max[0], track->pat_min[1], track->pat_max[1]); + add_v2_v2v2(pos, marker->pos, track->offset); + + ED_clip_point_undistorted_pos(sc, pos, pos); + + if(BLI_in_rctf(&r, pos[0]-marker_pos[0], pos[1]-marker_pos[1])) { + if(tiny) glPointSize(3.0f); + else glPointSize(4.0f); + glBegin(GL_POINTS); + glVertex2f(pos[0], pos[1]); + glEnd(); + glPointSize(1.0f); + } else { + if(!tiny) glLineWidth(3.0f); + glBegin(GL_LINES); + glVertex2f(pos[0] + px[0]*2, pos[1]); + glVertex2f(pos[0] + px[0]*8, pos[1]); + + glVertex2f(pos[0] - px[0]*2, pos[1]); + glVertex2f(pos[0] - px[0]*8, pos[1]); + + glVertex2f(pos[0], pos[1] - px[1]*2); + glVertex2f(pos[0], pos[1] - px[1]*8); + + glVertex2f(pos[0], pos[1] + px[1]*2); + glVertex2f(pos[0], pos[1] + px[1]*8); + glEnd(); + if(!tiny) glLineWidth(1.0f); + } + } + + /* pattern and search outline */ + glPushMatrix(); + glTranslatef(marker_pos[0], marker_pos[1], 0); + + if(!tiny) glLineWidth(3.0f); + + if(sc->flag&SC_SHOW_MARKER_PATTERN) { + glBegin(GL_LINE_LOOP); + glVertex2f(track->pat_min[0], track->pat_min[1]); + glVertex2f(track->pat_max[0], track->pat_min[1]); + glVertex2f(track->pat_max[0], track->pat_max[1]); + glVertex2f(track->pat_min[0], track->pat_max[1]); + glEnd(); + } + + show_search= TRACK_VIEW_SELECTED(sc, track) && ((marker->flag&MARKER_DISABLED)==0 || (sc->flag&SC_SHOW_MARKER_PATTERN)==0); + if(sc->flag&SC_SHOW_MARKER_SEARCH && show_search) { + glBegin(GL_LINE_LOOP); + glVertex2f(track->search_min[0], track->search_min[1]); + glVertex2f(track->search_max[0], track->search_min[1]); + glVertex2f(track->search_max[0], track->search_max[1]); + glVertex2f(track->search_min[0], track->search_max[1]); + glEnd(); + } + glPopMatrix(); + + if(!tiny) glLineWidth(1.0f); +} + +static void track_colors(MovieTrackingTrack *track, int act, float col[3], float scol[3]) +{ + if(track->flag&TRACK_CUSTOMCOLOR) { + if(act) UI_GetThemeColor3fv(TH_ACT_MARKER, scol); + else copy_v3_v3(scol, track->color); + + mul_v3_v3fl(col, track->color, 0.5f); + } else { + UI_GetThemeColor3fv(TH_MARKER, col); + + if(act) UI_GetThemeColor3fv(TH_ACT_MARKER, scol); + else UI_GetThemeColor3fv(TH_SEL_MARKER, scol); + } +} + +static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker, float marker_pos[2], int width, int height, int act, int sel) +{ + int tiny= sc->flag&SC_SHOW_TINY_MARKER; + int show_search= 0; + float col[3], scol[3], px[2]; + + track_colors(track, act, col, scol); + + px[0]= 1.0f/width/sc->zoom; + px[1]= 1.0f/height/sc->zoom; + + /* marker position and offset position */ + if((track->flag&SELECT)==sel && (marker->flag&MARKER_DISABLED)==0) { + float pos[2]; + rctf r; + + if(track->flag&TRACK_LOCKED) { + if(act) UI_ThemeColor(TH_ACT_MARKER); + else if(track->flag&SELECT) UI_ThemeColorShade(TH_LOCK_MARKER, 64); + else UI_ThemeColor(TH_LOCK_MARKER); + } else { + if(track->flag&SELECT) glColor3fv(scol); + else glColor3fv(col); + } + + BLI_init_rctf(&r, track->pat_min[0], track->pat_max[0], track->pat_min[1], track->pat_max[1]); + add_v2_v2v2(pos, marker->pos, track->offset); + ED_clip_point_undistorted_pos(sc, pos, pos); + + if(BLI_in_rctf(&r, pos[0]-marker_pos[0], pos[1]-marker_pos[1])) { + if(!tiny) glPointSize(2.0f); + glBegin(GL_POINTS); + glVertex2f(pos[0], pos[1]); + glEnd(); + if(!tiny) glPointSize(1.0f); + } else { + glBegin(GL_LINES); + glVertex2f(pos[0] + px[0]*3, pos[1]); + glVertex2f(pos[0] + px[0]*7, pos[1]); + + glVertex2f(pos[0] - px[0]*3, pos[1]); + glVertex2f(pos[0] - px[0]*7, pos[1]); + + glVertex2f(pos[0], pos[1] - px[1]*3); + glVertex2f(pos[0], pos[1] - px[1]*7); + + glVertex2f(pos[0], pos[1] + px[1]*3); + glVertex2f(pos[0], pos[1] + px[1]*7); + glEnd(); + + glColor3f(0.0f, 0.0f, 0.0f); + glLineStipple(3, 0xaaaa); + glEnable(GL_LINE_STIPPLE); + glEnable(GL_COLOR_LOGIC_OP); + glLogicOp(GL_NOR); + + glBegin(GL_LINES); + glVertex2fv(pos); + glVertex2fv(marker_pos); + glEnd(); + + glDisable(GL_COLOR_LOGIC_OP); + glDisable(GL_LINE_STIPPLE); + } + } + + /* pattern */ + glPushMatrix(); + glTranslatef(marker_pos[0], marker_pos[1], 0); + + if(tiny) { + glLineStipple(3, 0xaaaa); + glEnable(GL_LINE_STIPPLE); + } + + if((track->pat_flag&SELECT)==sel && (sc->flag&SC_SHOW_MARKER_PATTERN)) { + if(track->flag&TRACK_LOCKED) { + if(act) UI_ThemeColor(TH_ACT_MARKER); + else if(track->pat_flag&SELECT) UI_ThemeColorShade(TH_LOCK_MARKER, 64); + else UI_ThemeColor(TH_LOCK_MARKER); + } + else if(marker->flag&MARKER_DISABLED) { + if(act) UI_ThemeColor(TH_ACT_MARKER); + else if(track->pat_flag&SELECT) UI_ThemeColorShade(TH_DIS_MARKER, 128); + else UI_ThemeColor(TH_DIS_MARKER); + } else { + if(track->pat_flag&SELECT) glColor3fv(scol); + else glColor3fv(col); + } + + glBegin(GL_LINE_LOOP); + glVertex2f(track->pat_min[0], track->pat_min[1]); + glVertex2f(track->pat_max[0], track->pat_min[1]); + glVertex2f(track->pat_max[0], track->pat_max[1]); + glVertex2f(track->pat_min[0], track->pat_max[1]); + glEnd(); + } + + /* search */ + show_search= TRACK_VIEW_SELECTED(sc, track) && ((marker->flag&MARKER_DISABLED)==0 || (sc->flag&SC_SHOW_MARKER_PATTERN)==0); + if((track->search_flag&SELECT)==sel && (sc->flag&SC_SHOW_MARKER_SEARCH) && show_search) { + if(track->flag&TRACK_LOCKED) { + if(act) UI_ThemeColor(TH_ACT_MARKER); + else if(track->search_flag&SELECT) UI_ThemeColorShade(TH_LOCK_MARKER, 64); + else UI_ThemeColor(TH_LOCK_MARKER); + } + else if(marker->flag&MARKER_DISABLED) { + if(act) UI_ThemeColor(TH_ACT_MARKER); + else if(track->search_flag&SELECT) UI_ThemeColorShade(TH_DIS_MARKER, 128); + else UI_ThemeColor(TH_DIS_MARKER); + } else { + if(track->search_flag&SELECT) glColor3fv(scol); + else glColor3fv(col); + } + + glBegin(GL_LINE_LOOP); + glVertex2f(track->search_min[0], track->search_min[1]); + glVertex2f(track->search_max[0], track->search_min[1]); + glVertex2f(track->search_max[0], track->search_max[1]); + glVertex2f(track->search_min[0], track->search_max[1]); + glEnd(); + } + + /* pyramid */ + if(sel && TRACK_SELECTED(track) && (sc->flag&SC_SHOW_PYRAMID_LEVELS) && (track->tracker==TRACKER_KLT) && (marker->flag&MARKER_DISABLED)==0) { + if(track->flag&TRACK_LOCKED) { + if(act) UI_ThemeColor(TH_ACT_MARKER); + else if(track->pat_flag&SELECT) UI_ThemeColorShade(TH_LOCK_MARKER, 64); + else UI_ThemeColor(TH_LOCK_MARKER); + } + else if(marker->flag&MARKER_DISABLED) { + if(act) UI_ThemeColor(TH_ACT_MARKER); + else if(track->pat_flag&SELECT) UI_ThemeColorShade(TH_DIS_MARKER, 128); + else UI_ThemeColor(TH_DIS_MARKER); + } else { + if(track->pat_flag&SELECT) glColor3fv(scol); + else glColor3fv(col); + } + + { + int i = 0; + glPushMatrix(); + glEnable(GL_LINE_STIPPLE); + for (i = 1; i < track->pyramid_levels; ++i) { + glScalef(2.0f, 2.0f, 1.0); + } + /* only draw a pattern for the coarsest level */ + glBegin(GL_LINE_LOOP); + glVertex2f(track->pat_min[0], track->pat_min[1]); + glVertex2f(track->pat_max[0], track->pat_min[1]); + glVertex2f(track->pat_max[0], track->pat_max[1]); + glVertex2f(track->pat_min[0], track->pat_max[1]); + glEnd(); + glDisable(GL_LINE_STIPPLE); + glPopMatrix(); + } + } + + if(tiny) + glDisable(GL_LINE_STIPPLE); + + glPopMatrix(); +} + +static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker, + float marker_pos[2], int outline, int sel, int act, int width, int height) +{ + float x, y, dx, dy, patdx, patdy, searchdx, searchdy, tdx, tdy; + int tiny= sc->flag&SC_SHOW_TINY_MARKER; + float col[3], scol[3], px[2]; + + if((tiny && outline) || (marker->flag&MARKER_DISABLED)) + return; + + if(!TRACK_VIEW_SELECTED(sc, track) || track->flag&TRACK_LOCKED) + return; + + track_colors(track, act, col, scol); + + if(outline) { + glLineWidth(3.0f); + UI_ThemeColor(TH_MARKER_OUTLINE); + } + + glPushMatrix(); + glTranslatef(marker_pos[0], marker_pos[1], 0); + + dx= 6.0f/width/sc->zoom; + dy= 6.0f/height/sc->zoom; + + patdx= MIN2(dx*2.0f/3.0f, (track->pat_max[0]-track->pat_min[0])/6.0f); + patdy= MIN2(dy*2.0f/3.0f, (track->pat_max[1]-track->pat_min[1])/6.0f); + + searchdx= MIN2(dx, (track->search_max[0]-track->search_min[0])/6.0f); + searchdy= MIN2(dy, (track->search_max[1]-track->search_min[1])/6.0f); + + px[0]= 1.0f/sc->zoom/width/sc->scale; + px[1]= 1.0f/sc->zoom/height/sc->scale; + + if((sc->flag&SC_SHOW_MARKER_SEARCH) && ((track->search_flag&SELECT)==sel || outline)) { + if(!outline) { + if(track->search_flag&SELECT) glColor3fv(scol); + else glColor3fv(col); + } + + /* search offset square */ + x= track->search_min[0]; + y= track->search_max[1]; + + tdx= searchdx; + tdy= searchdy; + + if(outline) { + tdx+= px[0]; + tdy+= px[1]; + } + + glBegin(GL_QUADS); + glVertex3f(x-tdx, y+tdy, 0); + glVertex3f(x+tdx, y+tdy, 0); + glVertex3f(x+tdx, y-tdy, 0); + glVertex3f(x-tdx, y-tdy, 0); + glEnd(); + + /* search resizing triangle */ + x= track->search_max[0]; + y= track->search_min[1]; + + tdx= searchdx*2.0f; + tdy= searchdy*2.0f; + + if(outline) { + tdx+= px[0]; + tdy+= px[1]; + } + + glBegin(GL_TRIANGLES); + glVertex3f(x, y, 0); + glVertex3f(x-tdx, y, 0); + glVertex3f(x, y+tdy, 0); + glEnd(); + } + + if((sc->flag&SC_SHOW_MARKER_PATTERN) && ((track->pat_flag&SELECT)==sel || outline)) { + if(!outline) { + if(track->pat_flag&SELECT) glColor3fv(scol); + else glColor3fv(col); + } + + /* pattern offset square */ + x= track->pat_min[0]; + y= track->pat_max[1]; + + tdx= patdx; + tdy= patdy; + + if(outline) { + tdx+= px[0]; + tdy+= px[1]; + } + + glBegin(GL_QUADS); + glVertex3f(x-tdx, y+tdy, 0); + glVertex3f(x+tdx, y+tdy, 0); + glVertex3f(x+tdx, y-tdy, 0); + glVertex3f(x-tdx, y-tdy, 0); + glEnd(); + + /* pattern resizing triangle */ + x= track->pat_max[0]; + y= track->pat_min[1]; + + tdx= patdx*2.0f; + tdy= patdy*2.0f; + + if(outline) { + tdx+= px[0]; + tdy+= px[1]; + } + + glBegin(GL_TRIANGLES); + glVertex3f(x, y, 0); + glVertex3f(x-tdx, y, 0); + glVertex3f(x, y+tdy, 0); + glEnd(); + } + + glPopMatrix(); + + if(outline) + glLineWidth(1.0f); +} + +static void draw_marker_texts(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker, float marker_pos[2], int act, + int width, int height, float zoomx, float zoomy) +{ + char str[128]= {0}, state[64]= {0}; + float dx= 0.0f, dy= 0.0f, fontsize, pos[3]; + uiStyle *style= U.uistyles.first; + int fontid= style->widget.uifont_id; + + if(!TRACK_VIEW_SELECTED(sc, track)) + return; + + BLF_size(fontid, 11.0f, U.dpi); + fontsize= BLF_height_max(fontid); + + if(marker->flag&MARKER_DISABLED) { + if(act) UI_ThemeColor(TH_ACT_MARKER); + else UI_ThemeColorShade(TH_DIS_MARKER, 128); + } else { + if(act) UI_ThemeColor(TH_ACT_MARKER); + else UI_ThemeColor(TH_SEL_MARKER); + } + + if(sc->flag&SC_SHOW_MARKER_SEARCH) { + dx= track->search_min[0]; + dy= track->search_min[1]; + } else if(sc->flag&SC_SHOW_MARKER_PATTERN) { + dx= track->pat_min[0]; + dy= track->pat_min[1]; + } + + pos[0]= (marker_pos[0]+dx)*width; + pos[1]= (marker_pos[1]+dy)*height; + pos[2]= 0.0f; + + mul_m4_v3(sc->stabmat, pos); + + pos[0]= pos[0]*zoomx; + pos[1]= pos[1]*zoomy - fontsize; + + if(marker->flag&MARKER_DISABLED) strcpy(state, "disabled"); + else if(marker->framenr!=sc->user.framenr) strcpy(state, "estimated"); + else if(marker->flag&MARKER_TRACKED) strcpy(state, "tracked"); + else strcpy(state, "keyframed"); + + if(state[0]) + BLI_snprintf(str, sizeof(str), "%s: %s", track->name, state); + else + BLI_snprintf(str, sizeof(str), "%s", track->name); + + BLF_position(fontid, pos[0], pos[1], 0.0f); + BLF_draw(fontid, str, strlen(str)); + pos[1]-= fontsize; + + if(track->flag&TRACK_HAS_BUNDLE) { + BLI_snprintf(str, sizeof(str), "Average error: %.3f", track->error); + BLF_position(fontid, pos[0], pos[1], 0.0f); + BLF_draw(fontid, str, strlen(str)); + pos[1]-= fontsize; + } + + if(track->flag&TRACK_LOCKED) { + BLF_position(fontid, pos[0], pos[1], 0.0f); + BLF_draw(fontid, "locked", 6); + } +} + +static void view2d_to_region_float(View2D *v2d, float x, float y, float *regionx, float *regiony) +{ + /* express given coordinates as proportional values */ + x= -v2d->cur.xmin / (v2d->cur.xmax-v2d->cur.xmin); + y= -v2d->cur.ymin / (v2d->cur.ymax-v2d->cur.ymin); + + /* convert proportional distances to screen coordinates */ + *regionx= v2d->mask.xmin + x*(v2d->mask.xmax-v2d->mask.xmin); + *regiony= v2d->mask.ymin + y*(v2d->mask.ymax-v2d->mask.ymin); +} + +static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip, + int width, int height, float zoomx, float zoomy) +{ + float x, y; + MovieTracking* tracking= &clip->tracking; + MovieTrackingMarker *marker; + MovieTrackingTrack *track, *act_track; + int framenr= sc->user.framenr; + int undistort= sc->user.render_flag&MCLIP_PROXY_RENDER_UNDISTORT; + float *marker_pos= NULL, *fp, *active_pos= NULL, cur_pos[2]; + + /* ** find window pixel coordinates of origin ** */ + + /* UI_view2d_to_region_no_clip return integer values, this could + lead to 1px flickering when view is locked to selection during playbeck. + to avoid this flickering, calclate base point in the same way as it happens + in UI_view2d_to_region_no_clip, but do it in floats here */ + + view2d_to_region_float(&ar->v2d, 0.0f, 0.0f, &x, &y); + + glPushMatrix(); + glTranslatef(x, y, 0); + + glPushMatrix(); + glScalef(zoomx, zoomy, 0); + glMultMatrixf(sc->stabmat); + glScalef(width, height, 0); + + act_track= clip->tracking.act_track; + + if(sc->user.render_flag&MCLIP_PROXY_RENDER_UNDISTORT) { + int count= 0; + + /* count */ + track= tracking->tracks.first; + while(track) { + if((track->flag&TRACK_HIDDEN)==0) { + marker= BKE_tracking_get_marker(track, framenr); + + if(MARKER_VISIBLE(sc, marker)) + count++; + } + + track= track->next; + } + + /* undistort */ + if(count) { + marker_pos= MEM_callocN(2*sizeof(float)*count, "draw_tracking_tracks marker_pos"); + + track= tracking->tracks.first; + fp= marker_pos; + while(track) { + if((track->flag&TRACK_HIDDEN)==0) { + marker= BKE_tracking_get_marker(track, framenr); + + if(MARKER_VISIBLE(sc, marker)) { + ED_clip_point_undistorted_pos(sc, marker->pos, fp); + + if(track==act_track) + active_pos= fp; + + fp+= 2; + } + } + + track= track->next; + } + } + } + + if(sc->flag&SC_SHOW_TRACK_PATH) { + track= tracking->tracks.first; + while(track) { + if((track->flag&TRACK_HIDDEN)==0) + draw_track_path(sc, clip, track); + + track= track->next; + } + } + + /* markers outline and non-selected areas */ + track= tracking->tracks.first; + fp= marker_pos; + while(track) { + if((track->flag&TRACK_HIDDEN)==0) { + marker= BKE_tracking_get_marker(track, framenr); + + if(MARKER_VISIBLE(sc, marker)) { + copy_v2_v2(cur_pos, fp ? fp : marker->pos); + + draw_marker_outline(sc, track, marker, cur_pos, width, height); + draw_marker_areas(sc, track, marker, cur_pos, width, height, 0, 0); + draw_marker_slide_zones(sc, track, marker, cur_pos, 1, 0, 0, width, height); + draw_marker_slide_zones(sc, track, marker, cur_pos, 0, 0, 0, width, height); + + if(fp) fp+= 2; + } + } + + track= track->next; + } + + /* selected areas only, so selection wouldn't be overlapped by + non-selected areas */ + track= tracking->tracks.first; + fp= marker_pos; + while(track) { + if((track->flag&TRACK_HIDDEN)==0) { + int act= track==act_track; + + if(!act) { + marker= BKE_tracking_get_marker(track, framenr); + + if(MARKER_VISIBLE(sc, marker)) { + copy_v2_v2(cur_pos, fp ? fp : marker->pos); + + draw_marker_areas(sc, track, marker, cur_pos, width, height, 0, 1); + draw_marker_slide_zones(sc, track, marker, cur_pos, 0, 1, 0, width, height); + } + } + + if(MARKER_VISIBLE(sc, marker) && fp) + fp+= 2; + } + + track= track->next; + } + + /* active marker would be displayed on top of everything else */ + if(act_track) { + if((act_track->flag&TRACK_HIDDEN)==0) { + marker= BKE_tracking_get_marker(act_track, framenr); + + if(MARKER_VISIBLE(sc, marker)) { + copy_v2_v2(cur_pos, active_pos ? active_pos : marker->pos); + + draw_marker_areas(sc, act_track, marker, cur_pos, width, height, 1, 1); + draw_marker_slide_zones(sc, act_track, marker, cur_pos, 0, 1, 1, width, height); + } + } + } + + if(sc->flag&SC_SHOW_BUNDLES) { + float pos[4], vec[4], mat[4][4], aspy; + + glEnable(GL_POINT_SMOOTH); + glPointSize(3.0f); + + aspy= 1.0f/clip->tracking.camera.pixel_aspect; + BKE_tracking_projection_matrix(tracking, framenr, width, height, mat); + + track= tracking->tracks.first; + while(track) { + if((track->flag&TRACK_HIDDEN)==0 && track->flag&TRACK_HAS_BUNDLE) { + marker= BKE_tracking_get_marker(track, framenr); + + if(MARKER_VISIBLE(sc, marker)) { + float npos[2]; + copy_v4_v4(vec, track->bundle_pos); + vec[3]=1; + + mul_v4_m4v4(pos, mat, vec); + + pos[0]= (pos[0]/(pos[3]*2.0f)+0.5f)*width; + pos[1]= (pos[1]/(pos[3]*2.0f)+0.5f)*height*aspy; + + BKE_tracking_apply_intrinsics(tracking, pos, npos); + + if(npos[0]>=0.0f && npos[1]>=0.0f && npos[0]<=width && npos[1]<=height*aspy) { + vec[0]= (marker->pos[0]+track->offset[0])*width; + vec[1]= (marker->pos[1]+track->offset[1])*height*aspy; + + sub_v2_v2(vec, npos); + + if(len_v2(vec)<3) glColor3f(0.0f, 1.0f, 0.0f); + else glColor3f(1.0f, 0.0f, 0.0f); + + glBegin(GL_POINTS); + if(undistort) glVertex3f(pos[0]/width, pos[1]/(height*aspy), 0); + else glVertex3f(npos[0]/width, npos[1]/(height*aspy), 0); + glEnd(); + } + } + } + + track= track->next; + } + + glPointSize(1.0f); + glDisable(GL_POINT_SMOOTH); + } + + glPopMatrix(); + + if(sc->flag&SC_SHOW_NAMES) { + /* scaling should be cleared before drawing texts, otherwise font would also be scaled */ + track= tracking->tracks.first; + fp= marker_pos; + while(track) { + if((track->flag&TRACK_HIDDEN)==0) { + marker= BKE_tracking_get_marker(track, framenr); + + if(MARKER_VISIBLE(sc, marker)) { + int act= track==act_track; + + copy_v2_v2(cur_pos, fp ? fp : marker->pos); + + draw_marker_texts(sc, track, marker, cur_pos, act, width, height, zoomx, zoomy); + + if(fp) fp+= 2; + } + } + + track= track->next; + } + } + + glPopMatrix(); + + if(marker_pos) + MEM_freeN(marker_pos); +} + +static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, int width, int height, float zoomx, float zoomy) +{ + float x, y; + const int n= 10; + int i, j, a; + float pos[2], tpos[2], grid[11][11][2]; + MovieTracking *tracking= &clip->tracking; + float aspy= 1.0f/tracking->camera.pixel_aspect; + float dx= (float)width/n, dy= (float)height/n*aspy; + + if(sc->mode!=SC_MODE_DISTORTION) + return; + + if(!tracking->camera.focal) + return; + + if((sc->flag&SC_SHOW_GRID)==0 && (sc->flag&SC_MANUAL_CALIBRATION)==0) + return; + + view2d_to_region_float(&ar->v2d, 0.0f, 0.0f, &x, &y); + + glPushMatrix(); + glTranslatef(x, y, 0); + glScalef(zoomx, zoomy, 0); + glMultMatrixf(sc->stabmat); + glScalef(width, height, 0); + + /* grid */ + if(sc->flag&SC_SHOW_GRID) { + float val[4][2], idx[4][2]; + float min[2], max[2]; + + for(a=0; a<4; a++) { + if(a<2) val[a][a%2]= FLT_MAX; + else val[a][a%2]= -FLT_MAX; + } + + zero_v2(pos); + for(i= 0; i<=n; i++) { + for(j= 0; j<=n; j++) { + if(i==0 || j==0 || i==n || j==n) { + BKE_tracking_apply_intrinsics(tracking, pos, tpos); + + for(a=0; a<4; a++) { + int ok; + + if(a<2) ok= tpos[a%2] < val[a][a%2]; + else ok= tpos[a%2] > val[a][a%2]; + + if(ok) { + copy_v2_v2(val[a], tpos); + idx[a][0]= j; + idx[a][1]= i; + } + } + } + + pos[0]+= dx; + } + + pos[0]= 0.0f; + pos[1]+= dy; + } + + INIT_MINMAX2(min, max); + + for(a= 0; a<4; a++) { + pos[0]= idx[a][0]*dx; + pos[1]= idx[a][1]*dy; + + BKE_tracking_invert_intrinsics(tracking, pos, tpos); + + DO_MINMAX2(tpos, min, max); + } + + copy_v2_v2(pos, min); + dx= (max[0]-min[0])/n; + dy= (max[1]-min[1])/n; + + for(i= 0; i<=n; i++) { + for(j= 0; j<=n; j++) { + BKE_tracking_apply_intrinsics(tracking, pos, grid[i][j]); + + grid[i][j][0]/= width; + grid[i][j][1]/= height*aspy; + + pos[0]+= dx; + } + + pos[0]= min[0]; + pos[1]+= dy; + } + + glColor3f(1.0f, 0.0f, 0.0f); + + for(i= 0; i<=n; i++) { + glBegin(GL_LINE_STRIP); + for(j= 0; j<=n; j++) { + glVertex2fv(grid[i][j]); + } + glEnd(); + } + + for(j= 0; j<=n; j++) { + glBegin(GL_LINE_STRIP); + for(i= 0; i<=n; i++) { + glVertex2fv(grid[i][j]); + } + glEnd(); + } + } + + if(sc->flag&SC_MANUAL_CALIBRATION && clip->gpd) { + bGPDlayer *layer= clip->gpd->layers.first; + + while(layer) { + bGPDframe *frame= layer->frames.first; + + glColor4fv(layer->color); + glLineWidth(layer->thickness); + glPointSize((float)(layer->thickness + 2)); + + while(frame) { + bGPDstroke *stroke= frame->strokes.first; + + while(stroke) { + if(stroke->flag&GP_STROKE_2DSPACE) { + if(stroke->totpoints>1) { + glBegin(GL_LINE_STRIP); + for(i= 0; i<stroke->totpoints-1; i++) { + float npos[2], dpos[2], len; + int steps; + + pos[0]= stroke->points[i].x*width; + pos[1]= stroke->points[i].y*height*aspy; + + npos[0]= stroke->points[i+1].x*width; + npos[1]= stroke->points[i+1].y*height*aspy; + + len= len_v2v2(pos, npos); + steps= ceil(len/5.0f); + + /* we want to distort only long straight lines */ + if(stroke->totpoints==2) { + BKE_tracking_invert_intrinsics(tracking, pos, pos); + BKE_tracking_invert_intrinsics(tracking, npos, npos); + } + + sub_v2_v2v2(dpos, npos, pos); + mul_v2_fl(dpos, 1.0f/steps); + + for(j= 0; j<=steps; j++) { + BKE_tracking_apply_intrinsics(tracking, pos, tpos); + glVertex2f(tpos[0]/width, tpos[1]/(height*aspy)); + + add_v2_v2(pos, dpos); + } + } + glEnd(); + } + else if(stroke->totpoints==1) { + glBegin(GL_POINTS); + glVertex2f(stroke->points[0].x, stroke->points[0].y); + glEnd(); + } + } + + stroke= stroke->next; + } + + frame= frame->next; + } + + layer= layer->next; + } + + glLineWidth(1.0f); + glPointSize(1.0f); + } + + glPopMatrix(); +} + +void clip_draw_main(SpaceClip *sc, ARegion *ar, Scene *scene) +{ + MovieClip *clip= ED_space_clip(sc); + ImBuf *ibuf; + int width, height; + float zoomx, zoomy; + + /* if no clip, nothing to do */ + if(!clip) + return; + + ED_space_clip_size(sc, &width, &height); + ED_space_clip_zoom(sc, ar, &zoomx, &zoomy); + + if(sc->flag&SC_SHOW_STABLE) { + float smat[4][4], ismat[4][4]; + + ibuf= ED_space_clip_get_stable_buffer(sc, sc->loc, &sc->scale, &sc->angle); + BKE_tracking_stabdata_to_mat4(width, height, sc->loc, sc->scale, sc->angle, sc->stabmat); + + unit_m4(smat); + smat[0][0]= 1.0f/width; + smat[1][1]= 1.0f/height; + invert_m4_m4(ismat, smat); + + mul_serie_m4(sc->unistabmat, smat, sc->stabmat, ismat, NULL, NULL, NULL, NULL, NULL); + } else { + ibuf= ED_space_clip_get_buffer(sc); + + zero_v2(sc->loc); + sc->scale= 1.0f; + unit_m4(sc->stabmat); + unit_m4(sc->unistabmat); + } + + if(ibuf) { + draw_movieclip_buffer(sc, ar, ibuf, width, height, zoomx, zoomy); + IMB_freeImBuf(ibuf); + + draw_tracking_tracks(sc, ar, clip, width, height, zoomx, zoomy); + draw_distortion(sc, ar, clip, width, height, zoomx, zoomy); + } + + draw_movieclip_cache(sc, ar, clip, scene); + draw_movieclip_notes(sc, ar); +} + +/* draw grease pencil */ +void clip_draw_grease_pencil(bContext *C, int onlyv2d) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + ImBuf *ibuf; + + if((sc->flag&SC_SHOW_GPENCIL)==0 || !clip) + return; + + if(onlyv2d) { + /* if manual calibration is used then grase pencil data is already + drawed in draw_distortion */ + if((sc->flag&SC_MANUAL_CALIBRATION)==0 || sc->mode!=SC_MODE_DISTORTION) { + ibuf= ED_space_clip_get_buffer(sc); + + if(ibuf) { + glPushMatrix(); + glMultMatrixf(sc->unistabmat); + draw_gpencil_2dimage(C, ibuf); + + IMB_freeImBuf(ibuf); + glPopMatrix(); + } + } + } else { + draw_gpencil_view2d(C, 0); + } +} diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c new file mode 100644 index 00000000000..c5036145792 --- /dev/null +++ b/source/blender/editors/space_clip/clip_editor.c @@ -0,0 +1,310 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/editors/space_clip/clip_editor.c + * \ingroup spclip + */ + +#include <stddef.h> + +#include "BKE_main.h" +#include "BKE_movieclip.h" +#include "BKE_context.h" +#include "BKE_tracking.h" +#include "DNA_object_types.h" /* SELECT */ + +#include "BLI_utildefines.h" +#include "BLI_math.h" + +#include "IMB_imbuf_types.h" +#include "IMB_imbuf.h" + +#include "ED_screen.h" +#include "ED_clip.h" + +#include "BIF_gl.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "UI_view2d.h" + +#include "clip_intern.h" // own include + +int ED_space_clip_poll(bContext *C) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + + if(sc && sc->clip) + return 1; + + return 0; +} + +void ED_space_clip_set(bContext *C, SpaceClip *sc, MovieClip *clip) +{ + sc->clip= clip; + + if(sc->clip && sc->clip->id.us==0) + sc->clip->id.us= 1; + + if(C) + WM_event_add_notifier(C, NC_MOVIECLIP|NA_SELECTED, sc->clip); +} + +MovieClip *ED_space_clip(SpaceClip *sc) +{ + return sc->clip; +} + +ImBuf *ED_space_clip_get_buffer(SpaceClip *sc) +{ + if(sc->clip) { + ImBuf *ibuf; + + ibuf= BKE_movieclip_get_ibuf(sc->clip, &sc->user); + + if(ibuf && (ibuf->rect || ibuf->rect_float)) + return ibuf; + + if(ibuf) + IMB_freeImBuf(ibuf); + } + + return NULL; +} + +ImBuf *ED_space_clip_get_stable_buffer(SpaceClip *sc, float loc[2], float *scale, float *angle) +{ + if(sc->clip) { + ImBuf *ibuf; + + ibuf= BKE_movieclip_get_stable_ibuf(sc->clip, &sc->user, loc, scale, angle); + + if(ibuf && (ibuf->rect || ibuf->rect_float)) + return ibuf; + + if(ibuf) + IMB_freeImBuf(ibuf); + } + + return NULL; +} + +void ED_space_clip_size(SpaceClip *sc, int *width, int *height) +{ + if(!sc->clip) { + *width= 0; + *height= 0; + } else + BKE_movieclip_get_size(sc->clip, &sc->user, width, height); +} + +void ED_space_clip_zoom(SpaceClip *sc, ARegion *ar, float *zoomx, float *zoomy) +{ + int width, height; + + ED_space_clip_size(sc, &width, &height); + + *zoomx= (float)(ar->winrct.xmax - ar->winrct.xmin + 1)/(float)((ar->v2d.cur.xmax - ar->v2d.cur.xmin)*width); + *zoomy= (float)(ar->winrct.ymax - ar->winrct.ymin + 1)/(float)((ar->v2d.cur.ymax - ar->v2d.cur.ymin)*height); +} + +void ED_space_clip_aspect(SpaceClip *sc, float *aspx, float *aspy) +{ + MovieClip *clip= ED_space_clip(sc); + + if(clip) + BKE_movieclip_aspect(clip, aspx, aspy); + else + *aspx= *aspy= 1.0f; +} + +void ED_clip_update_frame(const Main *mainp, int cfra) +{ + wmWindowManager *wm; + wmWindow *win; + + /* image window, compo node users */ + for(wm=mainp->wm.first; wm; wm= wm->id.next) { /* only 1 wm */ + for(win= wm->windows.first; win; win= win->next) { + ScrArea *sa; + for(sa= win->screen->areabase.first; sa; sa= sa->next) { + if(sa->spacetype==SPACE_CLIP) { + SpaceClip *sc= sa->spacedata.first; + + sc->scopes.ok= 0; + + BKE_movieclip_user_set_frame(&sc->user, cfra); + } + } + } + } +} + +static int selected_boundbox(SpaceClip *sc, float min[2], float max[2]) +{ + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + int width, height, ok= 0; + + INIT_MINMAX2(min, max); + + ED_space_clip_size(sc, &width, &height); + + track= clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track)) { + MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr); + + if(marker) { + float pos[3]; + + pos[0]= marker->pos[0]+track->offset[0]; + pos[1]= marker->pos[1]+track->offset[1]; + pos[2]= 0.0f; + + /* undistortion happens for normalized coords */ + if(sc->user.render_flag&MCLIP_PROXY_RENDER_UNDISTORT) + /* undistortion happens for normalized coords */ + ED_clip_point_undistorted_pos(sc, pos, pos); + + pos[0]*= width; + pos[1]*= height; + + mul_v3_m4v3(pos, sc->stabmat, pos); + + DO_MINMAX2(pos, min, max); + + ok= 1; + } + } + + track= track->next; + } + + return ok; +} + +int ED_clip_view_selection(SpaceClip *sc, ARegion *ar, int fit) +{ + int w, h, frame_width, frame_height; + float min[2], max[2]; + + ED_space_clip_size(sc, &frame_width, &frame_height); + + if(frame_width==0 || frame_height==0) return 0; + + if(!selected_boundbox(sc, min, max)) + return 0; + + /* center view */ + clip_view_center_to_point(sc, (max[0]+min[0])/(2*frame_width), (max[1]+min[1])/(2*frame_height)); + + w= max[0]-min[0]; + h= max[1]-min[1]; + + /* set zoom to see all selection */ + if(w>0 && h>0) { + int width, height; + float zoomx, zoomy, newzoom, aspx, aspy; + + ED_space_clip_aspect(sc, &aspx, &aspy); + + width= ar->winrct.xmax - ar->winrct.xmin + 1; + height= ar->winrct.ymax - ar->winrct.ymin + 1; + + zoomx= (float)width/w/aspx; + zoomy= (float)height/h/aspy; + + newzoom= 1.0f/power_of_2(1/MIN2(zoomx, zoomy)); + + if(fit || sc->zoom>newzoom) + sc->zoom= newzoom; + } + + return 1; +} + +void ED_clip_point_undistorted_pos(SpaceClip *sc, float co[2], float nco[2]) +{ + copy_v2_v2(nco, co); + + if(sc->user.render_flag&MCLIP_PROXY_RENDER_UNDISTORT) { + MovieClip *clip= ED_space_clip(sc); + float aspy= 1.0f/clip->tracking.camera.pixel_aspect; + int width, height; + + ED_space_clip_size(sc, &width, &height); + + nco[0]*= width; + nco[1]*= height*aspy; + + BKE_tracking_invert_intrinsics(&clip->tracking, nco, nco); + nco[0]/= width; + nco[1]/= height*aspy; + } +} + +void ED_clip_point_stable_pos(bContext *C, float x, float y, float *xr, float *yr) +{ + ARegion *ar= CTX_wm_region(C); + SpaceClip *sc= CTX_wm_space_clip(C); + int sx, sy, width, height; + float zoomx, zoomy, pos[3]={0.0f, 0.0f, 0.0f}, imat[4][4]; + + ED_space_clip_zoom(sc, ar, &zoomx, &zoomy); + ED_space_clip_size(sc, &width, &height); + + UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &sx, &sy); + + pos[0]= (x-sx)/zoomx; + pos[1]= (y-sy)/zoomy; + + invert_m4_m4(imat, sc->stabmat); + mul_v3_m4v3(pos, imat, pos); + + *xr= pos[0]/width; + *yr= pos[1]/height; + + if(sc->user.render_flag&MCLIP_PROXY_RENDER_UNDISTORT) { + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + float aspy= 1.0f/tracking->camera.pixel_aspect; + float tmp[2]= {*xr*width, *yr*height*aspy}; + + BKE_tracking_apply_intrinsics(tracking, tmp, tmp); + + *xr= tmp[0]/width; + *yr= tmp[1]/(height*aspy); + } +} + +void ED_clip_mouse_pos(bContext *C, wmEvent *event, float co[2]) +{ + ED_clip_point_stable_pos(C, event->mval[0], event->mval[1], &co[0], &co[1]); +} diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c new file mode 100644 index 00000000000..7b14783d4ca --- /dev/null +++ b/source/blender/editors/space_clip/clip_graph_draw.c @@ -0,0 +1,255 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/editors/space_clip/clip_graph_draw.c + * \ingroup spclip + */ + +#include "DNA_movieclip_types.h" +#include "DNA_scene_types.h" +#include "DNA_object_types.h" /* SELECT */ + +#include "MEM_guardedalloc.h" + +#include "BKE_context.h" +#include "BKE_movieclip.h" +#include "BKE_tracking.h" + +#include "BLI_utildefines.h" +#include "BLI_math.h" +#include "BLI_string.h" + +#include "ED_screen.h" +#include "ED_clip.h" + +#include "BIF_gl.h" + +#include "WM_types.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "BLF_api.h" + +#include "clip_intern.h" // own include + +static void draw_curve_knot(float x, float y, float xscale, float yscale, float hsize) +{ + static GLuint displist=0; + + /* initialise round circle shape */ + if (displist == 0) { + GLUquadricObj *qobj; + + displist= glGenLists(1); + glNewList(displist, GL_COMPILE); + + qobj= gluNewQuadric(); + gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); + gluDisk(qobj, 0, 0.7, 8, 1); + gluDeleteQuadric(qobj); + + glEndList(); + } + + glPushMatrix(); + + glTranslatef(x, y, 0.0f); + glScalef(1.0f/xscale*hsize, 1.0f/yscale*hsize, 1.0f); + glCallList(displist); + + glPopMatrix(); +} + +static void draw_graph_cfra(SpaceClip *sc, ARegion *ar, Scene *scene) +{ + View2D *v2d= &ar->v2d; + float xscale, yscale; + float vec[2]; + + /* Draw a light green line to indicate current frame */ + vec[0]= (float)(sc->user.framenr * scene->r.framelen); + + UI_ThemeColor(TH_CFRAME); + glLineWidth(2.0); + + glBegin(GL_LINE_STRIP); + vec[1]= v2d->cur.ymin; + glVertex2fv(vec); + + vec[1]= v2d->cur.ymax; + glVertex2fv(vec); + glEnd(); + + glLineWidth(1.0); + + UI_view2d_view_orthoSpecial(ar, v2d, 1); + + /* because the frame number text is subject to the same scaling as the contents of the view */ + UI_view2d_getscale(v2d, &xscale, &yscale); + glScalef(1.0f/xscale, 1.0f, 1.0f); + + clip_draw_curfra_label(sc, (float)sc->user.framenr * xscale, 18); + + /* restore view transform */ + glScalef(xscale, 1.0, 1.0); +} + +static void tracking_segment_point_cb(void *UNUSED(userdata), MovieTrackingTrack *UNUSED(track), + MovieTrackingMarker *marker, int UNUSED(coord), float val) +{ + glVertex2f(marker->framenr, val); +} + +void tracking_segment_start_cb(void *userdata, MovieTrackingTrack *track, int coord) +{ + static float colors[2][3] = {{1.0f, 0.0f, 0.0f}, + {0.0f, 1.0f, 0.0f}}; + float col[4]; + + copy_v3_v3(col, colors[coord]); + + if(track==userdata) { + col[3]= 1.0f; + glLineWidth(2.0f); + } else { + col[3]= 0.5f; + glLineWidth(1.0f); + } + + glColor4fv(col); + + glBegin(GL_LINE_STRIP); +} + +void tracking_segment_end_cb(void *UNUSED(userdata)) +{ + glEnd(); + + glLineWidth(1.0f); +} + +static void tracking_segment_knot_cb(void *userdata, MovieTrackingTrack *track, + MovieTrackingMarker *marker, int UNUSED(coord), float val) +{ + struct { MovieTrackingTrack *act_track; int sel; float xscale, yscale, hsize; } *data = userdata; + int sel= 0; + + if(track!=data->act_track) + return; + + sel= (marker->flag&MARKER_GRAPH_SEL) ? 1 : 0; + + if(sel == data->sel) { + if(sel) UI_ThemeColor(TH_HANDLE_VERTEX_SELECT); + else UI_ThemeColor(TH_HANDLE_VERTEX); + + draw_curve_knot(marker->framenr, val, data->xscale, data->yscale, data->hsize); + } +} + +static void draw_tracks_curves(View2D *v2d, SpaceClip *sc) +{ + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + int width, height; + struct { MovieTrackingTrack *act_track; int sel; float xscale, yscale, hsize; } userdata; + + BKE_movieclip_get_size(clip, &sc->user, &width, &height); + + if(!width || !height) + return; + + /* non-selected knot handles */ + userdata.hsize= UI_GetThemeValuef(TH_HANDLE_VERTEX_SIZE); + userdata.sel= 0; + userdata.act_track= clip->tracking.act_track; + UI_view2d_getscale(v2d, &userdata.xscale, &userdata.yscale); + clip_graph_tracking_values_iterate(sc, &userdata, tracking_segment_knot_cb, NULL, NULL); + + /* draw graph lines */ + glEnable(GL_BLEND); + clip_graph_tracking_values_iterate(sc, tracking->act_track, tracking_segment_point_cb, tracking_segment_start_cb, tracking_segment_end_cb); + glDisable(GL_BLEND); + + /* selected knot handles on top of curves */ + userdata.sel= 1; + clip_graph_tracking_values_iterate(sc, &userdata, tracking_segment_knot_cb, NULL, NULL); +} + +static void draw_frame_curves(SpaceClip *sc) +{ + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + MovieTrackingReconstruction *reconstruction= &tracking->reconstruction; + int i, lines= 0, prevfra= 0; + + glColor3f(0.0f, 0.0f, 1.0f); + + for(i= 0; i<reconstruction->camnr; i++) { + MovieReconstructedCamera *camera= &reconstruction->cameras[i]; + + if(lines && camera->framenr!=prevfra+1) { + glEnd(); + lines= 0; + } + + if(!lines) { + glBegin(GL_LINE_STRIP); + lines= 1; + } + + glVertex2f(camera->framenr, camera->error); + + prevfra= camera->framenr; + } + + if(lines) + glEnd(); +} + +void clip_draw_graph(SpaceClip *sc, ARegion *ar, Scene *scene) +{ + View2D *v2d= &ar->v2d; + View2DGrid *grid; + short unitx= V2D_UNIT_FRAMESCALE, unity= V2D_UNIT_VALUES; + + /* grid */ + grid= UI_view2d_grid_calc(scene, v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP, ar->winx, ar->winy); + UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL); + UI_view2d_grid_free(grid); + + if(sc->flag&SC_SHOW_GRAPH_TRACKS) + draw_tracks_curves(v2d, sc); + + if(sc->flag&SC_SHOW_GRAPH_FRAMES) + draw_frame_curves(sc); + + /* current frame */ + draw_graph_cfra(sc, ar, scene); +} diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c new file mode 100644 index 00000000000..831b225386a --- /dev/null +++ b/source/blender/editors/space_clip/clip_graph_ops.c @@ -0,0 +1,356 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/editors/space_clip/clip_graph_ops.c + * \ingroup spclip + */ + +#include "DNA_object_types.h" /* SELECT */ + +#include "MEM_guardedalloc.h" + +#include "BLI_utildefines.h" +#include "BLI_math.h" +#include "BLI_listbase.h" + +#include "BKE_context.h" +#include "BKE_movieclip.h" +#include "BKE_tracking.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "ED_screen.h" +#include "ED_clip.h" + +#include "UI_interface.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "UI_view2d.h" + +#include "clip_intern.h" // own include + +/******************** common graph-editing utilities ********************/ + +typedef struct { + int action; +} SelectUserData; + +static void toggle_selection_cb(void *userdata, MovieTrackingMarker *marker) +{ + SelectUserData *data= (SelectUserData *)userdata; + + switch(data->action) { + case SEL_SELECT: + marker->flag|= MARKER_GRAPH_SEL; + break; + case SEL_DESELECT: + marker->flag&= ~MARKER_GRAPH_SEL; + break; + case SEL_INVERT: + marker->flag^= MARKER_GRAPH_SEL; + break; + } +} + +/******************** mouse select operator ********************/ + +typedef struct { + int coord, /* coordinate index of found entuty (0 = X-axis, 1 = Y-axis) */ + has_prev; /* if there's valid coordinate of previous point of curve segment */ + + float min_dist, /* minimal distance between mouse and currently found entuty */ + mouse_co[2], /* mouse coordinate */ + prev_co[2], /* coordinate of previeous point of segment */ + min_co[2]; /* coordinate of entity with minimal distance */ + + MovieTrackingTrack *track; /* nearest found track */ + MovieTrackingMarker *marker; /* nearest found marker */ +} MouseSelectUserData; + +static void find_nearest_tracking_segment_cb(void *userdata, MovieTrackingTrack *track, + MovieTrackingMarker *marker, int coord, float val) +{ + MouseSelectUserData *data= userdata; + float co[2]= {marker->framenr, val}; + + if(data->has_prev) { + float d= dist_to_line_segment_v2(data->mouse_co, data->prev_co, co); + + if(data->track==NULL || d<data->min_dist) { + data->track= track; + data->min_dist= d; + data->coord= coord; + copy_v2_v2(data->min_co, co); + } + } + + data->has_prev= 1; + copy_v2_v2(data->prev_co, co); +} + +void find_nearest_tracking_segment_end_cb(void *userdata) +{ + MouseSelectUserData *data= userdata; + + data->has_prev= 0; +} + +static void find_nearest_tracking_knot_cb(void *userdata, MovieTrackingTrack *track, + MovieTrackingMarker *marker, int coord, float val) +{ + MouseSelectUserData *data= userdata; + float dx= marker->framenr-data->mouse_co[0], dy= val-data->mouse_co[1]; + float d= dx*dx+dy*dy; + + if(data->marker==NULL || d<data->min_dist) { + float co[2]= {marker->framenr, val}; + + data->track= track; + data->marker= marker; + data->min_dist= d; + data->coord= coord; + copy_v2_v2(data->min_co, co); + } + +} + +static void mouse_select_init_data(MouseSelectUserData *userdata, float *co) +{ + memset(userdata, 0, sizeof(MouseSelectUserData)); + userdata->min_dist= FLT_MAX; + copy_v2_v2(userdata->mouse_co, co); +} + +static int mouse_select_knot(bContext *C, float co[2], int extend) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + ARegion *ar= CTX_wm_region(C); + View2D *v2d= &ar->v2d; + MovieTracking *tracking= &clip->tracking; + static const int delta= 6; + + if(tracking->act_track) { + MouseSelectUserData userdata; + + mouse_select_init_data(&userdata, co); + clip_graph_tracking_values_iterate_track(sc, tracking->act_track, + &userdata, find_nearest_tracking_knot_cb, NULL, NULL); + + if(userdata.marker) { + int x1, y1, x2, y2; + + UI_view2d_view_to_region(v2d, co[0], co[1], &x1, &y1); + UI_view2d_view_to_region(v2d, userdata.min_co[0], userdata.min_co[1], &x2, &y2); + + if(abs(x2-x1)<=delta && abs(y2-y1)<=delta) { + if(!extend) { + SelectUserData selectdata = {SEL_DESELECT}; + clip_graph_tracking_iterate(sc, &selectdata, toggle_selection_cb); + } + + userdata.marker->flag|= MARKER_GRAPH_SEL; + + return 1; + } + } + } + + return 0; +} + +static int mouse_select_curve(bContext *C, float co[2], int extend) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + MouseSelectUserData userdata; + + mouse_select_init_data(&userdata, co); + clip_graph_tracking_values_iterate(sc, &userdata, find_nearest_tracking_segment_cb, NULL, find_nearest_tracking_segment_end_cb); + + if(userdata.track) { + if(extend) { + if(tracking->act_track==userdata.track) { + /* currently only single curve can be selected (selected curve represents active track) */ + tracking->act_track= NULL; + } + } + else if(tracking->act_track!=userdata.track) { + MovieTrackingMarker *marker; + SelectUserData selectdata = {SEL_DESELECT}; + + tracking->act_track= userdata.track; + + /* make active track be centered to screen */ + marker= BKE_tracking_get_marker(userdata.track, sc->user.framenr); + + clip_view_center_to_point(sc, marker->pos[0], marker->pos[1]); + + /* deselect all knots on newly selected curve */ + clip_graph_tracking_iterate(sc, &selectdata, toggle_selection_cb); + } + + return 1; + } + + return 0; +} + +static int mouse_select(bContext *C, float co[2], int extend) +{ + int sel= 0; + + /* first try to select knot on selected curves */ + sel= mouse_select_knot(C, co, extend); + + if(!sel) { + /* if there's no close enough knot to mouse osition, select nearest curve */ + sel= mouse_select_curve(C, co, extend); + } + + if(sel) + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL); + + return OPERATOR_FINISHED; +} + +static int select_exec(bContext *C, wmOperator *op) +{ + float co[2]; + int extend= RNA_boolean_get(op->ptr, "extend"); + + RNA_float_get_array(op->ptr, "location", co); + + return mouse_select(C, co, extend); +} + +static int select_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + ARegion *ar= CTX_wm_region(C); + float co[2]; + + UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &co[0], &co[1]); + RNA_float_set_array(op->ptr, "location", co); + + return select_exec(C, op); +} + +void CLIP_OT_graph_select(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Select"; + ot->description= "Select graph curves"; + ot->idname= "CLIP_OT_graph_select"; + + /* api callbacks */ + ot->exec= select_exec; + ot->invoke= select_invoke; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_UNDO; + + /* properties */ + RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, + "Location", "Mouse location to select nearest entity closest to", -100.0f, 100.0f); + RNA_def_boolean(ot->srna, "extend", 0, + "Extend", "Extend selection rather than clearing the existing selection"); +} + +/******************** delete curve operator ********************/ + +static int delete_curve_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + + if(tracking->act_track) + clip_delete_track(C, clip, tracking->act_track); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_graph_delete_curve(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Delete Curve"; + ot->description= "Delete selected curves"; + ot->idname= "CLIP_OT_graph_delete_curve"; + + /* api callbacks */ + ot->invoke= WM_operator_confirm; + ot->exec= delete_curve_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/******************** delete knot operator ********************/ + +static int delete_knot_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + + if(tracking->act_track) { + int a= 0; + MovieTrackingTrack *track= tracking->act_track; + + while(a<track->markersnr) { + MovieTrackingMarker *marker= &track->markers[a]; + + if(marker->flag&MARKER_GRAPH_SEL) + clip_delete_marker(C, clip, track, marker); + else + a++; + } + } + + return OPERATOR_FINISHED; +} + +void CLIP_OT_graph_delete_knot(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Delete Knot"; + ot->description= "Delete curve knots"; + ot->idname= "CLIP_OT_graph_delete_knot"; + + /* api callbacks */ + ot->exec= delete_knot_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} diff --git a/source/blender/editors/space_clip/clip_intern.h b/source/blender/editors/space_clip/clip_intern.h new file mode 100644 index 00000000000..da0b589652e --- /dev/null +++ b/source/blender/editors/space_clip/clip_intern.h @@ -0,0 +1,144 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/editors/space_clip/clip_intern.h + * \ingroup spclip + */ + +#ifndef ED_CLIP_INTERN_H +#define ED_CLIP_INTERN_H + +struct bContext; +struct ARegion; +struct MovieClip; +struct MovieTrackingMarker; +struct MovieTrackingTrack; +struct Scene; +struct SpaceClip; +struct wmOperatorType; + +/* internal exports only */ + +/* clip_buttons.c */ +void ED_clip_buttons_register(struct ARegionType *art); + +/* clip_draw.c */ +void clip_draw_main(struct SpaceClip *sc, struct ARegion *ar, struct Scene *scene); +void clip_draw_grease_pencil(struct bContext *C, int onlyv2d); +void clip_draw_curfra_label(struct SpaceClip *sc, float x, float y); + +/* clip_graph_draw.c */ +void clip_draw_graph(struct SpaceClip *sc, struct ARegion *ar, struct Scene *scene); + +/* clip_graph_ops.c */ +void CLIP_OT_graph_select(struct wmOperatorType *ot); +void CLIP_OT_graph_delete_curve(struct wmOperatorType *ot); +void CLIP_OT_graph_delete_knot(struct wmOperatorType *ot); + +/* clip_ops.c */ +void CLIP_OT_open(struct wmOperatorType *ot); +void CLIP_OT_reload(struct wmOperatorType *ot); +void CLIP_OT_view_pan(struct wmOperatorType *ot); +void CLIP_OT_view_zoom(wmOperatorType *ot); +void CLIP_OT_view_zoom_in(struct wmOperatorType *ot); +void CLIP_OT_view_zoom_out(struct wmOperatorType *ot); +void CLIP_OT_view_zoom_ratio(struct wmOperatorType *ot); +void CLIP_OT_view_all(struct wmOperatorType *ot); +void CLIP_OT_view_selected(struct wmOperatorType *ot); +void CLIP_OT_change_frame(wmOperatorType *ot); +void CLIP_OT_rebuild_proxy(struct wmOperatorType *ot); +void CLIP_OT_mode_set(struct wmOperatorType *ot); + +/* clip_toolbar.c */ +void CLIP_OT_tools(struct wmOperatorType *ot); +void CLIP_OT_properties(struct wmOperatorType *ot); +void ED_clip_tool_props_register(struct ARegionType *art); + +/* clip_utils.c */ +void clip_graph_tracking_values_iterate_track(struct SpaceClip *sc, struct MovieTrackingTrack *track, void *userdata, + void (*func) (void *userdata, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, int coord, float val), + void (*segment_start) (void *userdata, struct MovieTrackingTrack *track, int coord), + void (*segment_end) (void *userdata)); + +void clip_graph_tracking_values_iterate(struct SpaceClip *sc, void *userdata, + void (*func) (void *userdata, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, int coord, float val), + void (*segment_start) (void *userdata, struct MovieTrackingTrack *track, int coord), + void (*segment_end) (void *userdata)); + +void clip_graph_tracking_iterate(struct SpaceClip *sc, void *userdata, + void (*func) (void *userdata, struct MovieTrackingMarker *marker)); + +void clip_delete_track(struct bContext *C, struct MovieClip *clip, struct MovieTrackingTrack *track); +void clip_delete_marker(struct bContext *C, struct MovieClip *clip, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker); + +void clip_view_center_to_point(struct SpaceClip *sc, float x, float y); + +/* tracking_ops.c */ +void CLIP_OT_select(struct wmOperatorType *ot); +void CLIP_OT_select_all(struct wmOperatorType *ot); +void CLIP_OT_select_border(struct wmOperatorType *ot); +void CLIP_OT_select_circle(struct wmOperatorType *ot); +void CLIP_OT_select_grouped(struct wmOperatorType *ot); + +void CLIP_OT_add_marker(struct wmOperatorType *ot); +void CLIP_OT_delete_track(struct wmOperatorType *ot); +void CLIP_OT_delete_marker(struct wmOperatorType *ot); + +void CLIP_OT_track_markers(struct wmOperatorType *ot); +void CLIP_OT_solve_camera(struct wmOperatorType *ot); +void CLIP_OT_clear_solution(struct wmOperatorType *ot); + +void CLIP_OT_clear_track_path(struct wmOperatorType *ot); +void CLIP_OT_join_tracks(struct wmOperatorType *ot); + +void CLIP_OT_disable_markers(struct wmOperatorType *ot); +void CLIP_OT_hide_tracks(struct wmOperatorType *ot); +void CLIP_OT_hide_tracks_clear(struct wmOperatorType *ot); +void CLIP_OT_lock_tracks(struct wmOperatorType *ot); + +void CLIP_OT_set_origin(struct wmOperatorType *ot); +void CLIP_OT_set_floor(struct wmOperatorType *ot); +void CLIP_OT_set_axis(struct wmOperatorType *ot); +void CLIP_OT_set_scale(struct wmOperatorType *ot); + +void CLIP_OT_set_center_principal(struct wmOperatorType *ot); + +void CLIP_OT_slide_marker(struct wmOperatorType *ot); + +void CLIP_OT_frame_jump(struct wmOperatorType *ot); +void CLIP_OT_track_copy_color(struct wmOperatorType *ot); + +void CLIP_OT_detect_features(struct wmOperatorType *ot); + +void CLIP_OT_stabilize_2d_add(struct wmOperatorType *ot); +void CLIP_OT_stabilize_2d_remove(struct wmOperatorType *ot); +void CLIP_OT_stabilize_2d_select(struct wmOperatorType *ot); +void CLIP_OT_stabilize_2d_set_rotation(struct wmOperatorType *ot); + +void CLIP_OT_clean_tracks(wmOperatorType *ot); + +#endif /* ED_CLIP_INTERN_H */ diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c new file mode 100644 index 00000000000..c52346fd4b6 --- /dev/null +++ b/source/blender/editors/space_clip/clip_ops.c @@ -0,0 +1,1004 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/editors/space_clip/clip_ops.c + * \ingroup spclip + */ + +#include <errno.h> + +#include "MEM_guardedalloc.h" + +#include "DNA_userdef_types.h" +#include "DNA_scene_types.h" /* min/max frames */ + +#include "BLI_utildefines.h" +#include "BLI_math.h" + +#include "BKE_context.h" +#include "BKE_global.h" +#include "BKE_report.h" +#include "BKE_main.h" +#include "BKE_library.h" +#include "BKE_movieclip.h" +#include "BKE_sound.h" +#include "BKE_tracking.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "IMB_imbuf_types.h" +#include "IMB_imbuf.h" + +#include "ED_screen.h" +#include "ED_clip.h" + +#include "UI_interface.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "UI_view2d.h" + +#include "clip_intern.h" // own include + +/******************** view navigation utilities *********************/ + +static void sclip_zoom_set(SpaceClip *sc, ARegion *ar, float zoom) +{ + float oldzoom= sc->zoom; + int width, height; + + sc->zoom= zoom; + + if (sc->zoom > 0.1f && sc->zoom < 4.0f) + return; + + /* check zoom limits */ + ED_space_clip_size(sc, &width, &height); + + width*= sc->zoom; + height*= sc->zoom; + + if((width < 4) && (height < 4)) + sc->zoom= oldzoom; + else if((ar->winrct.xmax - ar->winrct.xmin) <= sc->zoom) + sc->zoom= oldzoom; + else if((ar->winrct.ymax - ar->winrct.ymin) <= sc->zoom) + sc->zoom= oldzoom; +} + +static void sclip_zoom_set_factor(SpaceClip *sc, ARegion *ar, float zoomfac) +{ + sclip_zoom_set(sc, ar, sc->zoom*zoomfac); +} + + +/******************** open clip operator ********************/ + +static void clip_filesel(bContext *C, wmOperator *op, const char *path) +{ + RNA_string_set(op->ptr, "filepath", path); + WM_event_add_fileselect(C, op); +} + +static void open_init(bContext *C, wmOperator *op) +{ + PropertyPointerRNA *pprop; + + op->customdata= pprop= MEM_callocN(sizeof(PropertyPointerRNA), "OpenPropertyPointerRNA"); + uiIDContextProperty(C, &pprop->ptr, &pprop->prop); +} + +static int open_cancel(bContext *UNUSED(C), wmOperator *op) +{ + MEM_freeN(op->customdata); + op->customdata= NULL; + + return OPERATOR_CANCELLED; +} + +static int open_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + PropertyPointerRNA *pprop; + PointerRNA idptr; + MovieClip *clip= NULL; + char str[FILE_MAX]; + + RNA_string_get(op->ptr, "filepath", str); + /* default to frame 1 if there's no scene in context */ + + errno= 0; + + clip= BKE_add_movieclip_file(str); + + if(!clip) { + if(op->customdata) + MEM_freeN(op->customdata); + + BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s.", str, errno ? strerror(errno) : "Unsupported movie clip format"); + + return OPERATOR_CANCELLED; + } + + if(!op->customdata) + open_init(C, op); + + /* hook into UI */ + pprop= op->customdata; + + if(pprop->prop) { + /* when creating new ID blocks, use is already 1, but RNA + * pointer se also increases user, so this compensates it */ + clip->id.us--; + + RNA_id_pointer_create(&clip->id, &idptr); + RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr); + RNA_property_update(C, &pprop->ptr, pprop->prop); + } + else if(sc) { + ED_space_clip_set(C, sc, clip); + } + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_ADDED, clip); + + MEM_freeN(op->customdata); + + return OPERATOR_FINISHED; +} + +static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + char *path= U.textudir; + MovieClip *clip= NULL; + + if(sc) + clip= ED_space_clip(sc); + + if(clip) + path= clip->name; + + if(!RNA_property_is_set(op->ptr, "relative_path")) + RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); + + if(RNA_property_is_set(op->ptr, "filepath")) + return open_exec(C, op); + + open_init(C, op); + + clip_filesel(C, op, path); + + return OPERATOR_RUNNING_MODAL; +} + +void CLIP_OT_open(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Open Clip"; + ot->description= "Open clip"; + ot->idname= "CLIP_OT_open"; + + /* api callbacks */ + ot->exec= open_exec; + ot->invoke= open_invoke; + ot->cancel= open_cancel; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH); +} + +/******************* reload clip operator *********************/ + +static int reload_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= CTX_data_edit_movieclip(C); + + if(!clip) + return OPERATOR_CANCELLED; + + sc->scopes.ok= 0; + + BKE_movieclip_reload(clip); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_reload(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Reload Clip"; + ot->description= "Reload clip"; + ot->idname= "CLIP_OT_reload"; + + /* api callbacks */ + ot->exec= reload_exec; +} + +/********************** view pan operator *********************/ + +typedef struct ViewPanData { + float x, y; + float xof, yof, xorig, yorig; + int event_type; + float *vec; +} ViewPanData; + +static void view_pan_init(bContext *C, wmOperator *op, wmEvent *event) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + ViewPanData *vpd; + + op->customdata= vpd= MEM_callocN(sizeof(ViewPanData), "ClipViewPanData"); + WM_cursor_modal(CTX_wm_window(C), BC_NSEW_SCROLLCURSOR); + + vpd->x= event->x; + vpd->y= event->y; + + if(sc->flag&SC_LOCK_SELECTION) vpd->vec= &sc->xlockof; + else vpd->vec= &sc->xof; + + copy_v2_v2(&vpd->xof, vpd->vec); + copy_v2_v2(&vpd->xorig, &vpd->xof); + + vpd->event_type= event->type; + + WM_event_add_modal_handler(C, op); +} + +static void view_pan_exit(bContext *C, wmOperator *op, int cancel) +{ + ViewPanData *vpd= op->customdata; + + if(cancel) { + copy_v2_v2(vpd->vec, &vpd->xorig); + + ED_region_tag_redraw(CTX_wm_region(C)); + } + + WM_cursor_restore(CTX_wm_window(C)); + MEM_freeN(op->customdata); +} + +static int view_pan_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + float offset[2]; + + RNA_float_get_array(op->ptr, "offset", offset); + + if(sc->flag&SC_LOCK_SELECTION) { + sc->xlockof+= offset[0]; + sc->ylockof+= offset[1]; + } else { + sc->xof+= offset[0]; + sc->yof+= offset[1]; + } + + ED_region_tag_redraw(CTX_wm_region(C)); + + return OPERATOR_FINISHED; +} + +static int view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + if (event->type==MOUSEPAN) { + SpaceClip *sc= CTX_wm_space_clip(C); + float offset[2]; + + offset[0]= (event->x - event->prevx)/sc->zoom; + offset[1]= (event->y - event->prevy)/sc->zoom; + + RNA_float_set_array(op->ptr, "offset", offset); + + view_pan_exec(C, op); + return OPERATOR_FINISHED; + } + else { + view_pan_init(C, op, event); + return OPERATOR_RUNNING_MODAL; + } +} + +static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + ViewPanData *vpd= op->customdata; + float offset[2]; + + switch(event->type) { + case MOUSEMOVE: + copy_v2_v2(vpd->vec, &vpd->xorig); + offset[0]= (vpd->x - event->x)/sc->zoom; + offset[1]= (vpd->y - event->y)/sc->zoom; + RNA_float_set_array(op->ptr, "offset", offset); + view_pan_exec(C, op); + break; + case ESCKEY: + view_pan_exit(C, op, 1); + return OPERATOR_CANCELLED; + case SPACEKEY: + view_pan_exit(C, op, 0); + return OPERATOR_FINISHED; + default: + if(event->type==vpd->event_type && event->val==KM_RELEASE) { + view_pan_exit(C, op, 0); + return OPERATOR_FINISHED; + } + break; + } + + return OPERATOR_RUNNING_MODAL; +} + +static int view_pan_cancel(bContext *C, wmOperator *op) +{ + view_pan_exit(C, op, 1); + + return OPERATOR_CANCELLED; +} + +void CLIP_OT_view_pan(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "View Pan"; + ot->idname= "CLIP_OT_view_pan"; + + /* api callbacks */ + ot->exec= view_pan_exec; + ot->invoke= view_pan_invoke; + ot->modal= view_pan_modal; + ot->cancel= view_pan_cancel; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_BLOCKING; + + /* properties */ + RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX, + "Offset", "Offset in floating point units, 1.0 is the width and height of the image", -FLT_MAX, FLT_MAX); +} + +/********************** view zoom operator *********************/ + +typedef struct ViewZoomData { + float x, y; + float zoom; + int event_type; +} ViewZoomData; + +static void view_zoom_init(bContext *C, wmOperator *op, wmEvent *event) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + ViewZoomData *vpd; + + op->customdata= vpd= MEM_callocN(sizeof(ViewZoomData), "ClipViewZoomData"); + WM_cursor_modal(CTX_wm_window(C), BC_NSEW_SCROLLCURSOR); + + vpd->x= event->x; + vpd->y= event->y; + vpd->zoom= sc->zoom; + vpd->event_type= event->type; + + WM_event_add_modal_handler(C, op); +} + +static void view_zoom_exit(bContext *C, wmOperator *op, int cancel) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + ViewZoomData *vpd= op->customdata; + + if(cancel) { + sc->zoom= vpd->zoom; + ED_region_tag_redraw(CTX_wm_region(C)); + } + + WM_cursor_restore(CTX_wm_window(C)); + MEM_freeN(op->customdata); +} + +static int view_zoom_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + ARegion *ar= CTX_wm_region(C); + + sclip_zoom_set_factor(sc, ar, RNA_float_get(op->ptr, "factor")); + + ED_region_tag_redraw(CTX_wm_region(C)); + + return OPERATOR_FINISHED; +} + +static int view_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + if (event->type==MOUSEZOOM) { + SpaceClip *sc= CTX_wm_space_clip(C); + ARegion *ar= CTX_wm_region(C); + float factor; + + factor= 1.0f + (event->x-event->prevx+event->y-event->prevy)/300.0f; + RNA_float_set(op->ptr, "factor", factor); + sclip_zoom_set(sc, ar, sc->zoom*factor); + ED_region_tag_redraw(CTX_wm_region(C)); + + return OPERATOR_FINISHED; + } + else { + view_zoom_init(C, op, event); + return OPERATOR_RUNNING_MODAL; + } +} + +static int view_zoom_modal(bContext *C, wmOperator *op, wmEvent *event) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + ARegion *ar= CTX_wm_region(C); + ViewZoomData *vpd= op->customdata; + float factor; + + switch(event->type) { + case MOUSEMOVE: + factor= 1.0f + (vpd->x-event->x+vpd->y-event->y)/300.0f; + RNA_float_set(op->ptr, "factor", factor); + sclip_zoom_set(sc, ar, vpd->zoom*factor); + ED_region_tag_redraw(CTX_wm_region(C)); + break; + default: + if(event->type==vpd->event_type && event->val==KM_RELEASE) { + view_zoom_exit(C, op, 0); + return OPERATOR_FINISHED; + } + break; + } + + return OPERATOR_RUNNING_MODAL; +} + +static int view_zoom_cancel(bContext *C, wmOperator *op) +{ + view_zoom_exit(C, op, 1); + return OPERATOR_CANCELLED; +} + +void CLIP_OT_view_zoom(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "View Zoom"; + ot->idname= "CLIP_OT_view_zoom"; + + /* api callbacks */ + ot->exec= view_zoom_exec; + ot->invoke= view_zoom_invoke; + ot->modal= view_zoom_modal; + ot->cancel= view_zoom_cancel; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER; + + /* properties */ + RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, FLT_MAX, + "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out", -FLT_MAX, FLT_MAX); +} + +/********************** view zoom in/out operator *********************/ + +static int view_zoom_in_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + ARegion *ar= CTX_wm_region(C); + + sclip_zoom_set_factor(sc, ar, 1.25f); + + ED_region_tag_redraw(CTX_wm_region(C)); + + return OPERATOR_FINISHED; +} + +static int view_zoom_out_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + ARegion *ar= CTX_wm_region(C); + + sclip_zoom_set_factor(sc, ar, 0.8f); + + ED_region_tag_redraw(CTX_wm_region(C)); + + return OPERATOR_FINISHED; +} + +static int view_zoom_inout_invoke(bContext *C, wmOperator *op, wmEvent *event, int out) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + float co[2], oldzoom= sc->zoom; + + ED_clip_mouse_pos(C, event, co); + + if(out) + view_zoom_out_exec(C, op); + else + view_zoom_in_exec(C, op); + + if(U.uiflag&USER_ZOOM_TO_MOUSEPOS) { + int width, height; + + ED_space_clip_size(sc, &width, &height); + + sc->xof+= ((co[0]-0.5)*width-sc->xof)*(sc->zoom-oldzoom)/sc->zoom; + sc->yof+= ((co[1]-0.5)*height-sc->yof)*(sc->zoom-oldzoom)/sc->zoom; + } + + return OPERATOR_FINISHED; +} + +static int view_zoom_in_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + return view_zoom_inout_invoke(C, op, event, 0); +} + +void CLIP_OT_view_zoom_in(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "View Zoom In"; + ot->idname= "CLIP_OT_view_zoom_in"; + + /* api callbacks */ + ot->exec= view_zoom_in_exec; + ot->invoke= view_zoom_in_invoke; + ot->poll= ED_space_clip_poll; +} + +static int view_zoom_out_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + return view_zoom_inout_invoke(C, op, event, 1); +} + +void CLIP_OT_view_zoom_out(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "View Zoom Out"; + ot->idname= "CLIP_OT_view_zoom_out"; + + /* api callbacks */ + ot->exec= view_zoom_out_exec; + ot->invoke= view_zoom_out_invoke; + ot->poll= ED_space_clip_poll; +} + +/********************** view zoom ratio operator *********************/ + +static int view_zoom_ratio_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + ARegion *ar= CTX_wm_region(C); + + sclip_zoom_set(sc, ar, RNA_float_get(op->ptr, "ratio")); + + /* ensure pixel exact locations for draw */ + sc->xof= (int)sc->xof; + sc->yof= (int)sc->yof; + + ED_region_tag_redraw(CTX_wm_region(C)); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_view_zoom_ratio(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "View Zoom Ratio"; + ot->idname= "CLIP_OT_view_zoom_ratio"; + + /* api callbacks */ + ot->exec= view_zoom_ratio_exec; + ot->poll= ED_space_clip_poll; + + /* properties */ + RNA_def_float(ot->srna, "ratio", 0.0f, 0.0f, FLT_MAX, + "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX); +} + +/********************** view all operator *********************/ + +static int view_all_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc; + ARegion *ar; + int w, h, width, height; + float aspx, aspy; + + /* retrieve state */ + sc= CTX_wm_space_clip(C); + ar= CTX_wm_region(C); + + ED_space_clip_size(sc, &w, &h); + ED_space_clip_aspect(sc, &aspx, &aspy); + + w= w*aspx; + h= h*aspy; + + /* check if the image will fit in the image with zoom==1 */ + width= ar->winrct.xmax - ar->winrct.xmin + 1; + height= ar->winrct.ymax - ar->winrct.ymin + 1; + + if((w >= width || h >= height) && (width > 0 && height > 0)) { + float zoomx, zoomy; + + /* find the zoom value that will fit the image in the image space */ + zoomx= (float)width/w; + zoomy= (float)height/h; + sclip_zoom_set(sc, ar, 1.0f/power_of_2(1/MIN2(zoomx, zoomy))); + } + else + sclip_zoom_set(sc, ar, 1.0f); + + sc->xof= sc->yof= 0.0f; + + ED_region_tag_redraw(CTX_wm_region(C)); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_view_all(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "View All"; + ot->idname= "CLIP_OT_view_all"; + + /* api callbacks */ + ot->exec= view_all_exec; + ot->poll= ED_space_clip_poll; +} + +/********************** view selected operator *********************/ + +static int view_selected_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + ARegion *ar= CTX_wm_region(C); + + sc->xlockof= 0.0f; + sc->ylockof= 0.0f; + + ED_clip_view_selection(sc, ar, 1); + ED_region_tag_redraw(CTX_wm_region(C)); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_view_selected(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "View Selected"; + ot->idname= "CLIP_OT_view_selected"; + + /* api callbacks */ + ot->exec= view_selected_exec; + ot->poll= ED_space_clip_poll; +} + +/********************** change frame operator *********************/ + +static int change_frame_poll(bContext *C) +{ + /* prevent changes during render */ + if(G.rendering) + return 0; + + return ED_space_clip_poll(C); +} + +static void change_frame_apply(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + + /* set the new frame number */ + CFRA= RNA_int_get(op->ptr, "frame"); + FRAMENUMBER_MIN_CLAMP(CFRA); + SUBFRA = 0.0f; + + /* do updates */ + sound_seek_scene(CTX_data_main(C), CTX_data_scene(C)); + WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); +} + +static int change_frame_exec(bContext *C, wmOperator *op) +{ + change_frame_apply(C, op); + + return OPERATOR_FINISHED; +} + +static int frame_from_event(bContext *C, wmEvent *event) +{ + ARegion *ar= CTX_wm_region(C); + Scene *scene= CTX_data_scene(C); + int framenr= 0; + + if(ar->regiontype == RGN_TYPE_WINDOW) { + float sfra= SFRA, efra= EFRA, framelen= ar->winx/(efra-sfra+1); + + framenr= sfra+event->mval[0]/framelen; + } else { + float viewx, viewy; + + UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &viewx, &viewy); + + framenr= (int)floor(viewx+0.5f); + } + + return framenr; +} + +static int change_frame_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + ARegion *ar= CTX_wm_region(C); + + if(ar->regiontype == RGN_TYPE_WINDOW) { + if(event->mval[1]>16) + return OPERATOR_PASS_THROUGH; + } + + RNA_int_set(op->ptr, "frame", frame_from_event(C, event)); + + change_frame_apply(C, op); + + /* add temp handler */ + WM_event_add_modal_handler(C, op); + + return OPERATOR_RUNNING_MODAL; +} + +static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event) +{ + switch (event->type) { + case ESCKEY: + return OPERATOR_FINISHED; + + case MOUSEMOVE: + RNA_int_set(op->ptr, "frame", frame_from_event(C, event)); + change_frame_apply(C, op); + break; + + case LEFTMOUSE: + case RIGHTMOUSE: + if (event->val==KM_RELEASE) + return OPERATOR_FINISHED; + break; + } + + return OPERATOR_RUNNING_MODAL; +} + +void CLIP_OT_change_frame(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Change frame"; + ot->idname= "CLIP_OT_change_frame"; + ot->description= "Interactively change the current frame number"; + + /* api callbacks */ + ot->exec= change_frame_exec; + ot->invoke= change_frame_invoke; + ot->modal= change_frame_modal; + ot->poll= change_frame_poll; + + /* flags */ + ot->flag= OPTYPE_BLOCKING|OPTYPE_UNDO; + + /* rna */ + RNA_def_int(ot->srna, "frame", 0, MINAFRAME, MAXFRAME, "Frame", "", MINAFRAME, MAXFRAME); +} + +/********************** rebuild proxies operator *********************/ + +typedef struct ProxyBuildJob { + Scene *scene; + struct Main *main; + MovieClip *clip; +} ProxyJob; + +static void proxy_freejob(void *pjv) +{ + ProxyJob *pj= pjv; + + MEM_freeN(pj); +} + +/* only this runs inside thread */ +static void proxy_startjob(void *pjv, short *stop, short *do_update, float *progress) +{ + ProxyJob *pj= pjv; + Scene *scene=pj->scene; + MovieClip *clip= pj->clip; + struct MovieDistortion *distortion= NULL; + int cfra, undistort; + short tc_flag, size_flag, quality, build_flag; + int sfra= SFRA, efra= EFRA; + int build_sizes[4], build_count= 0; + + tc_flag= clip->proxy.build_tc_flag; + size_flag= clip->proxy.build_size_flag; + quality= clip->proxy.quality; + build_flag= clip->proxy.build_flag; + undistort= build_flag&MCLIP_PROXY_RENDER_UNDISTORT; + + if(clip->source == MCLIP_SRC_MOVIE) { + if(clip->anim) + IMB_anim_index_rebuild(clip->anim, tc_flag, size_flag, quality, stop, do_update, progress); + + if(!undistort) { + return; + } + else { + sfra= 1; + efra= IMB_anim_get_duration(clip->anim, IMB_TC_NONE); + } + } + + if(size_flag&IMB_PROXY_25) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_25; + if(size_flag&IMB_PROXY_50) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_50; + if(size_flag&IMB_PROXY_75) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_75; + if(size_flag&IMB_PROXY_100) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_100; + + if(undistort) + distortion= BKE_tracking_distortion_create(); + + for(cfra= sfra; cfra<=efra; cfra++) { + if(clip->source != MCLIP_SRC_MOVIE) + BKE_movieclip_build_proxy_frame(clip, NULL, cfra, build_sizes, build_count, 0); + + if(undistort) + BKE_movieclip_build_proxy_frame(clip, distortion, cfra, build_sizes, build_count, 1); + + if(*stop || G.afbreek) + break; + + *do_update= 1; + *progress= ((float)cfra)/(efra-sfra); + } + + if(distortion) + BKE_tracking_distortion_destroy(distortion); +} + +static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) +{ + wmJob * steve; + ProxyJob *pj; + Scene *scene= CTX_data_scene(C); + ScrArea *sa= CTX_wm_area(C); + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + + if((clip->flag&MCLIP_USE_PROXY)==0) + return OPERATOR_CANCELLED; + + steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa, "Building Proxies", WM_JOB_PROGRESS); + + pj= MEM_callocN(sizeof(ProxyJob), "proxy rebuild job"); + pj->scene= scene; + pj->main= CTX_data_main(C); + pj->clip= clip; + + WM_jobs_customdata(steve, pj, proxy_freejob); + WM_jobs_timer(steve, 0.2, NC_MOVIECLIP|ND_DISPLAY, 0); + WM_jobs_callbacks(steve, proxy_startjob, NULL, NULL, NULL); + + G.afbreek= 0; + WM_jobs_start(CTX_wm_manager(C), steve); + + ED_area_tag_redraw(CTX_wm_area(C)); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_rebuild_proxy(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Rebuild Proxy and Timecode Indices"; + ot->idname= "CLIP_OT_rebuild_proxy"; + ot->description="Rebuild all selected proxies and timecode indeces using the job system"; + + /* api callbacks */ + ot->exec= sequencer_rebuild_proxy_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER; +} + +/********************** mode set operator *********************/ + +static int mode_set_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + int mode= RNA_enum_get(op->ptr, "mode"); + int toggle= RNA_boolean_get(op->ptr, "toggle"); + + if(sc->mode==mode) { + if(toggle) + sc->mode= SC_MODE_TRACKING; + } else { + sc->mode= mode; + } + + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_CLIP, NULL); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_mode_set(wmOperatorType *ot) +{ + static EnumPropertyItem mode_items[] = { + {SC_MODE_TRACKING, "TRACKING", 0, "Tracking", "Show tracking and solving tools"}, + {SC_MODE_RECONSTRUCTION, "RECONSTRUCTION", 0, "Reconstruction", "Show tracking/reconstruction tools"}, + {SC_MODE_DISTORTION, "DISTORTION", 0, "Distortion", "Show distortion tools"}, + {0, NULL, 0, NULL, NULL}}; + + + /* identifiers */ + ot->name= "Set Clip Mode"; + ot->description = "Sets the clip interaction mode"; + ot->idname= "CLIP_OT_mode_set"; + + /* api callbacks */ + ot->exec= mode_set_exec; + + ot->poll= ED_space_clip_poll; + + /* properties */ + RNA_def_enum(ot->srna, "mode", mode_items, SC_MODE_TRACKING, "Mode", ""); + RNA_def_boolean(ot->srna, "toggle", 0, "Toggle", ""); +} + +/********************** macroses *********************/ + +void ED_operatormacros_clip(void) +{ + wmOperatorType *ot; + wmOperatorTypeMacro *otmacro; + + ot= WM_operatortype_append_macro("CLIP_OT_add_marker_move", "Add Marker and Move", OPTYPE_UNDO|OPTYPE_REGISTER); + ot->description = "Add new marker and move it on movie"; + WM_operatortype_macro_define(ot, "CLIP_OT_add_marker"); + otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + RNA_struct_idprops_unset(otmacro->ptr, "release_confirm"); + + ot= WM_operatortype_append_macro("CLIP_OT_add_marker_slide", "Add Marker and Slide", OPTYPE_UNDO|OPTYPE_REGISTER); + ot->description = "Add new marker and slide it with mouse until mouse button release"; + WM_operatortype_macro_define(ot, "CLIP_OT_add_marker"); + otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + RNA_boolean_set(otmacro->ptr, "release_confirm", 1); +} diff --git a/source/blender/editors/space_clip/clip_toolbar.c b/source/blender/editors/space_clip/clip_toolbar.c new file mode 100644 index 00000000000..c8113c5ea7b --- /dev/null +++ b/source/blender/editors/space_clip/clip_toolbar.c @@ -0,0 +1,244 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/editors/space_clip/clip_header.c + * \ingroup spclip + */ + +#include <string.h> + +#include "DNA_windowmanager_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_utildefines.h" + +#include "BKE_context.h" +#include "BKE_screen.h" + +#include "ED_screen.h" +#include "ED_util.h" + +#include "WM_types.h" +#include "WM_api.h" + +#include "UI_interface.h" +#include "UI_resources.h" + +/* ************************ header area region *********************** */ + +/************************** properties ******************************/ + +static ARegion *clip_has_properties_region(ScrArea *sa) +{ + ARegion *ar, *arnew; + + ar= BKE_area_find_region_type(sa, RGN_TYPE_UI); + if(ar) + return ar; + + /* add subdiv level; after header */ + ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER); + + /* is error! */ + if(ar==NULL) + return NULL; + + arnew= MEM_callocN(sizeof(ARegion), "clip properties region"); + + BLI_insertlinkafter(&sa->regionbase, ar, arnew); + arnew->regiontype= RGN_TYPE_UI; + arnew->alignment= RGN_ALIGN_RIGHT; + + arnew->flag= RGN_FLAG_HIDDEN; + + return arnew; +} + +static int properties_poll(bContext *C) +{ + return (CTX_wm_space_clip(C) != NULL); +} + +static int properties_exec(bContext *C, wmOperator *UNUSED(op)) +{ + ScrArea *sa= CTX_wm_area(C); + ARegion *ar= clip_has_properties_region(sa); + + if(ar) + ED_region_toggle_hidden(C, ar); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_properties(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Properties"; + ot->description= "Toggle clip properties panel"; + ot->idname= "CLIP_OT_properties"; + + /* api callbacks */ + ot->exec= properties_exec; + ot->poll= properties_poll; +} + +/************************** tools ******************************/ + +static ARegion *clip_has_tools_region(ScrArea *sa) +{ + ARegion *ar, *artool=NULL, *arprops=NULL, *arhead; + + for(ar= sa->regionbase.first; ar; ar= ar->next) { + if(ar->regiontype==RGN_TYPE_TOOLS) + artool= ar; + if(ar->regiontype==RGN_TYPE_TOOL_PROPS) + arprops= ar; + } + + /* tool region hide/unhide also hides props */ + if(arprops && artool) + return artool; + + if(artool==NULL) { + /* add subdiv level; after header */ + arhead= BKE_area_find_region_type(sa, RGN_TYPE_HEADER); + + /* is error! */ + if(arhead==NULL) + return NULL; + + artool= MEM_callocN(sizeof(ARegion), "clip tools region"); + + BLI_insertlinkafter(&sa->regionbase, arhead, artool); + artool->regiontype= RGN_TYPE_TOOLS; + artool->alignment= RGN_ALIGN_LEFT; + + artool->flag= RGN_FLAG_HIDDEN; + } + + if(arprops==NULL) { + /* add extra subdivided region for tool properties */ + arprops= MEM_callocN(sizeof(ARegion), "tool props for clip"); + + BLI_insertlinkafter(&sa->regionbase, artool, arprops); + arprops->regiontype= RGN_TYPE_TOOL_PROPS; + arprops->alignment= RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV; + } + + return artool; +} + +static int tools_poll(bContext *C) +{ + return (CTX_wm_space_clip(C) != NULL); +} + +static int tools_exec(bContext *C, wmOperator *UNUSED(op)) +{ + ScrArea *sa= CTX_wm_area(C); + ARegion *ar= clip_has_tools_region(sa); + + if(ar) + ED_region_toggle_hidden(C, ar); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_tools(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Tools"; + ot->description= "Toggle clip tools panel"; + ot->idname= "CLIP_OT_tools"; + + /* api callbacks */ + ot->exec= tools_exec; + ot->poll= tools_poll; +} + +/************************** redo panel ******************************/ + +static void clip_panel_operator_redo_buts(const bContext *C, Panel *pa, wmOperator *op) +{ + uiLayoutOperatorButs(C, pa->layout, op, NULL, 'V', 0); +} + +static void clip_panel_operator_redo_header(const bContext *C, Panel *pa) +{ + wmOperator *op= WM_operator_last_redo(C); + + if(op) BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname)); + else BLI_strncpy(pa->drawname, "Operator", sizeof(pa->drawname)); +} + +static void clip_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOperator *op) +{ + if(op->type->flag & OPTYPE_MACRO) { + for(op= op->macro.first; op; op= op->next) { + uiItemL(pa->layout, op->type->name, ICON_NONE); + clip_panel_operator_redo_operator(C, pa, op); + } + } + else { + clip_panel_operator_redo_buts(C, pa, op); + } +} + +static void clip_panel_operator_redo(const bContext *C, Panel *pa) +{ + wmOperator *op= WM_operator_last_redo(C); + uiBlock *block; + + if(op==NULL) + return; + if(WM_operator_poll((bContext*)C, op->type) == 0) + return; + + block= uiLayoutGetBlock(pa->layout); + + if(ED_undo_valid(C, op->type->name)==0) + uiLayoutSetEnabled(pa->layout, 0); + + /* note, blockfunc is a default but->func, use Handle func to allow button callbacks too */ + uiBlockSetHandleFunc(block, ED_undo_operator_repeat_cb_evt, op); + + clip_panel_operator_redo_operator(C, pa, op); +} + +void ED_clip_tool_props_register(ARegionType *art) +{ + PanelType *pt; + + pt= MEM_callocN(sizeof(PanelType), "spacetype clip panel last operator"); + strcpy(pt->idname, "CLIP_PT_last_operator"); + strcpy(pt->label, "Operator"); + pt->draw_header= clip_panel_operator_redo_header; + pt->draw= clip_panel_operator_redo; + BLI_addtail(&art->paneltypes, pt); +} diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c new file mode 100644 index 00000000000..649b278ab3d --- /dev/null +++ b/source/blender/editors/space_clip/clip_utils.c @@ -0,0 +1,219 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/editors/space_clip/clip_utils.c + * \ingroup spclip + */ + +#include "DNA_object_types.h" /* SELECT */ + +#include "MEM_guardedalloc.h" + +#include "BLI_utildefines.h" +#include "BLI_math.h" +#include "BLI_listbase.h" + +#include "BKE_context.h" +#include "BKE_movieclip.h" +#include "BKE_tracking.h" +#include "BKE_depsgraph.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "ED_screen.h" +#include "ED_clip.h" + +#include "UI_interface.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "UI_view2d.h" + +#include "clip_intern.h" // own include + +void clip_graph_tracking_values_iterate_track(SpaceClip *sc, MovieTrackingTrack *track, void *userdata, + void (*func) (void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, int coord, float val), + void (*segment_start) (void *userdata, MovieTrackingTrack *track, int coord), + void (*segment_end) (void *userdata)) +{ + MovieClip *clip= ED_space_clip(sc); + int width, height, coord; + + BKE_movieclip_get_size(clip, &sc->user, &width, &height); + + for(coord= 0; coord<2; coord++) { + int i, open= 0, prevfra= 0; + float prevval= 0.0f; + + for(i= 0; i<track->markersnr; i++) { + MovieTrackingMarker *marker= &track->markers[i]; + float val; + + if(marker->flag&MARKER_DISABLED) { + if(open) { + if(segment_end) + segment_end(userdata); + + open= 0; + } + + continue; + } + + if(!open) { + if(segment_start) + segment_start(userdata, track, coord); + + open= 1; + prevval= marker->pos[coord]; + } + + /* value is a pixels per frame speed */ + val= (marker->pos[coord] - prevval) * ((i==0) ? (width) : (height)); + val/= marker->framenr-prevfra; + + if(func) + func(userdata, track, marker, coord, val); + + prevval= marker->pos[coord]; + prevfra= marker->framenr; + } + + if(open) { + if(segment_end) + segment_end(userdata); + } + } +} + +void clip_graph_tracking_values_iterate(SpaceClip *sc, void *userdata, + void (*func) (void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, int coord, float val), + void (*segment_start) (void *userdata, MovieTrackingTrack *track, int coord), + void (*segment_end) (void *userdata)) +{ + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *track; + + track= tracking->tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track)) { + clip_graph_tracking_values_iterate_track(sc, track, userdata, func, segment_start, segment_end); + } + + track= track->next; + } +} + +void clip_graph_tracking_iterate(SpaceClip *sc, void *userdata, + void (*func) (void *userdata, MovieTrackingMarker *marker)) +{ + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *track; + + track= tracking->tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track)) { + int i; + + for(i= 0; i<track->markersnr; i++) { + MovieTrackingMarker *marker= &track->markers[i]; + + if(marker->flag&MARKER_DISABLED) + continue; + + if(func) + func(userdata, marker); + } + } + + track= track->next; + } +} + +void clip_delete_track(bContext *C, MovieClip *clip, MovieTrackingTrack *track) +{ + MovieTracking *tracking= &clip->tracking; + MovieTrackingStabilization *stab= &tracking->stabilization; + + int has_bundle= 0, update_stab= 0; + + if(track==tracking->act_track) + tracking->act_track= NULL; + + if(track==stab->rot_track) { + stab->rot_track= NULL; + + update_stab= 1; + } + + /* handle reconstruction display in 3d viewport */ + if(track->flag&TRACK_HAS_BUNDLE) + has_bundle= 1; + + BKE_tracking_free_track(track); + BLI_freelinkN(&tracking->tracks, track); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip); + + if(update_stab) { + tracking->stabilization.ok= 0; + + DAG_id_tag_update(&clip->id, 0); + WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip); + } + + if(has_bundle) + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL); +} + +void clip_delete_marker(bContext *C, MovieClip *clip, MovieTrackingTrack *track, MovieTrackingMarker *marker) +{ + if(track->markersnr==1) { + clip_delete_track(C, clip, track); + } + else { + BKE_tracking_delete_marker(track, marker->framenr); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip); + } +} + +void clip_view_center_to_point(SpaceClip *sc, float x, float y) +{ + int width, height; + float aspx, aspy; + + ED_space_clip_size(sc, &width, &height); + ED_space_clip_aspect(sc, &aspx, &aspy); + + sc->xof= (x-0.5f)*width*aspx; + sc->yof= (y-0.5f)*height*aspy; +} diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c new file mode 100644 index 00000000000..c8577f7760e --- /dev/null +++ b/source/blender/editors/space_clip/space_clip.c @@ -0,0 +1,949 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/editors/space_clip/space_clip.c + * \ingroup spclip + */ + +#include <string.h> +#include <stdio.h> + +#include "DNA_scene_types.h" +#include "DNA_movieclip_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_utildefines.h" +#include "BLI_math.h" + +#include "BKE_main.h" +#include "BKE_context.h" +#include "BKE_screen.h" +#include "BKE_movieclip.h" +#include "BKE_tracking.h" + +#include "IMB_imbuf_types.h" + +#include "ED_screen.h" +#include "ED_clip.h" +#include "ED_transform.h" + +#include "IMB_imbuf.h" + +#include "BIF_gl.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "RNA_access.h" + + +#include "clip_intern.h" // own include + +static void init_preview_region(const bContext *C, ARegion *ar) +{ + Scene *scene= CTX_data_scene(C); + + ar->regiontype= RGN_TYPE_PREVIEW; + ar->alignment= RGN_ALIGN_TOP; + ar->flag|= RGN_FLAG_HIDDEN; + + ar->v2d.tot.xmin= 0.0f; + ar->v2d.tot.ymin= (float)scene->r.sfra - 10.0f; + ar->v2d.tot.xmax= (float)scene->r.efra; + ar->v2d.tot.ymax= 10.0f; + + ar->v2d.cur= ar->v2d.tot; + + ar->v2d.min[0]= FLT_MIN; + ar->v2d.min[1]= FLT_MIN; + + ar->v2d.max[0]= MAXFRAMEF; + ar->v2d.max[1]= FLT_MAX; + + ar->v2d.scroll= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); + ar->v2d.scroll |= (V2D_SCROLL_LEFT|V2D_SCROLL_SCALE_VERTICAL); + + ar->v2d.keeptot= 0; +} + +static ARegion *clip_has_preview_region(const bContext *C, ScrArea *sa) +{ + ARegion *ar, *arnew; + + ar= BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW); + if(ar) + return ar; + + /* add subdiv level; after header */ + ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + + /* is error! */ + if(ar==NULL) + return NULL; + + arnew= MEM_callocN(sizeof(ARegion), "clip preview region"); + + BLI_insertlinkbefore(&sa->regionbase, ar, arnew); + init_preview_region(C, arnew); + + return arnew; +} + +static void clip_scopes_tag_refresh(ScrArea *sa) +{ + SpaceClip *sc= (SpaceClip *)sa->spacedata.first; + ARegion *ar; + + if(sc->mode!=SC_MODE_TRACKING) + return; + + /* only while proeprties are visible */ + for (ar=sa->regionbase.first; ar; ar=ar->next) { + if (ar->regiontype == RGN_TYPE_UI && ar->flag & RGN_FLAG_HIDDEN) + return; + } + + sc->scopes.ok= 0; +} + +static void clip_stabilization_tag_refresh(ScrArea *sa) +{ + SpaceClip *sc= (SpaceClip *)sa->spacedata.first; + MovieClip *clip= ED_space_clip(sc); + + if(clip) { + MovieTrackingStabilization *stab= &clip->tracking.stabilization; + + stab->ok= 0; + } +} + +/* ******************** default callbacks for clip space ***************** */ + +static SpaceLink *clip_new(const bContext *C) +{ + ARegion *ar; + SpaceClip *sc; + + sc= MEM_callocN(sizeof(SpaceClip), "initclip"); + sc->spacetype= SPACE_CLIP; + sc->flag= SC_SHOW_MARKER_PATTERN|SC_SHOW_TRACK_PATH|SC_SHOW_GPENCIL|SC_MANUAL_CALIBRATION|SC_SHOW_GRAPH_TRACKS|SC_SHOW_GRAPH_FRAMES; + sc->zoom= 1.0f; + sc->path_length= 20; + sc->scopes.track_preview_height= 120; + + /* header */ + ar= MEM_callocN(sizeof(ARegion), "header for clip"); + + BLI_addtail(&sc->regionbase, ar); + ar->regiontype= RGN_TYPE_HEADER; + ar->alignment= RGN_ALIGN_BOTTOM; + + /* tools view */ + ar= MEM_callocN(sizeof(ARegion), "tools for clip"); + + BLI_addtail(&sc->regionbase, ar); + ar->regiontype= RGN_TYPE_TOOLS; + ar->alignment= RGN_ALIGN_LEFT; + + /* tool properties */ + ar= MEM_callocN(sizeof(ARegion), "tool properties for clip"); + + BLI_addtail(&sc->regionbase, ar); + ar->regiontype= RGN_TYPE_TOOL_PROPS; + ar->alignment= RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV; + + /* properties view */ + ar= MEM_callocN(sizeof(ARegion), "properties for clip"); + + BLI_addtail(&sc->regionbase, ar); + ar->regiontype= RGN_TYPE_UI; + ar->alignment= RGN_ALIGN_RIGHT; + + /* preview view */ + ar= MEM_callocN(sizeof(ARegion), "preview for clip"); + + BLI_addtail(&sc->regionbase, ar); + init_preview_region(C, ar); + + /* main area */ + ar= MEM_callocN(sizeof(ARegion), "main area for clip"); + + BLI_addtail(&sc->regionbase, ar); + ar->regiontype= RGN_TYPE_WINDOW; + + return (SpaceLink *)sc; +} + +/* not spacelink itself */ +static void clip_free(SpaceLink *sl) +{ + SpaceClip *sc= (SpaceClip*) sl; + + sc->clip= NULL; + + if(sc->scopes.track_preview) + IMB_freeImBuf(sc->scopes.track_preview); +} + +/* spacetype; init callback */ +static void clip_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) +{ + +} + +static SpaceLink *clip_duplicate(SpaceLink *sl) +{ + SpaceClip *scn= MEM_dupallocN(sl); + + /* clear or remove stuff from old */ + scn->scopes.track_preview= NULL; + scn->scopes.ok= 0; + + return (SpaceLink *)scn; +} + +static void clip_listener(ScrArea *sa, wmNotifier *wmn) +{ + /* context changes */ + switch(wmn->category) { + case NC_SCENE: + switch(wmn->data) { + case ND_FRAME: + clip_scopes_tag_refresh(sa); + /* no break! */ + + case ND_FRAME_RANGE: + ED_area_tag_refresh(sa); + ED_area_tag_redraw(sa); + break; + } + break; + case NC_MOVIECLIP: + switch(wmn->data) { + case ND_DISPLAY: + case ND_SELECT: + clip_scopes_tag_refresh(sa); + ED_area_tag_redraw(sa); + break; + } + switch(wmn->action) { + case NA_REMOVED: + case NA_EDITED: + case NA_EVALUATED: + clip_stabilization_tag_refresh(sa); + /* no break! */ + + case NA_SELECTED: + clip_scopes_tag_refresh(sa); + ED_area_tag_redraw(sa); + break; + } + break; + case NC_GEOM: + switch(wmn->data) { + case ND_SELECT: + clip_scopes_tag_refresh(sa); + ED_area_tag_redraw(sa); + break; + } + break; + case NC_SCREEN: + if(wmn->data==ND_ANIMPLAY) { + ED_area_tag_redraw(sa); + } + break; + case NC_SPACE: + if(wmn->data==ND_SPACE_CLIP) { + clip_scopes_tag_refresh(sa); + clip_stabilization_tag_refresh(sa); + ED_area_tag_redraw(sa); + } + break; + } +} + +static void clip_operatortypes(void) +{ + /* ** clip_ops.c ** */ + WM_operatortype_append(CLIP_OT_open); + WM_operatortype_append(CLIP_OT_reload); + WM_operatortype_append(CLIP_OT_view_pan); + WM_operatortype_append(CLIP_OT_view_zoom); + WM_operatortype_append(CLIP_OT_view_zoom_in); + WM_operatortype_append(CLIP_OT_view_zoom_out); + WM_operatortype_append(CLIP_OT_view_zoom_ratio); + WM_operatortype_append(CLIP_OT_view_all); + WM_operatortype_append(CLIP_OT_view_selected); + WM_operatortype_append(CLIP_OT_change_frame); + WM_operatortype_append(CLIP_OT_rebuild_proxy); + WM_operatortype_append(CLIP_OT_mode_set); + + /* ** clip_toolbar.c ** */ + WM_operatortype_append(CLIP_OT_tools); + WM_operatortype_append(CLIP_OT_properties); + + /* ** tracking_ops.c ** */ + + /* navigation */ + WM_operatortype_append(CLIP_OT_frame_jump); + + /* foorage */ + WM_operatortype_append(CLIP_OT_set_center_principal); + + /* selection */ + WM_operatortype_append(CLIP_OT_select); + WM_operatortype_append(CLIP_OT_select_all); + WM_operatortype_append(CLIP_OT_select_border); + WM_operatortype_append(CLIP_OT_select_circle); + WM_operatortype_append(CLIP_OT_select_grouped); + + /* markers */ + WM_operatortype_append(CLIP_OT_add_marker); + WM_operatortype_append(CLIP_OT_slide_marker); + WM_operatortype_append(CLIP_OT_delete_track); + WM_operatortype_append(CLIP_OT_delete_marker); + + /* track */ + WM_operatortype_append(CLIP_OT_track_markers); + + /* solving */ + WM_operatortype_append(CLIP_OT_solve_camera); + WM_operatortype_append(CLIP_OT_clear_solution); + + WM_operatortype_append(CLIP_OT_disable_markers); + WM_operatortype_append(CLIP_OT_hide_tracks); + WM_operatortype_append(CLIP_OT_hide_tracks_clear); + WM_operatortype_append(CLIP_OT_lock_tracks); + + /* orientation */ + WM_operatortype_append(CLIP_OT_set_origin); + WM_operatortype_append(CLIP_OT_set_floor); + WM_operatortype_append(CLIP_OT_set_axis); + WM_operatortype_append(CLIP_OT_set_scale); + + /* detect */ + WM_operatortype_append(CLIP_OT_detect_features); + + /* stabilization */ + WM_operatortype_append(CLIP_OT_stabilize_2d_add); + WM_operatortype_append(CLIP_OT_stabilize_2d_remove); + WM_operatortype_append(CLIP_OT_stabilize_2d_select); + WM_operatortype_append(CLIP_OT_stabilize_2d_set_rotation); + + /* clean-up */ + WM_operatortype_append(CLIP_OT_clear_track_path); + WM_operatortype_append(CLIP_OT_join_tracks); + WM_operatortype_append(CLIP_OT_track_copy_color); + + WM_operatortype_append(CLIP_OT_clean_tracks); + + /* graph editing */ + WM_operatortype_append(CLIP_OT_graph_select); + WM_operatortype_append(CLIP_OT_graph_delete_curve); + WM_operatortype_append(CLIP_OT_graph_delete_knot); +} + +static void clip_keymap(struct wmKeyConfig *keyconf) +{ + wmKeyMap *keymap; + wmKeyMapItem *kmi; + + /* ******** Global hotkeys avalaible for all regions ******** */ + + keymap= WM_keymap_find(keyconf, "Clip", SPACE_CLIP, 0); + + WM_keymap_add_item(keymap, "CLIP_OT_open", OKEY, KM_PRESS, KM_ALT, 0); + + WM_keymap_add_item(keymap, "CLIP_OT_tools", TKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "CLIP_OT_properties", NKEY, KM_PRESS, 0, 0); + + /* 2d tracking */ + kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", LEFTARROWKEY, KM_PRESS, KM_ALT, 0); + RNA_boolean_set(kmi->ptr, "backwards", 1); + WM_keymap_add_item(keymap, "CLIP_OT_track_markers", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0); + kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "sequence", 1); + kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "backwards", 1); + RNA_boolean_set(kmi->ptr, "sequence", 1); + + /* mode */ + kmi= WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "mode", SC_MODE_RECONSTRUCTION); + RNA_boolean_set(kmi->ptr, "toggle", 1); + + kmi= WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(kmi->ptr, "mode", SC_MODE_DISTORTION); + RNA_boolean_set(kmi->ptr, "toggle", 1); + + /* ******** Hotkeys avalaible for main region only ******** */ + + keymap= WM_keymap_find(keyconf, "Clip Editor", SPACE_CLIP, 0); + + /* ** View/navigation ** */ + + WM_keymap_add_item(keymap, "CLIP_OT_view_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "CLIP_OT_view_pan", MIDDLEMOUSE, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "CLIP_OT_view_pan", MOUSEPAN, 0, 0, 0); + + WM_keymap_add_item(keymap, "CLIP_OT_view_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "CLIP_OT_view_zoom", MOUSEZOOM, 0, 0, 0); + WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_in", WHEELINMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_out", WHEELOUTMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_in", PADPLUSKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_out", PADMINUS, KM_PRESS, 0, 0); + + RNA_float_set(WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_ratio", PAD8, KM_PRESS, KM_SHIFT, 0)->ptr, "ratio", 8.0f); + RNA_float_set(WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_ratio", PAD4, KM_PRESS, KM_SHIFT, 0)->ptr, "ratio", 4.0f); + RNA_float_set(WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_ratio", PAD2, KM_PRESS, KM_SHIFT, 0)->ptr, "ratio", 2.0f); + RNA_float_set(WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_ratio", PAD1, KM_PRESS, 0, 0)->ptr, "ratio", 1.0f); + RNA_float_set(WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_ratio", PAD2, KM_PRESS, 0, 0)->ptr, "ratio", 0.5f); + RNA_float_set(WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_ratio", PAD4, KM_PRESS, 0, 0)->ptr, "ratio", 0.25f); + RNA_float_set(WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_ratio", PAD8, KM_PRESS, 0, 0)->ptr, "ratio", 0.125f); + + WM_keymap_add_item(keymap, "CLIP_OT_view_all", HOMEKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "CLIP_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0); + + /* jump to special frame */ + kmi= WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "position", 0); + + kmi= WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "position", 1); + + kmi= WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "position", 2); + + kmi= WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "position", 3); + + /* "timeline" */ + WM_keymap_add_item(keymap, "CLIP_OT_change_frame", LEFTMOUSE, KM_PRESS, 0, 0); + + /* selection */ + WM_keymap_add_item(keymap, "CLIP_OT_select", SELECTMOUSE, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "CLIP_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1); + WM_keymap_add_item(keymap, "CLIP_OT_select_all", AKEY, KM_PRESS, 0, 0); + RNA_enum_set(WM_keymap_add_item(keymap, "CLIP_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "action", SEL_INVERT); + WM_keymap_add_item(keymap, "CLIP_OT_select_border", BKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "CLIP_OT_select_circle", CKEY, KM_PRESS, 0, 0); + WM_keymap_add_menu(keymap, "CLIP_MT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0); + + /* marker */ + WM_keymap_add_item(keymap, "CLIP_OT_add_marker_slide", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); + + WM_keymap_add_item(keymap, "CLIP_OT_delete_marker", DELKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "CLIP_OT_delete_marker", XKEY, KM_PRESS, KM_SHIFT, 0); + + WM_keymap_add_item(keymap, "CLIP_OT_slide_marker", LEFTMOUSE, KM_PRESS, 0, 0); + + kmi= WM_keymap_add_item(keymap, "CLIP_OT_disable_markers", DKEY, KM_PRESS, KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "action", 2); /* toggle */ + + /* tracks */ + WM_keymap_add_item(keymap, "CLIP_OT_delete_track", DELKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "CLIP_OT_delete_track", XKEY, KM_PRESS, 0, 0); + + kmi= WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(kmi->ptr, "action", 0); /* lock */ + + kmi= WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_ALT, 0); + RNA_enum_set(kmi->ptr, "action", 1); /* unlock */ + + WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, 0, 0); + + kmi= WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "unselected", 1); + + WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks_clear", HKEY, KM_PRESS, KM_ALT, 0); + + /* clean-up */ + kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT, 0); + RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_REMAINED); + kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_UPTO); + kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_ALL); + + WM_keymap_add_item(keymap, "CLIP_OT_join_tracks", JKEY, KM_PRESS, KM_CTRL, 0); + + /* menus */ + WM_keymap_add_menu(keymap, "CLIP_MT_tracking_specials", WKEY, KM_PRESS, 0, 0); + + /* display */ + kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", LKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.lock_selection"); + + kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.use_mute_footage"); + + transform_keymap_for_space(keyconf, keymap, SPACE_CLIP); + + /* ******** Hotkeys avalaible for preview region only ******** */ + + keymap= WM_keymap_find(keyconf, "Clip Graph Editor", SPACE_CLIP, 0); + + /* "timeline" */ + WM_keymap_add_item(keymap, "CLIP_OT_change_frame", ACTIONMOUSE, KM_PRESS, 0, 0); + + /* selection */ + WM_keymap_add_item(keymap, "CLIP_OT_graph_select", SELECTMOUSE, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "CLIP_OT_graph_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1); + + /* delete */ + WM_keymap_add_item(keymap, "CLIP_OT_graph_delete_curve", DELKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "CLIP_OT_graph_delete_curve", XKEY, KM_PRESS, 0, 0); + + WM_keymap_add_item(keymap, "CLIP_OT_graph_delete_knot", DELKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "CLIP_OT_graph_delete_knot", XKEY, KM_PRESS, KM_SHIFT, 0); +} + +const char *clip_context_dir[]= {"edit_movieclip", NULL}; + +static int clip_context(const bContext *C, const char *member, bContextDataResult *result) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + + if(CTX_data_dir(member)) { + CTX_data_dir_set(result, clip_context_dir); + return 1; + } + else if(CTX_data_equals(member, "edit_movieclip")) { + CTX_data_id_pointer_set(result, &sc->clip->id); + return 1; + } + + return 0; +} + +static void clip_refresh(const bContext *C, ScrArea *sa) +{ + wmWindowManager *wm= CTX_wm_manager(C); + wmWindow *window= CTX_wm_window(C); + SpaceClip *sc= (SpaceClip *)sa->spacedata.first; + ARegion *ar_main= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); + ARegion *ar_preview= clip_has_preview_region(C, sa); + int view_changed= 0; + + switch (sc->view) { + case SC_VIEW_CLIP: + if (ar_preview && !(ar_preview->flag & RGN_FLAG_HIDDEN)) { + ar_preview->flag |= RGN_FLAG_HIDDEN; + ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; + WM_event_remove_handlers((bContext*)C, &ar_preview->handlers); + view_changed= 1; + } + if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { + ar_main->alignment= RGN_ALIGN_NONE; + view_changed= 1; + } + if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) { + ar_preview->alignment= RGN_ALIGN_NONE; + view_changed= 1; + } + break; + case SC_VIEW_GRAPH: + if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) { + ar_preview->flag &= ~RGN_FLAG_HIDDEN; + ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; + ar_preview->v2d.cur = ar_preview->v2d.tot; + view_changed= 1; + } + if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { + ar_main->alignment= RGN_ALIGN_NONE; + view_changed= 1; + } + if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) { + ar_preview->alignment= RGN_ALIGN_TOP; + view_changed= 1; + } + break; + } + + if(view_changed) { + ED_area_initialize(wm, window, sa); + ED_area_tag_redraw(sa); + } + + BKE_movieclip_user_set_frame(&sc->user, CTX_data_scene(C)->r.cfra); +} + +/********************* main region ********************/ + +/* sets up the fields of the View2D from zoom and offset */ +static void movieclip_main_area_set_view2d(SpaceClip *sc, ARegion *ar) +{ + MovieClip *clip= ED_space_clip(sc); + float x1, y1, w, h; + int width, height, winx, winy; + + ED_space_clip_size(sc, &width, &height); + + w= width; + h= height; + + if(clip) + h*= clip->aspy/clip->aspx/clip->tracking.camera.pixel_aspect; + + winx= ar->winrct.xmax - ar->winrct.xmin + 1; + winy= ar->winrct.ymax - ar->winrct.ymin + 1; + + ar->v2d.tot.xmin= 0; + ar->v2d.tot.ymin= 0; + ar->v2d.tot.xmax= w; + ar->v2d.tot.ymax= h; + + ar->v2d.mask.xmin= ar->v2d.mask.ymin= 0; + ar->v2d.mask.xmax= winx; + ar->v2d.mask.ymax= winy; + + /* which part of the image space do we see? */ + x1= ar->winrct.xmin+(winx-sc->zoom*w)/2.0f; + y1= ar->winrct.ymin+(winy-sc->zoom*h)/2.0f; + + x1-= sc->zoom*sc->xof; + y1-= sc->zoom*sc->yof; + + /* relative display right */ + ar->v2d.cur.xmin= ((ar->winrct.xmin - (float)x1)/sc->zoom); + ar->v2d.cur.xmax= ar->v2d.cur.xmin + ((float)winx/sc->zoom); + + /* relative display left */ + ar->v2d.cur.ymin= ((ar->winrct.ymin-(float)y1)/sc->zoom); + ar->v2d.cur.ymax= ar->v2d.cur.ymin + ((float)winy/sc->zoom); + + /* normalize 0.0..1.0 */ + ar->v2d.cur.xmin /= w; + ar->v2d.cur.xmax /= w; + ar->v2d.cur.ymin /= h; + ar->v2d.cur.ymax /= h; +} + +/* add handlers, stuff you only do once or on area/region changes */ +static void clip_main_area_init(wmWindowManager *wm, ARegion *ar) +{ + wmKeyMap *keymap; + + UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy); + + /* own keymap */ + keymap= WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0); + WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); + + keymap= WM_keymap_find(wm->defaultconf, "Clip Editor", SPACE_CLIP, 0); + WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); +} + +static void clip_main_area_draw(const bContext *C, ARegion *ar) +{ + /* draw entirely, view changes should be handled here */ + SpaceClip *sc= CTX_wm_space_clip(C); + Scene *scene= CTX_data_scene(C); + MovieClip *clip= ED_space_clip(sc); + + /* if trcking is in progress, we should sunchronize framenr from clipuser + so latest tracked frame would be shown */ + if(clip && clip->tracking_context) + BKE_tracking_sync_user(&sc->user, clip->tracking_context); + + if(sc->flag&SC_LOCK_SELECTION) { + ImBuf *tmpibuf= NULL; + + if(clip && clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) { + tmpibuf= ED_space_clip_get_stable_buffer(sc, NULL, NULL, NULL); + } + + if(ED_clip_view_selection(sc, ar, 0)) { + sc->xof+= sc->xlockof; + sc->yof+= sc->ylockof; + } + + if(tmpibuf) + IMB_freeImBuf(tmpibuf); + } + + /* clear and setup matrix */ + UI_ThemeClearColor(TH_BACK); + glClear(GL_COLOR_BUFFER_BIT); + + /* data... */ + movieclip_main_area_set_view2d(sc, ar); + + clip_draw_main(sc, ar, scene); + + /* Grease Pencil */ + clip_draw_grease_pencil((bContext *)C, 1); + + /* reset view matrix */ + UI_view2d_view_restore(C); + + /* draw Grease Pencil - screen space only */ + clip_draw_grease_pencil((bContext *)C, 0); +} + +static void clip_main_area_listener(ARegion *ar, wmNotifier *wmn) +{ + /* context changes */ + switch(wmn->category) { + case NC_SCREEN: + if (wmn->data==ND_GPENCIL) + ED_region_tag_redraw(ar); + break; + } +} + +/****************** preview region ******************/ + +static void clip_preview_area_init(wmWindowManager *wm, ARegion *ar) +{ + wmKeyMap *keymap; + + UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); + + /* own keymap */ + keymap= WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0); + WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); + + keymap= WM_keymap_find(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP, 0); + WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); +} + +static void clip_preview_area_draw(const bContext *C, ARegion *ar) +{ + View2D *v2d= &ar->v2d; + View2DScrollers *scrollers; + SpaceClip *sc= CTX_wm_space_clip(C); + Scene *scene= CTX_data_scene(C); + short unitx= V2D_UNIT_FRAMESCALE, unity= V2D_UNIT_VALUES; + + /* clear and setup matrix */ + UI_ThemeClearColor(TH_BACK); + glClear(GL_COLOR_BUFFER_BIT); + + UI_view2d_view_ortho(v2d); + + /* data... */ + clip_draw_graph(sc, ar, scene); + + /* reset view matrix */ + UI_view2d_view_restore(C); + + /* scrollers */ + scrollers= UI_view2d_scrollers_calc(C, v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP); + UI_view2d_scrollers_draw(C, v2d, scrollers); + UI_view2d_scrollers_free(scrollers); +} + +static void clip_preview_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn)) +{ +} + +/****************** header region ******************/ + +/* add handlers, stuff you only do once or on area/region changes */ +static void clip_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) +{ + ED_region_header_init(ar); +} + +static void clip_header_area_draw(const bContext *C, ARegion *ar) +{ + ED_region_header(C, ar); +} + +/****************** tools region ******************/ + +/* add handlers, stuff you only do once or on area/region changes */ +static void clip_tools_area_init(wmWindowManager *wm, ARegion *ar) +{ + ED_region_panels_init(wm, ar); +} + +static void clip_tools_area_draw(const bContext *C, ARegion *ar) +{ + ED_region_panels(C, ar, 1, NULL, -1); +} + +/****************** tool properties region ******************/ + +static void clip_props_area_listener(ARegion *ar, wmNotifier *wmn) +{ + /* context changes */ + switch(wmn->category) { + case NC_WM: + if(wmn->data == ND_HISTORY) + ED_region_tag_redraw(ar); + break; + case NC_SCENE: + if(wmn->data == ND_MODE) + ED_region_tag_redraw(ar); + break; + case NC_SPACE: + if(wmn->data == ND_SPACE_CLIP) + ED_region_tag_redraw(ar); + break; + case NC_SCREEN: + if(wmn->data == ND_GPENCIL) + ED_region_tag_redraw(ar); + break; + } +} + +/****************** properties region ******************/ + +/* add handlers, stuff you only do once or on area/region changes */ +static void clip_properties_area_init(wmWindowManager *wm, ARegion *ar) +{ + wmKeyMap *keymap; + + ED_region_panels_init(wm, ar); + + keymap= WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0); + WM_event_add_keymap_handler(&ar->handlers, keymap); +} + +static void clip_properties_area_draw(const bContext *C, ARegion *ar) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + + BKE_movieclip_update_scopes(sc->clip, &sc->user, &sc->scopes); + + ED_region_panels(C, ar, 1, NULL, -1); +} + +static void clip_properties_area_listener(ARegion *ar, wmNotifier *wmn) +{ + /* context changes */ + switch(wmn->category) { + case NC_SCREEN: + if (wmn->data==ND_GPENCIL) + ED_region_tag_redraw(ar); + break; + case NC_BRUSH: + if(wmn->action==NA_EDITED) + ED_region_tag_redraw(ar); + break; + } +} + +/********************* registration ********************/ + +/* only called once, from space/spacetypes.c */ +void ED_spacetype_clip(void) +{ + SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype clip"); + ARegionType *art; + + st->spaceid= SPACE_CLIP; + strncpy(st->name, "Clip", BKE_ST_MAXNAME); + + st->new= clip_new; + st->free= clip_free; + st->init= clip_init; + st->duplicate= clip_duplicate; + st->operatortypes= clip_operatortypes; + st->keymap= clip_keymap; + st->listener= clip_listener; + st->context= clip_context; + st->refresh= clip_refresh; + + /* regions: main window */ + art= MEM_callocN(sizeof(ARegionType), "spacetype clip region"); + art->regionid= RGN_TYPE_WINDOW; + art->init= clip_main_area_init; + art->draw= clip_main_area_draw; + art->listener= clip_main_area_listener; + art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_GPENCIL; + + BLI_addhead(&st->regiontypes, art); + + /* preview */ + art= MEM_callocN(sizeof(ARegionType), "spacetype clip region preview"); + art->regionid = RGN_TYPE_PREVIEW; + art->prefsizey = 240; + art->init= clip_preview_area_init; + art->draw= clip_preview_area_draw; + art->listener= clip_preview_area_listener; + art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; + + BLI_addhead(&st->regiontypes, art); + + /* regions: properties */ + art= MEM_callocN(sizeof(ARegionType), "spacetype clip region properties"); + art->regionid= RGN_TYPE_UI; + art->prefsizex= UI_COMPACT_PANEL_WIDTH; + art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI; + art->init= clip_properties_area_init; + art->draw= clip_properties_area_draw; + art->listener= clip_properties_area_listener; + BLI_addhead(&st->regiontypes, art); + ED_clip_buttons_register(art); + + /* regions: tools */ + art= MEM_callocN(sizeof(ARegionType), "spacetype clip region tools"); + art->regionid= RGN_TYPE_TOOLS; + art->prefsizex= UI_COMPACT_PANEL_WIDTH; + art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI; + art->listener= clip_props_area_listener; + art->init= clip_tools_area_init; + art->draw= clip_tools_area_draw; + + BLI_addhead(&st->regiontypes, art); + + /* tool properties */ + art= MEM_callocN(sizeof(ARegionType), "spacetype clip tool properties region"); + art->regionid = RGN_TYPE_TOOL_PROPS; + art->prefsizex= 0; + art->prefsizey= 120; + art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI; + art->listener= clip_props_area_listener; + art->init= clip_tools_area_init; + art->draw= clip_tools_area_draw; + ED_clip_tool_props_register(art); + + BLI_addhead(&st->regiontypes, art); + + /* regions: header */ + art= MEM_callocN(sizeof(ARegionType), "spacetype clip region"); + art->regionid= RGN_TYPE_HEADER; + art->prefsizey= HEADERY; + art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_HEADER; + + art->init= clip_header_area_init; + art->draw= clip_header_area_draw; + + BLI_addhead(&st->regiontypes, art); + + BKE_spacetype_register(st); +} diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c new file mode 100644 index 00000000000..e5bf053aa1c --- /dev/null +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -0,0 +1,2941 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/editors/space_clip/tracking_ops.c + * \ingroup spclip + */ + +#include "MEM_guardedalloc.h" + +#include "DNA_camera_types.h" +#include "DNA_gpencil_types.h" +#include "DNA_movieclip_types.h" +#include "DNA_object_types.h" /* SELECT */ +#include "DNA_scene_types.h" + +#include "BLI_utildefines.h" +#include "BLI_math.h" +#include "BLI_listbase.h" +#include "BLI_rect.h" +#include "BLI_blenlib.h" + +#include "BKE_main.h" +#include "BKE_context.h" +#include "BKE_movieclip.h" +#include "BKE_tracking.h" +#include "BKE_global.h" +#include "BKE_depsgraph.h" +#include "BKE_object.h" +#include "BKE_report.h" +#include "BKE_scene.h" +#include "BKE_library.h" +#include "BKE_sound.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "ED_screen.h" +#include "ED_clip.h" +#include "ED_keyframing.h" + +#include "IMB_imbuf_types.h" +#include "IMB_imbuf.h" + +#include "UI_interface.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "PIL_time.h" + +#include "UI_view2d.h" + +#include "clip_intern.h" // own include + +static int space_clip_frame_poll(bContext *C) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + + if(sc) { + MovieClip *clip= ED_space_clip(sc); + + if(clip) + return BKE_movieclip_has_frame(clip, &sc->user); + } + + return 0; +} + +static int space_clip_frame_camera_poll(bContext *C) +{ + Scene *scene= CTX_data_scene(C); + + if(space_clip_frame_poll(C)) { + return scene->camera != NULL; + } + + return 0; +} + +static int space_clip_camera_poll(bContext *C) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + Scene *scene= CTX_data_scene(C); + + if(sc && sc->clip && scene->camera) + return 1; + + return 0; +} + +/********************** add marker operator *********************/ + +static void add_marker(SpaceClip *sc, float x, float y) +{ + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + int width, height; + + ED_space_clip_size(sc, &width, &height); + + track= BKE_tracking_add_track(&clip->tracking, x, y, sc->user.framenr, width, height); + + BKE_tracking_select_track(&clip->tracking, track, TRACK_AREA_ALL, 0); + + clip->tracking.act_track= track; +} + +static int add_marker_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + float pos[2]; + int width, height; + + ED_space_clip_size(sc, &width, &height); + if(!width || !height) + return OPERATOR_CANCELLED; + + RNA_float_get_array(op->ptr, "location", pos); + + add_marker(sc, pos[0], pos[1]); + + /* reset offset from locked position, so frame jumping wouldn't be so confusing */ + sc->xlockof= 0; + sc->ylockof= 0; + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip); + + return OPERATOR_FINISHED; +} + +static int add_marker_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + float co[2]; + + ED_clip_mouse_pos(C, event, co); + + RNA_float_set_array(op->ptr, "location", co); + + return add_marker_exec(C, op); +} + +void CLIP_OT_add_marker(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Marker"; + ot->idname= "CLIP_OT_add_marker"; + ot->description= "Place new marker at specified location"; + + /* api callbacks */ + ot->invoke= add_marker_invoke; + ot->exec= add_marker_exec; + ot->poll= space_clip_frame_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MIN, FLT_MAX, + "Location", "Location of marker on frame", -1.0f, 1.0f); +} + +/********************** delete track operator *********************/ + +static int delete_track_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *track= tracking->tracks.first, *next; + + while(track) { + next= track->next; + + if(TRACK_VIEW_SELECTED(sc, track)) + clip_delete_track(C, clip, track); + + track= next; + } + + /* nothing selected now, unlock view so it can be scrolled nice again */ + sc->flag&= ~SC_LOCK_SELECTION; + + return OPERATOR_FINISHED; +} + +void CLIP_OT_delete_track(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Delete Track"; + ot->idname= "CLIP_OT_delete_track"; + ot->description= "Delete selected tracks"; + + /* api callbacks */ + ot->invoke= WM_operator_confirm; + ot->exec= delete_track_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** delete marker operator *********************/ + +static int delete_marker_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track= clip->tracking.tracks.first, *next; + int framenr= sc->user.framenr; + int has_selection= 0; + + while(track) { + next= track->next; + + if(TRACK_VIEW_SELECTED(sc, track)) { + MovieTrackingMarker *marker= BKE_tracking_exact_marker(track, framenr); + + if(marker) { + has_selection|= track->markersnr>1; + + clip_delete_marker(C, clip, track, marker); + } + } + + track= next; + } + + if(!has_selection) { + /* nothing selected now, unlock view so it can be scrolled nice again */ + sc->flag&= ~SC_LOCK_SELECTION; + } + + return OPERATOR_FINISHED; +} + +void CLIP_OT_delete_marker(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Delete Marker"; + ot->idname= "CLIP_OT_delete_marker"; + ot->description= "Delete marker for current frame from selected tracks"; + + /* api callbacks */ + ot->invoke= WM_operator_confirm; + ot->exec= delete_marker_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** slide marker operator *********************/ + +#define SLIDE_ACTION_POS 0 +#define SLIDE_ACTION_SIZE 1 +#define SLIDE_ACTION_OFFSET 2 + +typedef struct { + int area, action; + MovieTrackingTrack *track; + MovieTrackingMarker *marker; + + int mval[2]; + int width, height; + float *min, *max, *pos, *offset; + float smin[2], smax[2], spos[2], soff[2]; + float (*smarkers)[2]; + + int lock, accurate; +} SlideMarkerData; + +static SlideMarkerData *create_slide_marker_data(SpaceClip *sc, MovieTrackingTrack *track, + MovieTrackingMarker *marker, wmEvent *event, int area, int action, int width, int height) +{ + SlideMarkerData *data= MEM_callocN(sizeof(SlideMarkerData), "slide marker data"); + + marker= BKE_tracking_ensure_marker(track, sc->user.framenr); + + data->area= area; + data->action= action; + data->track= track; + data->marker= marker; + + if(area==TRACK_AREA_POINT) { + data->pos= marker->pos; + data->offset= track->offset; + copy_v2_v2(data->spos, marker->pos); + copy_v2_v2(data->soff, track->offset); + } else if(area==TRACK_AREA_PAT) { + if(action==SLIDE_ACTION_SIZE) { + data->min= track->pat_min; + data->max= track->pat_max; + } else { + int a; + + data->pos= marker->pos; + data->offset= track->offset; + + copy_v2_v2(data->soff, track->offset); + + data->smarkers= MEM_callocN(sizeof(*data->smarkers)*track->markersnr, "slide marekrs"); + for(a= 0; a<track->markersnr; a++) + copy_v2_v2(data->smarkers[a], track->markers[a].pos); + } + } else if(area==TRACK_AREA_SEARCH) { + data->min= track->search_min; + data->max= track->search_max; + } + + if(area==TRACK_AREA_SEARCH || (area==TRACK_AREA_PAT && action!=SLIDE_ACTION_OFFSET)) { + copy_v2_v2(data->smin, data->min); + copy_v2_v2(data->smax, data->max); + } + + data->mval[0]= event->mval[0]; + data->mval[1]= event->mval[1]; + + data->width= width; + data->height= height; + + if(action==SLIDE_ACTION_SIZE) + data->lock= 1; + + return data; +} + +/* corner = 0: right-bottom corner, + corner = 1: left-top corner */ +static int mouse_on_corner(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker, + int area, float co[2], int corner, int width, int height) +{ + int inside= 0; + float size= 12.0f; + float min[2], max[2]; + float crn[2], dx, dy, tdx, tdy; + + if(area==TRACK_AREA_SEARCH) { + copy_v2_v2(min, track->search_min); + copy_v2_v2(max, track->search_max); + } else { + copy_v2_v2(min, track->pat_min); + copy_v2_v2(max, track->pat_max); + } + + dx= size/width/sc->zoom; + dy= size/height/sc->zoom; + + tdx= 5.0f/width/sc->zoom; + tdy= 5.0f/height/sc->zoom; + + dx= MIN2(dx, (max[0]-min[0])/6.0f) + tdx; + dy= MIN2(dy, (max[1]-min[1])/6.0f) + tdy; + + if(corner==0) { + crn[0]= marker->pos[0]+max[0]; + crn[1]= marker->pos[1]+min[1]; + + inside= co[0]>=crn[0]-dx && co[0]<=crn[0]+tdx && co[1]>=crn[1]-tdy && co[1]<=crn[1]+dy; + } else { + crn[0]= marker->pos[0]+min[0]; + crn[1]= marker->pos[1]+max[1]; + + inside= co[0]>=crn[0]-dx && co[0]<=crn[0]+dx && co[1]>=crn[1]-dy && co[1]<=crn[1]+dy; + } + + return inside; +} + +static int mouse_on_offset(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker, + float co[2], int width, int height) +{ + float pos[2], dx, dy; + + add_v2_v2v2(pos, marker->pos, track->offset); + + dx= 12.0f/width/sc->zoom; + dy= 12.0f/height/sc->zoom; + + dx=MIN2(dx, (track->pat_max[0]-track->pat_min[0])/2.0f); + dy=MIN2(dy, (track->pat_max[1]-track->pat_min[1])/2.0f); + + return co[0]>=pos[0]-dx && co[0]<=pos[0]+dx && co[1]>=pos[1]-dy && co[1]<=pos[1]+dy; +} + +static void hide_cursor(bContext *C) +{ + wmWindow *win= CTX_wm_window(C); + + WM_cursor_set(win, CURSOR_NONE); +} + +static void show_cursor(bContext *C) +{ + wmWindow *win= CTX_wm_window(C); + + WM_cursor_set(win, CURSOR_STD); +} + +static void *slide_marker_customdata(bContext *C, wmEvent *event) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + int width, height; + float co[2]; + void *customdata= NULL; + + ED_space_clip_size(sc, &width, &height); + + if(width==0 || height==0) + return NULL; + + ED_clip_mouse_pos(C, event, co); + + track= clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) { + MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr); + + if((marker->flag&MARKER_DISABLED)==0) { + if(!customdata) + if(mouse_on_offset(sc, track, marker, co, width, height)) + customdata= create_slide_marker_data(sc, track, marker, event, TRACK_AREA_POINT, SLIDE_ACTION_POS, width, height); + + if(sc->flag&SC_SHOW_MARKER_SEARCH) { + if(mouse_on_corner(sc, track, marker, TRACK_AREA_SEARCH, co, 1, width, height)) + customdata= create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH, SLIDE_ACTION_OFFSET, width, height); + else if(mouse_on_corner(sc, track, marker, TRACK_AREA_SEARCH, co, 0, width, height)) + customdata= create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH, SLIDE_ACTION_SIZE, width, height); + } + + if(!customdata && sc->flag&SC_SHOW_MARKER_PATTERN) { + if(mouse_on_corner(sc, track, marker, TRACK_AREA_PAT, co, 1, width, height)) + customdata= create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT, SLIDE_ACTION_OFFSET, width, height); + + if(!customdata && mouse_on_corner(sc, track, marker, TRACK_AREA_PAT, co, 0, width, height)) + customdata= create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT, SLIDE_ACTION_SIZE, width, height); + } + + if(customdata) + break; + } + } + + track= track->next; + } + + return customdata; +} + +static int slide_marker_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + SlideMarkerData *slidedata= slide_marker_customdata(C, event); + + if(slidedata) { + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + + tracking->act_track= slidedata->track; + + op->customdata= slidedata; + + hide_cursor(C); + WM_event_add_modal_handler(C, op); + + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL); + + return OPERATOR_RUNNING_MODAL; + } + + return OPERATOR_PASS_THROUGH; +} + +static void cancel_mouse_slide(SlideMarkerData *data) +{ + /* cancel sliding */ + if(data->area == TRACK_AREA_POINT) { + if(data->action==SLIDE_ACTION_OFFSET) + copy_v2_v2(data->offset, data->soff); + else + copy_v2_v2(data->pos, data->spos); + } else { + if(data->action==SLIDE_ACTION_SIZE) { + copy_v2_v2(data->min, data->smin); + copy_v2_v2(data->max, data->smax); + } else { + int a; + + for(a= 0; a<data->track->markersnr; a++) + copy_v2_v2(data->track->markers[a].pos, data->smarkers[a]); + + copy_v2_v2(data->offset, data->soff); + } + } +} + +static void free_slide_data(SlideMarkerData *data) +{ + if(data->smarkers) MEM_freeN(data->smarkers); + MEM_freeN(data); +} + +static int slide_marker_modal(bContext *C, wmOperator *op, wmEvent *event) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + SlideMarkerData *data= (SlideMarkerData *)op->customdata; + float dx, dy, mdelta[2]; + + switch(event->type) { + case LEFTCTRLKEY: + case RIGHTCTRLKEY: + case LEFTSHIFTKEY: + case RIGHTSHIFTKEY: + if(data->action==SLIDE_ACTION_SIZE) + if(ELEM(event->type, LEFTCTRLKEY, RIGHTCTRLKEY)) + data->lock= event->val==KM_RELEASE; + + if(ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY)) + data->accurate= event->val==KM_PRESS; + + /* no break! update area size */ + + case MOUSEMOVE: + mdelta[0]= event->mval[0]-data->mval[0]; + mdelta[1]= event->mval[1]-data->mval[1]; + + dx= mdelta[0]/data->width/sc->zoom; + + if(data->lock) dy= -dx/data->height*data->width; + else dy= mdelta[1]/data->height/sc->zoom; + + if(data->accurate) { + dx/= 5; + dy/= 5; + } + + if(data->area==TRACK_AREA_POINT) { + if(data->action==SLIDE_ACTION_OFFSET) { + data->offset[0]= data->soff[0]+dx; + data->offset[1]= data->soff[1]+dy; + } else { + data->pos[0]= data->spos[0]+dx; + data->pos[1]= data->spos[1]+dy; + + data->marker->flag&= ~MARKER_TRACKED; + } + + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); + DAG_id_tag_update(&sc->clip->id, 0); + } else { + if(data->action==SLIDE_ACTION_SIZE) { + data->min[0]= data->smin[0]-dx; + data->max[0]= data->smax[0]+dx; + + data->min[1]= data->smin[1]+dy; + data->max[1]= data->smax[1]-dy; + + if(data->area==TRACK_AREA_SEARCH) BKE_tracking_clamp_track(data->track, CLAMP_SEARCH_DIM); + else BKE_tracking_clamp_track(data->track, CLAMP_PAT_DIM); + } else { + float d[2]={dx, dy}; + + if(data->area==TRACK_AREA_SEARCH) { + add_v2_v2v2(data->min, data->smin, d); + add_v2_v2v2(data->max, data->smax, d); + } else { + int a; + + for(a= 0; a<data->track->markersnr; a++) + add_v2_v2v2(data->track->markers[a].pos, data->smarkers[a], d); + + sub_v2_v2v2(data->offset, data->soff, d); + } + + if(data->area==TRACK_AREA_SEARCH) + BKE_tracking_clamp_track(data->track, CLAMP_SEARCH_POS); + } + } + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, NULL); + + break; + + case LEFTMOUSE: + if(event->val==KM_RELEASE) { + free_slide_data(op->customdata); + + show_cursor(C); + + return OPERATOR_FINISHED; + } + + break; + + case ESCKEY: + cancel_mouse_slide(op->customdata); + + free_slide_data(op->customdata); + + show_cursor(C); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, NULL); + + return OPERATOR_CANCELLED; + } + + return OPERATOR_RUNNING_MODAL; +} + +void CLIP_OT_slide_marker(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Slide Marker"; + ot->description= "Slide marker areas"; + ot->idname= "CLIP_OT_slide_marker"; + + /* api callbacks */ + ot->poll= space_clip_frame_poll; + ot->invoke= slide_marker_invoke; + ot->modal= slide_marker_modal; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_GRAB_POINTER|OPTYPE_BLOCKING; + + /* properties */ + RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX, + "Offset", "Offset in floating point units, 1.0 is the width and height of the image", -FLT_MAX, FLT_MAX); +} + +/********************** mouse select operator *********************/ + +static int mouse_on_side(float co[2], float x1, float y1, float x2, float y2, float epsx, float epsy) +{ + if(x1>x2) SWAP(float, x1, x2); + if(y1>y2) SWAP(float, y1, y2); + + return (co[0]>=x1-epsx && co[0]<=x2+epsx) && (co[1]>=y1-epsy && co[1]<=y2+epsy); +} + +static int mouse_on_rect(float co[2], float pos[2], float min[2], float max[2], float epsx, float epsy) +{ + return mouse_on_side(co, pos[0]+min[0], pos[1]+min[1], pos[0]+max[0], pos[1]+min[1], epsx, epsy) || + mouse_on_side(co, pos[0]+min[0], pos[1]+min[1], pos[0]+min[0], pos[1]+max[1], epsx, epsy) || + mouse_on_side(co, pos[0]+min[0], pos[1]+max[1], pos[0]+max[0], pos[1]+max[1], epsx, epsy) || + mouse_on_side(co, pos[0]+max[0], pos[1]+min[1], pos[0]+max[0], pos[1]+max[1], epsx, epsy); +} + +static int track_mouse_area(SpaceClip *sc, float co[2], MovieTrackingTrack *track) +{ + MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr); + float epsx, epsy; + int width, height; + + ED_space_clip_size(sc, &width, &height); + + epsx= MIN4(track->pat_min[0]-track->search_min[0], track->search_max[0]-track->pat_max[0], + fabsf(track->pat_min[0]), fabsf(track->pat_max[0])) / 2; + epsy= MIN4(track->pat_min[1]-track->search_min[1], track->search_max[1]-track->pat_max[1], + fabsf(track->pat_min[1]), fabsf(track->pat_max[1])) / 2; + + epsx= MAX2(epsy, 2.0f / width); + epsy= MAX2(epsy, 2.0f / height); + + if(sc->flag&SC_SHOW_MARKER_SEARCH) + if(mouse_on_rect(co, marker->pos, track->search_min, track->search_max, epsx, epsy)) + return TRACK_AREA_SEARCH; + + if((marker->flag&MARKER_DISABLED)==0) { + if(sc->flag&SC_SHOW_MARKER_PATTERN) + if(mouse_on_rect(co, marker->pos, track->pat_min, track->pat_max, epsx, epsy)) + return TRACK_AREA_PAT; + + epsx= 12.0f/width; + epsy= 12.0f/height; + + if(fabsf(co[0]-marker->pos[0]-track->offset[0])< epsx && fabsf(co[1]-marker->pos[1]-track->offset[1])<=epsy) + return TRACK_AREA_POINT; + } + + return TRACK_AREA_NONE; +} + +static float dist_to_rect(float co[2], float pos[2], float min[2], float max[2]) +{ + float d1, d2, d3, d4; + float p[2]= {co[0]-pos[0], co[1]-pos[1]}; + float v1[2]= {min[0], min[1]}, v2[2]= {max[0], min[1]}, + v3[2]= {max[0], max[1]}, v4[2]= {min[0], max[1]}; + + d1= dist_to_line_segment_v2(p, v1, v2); + d2= dist_to_line_segment_v2(p, v2, v3); + d3= dist_to_line_segment_v2(p, v3, v4); + d4= dist_to_line_segment_v2(p, v4, v1); + + return MIN4(d1, d2, d3, d4); +} + +static MovieTrackingTrack *find_nearest_track(SpaceClip *sc, MovieClip *clip, float co[2]) +{ + MovieTrackingTrack *track= NULL, *cur; + float mindist= 0.0f; + + cur= clip->tracking.tracks.first; + while(cur) { + MovieTrackingMarker *marker= BKE_tracking_get_marker(cur, sc->user.framenr); + + if(((cur->flag&TRACK_HIDDEN)==0) && MARKER_VISIBLE(sc, marker)) { + float dist, d1, d2=FLT_MAX, d3=FLT_MAX; + + d1= sqrtf((co[0]-marker->pos[0]-cur->offset[0])*(co[0]-marker->pos[0]-cur->offset[0])+ + (co[1]-marker->pos[1]-cur->offset[1])*(co[1]-marker->pos[1]-cur->offset[1])); /* distance to marker point */ + + /* distance to pattern boundbox */ + if(sc->flag&SC_SHOW_MARKER_PATTERN) + d2= dist_to_rect(co, marker->pos, cur->pat_min, cur->pat_max); + + /* distance to search boundbox */ + if(sc->flag&SC_SHOW_MARKER_SEARCH) + d3= dist_to_rect(co, marker->pos, cur->search_min, cur->search_max); + + /* choose minimal distance. useful for cases of overlapped markers. */ + dist= MIN3(d1, d2, d3); + + if(track==NULL || dist<mindist) { + track= cur; + mindist= dist; + } + } + + cur= cur->next; + } + + return track; +} + +static int mouse_select(bContext *C, float co[2], int extend) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *act_track= tracking->act_track; + MovieTrackingTrack *track= NULL; /* selected marker */ + + track= find_nearest_track(sc, clip, co); + + if(track) { + int area= track_mouse_area(sc, co, track); + + if(!extend || !TRACK_VIEW_SELECTED(sc, track)) + area= TRACK_AREA_ALL; + + if(extend && TRACK_AREA_SELECTED(track, area)) { + if(track==act_track) + BKE_tracking_deselect_track(track, area); + else + clip->tracking.act_track= track; + } else { + if(area==TRACK_AREA_POINT) + area= TRACK_AREA_ALL; + + BKE_tracking_select_track(tracking, track, area, extend); + clip->tracking.act_track= track; + } + } + + if(!extend) { + sc->xlockof= 0.0f; + sc->ylockof= 0.0f; + } + + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL); + + return OPERATOR_FINISHED; +} + +static int select_exec(bContext *C, wmOperator *op) +{ + float co[2]; + int extend; + + RNA_float_get_array(op->ptr, "location", co); + extend= RNA_boolean_get(op->ptr, "extend"); + + return mouse_select(C, co, extend); +} + +static int select_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + float co[2]; + int extend= RNA_boolean_get(op->ptr, "extend"); + + if(!extend) { + SlideMarkerData *slidedata= slide_marker_customdata(C, event); + + if(slidedata) { + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + + clip->tracking.act_track= slidedata->track; + + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL); + + MEM_freeN(slidedata); + + return OPERATOR_PASS_THROUGH; + } + } + + ED_clip_mouse_pos(C, event, co); + RNA_float_set_array(op->ptr, "location", co); + + return select_exec(C, op); +} + +void CLIP_OT_select(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Select"; + ot->description= "Select tracking markers"; + ot->idname= "CLIP_OT_select"; + + /* api callbacks */ + ot->exec= select_exec; + ot->invoke= select_invoke; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_UNDO; + + /* properties */ + RNA_def_boolean(ot->srna, "extend", 0, + "Extend", "Extend selection rather than clearing the existing selection"); + RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, + "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds", -100.0f, 100.0f); +} + +/********************** border select operator *********************/ + +static int border_select_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + rcti rect; + rctf rectf; + int change= 0, mode; + + /* get rectangle from operator */ + rect.xmin= RNA_int_get(op->ptr, "xmin"); + rect.ymin= RNA_int_get(op->ptr, "ymin"); + rect.xmax= RNA_int_get(op->ptr, "xmax"); + rect.ymax= RNA_int_get(op->ptr, "ymax"); + + ED_clip_point_stable_pos(C, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin); + ED_clip_point_stable_pos(C, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax); + + mode= RNA_int_get(op->ptr, "gesture_mode"); + + /* do actual selection */ + track= clip->tracking.tracks.first; + while(track) { + if((track->flag&TRACK_HIDDEN)==0) { + MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr); + + if(MARKER_VISIBLE(sc, marker) && BLI_in_rctf(&rectf, marker->pos[0], marker->pos[1])) { + BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, mode!=GESTURE_MODAL_SELECT); + + change= 1; + } + } + + track= track->next; + } + + if(change) { + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL); + + return OPERATOR_FINISHED; + } + + return OPERATOR_CANCELLED; +} + +void CLIP_OT_select_border(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Border Select"; + ot->description= "Select markers using border selection"; + ot->idname= "CLIP_OT_select_border"; + + /* api callbacks */ + ot->invoke= WM_border_select_invoke; + ot->exec= border_select_exec; + ot->modal= WM_border_select_modal; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + WM_operator_properties_gesture_border(ot, FALSE); +} + +/********************** circle select operator *********************/ + +static int marker_inside_ellipse(MovieTrackingMarker *marker, float offset[2], float ellipse[2]) +{ + /* normalized ellipse: ell[0] = scaleX, ell[1] = scaleY */ + float x, y; + + x= (marker->pos[0] - offset[0])*ellipse[0]; + y= (marker->pos[1] - offset[1])*ellipse[1]; + + return x*x + y*y < 1.0f; +} + +static int circle_select_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + ARegion *ar= CTX_wm_region(C); + MovieTrackingTrack *track; + int x, y, radius, width, height, mode, change= 0; + float zoomx, zoomy, offset[2], ellipse[2]; + + /* get operator properties */ + x= RNA_int_get(op->ptr, "x"); + y= RNA_int_get(op->ptr, "y"); + radius= RNA_int_get(op->ptr, "radius"); + + mode= RNA_int_get(op->ptr, "gesture_mode"); + + /* compute ellipse and position in unified coordinates */ + ED_space_clip_size(sc, &width, &height); + ED_space_clip_zoom(sc, ar, &zoomx, &zoomy); + + ellipse[0]= width*zoomx/radius; + ellipse[1]= height*zoomy/radius; + + ED_clip_point_stable_pos(C, x, y, &offset[0], &offset[1]); + + /* do selection */ + track= clip->tracking.tracks.first; + while(track) { + if((track->flag&TRACK_HIDDEN)==0) { + MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr); + + if(MARKER_VISIBLE(sc, marker) && marker_inside_ellipse(marker, offset, ellipse)) { + BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, mode!=GESTURE_MODAL_SELECT); + + change= 1; + } + } + + track= track->next; + } + + if(change) { + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL); + + return OPERATOR_FINISHED; + } + + return OPERATOR_CANCELLED; +} + +void CLIP_OT_select_circle(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Circle Select"; + ot->description= "Select markers using circle selection"; + ot->idname= "CLIP_OT_select_circle"; + + /* api callbacks */ + ot->invoke= WM_gesture_circle_invoke; + ot->modal= WM_gesture_circle_modal; + ot->exec= circle_select_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "y", 0, INT_MIN, INT_MAX, "Y", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "radius", 0, INT_MIN, INT_MAX, "Radius", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX); +} + +/********************** select all operator *********************/ + +static int select_all_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track= NULL; /* selected track */ + int action= RNA_enum_get(op->ptr, "action"); + int framenr= sc->user.framenr; + int has_selection= 0; + + if(action == SEL_TOGGLE){ + action= SEL_SELECT; + track= clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track)) { + action= SEL_DESELECT; + break; + } + + track= track->next; + } + } + + track= clip->tracking.tracks.first; + while(track) { + if((track->flag&TRACK_HIDDEN)==0) { + MovieTrackingMarker *marker= BKE_tracking_get_marker(track, framenr); + + if(marker && MARKER_VISIBLE(sc, marker)) { + switch (action) { + case SEL_SELECT: + track->flag|= SELECT; + track->pat_flag|= SELECT; + track->search_flag|= SELECT; + break; + case SEL_DESELECT: + track->flag&= ~SELECT; + track->pat_flag&= ~SELECT; + track->search_flag&= ~SELECT; + break; + case SEL_INVERT: + track->flag^= SELECT; + track->pat_flag^= SELECT; + track->search_flag^= SELECT; + break; + } + } + } + + if(TRACK_VIEW_SELECTED(sc, track)) + has_selection= 1; + + track= track->next; + } + + if(!has_selection) + sc->flag&= ~SC_LOCK_SELECTION; + + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_select_all(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Select or Deselect All"; + ot->description= "Change selection of all tracking markers"; + ot->idname= "CLIP_OT_select_all"; + + /* api callbacks */ + ot->exec= select_all_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + WM_operator_properties_select_all(ot); +} + +/********************** select grouped operator *********************/ + +static int select_groped_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + MovieTrackingMarker *marker; + int group= RNA_enum_get(op->ptr, "group"); + + track= clip->tracking.tracks.first; + while(track) { + int ok= 0; + + marker= BKE_tracking_get_marker(track, sc->user.framenr); + + if(group==0) { /* Keyframed */ + ok= marker->framenr==sc->user.framenr && (marker->flag&MARKER_TRACKED)==0; + } + else if(group==1) { /* Estimated */ + ok= marker->framenr!=sc->user.framenr; + } + else if(group==2) { /* tracked */ + ok= marker->framenr==sc->user.framenr && (marker->flag&MARKER_TRACKED); + } + else if(group==3) { /* locked */ + ok= track->flag&TRACK_LOCKED; + } + else if(group==4) { /* disabled */ + ok= marker->flag&MARKER_DISABLED; + } + else if(group==5) { /* color */ + if(clip->tracking.act_track) { + ok= (track->flag&TRACK_CUSTOMCOLOR) == (clip->tracking.act_track->flag&TRACK_CUSTOMCOLOR); + + if(ok && track->flag&TRACK_CUSTOMCOLOR) + ok= equals_v3v3(track->color, clip->tracking.act_track->color); + } + } + else if(group==6) { /* failed */ + ok= (track->flag&TRACK_HAS_BUNDLE) == 0; + } + + if(ok) { + track->flag|= SELECT; + if(sc->flag&SC_SHOW_MARKER_PATTERN) track->pat_flag|= SELECT;; + if(sc->flag&SC_SHOW_MARKER_SEARCH) track->search_flag|= SELECT;; + } + + track= track->next; + } + + WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_select_grouped(wmOperatorType *ot) +{ + static EnumPropertyItem select_group_items[] = { + {0, "KEYFRAMED", 0, "Keyframed tracks", "Select all keyframed tracks"}, + {1, "ESTIMATED", 0, "Estimated tracks", "Select all estimated tracks"}, + {2, "TRACKED", 0, "Tracked tracks", "Select all tracked tracks"}, + {3, "LOCKED", 0, "Locked tracks", "Select all locked tracks"}, + {4, "DISABLED", 0, "Disabled tracks", "Select all disabled tracks"}, + {5, "COLOR", 0, "Tracks with same color", "Select all tracks with same color as actiev track"}, + {6, "FAILED", 0, "Failed Tracks", "Select all tracks which failed to be reconstructed"}, + {0, NULL, 0, NULL, NULL} + }; + + /* identifiers */ + ot->name= "Select Grouped"; + ot->description= "Joint Selected Tracks"; + ot->idname= "CLIP_OT_select_grouped"; + + /* api callbacks */ + ot->exec= select_groped_exec; + ot->poll= space_clip_frame_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* proeprties */ + RNA_def_enum(ot->srna, "group", select_group_items, TRACK_CLEAR_REMAINED, "Action", "Clear action to execute"); +} + +/********************** track operator *********************/ + +typedef struct TrackMarkersJob { + struct MovieTrackingContext *context; /* tracking context */ + int sfra, efra, lastfra; /* Start, end and recently tracked frames */ + int backwards; /* Backwards tracking flag */ + MovieClip *clip; /* Clip which is tracking */ + float delay; /* Delay in milliseconds to allow tracking at fixed FPS */ + + struct Main *main; + struct Scene *scene; + struct bScreen *screen; +} TrackMarkersJob; + +static int track_markers_testbreak(void) +{ + return G.afbreek; +} + +static int track_count_markers(SpaceClip *sc, MovieClip *clip) +{ + int tot= 0; + MovieTrackingTrack *track; + + track= clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) + tot++; + + track= track->next; + } + + return tot; +} + +static void track_init_markers(SpaceClip *sc, MovieClip *clip) +{ + MovieTrackingTrack *track; + int framenr= sc->user.framenr, hidden= 0; + + if((sc->flag&SC_SHOW_MARKER_PATTERN)==0) hidden|= TRACK_AREA_PAT; + if((sc->flag&SC_SHOW_MARKER_SEARCH)==0) hidden|= TRACK_AREA_SEARCH; + + track= clip->tracking.tracks.first; + while(track) { + if(hidden) + BKE_tracking_track_flag(track, hidden, SELECT, 1); + + if(TRACK_SELECTED(track)) { + if((track->flag&TRACK_HIDDEN)==0 && (track->flag&TRACK_LOCKED)==0) + BKE_tracking_ensure_marker(track, framenr); + } + + track= track->next; + } +} + +static int track_markers_check_direction(int backwards, int curfra, int efra) +{ + if(backwards) { + if(curfra<efra) return 0; + } + else { + if(curfra>efra) return 0; + } + + return 1; +} + +static int track_markers_initjob(bContext *C, TrackMarkersJob *tmj, int backwards) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + Scene *scene= CTX_data_scene(C); + MovieTrackingSettings *settings= &clip->tracking.settings; + + tmj->sfra= sc->user.framenr; + tmj->clip= clip; + tmj->backwards= backwards; + + if(backwards) tmj->efra= SFRA; + else tmj->efra= EFRA; + + /* limit frames to be tracked by user setting */ + if(settings->frames_limit) { + if(backwards) tmj->efra= MAX2(tmj->efra, tmj->sfra-settings->frames_limit); + else tmj->efra= MIN2(tmj->efra, tmj->sfra+settings->frames_limit); + } + + if(settings->speed!=TRACKING_SPEED_FASTEST) { + tmj->delay= 1.0f/scene->r.frs_sec*1000.0f; + + if(settings->speed==TRACKING_SPEED_HALF) tmj->delay*= 2; + else if(settings->speed==TRACKING_SPEED_QUARTER) tmj->delay*= 4; + else if(settings->speed==TRACKING_SPEED_DOUBLE) tmj->delay/= 2; + } + + track_init_markers(sc, clip); + + tmj->context= BKE_tracking_context_new(clip, &sc->user, backwards, 1); + + clip->tracking_context= tmj->context; + + tmj->lastfra= tmj->sfra; + + /* XXX: silly to store this, but this data is needed to update scene and movieclip + frame numbers when tracking is finished. This introduces better feedback for artists. + Maybe there's another way to solve this problem, but can't think better way atm. + Anyway, this way isn't more unstable as animation rendering animation + which uses the same approach (except storing screen). */ + tmj->scene= scene; + tmj->main= CTX_data_main(C); + tmj->screen= CTX_wm_screen(C); + + return track_markers_check_direction(backwards, tmj->sfra, tmj->efra); +} + +static void track_markers_startjob(void *tmv, short *stop, short *do_update, float *progress) +{ + TrackMarkersJob *tmj= (TrackMarkersJob *)tmv; + int framenr= tmj->sfra; + //double t= PIL_check_seconds_timer(); + + while(framenr != tmj->efra) { + if(tmj->delay>0) { + /* tracking should happen with fixed fps. Calculate time + using current timer value before tracking frame and after. + + Small (and maybe unneeded optimization): do not calculate exec_time + for "Fastest" tracking */ + + double start_time= PIL_check_seconds_timer(), exec_time; + + if(!BKE_tracking_next(tmj->context)) + break; + + exec_time= PIL_check_seconds_timer()-start_time; + if(tmj->delay>exec_time) + PIL_sleep_ms(tmj->delay-exec_time); + } else if(!BKE_tracking_next(tmj->context)) + break; + + *do_update= 1; + *progress=(float)(framenr-tmj->sfra) / (tmj->efra-tmj->sfra); + + if(tmj->backwards) framenr--; + else framenr++; + + tmj->lastfra= framenr; + + if(*stop || track_markers_testbreak()) + break; + } + + //printf("Tracking time: %lf\n", PIL_check_seconds_timer()-t); +} + +static void track_markers_updatejob(void *tmv) +{ + TrackMarkersJob *tmj= (TrackMarkersJob *)tmv; + + BKE_tracking_sync(tmj->context); +} + +static void track_markers_freejob(void *tmv) +{ + TrackMarkersJob *tmj= (TrackMarkersJob *)tmv; + + tmj->clip->tracking_context= NULL; + tmj->scene->r.cfra= tmj->lastfra; + ED_update_for_newframe(tmj->main, tmj->scene, tmj->screen, 0); + + BKE_tracking_sync(tmj->context); + BKE_tracking_context_free(tmj->context); + + MEM_freeN(tmj); + + WM_main_add_notifier(NC_SCENE|ND_FRAME, tmj->scene); +} + +static int track_markers_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + Scene *scene= CTX_data_scene(C); + struct MovieTrackingContext *context; + int framenr= sc->user.framenr; + int sfra= framenr, efra; + int backwards= RNA_boolean_get(op->ptr, "backwards"); + int sequence= RNA_boolean_get(op->ptr, "sequence"); + MovieTrackingSettings *settings= &clip->tracking.settings; + + if(track_count_markers(sc, clip)==0) + return OPERATOR_CANCELLED; + + if(backwards) efra= SFRA; + else efra= EFRA; + + /* limit frames to be tracked by user setting */ + if(settings->frames_limit) { + if(backwards) efra= MAX2(efra, sfra-settings->frames_limit); + else efra= MIN2(efra, sfra+settings->frames_limit); + } + + if(!track_markers_check_direction(backwards, framenr, efra)) + return OPERATOR_CANCELLED; + + track_init_markers(sc, clip); + + /* do not disable tracks due to threshold when tracking frame-by-frame */ + context= BKE_tracking_context_new(clip, &sc->user, backwards, sequence); + + while(framenr != efra) { + if(!BKE_tracking_next(context)) + break; + + if(backwards) framenr--; + else framenr++; + + if(!sequence) + break; + } + + BKE_tracking_sync(context); + BKE_tracking_context_free(context); + + /* update scene current frame to the lastes tracked frame */ + scene->r.cfra= framenr; + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip); + WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); + + return OPERATOR_FINISHED; +} + +static int track_markers_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +{ + TrackMarkersJob *tmj; + ScrArea *sa= CTX_wm_area(C); + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + wmJob *steve; + int backwards= RNA_boolean_get(op->ptr, "backwards"); + int sequence= RNA_boolean_get(op->ptr, "sequence"); + + if(clip->tracking_context) + return OPERATOR_CANCELLED; + + if(track_count_markers(sc, clip)==0) + return OPERATOR_CANCELLED; + + if(!sequence) + return track_markers_exec(C, op); + + tmj= MEM_callocN(sizeof(TrackMarkersJob), "TrackMarkersJob data"); + if(!track_markers_initjob(C, tmj, backwards)) { + track_markers_freejob(tmj); + + return OPERATOR_CANCELLED; + } + + /* setup job */ + steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa, "Track Markers", WM_JOB_PROGRESS); + WM_jobs_customdata(steve, tmj, track_markers_freejob); + + /* if there's delay set in tracking job, tracking should happen + with fixed FPS. To deal with editor refresh we have to syncronize + tracks from job and tracks in clip. Do this in timer callback + to prevent threading conflicts. */ + if(tmj->delay>0) WM_jobs_timer(steve, tmj->delay/1000.0f, NC_MOVIECLIP|NA_EVALUATED, 0); + else WM_jobs_timer(steve, 0.2, NC_MOVIECLIP|NA_EVALUATED, 0); + + WM_jobs_callbacks(steve, track_markers_startjob, NULL, track_markers_updatejob, NULL); + + G.afbreek= 0; + + WM_jobs_start(CTX_wm_manager(C), steve); + WM_cursor_wait(0); + + /* add modal handler for ESC */ + WM_event_add_modal_handler(C, op); + + return OPERATOR_RUNNING_MODAL; +} + +static int track_markers_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +{ + /* no running blender, remove handler and pass through */ + if(0==WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C))) + return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; + + /* running tracking */ + switch (event->type) { + case ESCKEY: + return OPERATOR_RUNNING_MODAL; + break; + } + + return OPERATOR_PASS_THROUGH; +} + +void CLIP_OT_track_markers(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Track Markers"; + ot->description= "Track selected markers"; + ot->idname= "CLIP_OT_track_markers"; + + /* api callbacks */ + ot->exec= track_markers_exec; + ot->invoke= track_markers_invoke; + ot->poll= space_clip_frame_poll; + ot->modal= track_markers_modal; + + /* flags */ + ot->flag= OPTYPE_UNDO; + + /* properties */ + RNA_def_boolean(ot->srna, "backwards", 0, "Backwards", "Do backwards tracking"); + RNA_def_boolean(ot->srna, "sequence", 0, "Track Sequence", "Track marker during image sequence rather than single image"); +} + +/********************** solve camera operator *********************/ + +static int check_solve_track_count(MovieTracking *tracking) +{ + int tot= 0; + int frame1= tracking->settings.keyframe1, frame2= tracking->settings.keyframe2; + MovieTrackingTrack *track; + + track= tracking->tracks.first; + while(track) { + if(BKE_tracking_has_marker(track, frame1)) + if(BKE_tracking_has_marker(track, frame2)) + tot++; + + track= track->next; + } + + return tot>=8; +} + +static int solve_camera_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + Scene *scene= CTX_data_scene(C); + MovieTracking *tracking= &clip->tracking; + int width, height; + float error; + + if(!check_solve_track_count(tracking)) { + BKE_report(op->reports, RPT_ERROR, "At least 8 tracks on both of keyframes are needed for reconstruction"); + return OPERATOR_CANCELLED; + } + + /* could fail if footage uses images with different sizes */ + BKE_movieclip_get_size(clip, NULL, &width, &height); + + error= BKE_tracking_solve_reconstruction(tracking, width, height); + + if(error<0) + BKE_report(op->reports, RPT_WARNING, "Some data failed to reconstruct, see console for details"); + else + BKE_reportf(op->reports, RPT_INFO, "Average reprojection error %.3f", error); + + scene->clip= clip; + id_us_plus(&clip->id); + + if(!scene->camera) + scene->camera= scene_find_camera(scene); + + if(scene->camera) { + /* set blender camera focal length so result would look fine there */ + Camera *camera= (Camera*)scene->camera->data; + + BKE_tracking_camera_to_blender(tracking, scene, camera, width, height); + + WM_event_add_notifier(C, NC_OBJECT, camera); + } + + DAG_id_tag_update(&clip->id, 0); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip); + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); + + /* update active clip displayed in scene buttons */ + WM_event_add_notifier(C, NC_SCENE, scene); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_solve_camera(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Solve Camera"; + ot->description= "Solve camera motion from tracks"; + ot->idname= "CLIP_OT_solve_camera"; + + /* api callbacks */ + ot->exec= solve_camera_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** clear solution operator *********************/ + +static int clear_solution_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *track= tracking->tracks.first; + + while(track) { + track->flag&= ~TRACK_HAS_BUNDLE; + + track= track->next; + } + + if(tracking->reconstruction.cameras) + MEM_freeN(tracking->reconstruction.cameras); + + tracking->reconstruction.cameras= NULL; + tracking->reconstruction.camnr= 0; + + tracking->reconstruction.flag&= ~TRACKING_RECONSTRUCTED; + + DAG_id_tag_update(&clip->id, 0); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_clear_solution(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Clear Solution"; + ot->description= "Clear all calculated data"; + ot->idname= "CLIP_OT_clear_solution"; + + /* api callbacks */ + ot->exec= clear_solution_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** clear track operator *********************/ + +static int clear_track_path_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + int action= RNA_enum_get(op->ptr, "action"); + + track= clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track)) + BKE_tracking_clear_path(track, sc->user.framenr, action); + + track= track->next; + } + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_clear_track_path(wmOperatorType *ot) +{ + static EnumPropertyItem clear_path_actions[] = { + {TRACK_CLEAR_UPTO, "UPTO", 0, "Clear up-to", "Clear path up to current frame"}, + {TRACK_CLEAR_REMAINED, "REMAINED", 0, "Clear remained", "Clear path at remained frames (after current)"}, + {TRACK_CLEAR_ALL, "ALL", 0, "Clear all", "Clear the whole path"}, + {0, NULL, 0, NULL, NULL} + }; + + /* identifiers */ + ot->name= "Clear Track Path"; + ot->description= "Clear path of selected tracks"; + ot->idname= "CLIP_OT_clear_track_path"; + + /* api callbacks */ + ot->exec= clear_track_path_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* proeprties */ + RNA_def_enum(ot->srna, "action", clear_path_actions, TRACK_CLEAR_REMAINED, "Action", "Clear action to execute"); +} + +/********************** disable markers operator *********************/ + +static int disable_markers_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *track= tracking->tracks.first; + int action= RNA_enum_get(op->ptr, "action"); + + while(track) { + if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) { + MovieTrackingMarker *marker= BKE_tracking_ensure_marker(track, sc->user.framenr); + + if(action==0) marker->flag|= MARKER_DISABLED; + else if(action==1) marker->flag&= ~MARKER_DISABLED; + else marker->flag^= MARKER_DISABLED; + } + + track= track->next; + } + + DAG_id_tag_update(&clip->id, 0); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_disable_markers(wmOperatorType *ot) +{ + static EnumPropertyItem actions_items[] = { + {0, "DISABLE", 0, "Disable", "Disable selected markers"}, + {1, "ENABLE", 0, "Enable", "Enable selected markers"}, + {2, "TOGGLE", 0, "Toggle", "Toggle disabled flag for selected markers"}, + {0, NULL, 0, NULL, NULL} + }; + + /* identifiers */ + ot->name= "Disable Markers"; + ot->description= "Disable/enable selected markers"; + ot->idname= "CLIP_OT_disable_markers"; + + /* api callbacks */ + ot->exec= disable_markers_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_enum(ot->srna, "action", actions_items, 0, "Action", "Disable action to execute"); +} + +/********************** set origin operator *********************/ + +static int count_selected_bundles(bContext *C) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + int tot= 0; + + track= clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_HAS_BUNDLE)) + tot++; + + track= track->next; + } + + return tot; +} + +static int set_origin_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + Scene *scene= CTX_data_scene(C); + Object *parent= scene->camera; + float mat[4][4], vec[3]; + + if(count_selected_bundles(C)!=1) { + BKE_report(op->reports, RPT_ERROR, "Track with bundle should be selected to define origin position"); + return OPERATOR_CANCELLED; + } + + if(scene->camera->parent) + parent= scene->camera->parent; + + track= clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track)) + break; + + track= track->next; + } + + BKE_get_tracking_mat(scene, NULL, mat); + mul_v3_m4v3(vec, mat, track->bundle_pos); + + sub_v3_v3(parent->loc, vec); + + DAG_id_tag_update(&clip->id, 0); + DAG_id_tag_update(&parent->id, OB_RECALC_OB); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip); + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_set_origin(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Set Origin"; + ot->description= "Set active marker as origin by moving camera (or it's parent if present) in 3d space"; + ot->idname= "CLIP_OT_set_origin"; + + /* api callbacks */ + ot->exec= set_origin_exec; + ot->poll= space_clip_frame_camera_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** set floor operator *********************/ + +static void set_axis(Scene *scene, Object *ob, MovieTrackingTrack *track, char axis) +{ + float mat[4][4], vec[3], obmat[4][4]; + + BKE_get_tracking_mat(scene, NULL, mat); + mul_v3_m4v3(vec, mat, track->bundle_pos); + + if(len_v2(vec)<1e-3) + return; + + unit_m4(mat); + + if(axis=='X') { + if(fabsf(vec[1])<1e-3) { + mat[0][0]= -1.0f; mat[0][1]= 0.0f; mat[0][2]= 0.0f; + mat[1][0]= 0.0f; mat[1][1]= -1.0f; mat[1][2]= 0.0f; + mat[2][0]= 0.0f; mat[2][1]= 0.0f; mat[2][2]= 1.0f; + } else { + copy_v3_v3(mat[0], vec); + mat[0][2]= 0.0f; + mat[2][0]= 0.0f; mat[2][1]= 0.0f; mat[2][2]= 1.0f; + cross_v3_v3v3(mat[1], mat[2], mat[0]); + } + } else { + if(fabsf(vec[0])<1e-3) { + mat[0][0]= -1.0f; mat[0][1]= 0.0f; mat[0][2]= 0.0f; + mat[1][0]= 0.0f; mat[1][1]= -1.0f; mat[1][2]= 0.0f; + mat[2][0]= 0.0f; mat[2][1]= 0.0f; mat[2][2]= 1.0f; + } else { + copy_v3_v3(mat[1], vec); + mat[1][2]= 0.0f; + mat[2][0]= 0.0f; mat[2][1]= 0.0f; mat[2][2]= 1.0f; + cross_v3_v3v3(mat[0], mat[1], mat[2]); + } + } + + normalize_v3(mat[0]); + normalize_v3(mat[1]); + normalize_v3(mat[2]); + + invert_m4(mat); + + object_to_mat4(ob, obmat); + mul_m4_m4m4(mat, obmat, mat); + object_apply_mat4(ob, mat, 0, 0); +} + +static int set_floor_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + Scene *scene= CTX_data_scene(C); + MovieTrackingTrack *track, *axis_track= NULL; + Object *camera= scene->camera; + Object *parent= camera; + int tot= 0; + float vec[3][3], mat[4][4], obmat[4][4], newmat[4][4], orig[3]= {0.0f, 0.0f, 0.0f}; + float rot[4][4]={{0.0f, 0.0f, -1.0f, 0.0f}, + {0.0f, 1.0f, 0.0f, 0.0f}, + {1.0f, 0.0f, 0.0f, 0.0f}, + {0.0f, 0.0f, 0.0f, 1.0f}}; /* 90 degrees Y-axis rotation matrix */ + + if(count_selected_bundles(C)!=3) { + BKE_report(op->reports, RPT_ERROR, "Three tracks with bundles are needed to orient the floor"); + return OPERATOR_CANCELLED; + } + + if(scene->camera->parent) + parent= scene->camera->parent; + + BKE_get_tracking_mat(scene, NULL, mat); + + /* get 3 bundles to use as reference */ + track= clip->tracking.tracks.first; + while(track && tot<3) { + if(track->flag&TRACK_HAS_BUNDLE && TRACK_VIEW_SELECTED(sc, track)) { + mul_v3_m4v3(vec[tot], mat, track->bundle_pos); + + if(tot==0 || track==clip->tracking.act_track) + copy_v3_v3(orig, vec[tot]); + else + axis_track= track; + + tot++; + } + + track= track->next; + } + + sub_v3_v3(vec[1], vec[0]); + sub_v3_v3(vec[2], vec[0]); + + /* construct ortho-normal basis */ + unit_m4(mat); + + cross_v3_v3v3(mat[0], vec[1], vec[2]); + copy_v3_v3(mat[1], vec[1]); + cross_v3_v3v3(mat[2], mat[0], mat[1]); + + normalize_v3(mat[0]); + normalize_v3(mat[1]); + normalize_v3(mat[2]); + + /* move to origin point */ + mat[3][0]= orig[0]; + mat[3][1]= orig[1]; + mat[3][2]= orig[2]; + + invert_m4(mat); + + object_to_mat4(parent, obmat); + mul_m4_m4m4(mat, obmat, mat); + mul_m4_m4m4(newmat, mat, rot); + object_apply_mat4(parent, newmat, 0, 0); + + /* make camera have positive z-coordinate */ + mul_v3_m4v3(vec[0], mat, camera->loc); + if(camera->loc[2]<0) { + invert_m4(rot); + mul_m4_m4m4(newmat, mat, rot); + object_apply_mat4(camera, newmat, 0, 0); + } + + where_is_object(scene, parent); + set_axis(scene, parent, axis_track, 'X'); + + DAG_id_tag_update(&clip->id, 0); + DAG_id_tag_update(&parent->id, OB_RECALC_OB); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip); + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_set_floor(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Set Floor"; + ot->description= "Set floor based on 3 selected bundles by moving camera (or it's parent if present) in 3d space"; + ot->idname= "CLIP_OT_set_floor"; + + /* api callbacks */ + ot->exec= set_floor_exec; + ot->poll= space_clip_camera_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** set axis operator *********************/ + +static int set_axis_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + Scene *scene= CTX_data_scene(C); + Object *parent= scene->camera; + int axis= RNA_enum_get(op->ptr, "axis"); + + if(count_selected_bundles(C)!=1) { + BKE_report(op->reports, RPT_ERROR, "Single track with bundle should be selected to define axis"); + + return OPERATOR_CANCELLED; + } + + if(scene->camera->parent) + parent= scene->camera->parent; + + track= clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track)) + break; + + track= track->next; + } + + set_axis(scene, parent, track, axis==0?'X':'Y'); + + DAG_id_tag_update(&clip->id, 0); + DAG_id_tag_update(&parent->id, OB_RECALC_OB); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip); + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_set_axis(wmOperatorType *ot) +{ + static EnumPropertyItem axis_actions[] = { + {0, "X", 0, "X", "Align bundle align X axis"}, + {1, "Y", 0, "Y", "Align bundle align Y axis"}, + {0, NULL, 0, NULL, NULL} + }; + + /* identifiers */ + ot->name= "Set Axis"; + ot->description= "Set direction of scene axis rotating camera (or it's parent if present) and assuming selected track lies on real axis joining it with the origin"; + ot->idname= "CLIP_OT_set_axis"; + + /* api callbacks */ + ot->exec= set_axis_exec; + ot->poll= space_clip_frame_camera_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_enum(ot->srna, "axis", axis_actions, 0, "Axis", "Axis to use to align bundle along"); +} + +/********************** set scale operator *********************/ + +static int set_scale_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + Scene *scene= CTX_data_scene(C); + Object *parent= scene->camera; + int tot= 0; + float vec[2][3], mat[4][4], scale; + float dist= RNA_float_get(op->ptr, "distance"); + + if(count_selected_bundles(C)!=2) { + BKE_report(op->reports, RPT_ERROR, "Two tracks with bundles should be selected to scale scene"); + + return OPERATOR_CANCELLED; + } + + if(scene->camera->parent) + parent= scene->camera->parent; + + BKE_get_tracking_mat(scene, NULL, mat); + + track= clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track)) { + mul_v3_m4v3(vec[tot], mat, track->bundle_pos); + tot++; + } + + track= track->next; + } + + sub_v3_v3(vec[0], vec[1]); + + if(len_v3(vec[0])>1e-5) { + scale= dist / len_v3(vec[0]); + + mul_v3_fl(parent->size, scale); + mul_v3_fl(parent->loc, scale); + + DAG_id_tag_update(&clip->id, 0); + DAG_id_tag_update(&parent->id, OB_RECALC_OB); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip); + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); + } + + return OPERATOR_FINISHED; +} + +static int set_scale_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + float dist= RNA_float_get(op->ptr, "distance"); + + if(dist==0.0f) + RNA_float_set(op->ptr, "distance", clip->tracking.settings.dist); + + return set_scale_exec(C, op); +} + +void CLIP_OT_set_scale(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Set Scale"; + ot->description= "Set scale of scene by scaling camera (or it's parent if present)"; + ot->idname= "CLIP_OT_set_scale"; + + /* api callbacks */ + ot->exec= set_scale_exec; + ot->invoke= set_scale_invoke; + ot->poll= space_clip_frame_camera_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_float(ot->srna, "distance", 0.0f, -FLT_MAX, FLT_MAX, + "Distance", "Distance between selected tracks", -100.0f, 100.0f); +} + +/********************** set principal center operator *********************/ + +static int set_center_principal_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + int width, height; + + BKE_movieclip_get_size(clip, &sc->user, &width, &height); + + if(width==0 || height==0) + return OPERATOR_CANCELLED; + + clip->tracking.camera.principal[0]= ((float)width)/2.0f; + clip->tracking.camera.principal[1]= ((float)height)/2.0f; + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_set_center_principal(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Set Principal to Center"; + ot->description= "Set principal point to center of footage"; + ot->idname= "CLIP_OT_set_center_principal"; + + /* api callbacks */ + ot->exec= set_center_principal_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** hide tracks operator *********************/ + +static int hide_tracks_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + int unselected; + + unselected= RNA_boolean_get(op->ptr, "unselected"); + + track= clip->tracking.tracks.first; + while(track) { + if(unselected==0 && TRACK_VIEW_SELECTED(sc, track)) { + track->flag|= TRACK_HIDDEN; + } else if(unselected==1 && !TRACK_VIEW_SELECTED(sc, track)) { + track->flag|= TRACK_HIDDEN; + } + + track= track->next; + } + + if(clip->tracking.act_track && clip->tracking.act_track->flag&TRACK_HIDDEN) + clip->tracking.act_track= NULL; + + if(unselected==0) { + /* no selection on screen now, unlock view so it can be scrolled nice again */ + sc->flag&= ~SC_LOCK_SELECTION; + } + + WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, NULL); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_hide_tracks(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Hide Tracks"; + ot->description= "Hide selected tracks"; + ot->idname= "CLIP_OT_hide_tracks"; + + /* api callbacks */ + ot->exec= hide_tracks_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected tracks"); +} + +/********************** hide tracks clear operator *********************/ + +static int hide_tracks_clear_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + + track= clip->tracking.tracks.first; + while(track) { + track->flag&= ~TRACK_HIDDEN; + + track= track->next; + } + + WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, NULL); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_hide_tracks_clear(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Hide Tracks Clear"; + ot->description= "Clear hide selected tracks"; + ot->idname= "CLIP_OT_hide_tracks_clear"; + + /* api callbacks */ + ot->exec= hide_tracks_clear_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** detect features operator *********************/ + +static bGPDlayer *detect_get_layer(MovieClip *clip) +{ + bGPDlayer *layer; + + if(!clip->gpd) + return NULL; + + layer= clip->gpd->layers.first; + while(layer) { + if(layer->flag&GP_LAYER_ACTIVE) + return layer; + + layer= layer->next; + } + + return NULL; +} + +static int detect_features_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + ImBuf *ibuf= BKE_movieclip_get_ibuf_flag(clip, &sc->user, 0); + MovieTrackingTrack *track= clip->tracking.tracks.first; + int placement= RNA_enum_get(op->ptr, "placement"); + int margin= RNA_int_get(op->ptr, "margin"); + int min_trackness= RNA_int_get(op->ptr, "min_trackness"); + int min_distance= RNA_int_get(op->ptr, "min_distance"); + int place_outside_layer= 0; + bGPDlayer *layer= NULL; + + if(placement!=0) { + layer= detect_get_layer(clip); + place_outside_layer= placement==2; + } + + /* deselect existing tracks */ + while(track) { + track->flag&= ~SELECT; + track->pat_flag&= ~SELECT; + track->search_flag&= ~SELECT; + + track= track->next; + } + + BKE_tracking_detect_fast(&clip->tracking, ibuf, sc->user.framenr, margin, min_trackness, min_distance, layer, place_outside_layer); + + IMB_freeImBuf(ibuf); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, NULL); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_detect_features(wmOperatorType *ot) +{ + static EnumPropertyItem placement_items[] = { + {0, "FRAME", 0, "Whole Frame", "Place markers across the whole frame"}, + {1, "INSIDE_GPENCIL", 0, "Inside grease pencil", "Place markers only inside areas oulined with grease pencil"}, + {2, "OUTSIDE_GPENCIL", 0, "Outside grease pencil", "Place markers only outside areas oulined with grease pencil"}, + {0, NULL, 0, NULL, NULL} + }; + + /* identifiers */ + ot->name= "Detect Features"; + ot->description= "Automatically detect features to track"; + ot->idname= "CLIP_OT_detect_features"; + + /* api callbacks */ + ot->exec= detect_features_exec; + ot->poll= space_clip_frame_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_enum(ot->srna, "placement", placement_items, 0, "Placement", "Placement for detected features"); + RNA_def_int(ot->srna, "margin", 16, 0, INT_MAX, "Margin", "Only corners further than margin pixels from the image edges are considered", 0, 300); + RNA_def_int(ot->srna, "min_trackness", 16, 0, INT_MAX, "Trackness", "Minimum score to add a corner", 0, 300); + RNA_def_int(ot->srna, "min_distance", 120, 0, INT_MAX, "Distance", "Minimal distance accepted between two corners", 0, 300); +} + +/********************** frame jump operator *********************/ + +static int frame_jump_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + int pos= RNA_enum_get(op->ptr, "position"); + int delta; + + if(pos<=1) { /* jump to path */ + track= clip->tracking.act_track; + + if(!track) + return OPERATOR_CANCELLED; + + delta= pos == 1 ? 1 : -1; + + while(sc->user.framenr+delta >= SFRA && sc->user.framenr+delta <= EFRA) { + MovieTrackingMarker *marker= BKE_tracking_exact_marker(track, sc->user.framenr+delta); + + if(!marker || marker->flag&MARKER_DISABLED) + break; + + sc->user.framenr+= delta; + } + } + else { /* to to failed frame */ + if(clip->tracking.reconstruction.flag&TRACKING_RECONSTRUCTED) { + int a= sc->user.framenr; + MovieTracking *tracking= &clip->tracking; + + delta= pos == 3 ? 1 : -1; + + a+= delta; + + while(a+delta >= SFRA && a+delta <= EFRA) { + MovieReconstructedCamera *cam= BKE_tracking_get_reconstructed_camera(tracking, a); + + if(!cam) { + sc->user.framenr= a; + + break; + } + + a+= delta; + } + } + } + + if(CFRA!=sc->user.framenr) { + CFRA= sc->user.framenr; + sound_seek_scene(CTX_data_main(C), CTX_data_scene(C)); + + WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); + } + + WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, NULL); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_frame_jump(wmOperatorType *ot) +{ + static EnumPropertyItem position_items[] = { + {0, "PATHSTART", 0, "Path Start", "Jump to start of current path"}, + {1, "PATHEND", 0, "Path End", "Jump to end of current path"}, + {2, "FAILEDPREV", 0, "Previons Failed", "Jump to previous failed frame"}, + {2, "FAILNEXT", 0, "Next Failed", "Jump to next failed frame"}, + {0, NULL, 0, NULL, NULL} + }; + + /* identifiers */ + ot->name= "Jump to Frame"; + ot->description= "Jump to special frame"; + ot->idname= "CLIP_OT_frame_jump"; + + /* api callbacks */ + ot->exec= frame_jump_exec; + ot->poll= space_clip_frame_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_enum(ot->srna, "position", position_items, 0, "Position", "Position to jumo to"); +} + +/********************** join tracks operator *********************/ + +static int join_tracks_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *act_track, *track, *next; + + act_track= clip->tracking.act_track; + + if(!act_track) { + BKE_report(op->reports, RPT_ERROR, "No active track to join to"); + return OPERATOR_CANCELLED; + } + + track= clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track) && track!=act_track) { + if(!BKE_tracking_test_join_tracks(act_track, track)) { + BKE_report(op->reports, RPT_ERROR, "Some selected tracks have got keyframed markers to the same frame"); + return OPERATOR_CANCELLED; + } + } + + track= track->next; + } + + track= clip->tracking.tracks.first; + while(track) { + next= track->next; + + if(TRACK_VIEW_SELECTED(sc, track) && track!=act_track) { + BKE_tracking_join_tracks(act_track, track); + + BKE_tracking_free_track(track); + BLI_freelinkN(&clip->tracking.tracks, track); + } + + track= next; + } + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_join_tracks(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Join Tracks"; + ot->description= "Joint Selected Tracks"; + ot->idname= "CLIP_OT_join_tracks"; + + /* api callbacks */ + ot->exec= join_tracks_exec; + ot->poll= space_clip_frame_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** lock tracks operator *********************/ + +static int lock_tracks_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *track= tracking->tracks.first; + int action= RNA_enum_get(op->ptr, "action"); + + while(track) { + if(TRACK_VIEW_SELECTED(sc, track)) { + if(action==0) track->flag|= TRACK_LOCKED; + else if(action==1) track->flag&= ~TRACK_LOCKED; + else track->flag^= TRACK_LOCKED; + } + + track= track->next; + } + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_lock_tracks(wmOperatorType *ot) +{ + static EnumPropertyItem actions_items[] = { + {0, "LOCK", 0, "Lock", "Lock selected tracks"}, + {1, "UNLOCK", 0, "Unlock", "Unlock selected tracks"}, + {2, "TOGGLE", 0, "Toggle", "Toggle locked flag for selected tracks"}, + {0, NULL, 0, NULL, NULL} + }; + + /* identifiers */ + ot->name= "Lock Tracks"; + ot->description= "Lock/unlock selected tracks"; + ot->idname= "CLIP_OT_lock_tracks"; + + /* api callbacks */ + ot->exec= lock_tracks_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_enum(ot->srna, "action", actions_items, 0, "Action", "Lock action to execute"); +} + +/********************** track copy color operator *********************/ + +static int track_copy_color_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track, *act_track= clip->tracking.act_track; + + if(!act_track) + return OPERATOR_CANCELLED; + + track= clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track) && track!=act_track) { + track->flag&= ~TRACK_CUSTOMCOLOR; + + if(act_track->flag&TRACK_CUSTOMCOLOR) { + copy_v3_v3(track->color, act_track->color); + track->flag|= TRACK_CUSTOMCOLOR; + } + } + + track= track->next; + } + + WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_track_copy_color(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Copy Color"; + ot->description= "Copy color to all selected tracks"; + ot->idname= "CLIP_OT_track_copy_color"; + + /* api callbacks */ + ot->exec= track_copy_color_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** add 2d stabilization tracks operator *********************/ + +static int stabilize_2d_add_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *track; + MovieTrackingStabilization *stab= &tracking->stabilization; + int update= 0; + + track= tracking->tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_USE_2D_STAB)==0) { + track->flag|= TRACK_USE_2D_STAB; + stab->tot_track++; + + update= 1; + } + + track= track->next; + } + + if(update) { + stab->ok= 0; + + DAG_id_tag_update(&clip->id, 0); + WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip); + } + + return OPERATOR_FINISHED; +} + +void CLIP_OT_stabilize_2d_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Stabilization Tracks"; + ot->description= "Add selected tracks to 2D stabilization tool"; + ot->idname= "CLIP_OT_stabilize_2d_add"; + + /* api callbacks */ + ot->exec= stabilize_2d_add_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** remove 2d stabilization tracks operator *********************/ + +static int stabilize_2d_remove_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + MovieTrackingStabilization *stab= &tracking->stabilization; + MovieTrackingTrack *track; + int a= 0, update= 0; + + track= tracking->tracks.first; + while(track) { + if(track->flag&TRACK_USE_2D_STAB) { + if(a==stab->act_track) { + track->flag&= ~TRACK_USE_2D_STAB; + + stab->act_track--; + stab->tot_track--; + + if(stab->act_track<0) + stab->act_track= 0; + + update= 1; + + break; + } + + a++; + } + + track= track->next; + } + + if(update) { + stab->ok= 0; + + DAG_id_tag_update(&clip->id, 0); + WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip); + } + + return OPERATOR_FINISHED; +} + +void CLIP_OT_stabilize_2d_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Stabilization Track"; + ot->description= "Remove selected track from stabilization"; + ot->idname= "CLIP_OT_stabilize_2d_remove"; + + /* api callbacks */ + ot->exec= stabilize_2d_remove_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** select 2d stabilization tracks operator *********************/ + +static int stabilize_2d_select_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *track; + int update= 0; + + track= tracking->tracks.first; + while(track) { + if(track->flag&TRACK_USE_2D_STAB) { + BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, 0); + + update= 1; + } + + track= track->next; + } + + if(update) + WM_event_add_notifier(C, NC_MOVIECLIP|ND_SELECT, clip); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_stabilize_2d_select(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Select Stabilization Tracks"; + ot->description= "Select track which are used for stabilization"; + ot->idname= "CLIP_OT_stabilize_2d_select"; + + /* api callbacks */ + ot->exec= stabilize_2d_select_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** set 2d stabilization rotation track operator *********************/ + +static int stabilize_2d_set_rotation_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + + if(tracking->act_track) { + MovieTrackingStabilization *stab= &tracking->stabilization; + + stab->rot_track= tracking->act_track; + stab->ok= 0; + + DAG_id_tag_update(&clip->id, 0); + WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip); + } + + return OPERATOR_FINISHED; +} + +void CLIP_OT_stabilize_2d_set_rotation(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Set Rotation Track"; + ot->description= "Use active track to compensate rotaiton when doing 2D stabilization"; + ot->idname= "CLIP_OT_stabilize_2d_set_rotation"; + + /* api callbacks */ + ot->exec= stabilize_2d_set_rotation_exec; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** clean tracks operator *********************/ + +static int is_track_clean(MovieTrackingTrack *track, int frames, int del) +{ + int ok= 1, a, prev= -1, count= 0; + MovieTrackingMarker *markers= track->markers, *new_markers= NULL; + int start_disabled= 0; + int markersnr= track->markersnr; + + if(del) + new_markers= MEM_callocN(markersnr*sizeof(MovieTrackingMarker), "track cleaned markers"); + + for(a= 0; a<markersnr; a++) { + int end= 0; + + if(prev==-1) { + if((markers[a].flag&MARKER_DISABLED)==0) + prev= a; + else + start_disabled= 1; + } + + if(prev >= 0) { + end= a == markersnr-1; + end|= (a < markersnr-1) && (markers[a].framenr != markers[a+1].framenr-1 || + markers[a].flag&MARKER_DISABLED); + } + + if(end) { + int segok= 1, len= 0; + + if(a != prev && markers[a].framenr != markers[a-1].framenr+1) + len= a-prev; + else if(markers[a].flag&MARKER_DISABLED) + len= a-prev; + else len= a-prev+1; + + if(frames) { + if(len < frames) { + segok= 0; + ok= 0; + + if(!del) + break; + } + } + + if(del) { + if(segok) { + int t= len; + + if(markers[a].flag&MARKER_DISABLED) + t++; + + /* place disabled marker in front of current segment */ + if(start_disabled) { + memcpy(new_markers+count, markers+prev, sizeof(MovieTrackingMarker)); + new_markers[count].framenr--; + new_markers[count].flag|= MARKER_DISABLED; + + count++; + start_disabled= 0; + } + + memcpy(new_markers+count, markers+prev, t*sizeof(MovieTrackingMarker)); + count+= t; + } + else if(markers[a].flag&MARKER_DISABLED) { + /* current segment which would be deleted was finished by disabled marker, + so next segment should be started from disabled marker */ + start_disabled= 1; + } + } + + prev= -1; + } + } + + if(del) { + MEM_freeN(track->markers); + + if(count) { + track->markers= new_markers; + } + else { + track->markers= NULL; + MEM_freeN(new_markers); + } + + track->markersnr= count; + } + + return ok; +} + +static int clean_tracks_exec(bContext *C, wmOperator *op) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *track, *next, *act_track= clip->tracking.act_track; + int frames= RNA_int_get(op->ptr, "frames"); + int action= RNA_enum_get(op->ptr, "action"); + float error= RNA_float_get(op->ptr, "error"); + + if(error && action==TRACKING_CLEAN_DELETE_SEGMENT) + action= TRACKING_CLEAN_DELETE_TRACK; + + track= tracking->tracks.first; + while(track) { + next= track->next; + + if((track->flag&TRACK_HIDDEN)==0 && (track->flag&TRACK_LOCKED)==0) { + int ok= 1; + + ok= (is_track_clean(track, frames, action==TRACKING_CLEAN_DELETE_SEGMENT)) && + (error == 0.0f || (track->flag&TRACK_HAS_BUNDLE)==0 || track->error < error); + + if(!ok) { + if(action==TRACKING_CLEAN_SELECT) { + BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, 0); + } + else if(action==TRACKING_CLEAN_DELETE_TRACK) { + if(track==act_track) + clip->tracking.act_track= NULL; + + BKE_tracking_free_track(track); + BLI_freelinkN(&clip->tracking.tracks, track); + track= NULL; + } + + /* happens when all tracking segments are not long enough */ + if(track && track->markersnr==0) { + if(track==act_track) + clip->tracking.act_track= NULL; + + BKE_tracking_free_track(track); + BLI_freelinkN(&clip->tracking.tracks, track); + } + } + } + + track= next; + } + + WM_event_add_notifier(C, NC_MOVIECLIP|ND_SELECT, clip); + + return OPERATOR_FINISHED; +} + +static int clean_tracks_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +{ + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + int frames= RNA_int_get(op->ptr, "frames"); + float error= RNA_float_get(op->ptr, "error"); + int action= RNA_enum_get(op->ptr, "action"); + + if(frames==0 && error==0 && action==0) { + RNA_int_set(op->ptr, "frames", clip->tracking.settings.clean_frames); + RNA_float_set(op->ptr, "error", clip->tracking.settings.clean_error); + RNA_enum_set(op->ptr, "action", clip->tracking.settings.clean_action); + } + + return clean_tracks_exec(C, op); +} + +void CLIP_OT_clean_tracks(wmOperatorType *ot) +{ + static EnumPropertyItem actions_items[] = { + {TRACKING_CLEAN_SELECT, "SELECT", 0, "Select", "Select unclean tracks"}, + {TRACKING_CLEAN_DELETE_TRACK, "DELETE_TRACK", 0, "Delete Track", "Delete unclean tracks"}, + {TRACKING_CLEAN_DELETE_SEGMENT, "DELETE_SEGMENTS", 0, "Delete Segments", "Delete unclean segments of tracks"}, + {0, NULL, 0, NULL, NULL} + }; + + /* identifiers */ + ot->name= "Clean Tracks"; + ot->description= "Clean tracks"; + ot->idname= "CLIP_OT_clean_tracks"; + + /* api callbacks */ + ot->exec= clean_tracks_exec; + ot->invoke= clean_tracks_invoke; + ot->poll= ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_int(ot->srna, "frames", 0, 0, INT_MAX, "Tracked Frames", "Effect on tracks which are tracked less than specified amount of frames", 0, INT_MAX); + RNA_def_float(ot->srna, "error", 0.0f, 0.0f, FLT_MAX, "Reprojection Error", "Effect on tracks with have got larger reprojection error", 0.0f, 100.0f); + RNA_def_enum(ot->srna, "action", actions_items, 0, "Action", "Cleanup action to execute"); +} diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index e739c5fe22e..deed7ad2a3a 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -666,7 +666,7 @@ struct direntry * filelist_file(struct FileList* filelist, int index) return &filelist->filelist[fidx]; } -int filelist_find(struct FileList* filelist, char *file) +int filelist_find(struct FileList* filelist, const char *filename) { int index = -1; int i; @@ -677,7 +677,7 @@ int filelist_find(struct FileList* filelist, char *file) for (i = 0; i < filelist->numfiles; ++i) { - if ( strcmp(filelist->filelist[i].relname, file) == 0) { /* not dealing with user input so dont need BLI_path_cmp */ + if ( strcmp(filelist->filelist[i].relname, filename) == 0) { /* not dealing with user input so dont need BLI_path_cmp */ index = i; break; } diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h index a7f2a0d1af9..cd4c22df418 100644 --- a/source/blender/editors/space_file/filelist.h +++ b/source/blender/editors/space_file/filelist.h @@ -66,7 +66,7 @@ typedef enum FileCheckType struct FileList * filelist_new(short type); void filelist_init_icons(void); void filelist_free_icons(void); -int filelist_find(struct FileList* filelist, char *file); +int filelist_find(struct FileList* filelist, const char *file); void filelist_free(struct FileList* filelist); void filelist_sort(struct FileList* filelist, short sort); int filelist_numfiles(struct FileList* filelist); diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 505452f504c..77ac577792c 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -127,7 +127,7 @@ static void draw_render_info(Scene *scene, Image *ima, ARegion *ar) BKE_image_release_renderresult(scene, ima); } -void draw_image_info(ARegion *ar, int color_manage, int channels, int x, int y, char *cp, float *fp, int *zp, float *zpf) +void draw_image_info(ARegion *ar, int color_manage, int channels, int x, int y, const char cp[4], const float fp[4], int *zp, float *zpf) { char str[256]; float dx= 6; diff --git a/source/blender/editors/space_image/image_intern.h b/source/blender/editors/space_image/image_intern.h index 4310b5dbae8..04156c80c0e 100644 --- a/source/blender/editors/space_image/image_intern.h +++ b/source/blender/editors/space_image/image_intern.h @@ -55,7 +55,7 @@ void IMAGE_OT_toolbox(struct wmOperatorType *ot); /* image_draw.c */ void draw_image_main(struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene); -void draw_image_info(struct ARegion *ar, int color_manage, int channels, int x, int y, char *cp, float *fp, int *zp, float *zpf); +void draw_image_info(struct ARegion *ar, int color_manage, int channels, int x, int y, const char cp[4], const float fp[4], int *zp, float *zpf); void draw_image_grease_pencil(struct bContext *C, short onlyv2d); /* image_ops.c */ diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index 70c4ebd445a..177b72567e5 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -33,6 +33,7 @@ #include "BLF_api.h" +#include "BLI_math.h" #include "BLI_utildefines.h" @@ -131,7 +132,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str const char *line_stride= str + initial_offset; /* advance to the last line and draw it first */ int sel_orig[2]; - VECCOPY2D(sel_orig, cdc->sel); + copy_v2_v2_int(sel_orig, cdc->sel); /* invert and swap for wrapping */ cdc->sel[0] = str_len - sel_orig[1]; @@ -178,7 +179,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str return 0; } - VECCOPY2D(cdc->sel, sel_orig); + copy_v2_v2_int(cdc->sel, sel_orig); STEP_SEL(-(str_len + 1)); } else { /* simple, no wrap */ diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index db8d9b1ddf1..b4d89e1365d 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1679,6 +1679,40 @@ static void node_composit_buts_ycc(uiLayout *layout, bContext *UNUSED(C), Pointe uiItemR(layout, ptr, "mode", 0, "", ICON_NONE); } +static void node_composit_buts_movieclip(uiLayout *layout, bContext *C, PointerRNA *ptr) +{ + uiTemplateID(layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL); +} + +static void node_composit_buts_stabilize2d(uiLayout *layout, bContext *C, PointerRNA *ptr) +{ + bNode *node= ptr->data; + + uiTemplateID(layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL); + + if(!node->id) + return; + + uiItemR(layout, ptr, "filter_type", 0, "", 0); +} + +static void node_composit_buts_transform(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiItemR(layout, ptr, "filter_type", 0, "", 0); +} + +static void node_composit_buts_moviedistortion(uiLayout *layout, bContext *C, PointerRNA *ptr) +{ + bNode *node= ptr->data; + + uiTemplateID(layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL); + + if(!node->id) + return; + + uiItemR(layout, ptr, "distortion_type", 0, "", 0); +} + /* only once called */ static void node_composit_set_butfunc(bNodeType *ntype) { @@ -1829,6 +1863,20 @@ static void node_composit_set_butfunc(bNodeType *ntype) case CMP_NODE_SEPYCCA: ntype->uifunc=node_composit_buts_ycc; break; + case CMP_NODE_MOVIECLIP: + ntype->uifunc= node_composit_buts_movieclip; + break; + case CMP_NODE_STABILIZE2D: + ntype->uifunc= node_composit_buts_stabilize2d; + break; + case CMP_NODE_TRANSFORM: + ntype->uifunc= node_composit_buts_transform; + break; + case CMP_NODE_MOVIEDISTORTION: + ntype->uifunc= node_composit_buts_moviedistortion; + break; + default: + ntype->uifunc= NULL; } if (ntype->uifuncbut == NULL) ntype->uifuncbut = ntype->uifunc; @@ -2124,7 +2172,7 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage) } } -void draw_nodespace_color_info(ARegion *ar, int color_manage, int channels, int x, int y, char *cp, float *fp) +void draw_nodespace_color_info(ARegion *ar, int color_manage, int channels, int x, int y, const char cp[4], const float fp[4]) { char str[256]; float dx= 6; diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index c1e50c112fa..745611c6251 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -2207,8 +2207,14 @@ bNode *node_add_node(SpaceNode *snode, Main *bmain, Scene *scene, bNodeTemplate ED_node_set_active(bmain, snode->edittree, node); if(snode->nodetree->type==NTREE_COMPOSIT) { - if(ELEM4(node->type, CMP_NODE_R_LAYERS, CMP_NODE_COMPOSITE, CMP_NODE_DEFOCUS, CMP_NODE_OUTPUT_FILE)) + if(ELEM4(node->type, CMP_NODE_R_LAYERS, CMP_NODE_COMPOSITE, CMP_NODE_DEFOCUS, CMP_NODE_OUTPUT_FILE)) { node->id = &scene->id; + } + else if(ELEM3(node->type, CMP_NODE_MOVIECLIP, CMP_NODE_MOVIEDISTORTION, CMP_NODE_STABILIZE2D)) { + if(G.main->movieclip.first == G.main->movieclip.last) { + node->id= G.main->movieclip.first; + } + } ntreeCompositForceHidden(snode->edittree, scene); } diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index 655d54ac8a7..88b81d0855c 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -99,7 +99,7 @@ void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int t int node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, float coord_array[][2], int resol); void node_draw_link_straight(View2D *v2d, SpaceNode *snode, bNodeLink *link, int th_col1, int do_shaded, int th_col2, int do_triple, int th_col3 ); void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage); -void draw_nodespace_color_info(struct ARegion *ar, int color_manage, int channels, int x, int y, char *cp, float *fp); +void draw_nodespace_color_info(struct ARegion *ar, int color_manage, int channels, int x, int y, const char cp[4], const float fp[4]); /* node_edit.c */ void node_tree_from_ID(ID *id, bNodeTree **ntree, bNodeTree **edittree, int *treetype); diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index a7bb1fb3ee6..c0046b089af 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -153,17 +153,17 @@ static short set_pchan_glColor (short colCode, int boneflag, short constflag) unsigned char cp[3]; if (boneflag & BONE_DRAW_ACTIVE) { - VECCOPY(cp, bcolor->active); + copy_v3_v3_char((char *)cp, bcolor->active); if(!(boneflag & BONE_SELECTED)) { cp_shade_color3ub(cp, -80); } } else if (boneflag & BONE_SELECTED) { - VECCOPY(cp, bcolor->select); + copy_v3_v3_char((char *)cp, bcolor->select); } else { /* a bit darker than solid */ - VECCOPY(cp, bcolor->solid); + copy_v3_v3_char((char *)cp, bcolor->solid); cp_shade_color3ub(cp, -50); } @@ -213,13 +213,13 @@ static short set_pchan_glColor (short colCode, int boneflag, short constflag) unsigned char cp[3]; if (boneflag & BONE_DRAW_ACTIVE) { - VECCOPY(cp, bcolor->active); + copy_v3_v3_char((char *)cp, bcolor->active); } else if (boneflag & BONE_SELECTED) { - VECCOPY(cp, bcolor->select); + copy_v3_v3_char((char *)cp, bcolor->select); } else { - VECCOPY(cp, bcolor->solid); + copy_v3_v3_char((char *)cp, bcolor->solid); } glColor3ubv(cp); @@ -239,15 +239,15 @@ static short set_pchan_glColor (short colCode, int boneflag, short constflag) unsigned char cp[3]; if (boneflag & BONE_DRAW_ACTIVE) { - VECCOPY(cp, bcolor->active); + copy_v3_v3_char((char *)cp, bcolor->active); cp_shade_color3ub(cp, 10); } else if (boneflag & BONE_SELECTED) { - VECCOPY(cp, bcolor->select); + copy_v3_v3_char((char *)cp, bcolor->select); cp_shade_color3ub(cp, -30); } else { - VECCOPY(cp, bcolor->solid); + copy_v3_v3_char((char *)cp, bcolor->solid); cp_shade_color3ub(cp, -30); } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index bf4a7720564..bfb3d849c80 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -56,6 +56,7 @@ #include "BLI_utildefines.h" #include "BKE_anim.h" //for the where_on_path function +#include "BKE_camera.h" #include "BKE_constraint.h" // for the get_constraint_target function #include "BKE_curve.h" #include "BKE_DerivedMesh.h" @@ -74,7 +75,10 @@ #include "BKE_paint.h" #include "BKE_particle.h" #include "BKE_pointcache.h" +#include "BKE_scene.h" #include "BKE_unit.h" +#include "BKE_movieclip.h" +#include "BKE_tracking.h" #include "smoke_API.h" @@ -201,6 +205,40 @@ static void view3d_project_short_noclip(ARegion *ar, const float vec[3], short * } } +/* same as view3d_project_short_clip but use persmat instead of persmatob for projection */ +static void view3d_project_short_clip_persmat(ARegion *ar, float *vec, short *adr, int local) +{ + RegionView3D *rv3d= ar->regiondata; + float fx, fy, vec4[4]; + + adr[0]= IS_CLIPPED; + + /* clipplanes in eye space */ + if(rv3d->rflag & RV3D_CLIPPING) { + if(ED_view3d_test_clipping(rv3d, vec, local)) + return; + } + + copy_v3_v3(vec4, vec); + vec4[3]= 1.0; + + mul_m4_v4(rv3d->persmat, vec4); + + /* clipplanes in window space */ + if( vec4[3] > (float)BL_NEAR_CLIP ) { /* is the NEAR clipping cutoff for picking */ + fx= (ar->winx/2)*(1 + vec4[0]/vec4[3]); + + if( fx>0 && fx<ar->winx) { + + fy= (ar->winy/2)*(1 + vec4[1]/vec4[3]); + + if(fy > 0.0f && fy < (float)ar->winy) { + adr[0]= (short)floorf(fx); + adr[1]= (short)floorf(fy); + } + } + } +} /* ************************ */ /* check for glsl drawing */ @@ -732,7 +770,12 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa for(vos= strings->first; vos; vos= vos->next) { if(mat && !(vos->flag & V3D_CACHE_TEXT_WORLDSPACE)) mul_m4_v3(mat, vos->vec); - view3d_project_short_clip(ar, vos->vec, vos->sco, 0); + + if(vos->flag&V3D_CACHE_TEXT_GLOBALSPACE) + view3d_project_short_clip_persmat(ar, vos->vec, vos->sco, 0); + else + view3d_project_short_clip(ar, vos->vec, vos->sco, 0); + if(vos->sco[0]!=IS_CLIPPED) tot++; } @@ -1364,16 +1407,203 @@ float view3d_camera_border_hack_col[4]; short view3d_camera_border_hack_test= FALSE; #endif +/* ****************** draw clip data *************** */ + +static void draw_bundle_sphere(void) +{ + static GLuint displist= 0; + + if (displist == 0) { + GLUquadricObj *qobj; + + displist= glGenLists(1); + glNewList(displist, GL_COMPILE); + + qobj= gluNewQuadric(); + gluQuadricDrawStyle(qobj, GLU_FILL); + glShadeModel(GL_SMOOTH); + gluSphere(qobj, 0.05, 8, 8); + glShadeModel(GL_FLAT); + gluDeleteQuadric(qobj); + + glEndList(); + } + + glCallList(displist); +} + +static void draw_viewport_reconstruction(Scene *scene, Base *base, View3D *v3d, MovieClip *clip, int flag) +{ + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *track; + float mat[4][4], imat[4][4], curcol[4]; + unsigned char col[4], scol[4]; + int bundlenr= 1; + + if((v3d->flag2&V3D_SHOW_RECONSTRUCTION)==0) + return; + + if(v3d->flag2&V3D_RENDER_OVERRIDE) + return; + + glGetFloatv(GL_CURRENT_COLOR, curcol); + + UI_GetThemeColor4ubv(TH_TEXT, col); + UI_GetThemeColor4ubv(TH_SELECT, scol); + + BKE_get_tracking_mat(scene, base->object, mat); + + glEnable(GL_LIGHTING); + glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); + glEnable(GL_COLOR_MATERIAL); + glShadeModel(GL_SMOOTH); + + /* current ogl matrix is translated in camera space, bundles should + be rendered in world space, so camera matrix should be "removed" + from current ogl matrix */ + invert_m4_m4(imat, base->object->obmat); + + glPushMatrix(); + glMultMatrixf(imat); + glMultMatrixf(mat); + + for ( track= tracking->tracks.first; track; track= track->next) { + int selected= track->flag&SELECT || track->pat_flag&SELECT || track->search_flag&SELECT; + if((track->flag&TRACK_HAS_BUNDLE)==0) + continue; + + if(flag&DRAW_PICKING) + glLoadName(base->selcol + (bundlenr<<16)); + + glPushMatrix(); + glTranslatef(track->bundle_pos[0], track->bundle_pos[1], track->bundle_pos[2]); + glScalef(v3d->bundle_size/0.05, v3d->bundle_size/0.05, v3d->bundle_size/0.05); + + if(v3d->drawtype==OB_WIRE) { + glDisable(GL_LIGHTING); + glDepthMask(0); + + if(selected) { + if(base==BASACT) UI_ThemeColor(TH_ACTIVE); + else UI_ThemeColor(TH_SELECT); + } else { + if(track->flag&TRACK_CUSTOMCOLOR) glColor3fv(track->color); + else UI_ThemeColor(TH_WIRE); + } + + drawaxes(0.05f, v3d->bundle_drawtype); + + glDepthMask(1); + glEnable(GL_LIGHTING); + } else if(v3d->drawtype>OB_WIRE) { + if(v3d->bundle_drawtype==OB_EMPTY_SPHERE) { + /* selection outline */ + if(selected) { + if(base==BASACT) UI_ThemeColor(TH_ACTIVE); + else UI_ThemeColor(TH_SELECT); + + glDepthMask(0); + glLineWidth(2.f); + glDisable(GL_LIGHTING); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + + draw_bundle_sphere(); + + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glEnable(GL_LIGHTING); + glLineWidth(1.f); + glDepthMask(1); + } + + if(track->flag&TRACK_CUSTOMCOLOR) glColor3fv(track->color); + else UI_ThemeColor(TH_BUNDLE_SOLID); + + draw_bundle_sphere(); + } else { + glDisable(GL_LIGHTING); + glDepthMask(0); + + if(selected) { + if(base==BASACT) UI_ThemeColor(TH_ACTIVE); + else UI_ThemeColor(TH_SELECT); + } else { + if(track->flag&TRACK_CUSTOMCOLOR) glColor3fv(track->color); + else UI_ThemeColor(TH_WIRE); + } + + drawaxes(0.05f, v3d->bundle_drawtype); + + glDepthMask(1); + glEnable(GL_LIGHTING); + } + } + + glPopMatrix(); + + if((flag & DRAW_PICKING)==0 && (v3d->flag2&V3D_SHOW_BUNDLENAME)) { + float pos[3]; + unsigned char tcol[4]; + + if(selected) memcpy(tcol, scol, sizeof(tcol)); + else memcpy(tcol, col, sizeof(tcol)); + + mul_v3_m4v3(pos, mat, track->bundle_pos); + view3d_cached_text_draw_add(pos, track->name, 10, V3D_CACHE_TEXT_GLOBALSPACE, tcol); + } + + bundlenr++; + } + + if((flag & DRAW_PICKING)==0) { + if(v3d->flag2&V3D_SHOW_CAMERAPATH && clip->tracking.reconstruction.camnr) { + int a= 0; + MovieTrackingReconstruction *reconstruction= &tracking->reconstruction; + MovieReconstructedCamera *camera= tracking->reconstruction.cameras; + + glDisable(GL_LIGHTING); + UI_ThemeColor(TH_CAMERA_PATH); + glLineWidth(2.0f); + + glBegin(GL_LINE_STRIP); + for(a= 0; a<reconstruction->camnr; a++, camera++) { + glVertex3f(camera->mat[3][0], camera->mat[3][1], camera->mat[3][2]); + } + glEnd(); + + glLineWidth(1.0f); + glEnable(GL_LIGHTING); + } + } + + glPopMatrix(); + + /* restore */ + glShadeModel(GL_FLAT); + glDisable(GL_COLOR_MATERIAL); + glDisable(GL_LIGHTING); + + glColor4fv(curcol); + + if(flag&DRAW_PICKING) + glLoadName(base->selcol); +} + /* flag similar to draw_object() */ -static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, int flag) +static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int flag) { /* a standing up pyramid with (0,0,0) as top */ Camera *cam; + Object *ob= base->object; float tvec[3]; float vec[4][3], asp[2], shift[2], scale[3]; int i; float drawsize; const short is_view= (rv3d->persp==RV3D_CAMOB && ob==v3d->camera); + MovieClip *clip= object_get_movieclip(scene, base->object, 0); + + /* draw data for movie clip set as active for scene */ + if(clip) + draw_viewport_reconstruction(scene, base, v3d, clip, flag); #ifdef VIEW3D_CAMERA_BORDER_HACK if(is_view && !(G.f & G_PICKSEL)) { @@ -3720,7 +3950,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv totpart=psys->totpart; - cfra= bsystem_time(scene, NULL, (float)CFRA, 0.0f); + cfra= BKE_curframe(scene); if(draw_as==PART_DRAW_PATH && psys->pathcache==NULL && psys->childcache==NULL) draw_as=PART_DRAW_DOT; @@ -4969,7 +5199,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int skip= nu->resolu/16; while (nr-->0) { /* accounts for empty bevel lists */ - float fac= bevp->radius * ts->normalsize; + const float fac= bevp->radius * ts->normalsize; float vec_a[3]; // Offset perpendicular to the curve float vec_b[3]; // Delta along the curve @@ -4985,9 +5215,9 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, mul_qt_v3(bevp->quat, vec_b); add_v3_v3(vec_a, bevp->vec); add_v3_v3(vec_b, bevp->vec); - - VECSUBFAC(vec_a, vec_a, bevp->dir, fac); - VECSUBFAC(vec_b, vec_b, bevp->dir, fac); + + madd_v3_v3fl(vec_a, bevp->dir, -fac); + madd_v3_v3fl(vec_b, bevp->dir, -fac); glBegin(GL_LINE_STRIP); glVertex3fv(vec_a); @@ -5796,7 +6026,6 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) Object *ob; Curve *cu; RegionView3D *rv3d= ar->regiondata; - //float cfraont; float vec1[3], vec2[3]; unsigned int col=0; int /*sel, drawtype,*/ colindex= 0; @@ -5835,83 +6064,6 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) /* no return after this point, otherwise leaks */ view3d_cached_text_draw_begin(); - - /* draw keys? */ -#if 0 // XXX old animation system - if(base==(scene->basact) || (base->flag & (SELECT+BA_WAS_SEL))) { - if(flag==0 && warning_recursive==0 && ob!=scene->obedit) { - if(ob->ipo && ob->ipo->showkey && (ob->ipoflag & OB_DRAWKEY)) { - ListBase elems; - CfraElem *ce; - float temp[7][3]; - - warning_recursive= 1; - - elems.first= elems.last= 0; - // warning: no longer checks for certain ob-keys only... (so does this need to use the proper ipokeys then?) - make_cfra_list(ob->ipo, &elems); - - cfraont= (scene->r.cfra); - drawtype= v3d->drawtype; - if(drawtype>OB_WIRE) v3d->drawtype= OB_WIRE; - sel= base->flag; - memcpy(temp, &ob->loc, 7*3*sizeof(float)); - - ipoflag= ob->ipoflag; - ob->ipoflag &= ~OB_OFFS_OB; - - set_no_parent_ipo(1); - disable_speed_curve(1); - - if ((ob->ipoflag & OB_DRAWKEYSEL)==0) { - ce= elems.first; - while(ce) { - if(!ce->sel) { - (scene->r.cfra)= ce->cfra/scene->r.framelen; - - base->flag= 0; - - where_is_object_time(scene, ob, (scene->r.cfra)); - draw_object(scene, ar, v3d, base, 0); - } - ce= ce->next; - } - } - - ce= elems.first; - while(ce) { - if(ce->sel) { - (scene->r.cfra)= ce->cfra/scene->r.framelen; - - base->flag= SELECT; - - where_is_object_time(scene, ob, (scene->r.cfra)); - draw_object(scene, ar, v3d, base, 0); - } - ce= ce->next; - } - - set_no_parent_ipo(0); - disable_speed_curve(0); - - base->flag= sel; - ob->ipoflag= ipoflag; - - /* restore icu->curval */ - (scene->r.cfra)= cfraont; - - memcpy(&ob->loc, temp, 7*3*sizeof(float)); - where_is_object(scene, ob); - v3d->drawtype= drawtype; - - BLI_freelistN(&elems); - - warning_recursive= 0; - } - } - } -#endif // XXX old animation system - /* patch? children objects with a timeoffs change the parents. How to solve! */ /* if( ((int)ob->ctime) != F_(scene->r.cfra)) where_is_object(scene, ob); */ @@ -5969,7 +6121,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) if(base->flag & (SELECT+BA_WAS_SEL)) { /* uses darker active color for non-active + selected*/ theme_id= TH_GROUP_ACTIVE; - + if(scene->basact != base) { theme_shade= -16; } @@ -6207,7 +6359,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) break; case OB_CAMERA: if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0 || (rv3d->persp==RV3D_CAMOB && v3d->camera==ob)) /* special exception for active camera */ - drawcamera(scene, v3d, rv3d, ob, flag); + drawcamera(scene, v3d, rv3d, base, flag); break; case OB_SPEAKER: if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) @@ -6558,7 +6710,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) for (ct= targets.first; ct; ct= ct->next) { /* calculate target's matrix */ if (cti->get_target_matrix) - cti->get_target_matrix(curcon, cob, ct, bsystem_time(scene, ob, (float)(scene->r.cfra), give_timeoffset(ob))); + cti->get_target_matrix(curcon, cob, ct, BKE_curframe(scene)); else unit_m4(ct->matrix); diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 7c89ce0f689..6605d488d36 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -242,7 +242,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3 tstart(); - VECSUB(size, max, min); + sub_v3_v3v3(size, max, min); // maxx, maxy, maxz cv[0][0] = max[0]; diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index ef806cb8881..c493e4af944 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -250,6 +250,7 @@ static SpaceLink *view3d_new(const bContext *C) v3d->gridflag &= ~V3D_SHOW_Z; v3d->flag |= V3D_SELECT_OUTLINE; + v3d->flag2 |= V3D_SHOW_RECONSTRUCTION; v3d->lens= 35.0f; v3d->near= 0.01f; @@ -259,6 +260,9 @@ static SpaceLink *view3d_new(const bContext *C) v3d->twtype= V3D_MANIP_TRANSLATE; v3d->around= V3D_CENTROID; + v3d->bundle_size= 0.2f; + v3d->bundle_drawtype= OB_PLAINAXES; + /* header */ ar= MEM_callocN(sizeof(ARegion), "header for view3d"); @@ -744,6 +748,10 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn) /* same as above */ ED_region_tag_redraw(ar); break; + case NC_MOVIECLIP: + if(wmn->data==ND_DISPLAY) + ED_region_tag_redraw(ar); + break; case NC_SPACE: if(wmn->data == ND_SPACE_VIEW3D) { if (wmn->subtype == NS_VIEW3D_GPU) { @@ -874,6 +882,7 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn) case ND_MODE: case ND_LAYER: case ND_LAYER_CONTENT: + case ND_TOOLSETTINGS: ED_region_tag_redraw(ar); break; } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index aa69e7121e0..51bbf591bb3 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -51,6 +51,7 @@ #include "BLI_utildefines.h" #include "BKE_anim.h" +#include "BKE_camera.h" #include "BKE_context.h" #include "BKE_customdata.h" #include "BKE_image.h" @@ -61,6 +62,7 @@ #include "BKE_scene.h" #include "BKE_screen.h" #include "BKE_unit.h" +#include "BKE_movieclip.h" #include "RE_engine.h" #include "RE_pipeline.h" // make_stars @@ -1486,7 +1488,8 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d) RegionView3D *rv3d= ar->regiondata; BGpic *bgpic; Image *ima; - ImBuf *ibuf= NULL; + MovieClip *clip; + ImBuf *ibuf= NULL, *freeibuf; float vec[4], fac, asp, zoomx, zoomy; float x1, y1, x2, y2, cx, cy; @@ -1497,15 +1500,46 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d) (bgpic->view & (1<<rv3d->view)) || /* check agaist flags */ (rv3d->persp==RV3D_CAMOB && bgpic->view == (1<<RV3D_VIEW_CAMERA)) ) { - ima= bgpic->ima; - if(ima==NULL) - continue; - BKE_image_user_calc_frame(&bgpic->iuser, CFRA, 0); - ibuf= BKE_image_get_ibuf(ima, &bgpic->iuser); - if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL) ) + freeibuf= NULL; + if(bgpic->source==V3D_BGPIC_IMAGE) { + ima= bgpic->ima; + if(ima==NULL) + continue; + BKE_image_user_calc_frame(&bgpic->iuser, CFRA, 0); + ibuf= BKE_image_get_ibuf(ima, &bgpic->iuser); + } else { + clip= NULL; + + if(bgpic->flag&V3D_BGPIC_CAMERACLIP) { + if(!scene->camera) + scene->camera= scene_find_camera(scene); + + if(scene->camera) + clip= object_get_movieclip(scene, scene->camera, 1); + } else clip= bgpic->clip; + + if(clip==NULL) + continue; + + BKE_movieclip_user_set_frame(&bgpic->cuser, CFRA); + ibuf= BKE_movieclip_get_ibuf(clip, &bgpic->cuser); + + /* working with ibuf from image and clip has got different workflow now. + ibuf acquired from clip is referenced by cache system and should + be dereferenced after usage. */ + freeibuf= ibuf; + } + + if(ibuf==NULL) continue; - if(ibuf->channels!=4) + + if((ibuf->rect==NULL && ibuf->rect_float==NULL) || ibuf->channels!=4) { /* invalid image format */ + if(freeibuf) + IMB_freeImBuf(freeibuf); + continue; + } + if(ibuf->rect==NULL) IMB_rect_from_float(ibuf); @@ -1544,10 +1578,12 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d) /* complete clip? */ - if(x2 < 0 ) continue; - if(y2 < 0 ) continue; - if(x1 > ar->winx ) continue; - if(y1 > ar->winy ) continue; + if(x2 < 0 || y2 < 0 || x1 > ar->winx || y1 > ar->winy) { + if(freeibuf) + IMB_freeImBuf(freeibuf); + + continue; + } zoomx= (x2-x1)/ibuf->x; zoomy= (y2-y1)/ibuf->y; @@ -1602,6 +1638,9 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d) glDepthMask(1); if(v3d->zbuf) glEnable(GL_DEPTH_TEST); + + if(freeibuf) + IMB_freeImBuf(freeibuf); } } } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index e7fbdaf1deb..7331959ef51 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2940,18 +2940,8 @@ void VIEW3D_OT_view_persportho(wmOperatorType *ot) static BGpic *background_image_add(bContext *C) { View3D *v3d= CTX_wm_view3d(C); - - BGpic *bgpic= MEM_callocN(sizeof(BGpic), "Background Image"); - bgpic->size= 5.0; - bgpic->blend= 0.5; - bgpic->iuser.fie_ima= 2; - bgpic->iuser.ok= 1; - bgpic->view= 0; /* 0 for all */ - bgpic->flag |= V3D_BGPIC_EXPANDED; - - BLI_addtail(&v3d->bgpicbase, bgpic); - - return bgpic; + + return ED_view3D_background_image_add(v3d); } static int background_image_add_exec(bContext *C, wmOperator *UNUSED(op)) @@ -3027,7 +3017,8 @@ static int background_image_remove_exec(bContext *C, wmOperator *op) if(bgpic_rem) { BLI_remlink(&vd->bgpicbase, bgpic_rem); - if(bgpic_rem->ima) bgpic_rem->ima->id.us--; + if(bgpic_rem->ima) id_us_min(&bgpic_rem->ima->id); + if(bgpic_rem->clip) id_us_min(&bgpic_rem->clip->id); MEM_freeN(bgpic_rem); WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, vd); return OPERATOR_FINISHED; @@ -3462,8 +3453,8 @@ int ED_view3d_autodist_depth_seg(struct ARegion *ar, const int mval_sta[2], cons data.margin= margin; data.depth= FLT_MAX; - VECCOPY2D(p1, mval_sta); - VECCOPY2D(p2, mval_end); + copy_v2_v2_int(p1, mval_sta); + copy_v2_v2_int(p2, mval_end); plot_line_v2v2i(p1, p2, depth_segment_cb, &data); @@ -3534,3 +3525,18 @@ void ED_view3d_to_object(Object *ob, const float ofs[3], const float quat[4], co ED_view3d_to_m4(mat, ofs, quat, dist); object_apply_mat4(ob, mat, TRUE, TRUE); } + +BGpic *ED_view3D_background_image_add(View3D *v3d) +{ + BGpic *bgpic= MEM_callocN(sizeof(BGpic), "Background Image"); + + bgpic->size= 5.0; + bgpic->blend= 0.5; + bgpic->iuser.fie_ima= 2; + bgpic->iuser.ok= 1; + bgpic->view= 0; /* 0 for all */ + + BLI_addtail(&v3d->bgpicbase, bgpic); + + return bgpic; +} diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index e9db9fe1d7e..0cdb7a19995 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -314,7 +314,7 @@ static int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *even fly->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f); - VECCOPY2D(fly->mval, event->mval) + copy_v2_v2_int(fly->mval, event->mval); fly->ndof = NULL; fly->time_lastdraw= fly->time_lastwheel= PIL_check_seconds_timer(); @@ -475,7 +475,7 @@ static void flyEvent(FlyInfo *fly, wmEvent *event) fly->redraw = 1; } else if (event->type == MOUSEMOVE) { - VECCOPY2D(fly->mval, event->mval); + copy_v2_v2_int(fly->mval, event->mval); } else if (event->type == NDOF_MOTION) { // do these automagically get delivered? yes. diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 73174dcace8..6eafb10d74c 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -551,12 +551,9 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) if(obedit==NULL && v3d->localvd==NULL) { unsigned int ob_lay = ob ? ob->lay : 0; - + /* Layers */ - if (v3d->scenelock) - uiTemplateLayers(layout, &sceneptr, "layers", &v3dptr, "layers_used", ob_lay); - else - uiTemplateLayers(layout, &v3dptr, "layers", &v3dptr, "layers_used", ob_lay); + uiTemplateLayers(layout, v3d->scenelock ? &sceneptr : &v3dptr, "layers", &v3dptr, "layers_used", ob_lay); /* Scene lock */ uiItemR(layout, &v3dptr, "lock_camera_and_layers", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 772f29fb502..79b7681260a 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -125,6 +125,7 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa #define V3D_CACHE_TEXT_ZBUF (1<<0) #define V3D_CACHE_TEXT_WORLDSPACE (1<<1) #define V3D_CACHE_TEXT_ASCII (1<<2) +#define V3D_CACHE_TEXT_GLOBALSPACE (1<<3) /* drawarmature.c */ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag, const short is_outline); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 94d3469dc8c..0163c29c9aa 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -42,6 +42,7 @@ #include "DNA_meshdata_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "DNA_tracking_types.h" #include "MEM_guardedalloc.h" @@ -60,6 +61,9 @@ #include "BKE_context.h" #include "BKE_paint.h" #include "BKE_armature.h" +#include "BKE_movieclip.h" +#include "BKE_object.h" +#include "BKE_tracking.h" #include "BIF_gl.h" @@ -1373,6 +1377,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce if(hits>0) { int has_bones= 0; + /* note: bundles are handling in the same way as bones */ for(a=0; a<hits; a++) if(buffer[4*a+3] & 0xFFFF0000) has_bones= 1; /* note; shift+alt goes to group-flush-selecting */ @@ -1383,7 +1388,45 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce } if(has_bones && basact) { - if(ED_do_pose_selectbuffer(scene, basact, buffer, hits, extend) ) { /* then bone is found */ + if(basact->object->type==OB_CAMERA) { + if(BASACT==basact) { + int i, hitresult; + MovieTrackingTrack *track; + + for (i=0; i< hits; i++) { + hitresult= buffer[3+(i*4)]; + + /* if there's bundles in buffer select bundles first, + so non-camera elements should be ignored in buffer */ + if(basact->selcol != (hitresult & 0xFFFF)) + continue; + + /* index of bundle is 1<<16-based. if there's no "bone" index + in hight word, this buffer value belongs to camera,. not to bundle */ + if(buffer[4*i+3] & 0xFFFF0000) { + MovieClip *clip= object_get_movieclip(scene, basact->object, 0); + int selected; + track= BKE_tracking_indexed_track(&clip->tracking, hitresult >> 16); + + selected= (track->flag&SELECT) || (track->pat_flag&SELECT) || (track->search_flag&SELECT); + + if(selected && extend) BKE_tracking_deselect_track(track, TRACK_AREA_ALL); + else BKE_tracking_select_track(&clip->tracking, track, TRACK_AREA_ALL, extend); + + basact->flag|= SELECT; + basact->object->flag= basact->flag; + + retval= 1; + + WM_event_add_notifier(C, NC_MOVIECLIP|ND_SELECT, track); + WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene); + + break; + } + } + } + } + else if(ED_do_pose_selectbuffer(scene, basact, buffer, hits, extend) ) { /* then bone is found */ /* we make the armature selected: not-selected active object in posemode won't work well for tools */ diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 1b726cd90b3..012e08f98cb 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -55,6 +55,7 @@ #include "BKE_lattice.h" #include "BKE_main.h" #include "BKE_object.h" +#include "BKE_tracking.h" #include "WM_api.h" #include "WM_types.h" @@ -753,6 +754,37 @@ void VIEW3D_OT_snap_cursor_to_grid(wmOperatorType *ot) /* **************************************************** */ +static void bundle_midpoint(Scene *scene, Object *ob, float vec[3]) +{ + MovieTrackingTrack *track; + MovieClip *clip= object_get_movieclip(scene, ob, 0); + int ok= 0; + float min[3], max[3], mat[4][4], pos[3]; + + if(!clip) + return; + + BKE_get_tracking_mat(scene, ob, mat); + + INIT_MINMAX(min, max); + + track= clip->tracking.tracks.first; + while(track) { + int selected= (track->flag&SELECT) || (track->pat_flag&SELECT) || (track->search_flag&SELECT); + if((track->flag&TRACK_HAS_BUNDLE) && selected) { + ok= 1; + mul_v3_m4v3(pos, mat, track->bundle_pos); + DO_MINMAX(pos, min, max); + } + + track= track->next; + } + + if(ok) { + interp_v3_v3v3(vec, min, max, 0.5); + } +} + static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); @@ -817,6 +849,15 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op)) else { CTX_DATA_BEGIN(C, Object*, ob, selected_objects) { copy_v3_v3(vec, ob->obmat[3]); + + /* special case for camera -- snap to bundles */ + if(ob->type==OB_CAMERA) { + /* snap to bundles should happen only when bundles are visible */ + if(v3d->flag2&V3D_SHOW_RECONSTRUCTION) { + bundle_midpoint(scene, ob, vec); + } + } + add_v3_v3(centroid, vec); DO_MINMAX(vec, min, max); count++; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 759fefba438..13d686508de 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -48,6 +48,7 @@ #include "DNA_armature_types.h" #include "DNA_constraint_types.h" #include "DNA_meshdata_types.h" +#include "DNA_movieclip_types.h" #include "DNA_scene_types.h" /* PET modes */ #include "RNA_access.h" @@ -71,6 +72,7 @@ #include "ED_markers.h" #include "ED_view3d.h" #include "ED_mesh.h" +#include "ED_clip.h" #include "UI_view2d.h" #include "WM_types.h" @@ -155,6 +157,17 @@ void convertViewVec(TransInfo *t, float *vec, int dx, int dy) else if(ELEM(t->spacetype, SPACE_NODE, SPACE_SEQ)) { convertViewVec2D(&t->ar->v2d, vec, dx, dy); } + else if(t->spacetype==SPACE_CLIP) { + View2D *v2d = t->view; + float divx, divy; + + divx= v2d->mask.xmax-v2d->mask.xmin; + divy= v2d->mask.ymax-v2d->mask.ymin; + + vec[0]= (v2d->cur.xmax-v2d->cur.xmin)*(dx)/divx; + vec[1]= (v2d->cur.ymax-v2d->cur.ymin)*(dy)/divy; + vec[2]= 0.0f; + } } void projectIntView(TransInfo *t, float *vec, int *adr) @@ -205,6 +218,9 @@ void projectIntView(TransInfo *t, float *vec, int *adr) adr[0]= out[0]; adr[1]= out[1]; } + else if(t->spacetype==SPACE_CLIP) { + UI_view2d_to_region_no_clip(t->view, vec[0], vec[1], adr, adr+1); + } } void projectFloatView(TransInfo *t, float *vec, float *adr) @@ -213,7 +229,7 @@ void projectFloatView(TransInfo *t, float *vec, float *adr) if(t->ar->regiontype == RGN_TYPE_WINDOW) project_float_noclip(t->ar, vec, adr); } - else if(t->spacetype==SPACE_IMAGE) { + else if(ELEM(t->spacetype, SPACE_IMAGE, SPACE_CLIP)) { int a[2]; projectIntView(t, vec, a); @@ -311,6 +327,15 @@ static void viewRedrawForce(const bContext *C, TransInfo *t) if(sima->lock) WM_event_add_notifier(C, NC_GEOM|ND_DATA, t->obedit->data); else ED_area_tag_redraw(t->sa); } + else if (t->spacetype==SPACE_CLIP) { + SpaceClip *sc= (SpaceClip*)t->sa->spacedata.first; + MovieClip *clip= ED_space_clip(sc); + + /* objects could be parented to tracking data, so send this for viewport refresh */ + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip); + } } static void viewRedrawPost(bContext *C, TransInfo *t) @@ -548,7 +573,7 @@ int transformEvent(TransInfo *t, wmEvent *event) if (t->modifiers & MOD_CONSTRAINT_SELECT) t->con.mode |= CON_SELECT; - VECCOPY2D(t->mval, event->mval); + copy_v2_v2_int(t->mval, event->mval); // t->redraw |= TREDRAW_SOFT; /* Use this for soft redraw. Might cause flicker in object mode */ t->redraw |= TREDRAW_HARD; @@ -579,10 +604,18 @@ int transformEvent(TransInfo *t, wmEvent *event) initSnapping(t, NULL); // need to reinit after mode change t->redraw |= TREDRAW_HARD; } + else if(t->mode == TFM_TRANSLATION) { + if(t->options&CTX_MOVIECLIP) { + restoreTransObjects(t); + + t->flag^= T_ALT_TRANSFORM; + t->redraw |= TREDRAW_HARD; + } + } break; case TFM_MODAL_ROTATE: /* only switch when... */ - if(!(t->options & CTX_TEXTURE)) { + if(!(t->options & CTX_TEXTURE) && !(t->options & CTX_MOVIECLIP)) { if( ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) { resetTransRestrictions(t); @@ -837,7 +870,7 @@ int transformEvent(TransInfo *t, wmEvent *event) break; case RKEY: /* only switch when... */ - if(!(t->options & CTX_TEXTURE)) { + if(!(t->options & CTX_TEXTURE) && !(t->options & CTX_MOVIECLIP)) { if( ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) { resetTransRestrictions(t); @@ -1502,6 +1535,11 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW); //t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL); } + else if(t->spacetype == SPACE_CLIP) { + unit_m3(t->spacemtx); + t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW); + t->options |= CTX_MOVIECLIP; + } else unit_m3(t->spacemtx); @@ -3293,7 +3331,7 @@ void initTranslation(TransInfo *t) t->snap[2] = t->snap[1] * 0.1f; } } - else if(t->spacetype == SPACE_IMAGE) { + else if(ELEM(t->spacetype, SPACE_IMAGE, SPACE_CLIP)) { t->snap[0] = 0.0f; t->snap[1] = 0.125f; t->snap[2] = 0.0625f; @@ -3882,7 +3920,7 @@ int Bevel(TransInfo *t, const int UNUSED(mval[2])) else { d = distance; } - VECADDFAC(td->loc,td->center,td->axismtx[0],(*td->val)*d); + madd_v3_v3v3fl(td->loc, td->center, td->axismtx[0], (*td->val) * d); } recalcData(t); @@ -4847,7 +4885,7 @@ int doEdgeSlide(TransInfo *t, float perc) interp_v2_v2v2(uv_tmp, suv->origuv, (perc>=0)?suv->uv_up:suv->uv_down, fabs(perc)); fuv_link = suv->fuv_list; while (fuv_link) { - VECCOPY2D(((float *)fuv_link->link), uv_tmp); + copy_v2_v2(((float *)fuv_link->link), uv_tmp); fuv_link = fuv_link->next; } } @@ -4878,7 +4916,7 @@ int doEdgeSlide(TransInfo *t, float perc) interp_v2_v2v2(uv_tmp, suv->uv_down, suv->uv_up, fabs(newlen)); fuv_link = suv->fuv_list; while (fuv_link) { - VECCOPY2D(((float *)fuv_link->link), uv_tmp); + copy_v2_v2(((float *)fuv_link->link), uv_tmp); fuv_link = fuv_link->next; } } @@ -4895,7 +4933,7 @@ int doEdgeSlide(TransInfo *t, float perc) interp_v2_v2v2(uv_tmp, suv->uv_up, suv->uv_down, fabs(newlen)); fuv_link = suv->fuv_list; while (fuv_link) { - VECCOPY2D(((float *)fuv_link->link), uv_tmp); + copy_v2_v2(((float *)fuv_link->link), uv_tmp); fuv_link = fuv_link->next; } } @@ -5861,7 +5899,7 @@ int TimeScale(TransInfo *t, const int UNUSED(mval[2])) /* ************************************ */ -void BIF_TransformSetUndo(char *UNUSED(str)) +void BIF_TransformSetUndo(const char *UNUSED(str)) { // TRANSFORM_FIX_ME //Trans.undostr= str; diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 77e7cfb4d12..8b8ae95631c 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -382,6 +382,9 @@ typedef struct TransInfo { #define T_RELEASE_CONFIRM (1 << 23) + /* alternative transformation. used to add offset to tracking markers */ +#define T_ALT_TRANSFORM (1 << 24) + /* TransInfo->modifiers */ #define MOD_CONSTRAINT_SELECT 0x01 #define MOD_PRECISION 0x02 @@ -546,6 +549,7 @@ void flushTransParticles(TransInfo *t); int clipUVTransform(TransInfo *t, float *vec, int resize); void flushTransNodes(TransInfo *t); void flushTransSeq(TransInfo *t); +void flushTransTracking(TransInfo *t); /*********************** exported from transform_manipulator.c ********** */ int gimbal_axis(struct Object *ob, float gmat[][3]); /* return 0 when no gimbal for selection */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 6de854ff6c9..0a6f49f7c9f 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -51,6 +51,7 @@ #include "DNA_scene_types.h" #include "DNA_meshdata_types.h" #include "DNA_gpencil_types.h" +#include "DNA_movieclip_types.h" #include "MEM_guardedalloc.h" @@ -74,6 +75,9 @@ #include "BKE_bmesh.h" #include "BKE_scene.h" #include "BKE_report.h" +#include "BKE_tracking.h" +#include "BKE_movieclip.h" +#include "BKE_node.h" #include "ED_anim_api.h" @@ -88,8 +92,12 @@ #include "ED_node.h" #include "ED_types.h" #include "ED_uvedit.h" +#include "ED_clip.h" #include "ED_util.h" /* for crazyspace correction */ +#include "WM_api.h" /* for WM_event_add_notifier to deal with stabilization nodes */ +#include "WM_types.h" + #include "UI_view2d.h" #include "BLI_math.h" @@ -2960,8 +2968,8 @@ static TransData *ActionFCurveToTransData(TransData *td, TransData2D **td2dv, FC td2d->h1 = bezt->vec[0]; td2d->h2 = bezt->vec[2]; - VECCOPY2D(td2d->ih1, td2d->h1); - VECCOPY2D(td2d->ih2, td2d->h2); + copy_v2_v2(td2d->ih1, td2d->h1); + copy_v2_v2(td2d->ih2, td2d->h2); td++; td2d++; @@ -3217,14 +3225,14 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt, if (td->flag & TD_MOVEHANDLE1) { td2d->h1 = bezt->vec[0]; - VECCOPY2D(td2d->ih1, td2d->h1); + copy_v2_v2(td2d->ih1, td2d->h1); } else td2d->h1 = NULL; if (td->flag & TD_MOVEHANDLE2) { td2d->h2 = bezt->vec[2]; - VECCOPY2D(td2d->ih2, td2d->h2); + copy_v2_v2(td2d->ih2, td2d->h2); } else td2d->h2 = NULL; @@ -4796,6 +4804,17 @@ void special_aftertrans_update(bContext *C, TransInfo *t) /* clear link line */ ED_node_link_intersect_test(t->sa, 0); } + else if (t->spacetype == SPACE_CLIP) { + SpaceClip *sc= t->sa->spacedata.first; + MovieClip *clip= ED_space_clip(sc); + + if(t->scene->nodetree) { + /* tracks can be used for stabilization nodes, + flush update for such nodes */ + nodeUpdateID(t->scene->nodetree, &clip->id); + WM_event_add_notifier(C, NC_SCENE|ND_NODES, NULL); + } + } else if (t->spacetype == SPACE_ACTION) { SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first; bAnimContext ac; @@ -5264,6 +5283,229 @@ static void createTransNodeData(bContext *C, TransInfo *t) CTX_DATA_END } +/* *** CLIP EDITOR *** */ + +typedef struct TransDataTracking { + int area; + float *relative, *loc; + float soffset[2], srelative[2]; + float offset[2]; + + float (*smarkers)[2]; + int markersnr; + MovieTrackingMarker *markers; +} TransDataTracking; + +static void markerToTransDataInit(TransData *td, TransData2D *td2d, + TransDataTracking *tdt, MovieTrackingTrack *track, int area, float *loc, float *rel, float *off) +{ + int anchor = area==TRACK_AREA_POINT && off; + + if(anchor) { + td2d->loc[0] = rel[0]; /* hold original location */ + td2d->loc[1] = rel[1]; + + tdt->loc= loc; + td2d->loc2d = loc; /* current location */ + } else { + td2d->loc[0] = loc[0]; /* hold original location */ + td2d->loc[1] = loc[1]; + + td2d->loc2d = loc; /* current location */ + } + td2d->loc[2] = 0.0f; + + tdt->relative= rel; + tdt->area= area; + + tdt->markersnr= track->markersnr; + tdt->markers= track->markers; + + if(rel) { + if(!anchor) { + td2d->loc[0]+= rel[0]; + td2d->loc[1]+= rel[1]; + } + + copy_v2_v2(tdt->srelative, rel); + } + + if(off) + copy_v2_v2(tdt->soffset, off); + + td->flag = 0; + td->loc = td2d->loc; + VECCOPY(td->center, td->loc); + VECCOPY(td->iloc, td->loc); + + memset(td->axismtx, 0, sizeof(td->axismtx)); + td->axismtx[2][2] = 1.0f; + + td->ext= NULL; td->val= NULL; + + td->flag |= TD_SELECTED; + td->dist= 0.0; + + unit_m3(td->mtx); + unit_m3(td->smtx); +} + +static void trackToTransData(SpaceClip *sc, TransData *td, TransData2D *td2d, + TransDataTracking *tdt, MovieTrackingTrack *track) +{ + MovieTrackingMarker *marker= BKE_tracking_ensure_marker(track, sc->user.framenr); + + track->transflag= marker->flag; + + marker->flag&= ~(MARKER_DISABLED|MARKER_TRACKED); + + markerToTransDataInit(td++, td2d++, tdt++, track, TRACK_AREA_POINT, track->offset, marker->pos, track->offset); + + if(track->flag&SELECT) + markerToTransDataInit(td++, td2d++, tdt++, track, TRACK_AREA_POINT, marker->pos, NULL, NULL); + + if(track->pat_flag&SELECT) { + markerToTransDataInit(td++, td2d++, tdt++, track, TRACK_AREA_PAT, track->pat_min, marker->pos, NULL); + markerToTransDataInit(td++, td2d++, tdt++, track, TRACK_AREA_PAT, track->pat_max, marker->pos, NULL); + } + + if(track->search_flag&SELECT) { + markerToTransDataInit(td++, td2d++, tdt++, track, TRACK_AREA_SEARCH, track->search_min, marker->pos, NULL); + markerToTransDataInit(td++, td2d++, tdt++, track, TRACK_AREA_SEARCH, track->search_max, marker->pos, NULL); + } +} + +static void transDataTrackingFree(TransInfo *t) +{ + TransDataTracking *tdt= t->customData; + + if(tdt) { + if(tdt->smarkers) MEM_freeN(tdt->smarkers); + MEM_freeN(tdt); + } +} + +static void createTransTrackingData(bContext *C, TransInfo *t) +{ + TransData *td; + TransData2D *td2d; + SpaceClip *sc = CTX_wm_space_clip(C); + MovieClip *clip = ED_space_clip(sc); + MovieTrackingTrack *track; + MovieTrackingMarker *marker; + TransDataTracking *tdt; + int framenr = sc->user.framenr; + + if(clip && !BKE_movieclip_has_frame(clip, &sc->user)) { + t->total = 0; + return; + } + + /* count */ + t->total = 0; + + track = clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) { + marker= BKE_tracking_get_marker(track, framenr); + + if(marker) { + t->total++; /* offset */ + + if(track->flag&SELECT) t->total++; + if(track->pat_flag&SELECT) t->total+= 2; + if(track->search_flag&SELECT) t->total+= 2; + } + } + + track = track->next; + } + + if(t->total==0) + return; + + td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransTracking TransData"); + td2d = t->data2d = MEM_callocN(t->total*sizeof(TransData2D), "TransTracking TransData2D"); + tdt = t->customData = MEM_callocN(t->total*sizeof(TransDataTracking), "TransTracking TransDataTracking"); + + t->customFree= transDataTrackingFree; + + /* create actual data */ + track = clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) { + marker= BKE_tracking_get_marker(track, framenr); + + trackToTransData(sc, td, td2d, tdt, track); + + /* offset */ + td++; + td2d++; + tdt++; + + if((marker->flag&MARKER_DISABLED)==0) { + if(track->flag&SELECT) {td++; td2d++; tdt++;} + if(track->pat_flag&SELECT) {td+= 2; td2d+= 2;tdt+=2;} + } + + if(track->search_flag&SELECT) { + td+= 2; + td2d+= 2; + tdt+= 2; + + if(marker->flag&MARKER_DISABLED) { + td+= 3; + td2d+= 3; + tdt+= 3; + }; + } + } + + track = track->next; + } +} + +void flushTransTracking(TransInfo *t) +{ + TransData *td; + TransData2D *td2d; + TransDataTracking *tdt; + int a; + + /* flush to 2d vector from internally used 3d vector */ + for(a=0, td= t->data, td2d= t->data2d, tdt= t->customData; a<t->total; a++, td2d++, td++, tdt++) { + if(t->flag&T_ALT_TRANSFORM) { + if(tdt->area==TRACK_AREA_POINT && tdt->relative) { + float d[2], d2[2]; + + if(!tdt->smarkers) { + tdt->smarkers= MEM_callocN(sizeof(*tdt->smarkers)*tdt->markersnr, "flushTransTracking markers"); + for(a= 0; a<tdt->markersnr; a++) + copy_v2_v2(tdt->smarkers[a], tdt->markers[a].pos); + } + + sub_v2_v2v2(d, td2d->loc, tdt->soffset); + sub_v2_v2(d, tdt->srelative); + + sub_v2_v2v2(d2, td2d->loc, tdt->srelative); + + for(a= 0; a<tdt->markersnr; a++) + add_v2_v2v2(tdt->markers[a].pos, tdt->smarkers[a], d2); + + negate_v2_v2(td2d->loc2d, d); + } + } + + if(tdt->area!=TRACK_AREA_POINT || tdt->relative==0) { + td2d->loc2d[0] = td2d->loc[0]; + td2d->loc2d[1] = td2d->loc[1]; + + if(tdt->relative) + sub_v2_v2(td2d->loc2d, tdt->relative); + } + } +} + void createTransData(bContext *C, TransInfo *t) { Scene *scene = t->scene; @@ -5329,6 +5571,10 @@ void createTransData(bContext *C, TransInfo *t) sort_trans_data_dist(t); } } + else if (t->spacetype == SPACE_CLIP) { + t->flag |= T_POINTS|T_2D_EDIT; + createTransTrackingData(C, t); + } else if (t->obedit) { t->ext = NULL; if (t->obedit->type == OB_MESH) { diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 2c69cc85214..53e379a2d27 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -47,6 +47,7 @@ #include "DNA_meshdata_types.h" #include "DNA_view3d_types.h" #include "DNA_modifier_types.h" +#include "DNA_movieclip_types.h" #include "RNA_access.h" @@ -70,6 +71,7 @@ #include "BKE_mesh.h" #include "BKE_nla.h" #include "BKE_context.h" +#include "BKE_tracking.h" #include "ED_anim_api.h" #include "ED_armature.h" @@ -83,6 +85,7 @@ #include "ED_uvedit.h" #include "ED_view3d.h" #include "ED_curve.h" /* for curve_editnurbs */ +#include "ED_clip.h" //#include "BDR_unwrapper.h" @@ -863,6 +866,48 @@ void recalcData(TransInfo *t) else if (t->spacetype == SPACE_VIEW3D) { recalcData_view3d(t); } + else if (t->spacetype == SPACE_CLIP) { + SpaceClip *sc= t->sa->spacedata.first; + MovieClip *clip= ED_space_clip(sc); + MovieTrackingTrack *track; + + if(t->state == TRANS_CANCEL) { + track= clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track)) { + MovieTrackingMarker *marker= BKE_tracking_ensure_marker(track, sc->user.framenr); + + marker->flag= track->transflag; + } + + track= track->next; + } + } + + flushTransTracking(t); + + track= clip->tracking.tracks.first; + while(track) { + if(TRACK_VIEW_SELECTED(sc, track)) { + if (t->mode == TFM_TRANSLATION) { + if(TRACK_AREA_SELECTED(track, TRACK_AREA_PAT)) + BKE_tracking_clamp_track(track, CLAMP_PAT_POS); + if(TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH)) + BKE_tracking_clamp_track(track, CLAMP_SEARCH_POS); + } + else if (t->mode == TFM_RESIZE) { + if(TRACK_AREA_SELECTED(track, TRACK_AREA_PAT)) + BKE_tracking_clamp_track(track, CLAMP_PAT_DIM); + if(TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH)) + BKE_tracking_clamp_track(track, CLAMP_SEARCH_DIM); + } + } + + track= track->next; + } + + DAG_id_tag_update(&clip->id, 0); + } } void drawLine(TransInfo *t, float *center, float *dir, char axis, short options) @@ -941,7 +986,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) if (event) { - VECCOPY2D(t->imval, event->mval); + copy_v2_v2_int(t->imval, event->mval); t->event_type = event->type; } else diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index cc3ffe086f1..3de68a6e312 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -409,7 +409,7 @@ int handleMouseInput(TransInfo *t, MouseInput *mi, wmEvent *event) t->modifiers |= MOD_PRECISION; /* shift is modifier for higher precision transform * store the mouse position where the normal movement ended */ - VECCOPY2D(mi->precision_mval, event->mval); + copy_v2_v2_int(mi->precision_mval, event->mval); mi->precision = 1; } else diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index f926f442830..7951fe0ee02 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -973,6 +973,11 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0); RNA_string_set(km->ptr, "data_path", "tool_settings.use_snap"); break; + case SPACE_CLIP: + WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0); + WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0); + break; default: break; } diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index a09778726d5..5d61d2a1ebb 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -606,9 +606,9 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], { if(efa->f & SELECT) { - VECADD(normal, normal, efa->n); + add_v3_v3(normal, efa->n); sub_v3_v3v3(vec, efa->v2->co, efa->v1->co); - VECADD(plane, plane, vec); + add_v3_v3(plane, vec); } } @@ -662,7 +662,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], if(eed->f & SELECT) { /* use average vert normals as plane and edge vector as normal */ copy_v3_v3(plane, eed->v1->no); - VECADD(plane, plane, eed->v2->no); + add_v3_v3(plane, eed->v2->no); sub_v3_v3v3(normal, eed->v2->co, eed->v1->co); break; } @@ -683,7 +683,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], v2 = eve; copy_v3_v3(plane, v1->no); - VECADD(plane, plane, v2->no); + add_v3_v3(plane, v2->no); sub_v3_v3v3(normal, v2->co, v1->co); break; } diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt index 69f576d8aa7..7a6ccdff08f 100644 --- a/source/blender/editors/util/CMakeLists.txt +++ b/source/blender/editors/util/CMakeLists.txt @@ -46,6 +46,7 @@ set(SRC ../include/BIF_glutil.h ../include/ED_anim_api.h ../include/ED_armature.h + ../include/ED_clip.h ../include/ED_curve.h ../include/ED_datafiles.h ../include/ED_fileselect.h diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index 9ca990c4193..9ee4a875e24 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -80,7 +80,7 @@ static void make_vertexcos__mapFunc(void *userData, int index, float *co, float if(!mappedData->flags[index]) { /* we need coord from prototype vertex, not it clones or images, suppose they stored in the beginning of vertex array stored in DM */ - VECCOPY(vec, co); + copy_v3_v3(vec, co); mappedData->flags[index]= 1; } } diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index a312b0abbb4..34dffc11d94 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -338,7 +338,7 @@ int undo_editmode_valid(const char *undoname) /* get name of undo item, return null if no item with this index */ /* if active pointer, set it to 1 if true */ -char *undo_editmode_get_name(bContext *C, int nr, int *active) +const char *undo_editmode_get_name(bContext *C, int nr, int *active) { UndoElem *uel; diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 6a1819736a2..527537b5efb 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -426,7 +426,7 @@ static EnumPropertyItem *rna_undo_itemf(bContext *C, int undosys, int *totitem) int active, i= 0; while(TRUE) { - char *name= NULL; + const char *name= NULL; if(undosys==UNDOSYSTEM_PARTICLE) { name= PE_undo_get_name(CTX_data_scene(C), i, &active); diff --git a/source/blender/editors/util/util_intern.h b/source/blender/editors/util/util_intern.h index 3e2833ec89a..c6e2d079c28 100644 --- a/source/blender/editors/util/util_intern.h +++ b/source/blender/editors/util/util_intern.h @@ -37,7 +37,7 @@ /* editmode_undo.c */ void undo_editmode_name (struct bContext *C, const char *undoname); int undo_editmode_valid (const char *undoname); -char *undo_editmode_get_name (struct bContext *C, int nr, int *active); +const char *undo_editmode_get_name (struct bContext *C, int nr, int *active); void *undo_editmode_get_prev (struct Object *ob); void undo_editmode_step (struct bContext *C, int step); void undo_editmode_number (struct bContext *C, int nr); diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 8a50ec28bd6..0f21aa3759c 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -267,10 +267,10 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac #endif /* uv angles */ - VECSUB2D(av1, tf_uv[3], tf_uv[0]); normalize_v2(av1); - VECSUB2D(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2); - VECSUB2D(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3); - VECSUB2D(av4, tf_uv[2], tf_uv[3]); normalize_v2(av4); + sub_v2_v2v2(av1, tf_uv[3], tf_uv[0]); normalize_v2(av1); + sub_v2_v2v2(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2); + sub_v2_v2v2(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3); + sub_v2_v2v2(av4, tf_uv[2], tf_uv[3]); normalize_v2(av4); /* This is the correct angle however we are only comparing angles * uvang1 = 90-((angle_normalized_v2v2(av1, av2) * RAD2DEGF(1.0f))-90);*/ @@ -280,10 +280,10 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac uvang4 = angle_normalized_v2v2(av4, av1); /* 3d angles */ - VECSUB(av1, efa->v4->co, efa->v1->co); normalize_v3(av1); - VECSUB(av2, efa->v1->co, efa->v2->co); normalize_v3(av2); - VECSUB(av3, efa->v2->co, efa->v3->co); normalize_v3(av3); - VECSUB(av4, efa->v3->co, efa->v4->co); normalize_v3(av4); + sub_v3_v3v3(av1, efa->v4->co, efa->v1->co); normalize_v3(av1); + sub_v3_v3v3(av2, efa->v1->co, efa->v2->co); normalize_v3(av2); + sub_v3_v3v3(av3, efa->v2->co, efa->v3->co); normalize_v3(av3); + sub_v3_v3v3(av4, efa->v3->co, efa->v4->co); normalize_v3(av4); /* This is the correct angle however we are only comparing angles * ang1 = 90-((angle_normalized_v3v3(av1, av2) * RAD2DEGF(1.0f))-90);*/ @@ -328,9 +328,9 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac #endif /* uv angles */ - VECSUB2D(av1, tf_uv[2], tf_uv[0]); normalize_v2(av1); - VECSUB2D(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2); - VECSUB2D(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3); + sub_v2_v2v2(av1, tf_uv[2], tf_uv[0]); normalize_v2(av1); + sub_v2_v2v2(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2); + sub_v2_v2v2(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3); /* This is the correct angle however we are only comparing angles * uvang1 = 90-((angle_normalized_v2v2(av1, av2) * 180.0/M_PI)-90); */ @@ -339,9 +339,9 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac uvang3 = angle_normalized_v2v2(av3, av1); /* 3d angles */ - VECSUB(av1, efa->v3->co, efa->v1->co); normalize_v3(av1); - VECSUB(av2, efa->v1->co, efa->v2->co); normalize_v3(av2); - VECSUB(av3, efa->v2->co, efa->v3->co); normalize_v3(av3); + sub_v3_v3v3(av1, efa->v3->co, efa->v1->co); normalize_v3(av1); + sub_v3_v3v3(av2, efa->v1->co, efa->v2->co); normalize_v3(av2); + sub_v3_v3v3(av3, efa->v2->co, efa->v3->co); normalize_v3(av3); /* This is the correct angle however we are only comparing angles * ang1 = 90-((angle_normalized_v3v3(av1, av2) * 180.0/M_PI)-90); */ ang1 = angle_normalized_v3v3(av1, av2); diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 3593d94b400..62b875c82de 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -2530,11 +2530,11 @@ static int snap_uvs_to_cursor(Scene *scene, Image *ima, Object *obedit, SpaceIma for(efa= em->faces.first; efa; efa= efa->next) { tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); if(uvedit_face_visible(scene, ima, efa, tface)) { - if(uvedit_uv_selected(scene, efa, tface, 0)) VECCOPY2D(tface->uv[0], sima->cursor); - if(uvedit_uv_selected(scene, efa, tface, 1)) VECCOPY2D(tface->uv[1], sima->cursor); - if(uvedit_uv_selected(scene, efa, tface, 2)) VECCOPY2D(tface->uv[2], sima->cursor); + if(uvedit_uv_selected(scene, efa, tface, 0)) copy_v2_v2(tface->uv[0], sima->cursor); + if(uvedit_uv_selected(scene, efa, tface, 1)) copy_v2_v2(tface->uv[1], sima->cursor); + if(uvedit_uv_selected(scene, efa, tface, 2)) copy_v2_v2(tface->uv[2], sima->cursor); if(efa->v4) - if(uvedit_uv_selected(scene, efa, tface, 3)) VECCOPY2D(tface->uv[3], sima->cursor); + if(uvedit_uv_selected(scene, efa, tface, 3)) copy_v2_v2(tface->uv[3], sima->cursor); change= 1; } diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 26c08f6cae5..9344b4e680a 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -260,7 +260,7 @@ void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double tim if(!lamp->hide && (lamp->lay & viewlay) && (!(lamp->mode & LA_LAYER) || (lamp->lay & oblay))) { lamp->dynenergy = lamp->energy; - VECCOPY(lamp->dyncol, lamp->col); + copy_v3_v3(lamp->dyncol, lamp->col); } else { lamp->dynenergy = 0.0f; @@ -296,7 +296,7 @@ void GPU_material_bind_uniforms(GPUMaterial *material, float obmat[][4], float v GPU_shader_uniform_vector(shader, material->invobmatloc, 16, 1, (float*)invmat); } if(material->builtins & GPU_OBCOLOR) { - QUATCOPY(col, obcol); + copy_v4_v4(col, obcol); CLAMP(col[3], 0.0f, 1.0f); GPU_shader_uniform_vector(shader, material->obcolloc, 4, 1, col); } @@ -306,14 +306,14 @@ void GPU_material_bind_uniforms(GPUMaterial *material, float obmat[][4], float v lamp= nlink->data; if(material->dynproperty & DYN_LAMP_VEC) { - VECCOPY(lamp->dynvec, lamp->vec); + copy_v3_v3(lamp->dynvec, lamp->vec); normalize_v3(lamp->dynvec); negate_v3(lamp->dynvec); mul_mat3_m4_v3(viewmat, lamp->dynvec); } if(material->dynproperty & DYN_LAMP_CO) { - VECCOPY(lamp->dynco, lamp->co); + copy_v3_v3(lamp->dynco, lamp->co); mul_m4_v3(viewmat, lamp->dynco); } @@ -1472,8 +1472,8 @@ void GPU_lamp_update(GPULamp *lamp, int lay, int hide, float obmat[][4]) copy_m4_m4(mat, obmat); normalize_m4(mat); - VECCOPY(lamp->vec, mat[2]); - VECCOPY(lamp->co, mat[3]); + copy_v3_v3(lamp->vec, mat[2]); + copy_v3_v3(lamp->co, mat[3]); copy_m4_m4(lamp->obmat, mat); invert_m4_m4(lamp->imat, mat); } diff --git a/source/blender/ikplugin/intern/iksolver_plugin.c b/source/blender/ikplugin/intern/iksolver_plugin.c index cfaafe9bf5c..2a83052c827 100644 --- a/source/blender/ikplugin/intern/iksolver_plugin.c +++ b/source/blender/ikplugin/intern/iksolver_plugin.c @@ -205,9 +205,9 @@ static void where_is_ik_bone(bPoseChannel *pchan, float ik_mat[][3]) // nr = t mul_m4_m4m4(pchan->pose_mat, ikmat, pchan->chan_mat); /* calculate head */ - VECCOPY(pchan->pose_head, pchan->pose_mat[3]); + copy_v3_v3(pchan->pose_head, pchan->pose_mat[3]); /* calculate tail */ - VECCOPY(vec, pchan->pose_mat[1]); + copy_v3_v3(vec, pchan->pose_mat[1]); mul_v3_fl(vec, pchan->bone->length); add_v3_v3v3(pchan->pose_tail, pchan->pose_head, vec); @@ -340,7 +340,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) copy_m4_m4(rootmat, pchan->parent->pose_mat); else unit_m4(rootmat); - VECCOPY(rootmat[3], pchan->pose_head); + copy_v3_v3(rootmat[3], pchan->pose_head); mul_m4_m4m4(imat, rootmat, ob->obmat); invert_m4_m4(goalinv, imat); @@ -359,7 +359,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) /* and set and transform goal */ mul_m4_m4m4(goal, rootmat, goalinv); - VECCOPY(goalpos, goal[3]); + copy_v3_v3(goalpos, goal[3]); copy_m3_m4(goalrot, goal); /* same for pole vector target */ @@ -372,7 +372,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) } else { mul_m4_m4m4(goal, rootmat, goalinv); - VECCOPY(polepos, goal[3]); + copy_v3_v3(polepos, goal[3]); poleconstrain= 1; /* for pole targets, we blend the result of the ik solver @@ -398,7 +398,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) /* end effector in world space */ copy_m4_m4(end_pose, pchan->pose_mat); - VECCOPY(end_pose[3], pchan->pose_tail); + copy_v3_v3(end_pose[3], pchan->pose_tail); mul_serie_m4(world_pose, goalinv, ob->obmat, end_pose, NULL, NULL, NULL, NULL, NULL); /* blend position */ @@ -526,12 +526,14 @@ void iksolver_execute_tree(struct Scene *scene, struct Object *ob, struct bPose /* 6. apply the differences to the channels, we need to calculate the original differences first */ - for(a=0; a<tree->totchannel; a++) + for(a=0; a<tree->totchannel; a++) { make_dmats(tree->pchan[a]); + } - for(a=0; a<tree->totchannel; a++) + for(a=0; a<tree->totchannel; a++) { /* sets POSE_DONE */ where_is_ik_bone(tree->pchan[a], tree->basis_change[a]); + } /* 7. and free */ BLI_remlink(&pchan->iktree, tree); diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp index 400e720f138..2cb3a32ae3e 100644 --- a/source/blender/ikplugin/intern/itasc_plugin.cpp +++ b/source/blender/ikplugin/intern/itasc_plugin.cpp @@ -558,7 +558,7 @@ static bool target_callback(const iTaSC::Timestamp& timestamp, const iTaSC::Fram pchan = pchan->parent; float chanmat[4][4]; copy_m4_m4(chanmat, pchan->pose_mat); - VECCOPY(chanmat[3], pchan->pose_tail); + copy_v3_v3(chanmat[3], pchan->pose_tail); mul_serie_m4(restmat, target->owner->obmat, chanmat, target->eeRest, NULL, NULL, NULL, NULL, NULL); } else { @@ -585,7 +585,7 @@ static bool base_callback(const iTaSC::Timestamp& timestamp, const iTaSC::Frame& pchan = pchan->parent; float chanmat[4][4]; copy_m4_m4(chanmat, pchan->pose_mat); - VECCOPY(chanmat[3], pchan->pose_tail); + copy_v3_v3(chanmat[3], pchan->pose_tail); // save the base as a frame too so that we can compute deformation // after simulation ikscene->baseFrame.setValue(&chanmat[0][0]); @@ -1662,12 +1662,12 @@ static void execute_scene(Scene* blscene, IK_Scene* ikscene, bItasc* ikparam, fl pchan = ikchan->pchan; // tail mat ikchan->frame.getValue(&pchan->pose_mat[0][0]); - VECCOPY(pchan->pose_tail, pchan->pose_mat[3]); + copy_v3_v3(pchan->pose_tail, pchan->pose_mat[3]); // shift to head - VECCOPY(yaxis, pchan->pose_mat[1]); + copy_v3_v3(yaxis, pchan->pose_mat[1]); mul_v3_fl(yaxis, length); sub_v3_v3v3(pchan->pose_mat[3], pchan->pose_mat[3], yaxis); - VECCOPY(pchan->pose_head, pchan->pose_mat[3]); + copy_v3_v3(pchan->pose_head, pchan->pose_mat[3]); // add scale mul_v3_fl(pchan->pose_mat[0], scale); mul_v3_fl(pchan->pose_mat[1], scale); diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 6f2933d154b..7fa26478ae2 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -194,6 +194,7 @@ typedef struct PreviewImage { #define ID_PA MAKE_ID2('P', 'A') /* ParticleSettings */ #define ID_GD MAKE_ID2('G', 'D') /* GreasePencil */ #define ID_WM MAKE_ID2('W', 'M') /* WindowManager */ +#define ID_MC MAKE_ID2('M', 'C') /* MovieClip */ /* NOTE! Fake IDs, needed for g.sipo->blocktype or outliner */ #define ID_SEQ MAKE_ID2('S', 'Q') diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index db574160771..b198231df3a 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -198,7 +198,9 @@ typedef struct bPoseChannel { struct Bone *bone; /* set on read file or rebuild pose */ struct bPoseChannel *parent; /* set on read file or rebuild pose */ struct bPoseChannel *child; /* set on read file or rebuild pose, the 'ik' child, for b-bones */ - struct ListBase iktree; /* only while evaluating pose */ + + struct ListBase iktree; /* "IK trees" - only while evaluating pose */ + struct ListBase siktree; /* Spline-IK "trees" - only while evaluating pose */ bMotionPath *mpath; /* motion path cache for this bone */ struct Object *custom; /* draws custom object instead of default bone shape */ diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 00f6f2433af..3620131b8df 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -406,6 +406,18 @@ typedef struct bShrinkwrapConstraint { char pad[9]; } bShrinkwrapConstraint; +/* Follow Track constraints */ +typedef struct bFollowTrackConstraint { + struct MovieClip *clip; + char track[24]; + int flag, reference; +} bFollowTrackConstraint; + +/* Camera Solver constraints */ +typedef struct bCameraSolverConstraint { + struct MovieClip *clip; + int flag, pad; +} bCameraSolverConstraint; /* ------------------------------------------ */ @@ -440,6 +452,8 @@ typedef enum eBConstraint_Types { CONSTRAINT_TYPE_TRANSLIKE, /* Copy transform matrix */ CONSTRAINT_TYPE_SAMEVOL, /* Maintain volume during scaling */ CONSTRAINT_TYPE_PIVOT, /* Pivot Constraint */ + CONSTRAINT_TYPE_FOLLOWTRACK, /* Follow Track Constraint */ + CONSTRAINT_TYPE_CAMERASOLVER, /* Camera Solver Constraint */ /* NOTE: no constraints are allowed to be added after this */ NUM_CONSTRAINT_TYPES @@ -737,6 +751,21 @@ typedef enum ePivotConstraint_Flag { PIVOTCON_FLAG_ROTACT_NEG = (1<<1) } ePivotConstraint_Flag; +/* FollowTrack Constraint -> flag */ +typedef enum eFollowTrack_Reference { + FOLLOWTRACK_TRACK = (1<<0), + FOLLOWTRACK_BUNDLE = (1<<1) +} FollowTrack_Reference; + +typedef enum eFollowTrack_Flags { + FOLLOWTRACK_ACTIVECLIP = (1<<0) +} eFollowTrack_Flags; + +/* CameraSolver Constraint -> flag */ +typedef enum eCameraSolver_Flags { + CAMERASOLVER_ACTIVECLIP = (1<<0) +} eCameraSolver_Flags; + /* Rigid-Body Constraint */ #define CONSTRAINT_DRAW_PIVOT 0x40 #define CONSTRAINT_DISABLE_LINKED_COLLISION 0x80 diff --git a/source/blender/makesdna/DNA_movieclip_types.h b/source/blender/makesdna/DNA_movieclip_types.h new file mode 100644 index 00000000000..fc21f26fa32 --- /dev/null +++ b/source/blender/makesdna/DNA_movieclip_types.h @@ -0,0 +1,126 @@ +/* + * ***** 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) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef DNA_MOVIECLIP_TYPES_H +#define DNA_MOVIECLIP_TYPES_H + +/** \file DNA_movieclip_types.h + * \ingroup DNA + * \since may-2011 + * \author Sergey Sharybin + */ + +#include "DNA_ID.h" +#include "DNA_tracking_types.h" + +struct anim; +struct bGPdata; +struct ImBuf; +struct MovieClipProxy; +struct MovieTrackingTrack; +struct MovieTrackingMarker; + +typedef struct MovieClipUser { + int framenr; /* current frame number */ + short render_size, render_flag; /* proxy render size */ +} MovieClipUser; + +typedef struct MovieClipProxy { + char dir[160]; /* custom directory for index and proxy files (defaults to BL_proxy) */ + + short tc; /* time code in use */ + short quality; /* proxy build quality */ + short build_size_flag; /* size flags (see below) of all proxies to build */ + short build_tc_flag; /* time code flags (see below) of all tc indices to build */ + short build_flag, pad; /* other build flags */ + char pad2[4]; +} MovieClipProxy; + +typedef struct MovieClip { + ID id; + + char name[240]; /* file path */ + + int source; /* sequence or movie */ + int lastframe; /* last accessed frame number */ + int lastsize[2]; /* size of last accessed frame */ + + float aspx, aspy; /* display aspect */ + + struct anim *anim; /* movie source data */ + struct MovieClipCache *cache; /* cache for different stuff, not in file */ + struct bGPdata *gpd; /* grease pencil data */ + + struct MovieTracking tracking; /* data for SfM tracking */ + void *tracking_context; /* context of tracking job + used to synchronize data like framenumber + in SpaceClip clip user */ + + struct MovieClipProxy proxy; /* proxy to clip data */ + int flag, pad; +} MovieClip; + +typedef struct MovieClipScopes { + int ok; /* 1 means scopes are ok and recalculation is unneeded */ + int track_preview_height; /* height of track preview widget */ + struct ImBuf *track_preview; /* ImBuf displayed in track preview */ + float track_pos[2]; /* sub-pizel position of marker in track ImBuf */ + short track_disabled; /* active track is disabled, special notifier should be drawn */ + char pad[2]; + int framenr; /* frame number scopes are created for */ + struct MovieTrackingTrack *track; /* track scopes are created for */ + struct MovieTrackingMarker *marker; /* marker scopes are created for */ + float slide_scale[2]; /* scale used for sliding from previewe area */ +} MovieClipScopes; + +/* MovieClipProxy->build_flag */ +#define MCLIP_PROXY_BUILD_UNDISTORT 1 /* build undistorted proxies as well */ + +/* MovieClip->source */ +#define MCLIP_SRC_SEQUENCE 1 +#define MCLIP_SRC_MOVIE 2 + +/* MovieClip->selection types */ +#define MCLIP_SEL_NONE 0 +#define MCLIP_SEL_TRACK 1 + +/* MovieClip->flag */ +#define MCLIP_USE_PROXY (1<<0) +#define MCLIP_USE_PROXY_CUSTOM_DIR (1<<1) + +/* MovieClip->render_size */ +#define MCLIP_PROXY_RENDER_SIZE_FULL 0 +#define MCLIP_PROXY_RENDER_SIZE_25 1 +#define MCLIP_PROXY_RENDER_SIZE_50 2 +#define MCLIP_PROXY_RENDER_SIZE_75 3 +#define MCLIP_PROXY_RENDER_SIZE_100 4 + +/* MovieClip->render_flag */ +#define MCLIP_PROXY_RENDER_UNDISTORT 1 + +#endif diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 3306b9e97bc..29568fdd0fb 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -163,7 +163,8 @@ typedef struct Object { short transflag, protectflag; /* transformation settings and transform locks */ short trackflag, upflag; - short nlaflag, ipoflag; // xxx depreceated... old animation system + short nlaflag; /* used for DopeSheet filtering settings (expanded/collapsed) */ + short ipoflag; // xxx depreceated... old animation system short scaflag; /* ui state for game logic */ char scavisflag; /* more display settings for game logic */ char pad5; @@ -325,11 +326,12 @@ typedef struct DupliObject { #define PARVERT1 5 #define PARVERT3 6 #define PARBONE 7 + + /* slow parenting - is not threadsafe and/or may give errors after jumping */ #define PARSLOW 16 /* (short) transflag */ -/*#define OB_OFFS_LOCAL 1*/ /*UNUSED*/ -/* #define OB_QUAT 2 */ /* never used, free flag */ +/* flags 1 and 2 were unused or relics from past features */ #define OB_NEG_SCALE 4 #define OB_DUPLI (8+16+256+512+2048) #define OB_DUPLIFRAMES 8 @@ -345,24 +347,12 @@ typedef struct DupliObject { #define OB_NO_CONSTRAINTS 8192 /* runtime constraints disable */ /* (short) ipoflag */ - // XXX depreceated - old animation system crap -#define OB_DRAWKEY 1 -#define OB_DRAWKEYSEL 2 -#define OB_OFFS_OB 4 -/* #define OB_OFFS_MAT 8 */ /*UNUSED*/ -/* #define OB_OFFS_VKEY 16 */ /*UNUSED*/ -/* #define OB_OFFS_PATH 32 */ /*UNUSED*/ -#define OB_OFFS_PARENT 64 -#define OB_OFFS_PARTICLE 128 - /* get ipo from from action or not? */ -#define OB_ACTION_OB 256 -#define OB_ACTION_KEY 512 - /* for stride edit */ +/* XXX: many old flags for features removed due to incompatability + * with new system and/or other design issues were here + */ + /* for stride/path editing (XXX: NEEDS REVIEW) */ #define OB_DISABLE_PATH 1024 -#define OB_OFFS_PARENTADD 2048 - - /* (short) trackflag / upflag */ #define OB_POSX 0 #define OB_POSY 1 @@ -529,10 +519,7 @@ typedef struct DupliObject { #define OB_SHAPE_EDIT_MODE 4 /* ob->nlaflag */ - // XXX depreceated - old animation system -#define OB_NLA_OVERRIDE (1<<0) -#define OB_NLA_COLLAPSED (1<<1) - + /* WARNING: flags (1<<0) and (1<<1) were from old animsys */ /* object-channel expanded status */ #define OB_ADS_COLLAPSED (1<<10) /* object's ipo-block */ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index de04e83e569..27e21290a9b 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -31,7 +31,7 @@ * \ingroup DNA */ -// XXX, temp feature +// XXX, temp feature - campbell #define DURIAN_CAMERA_SWITCH #ifdef __cplusplus @@ -54,6 +54,7 @@ struct AnimData; struct Editing; struct SceneStats; struct bGPdata; +struct MovieClip; typedef struct Base { struct Base *next, *prev; @@ -863,6 +864,9 @@ typedef struct Scene { /* Physics simulation settings */ struct PhysicsSettings physics_settings; + + /* Movie Tracking */ + struct MovieClip *clip; /* active movie clip */ } Scene; @@ -1337,7 +1341,6 @@ typedef enum SculptFlags { #define USER_UNIT_OPT_SPLIT 1 #define USER_UNIT_ROT_RADIANS 2 - #ifdef __cplusplus } #endif diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 5d437fefebc..1bafefe2b11 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -37,6 +37,7 @@ #include "DNA_vec_types.h" #include "DNA_outliner_types.h" /* for TreeStoreElem */ #include "DNA_image_types.h" /* ImageUser */ +#include "DNA_movieclip_types.h" /* MovieClipUser */ /* Hum ... Not really nice... but needed for spacebuts. */ #include "DNA_view2d_types.h" @@ -62,6 +63,8 @@ struct bScreen; struct Scene; struct wmOperator; struct wmTimer; +struct MovieClip; +struct MovieClipScopes; /** * The base structure all the other spaces @@ -489,6 +492,32 @@ typedef struct SpaceUserPref { } SpaceUserPref; +typedef struct SpaceClip { + SpaceLink *next, *prev; + ListBase regionbase; /* storage of regions for inactive spaces */ + int spacetype; + + float xof, yof; /* user defined offset, image is centered */ + float xlockof, ylockof; /* user defined offset from locked position */ + float zoom; /* user defined zoom level */ + + struct MovieClipUser user; /* user of clip */ + struct MovieClip *clip; /* clip data */ + struct MovieClipScopes scopes; /* different scoped displayed in space panels */ + + int flag; /* flags */ + short mode; /* editor mode (editing context being displayed) */ + short view; /* type of the clip editor view */ + + int path_length; /* length of displaying path, in frames */ + + /* current stabilization data */ + float loc[2], scale, angle; /* pre-composed stabilization data */ + int pad; + float stabmat[4][4], unistabmat[4][4]; /* current stabilization matrix and the same matrix in unified space, + defined when drawing and used for mouse position calculation */ +} SpaceClip; + /* view3d Now in DNA_view3d_types.h */ @@ -824,6 +853,7 @@ enum { #define TIME_ALL_IMAGE_WIN 64 #define TIME_CONTINUE_PHYSICS 128 #define TIME_NODES 256 +#define TIME_CLIPS 512 /* time->cache */ #define TIME_CACHE_DISPLAY 1 @@ -862,6 +892,33 @@ enum { #define SEQ_PROXY_RENDER_SIZE_100 99 #define SEQ_PROXY_RENDER_SIZE_FULL 100 +/* SpaceClip->flag */ +#define SC_SHOW_MARKER_PATTERN (1<<0) +#define SC_SHOW_MARKER_SEARCH (1<<1) +#define SC_LOCK_SELECTION (1<<2) +#define SC_SHOW_TINY_MARKER (1<<3) +#define SC_SHOW_TRACK_PATH (1<<4) +#define SC_SHOW_BUNDLES (1<<5) +#define SC_MUTE_FOOTAGE (1<<6) +#define SC_HIDE_DISABLED (1<<7) +#define SC_SHOW_NAMES (1<<8) +#define SC_SHOW_GRID (1<<9) +#define SC_SHOW_STABLE (1<<10) +#define SC_MANUAL_CALIBRATION (1<<11) +#define SC_SHOW_GPENCIL (1<<12) +#define SC_SHOW_FILTERS (1<<13) +#define SC_SHOW_GRAPH_FRAMES (1<<14) +#define SC_SHOW_GRAPH_TRACKS (1<<15) +#define SC_SHOW_PYRAMID_LEVELS (1<<16) + +/* SpaceClip->mode */ +#define SC_MODE_TRACKING 0 +#define SC_MODE_RECONSTRUCTION 1 +#define SC_MODE_DISTORTION 2 + +/* SpaceClip->view */ +#define SC_VIEW_CLIP 0 +#define SC_VIEW_GRAPH 1 /* space types, moved from DNA_screen_types.h */ /* Do NOT change order, append on end. types are hardcoded needed */ @@ -886,7 +943,8 @@ enum { SPACE_LOGIC, SPACE_CONSOLE, SPACE_USERPREF, - SPACEICONMAX = SPACE_USERPREF + SPACE_CLIP, + SPACEICONMAX = SPACE_CLIP }; #endif diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h new file mode 100644 index 00000000000..b359ea3544d --- /dev/null +++ b/source/blender/makesdna/DNA_tracking_types.h @@ -0,0 +1,217 @@ +/* + * ***** 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) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef DNA_TRACKING_TYPES_H +#define DNA_TRACKING_TYPES_H + +/** \file DNA_tracking_types.h + * \ingroup DNA + * \since may-2011 + * \author Sergey Sharybin + */ + +#include "DNA_listBase.h" + +/* match-moving data */ + +struct ImBuf; +struct MovieReconstructedCamera; +struct MovieTrackingCamera; +struct MovieTrackingBundle; +struct MovieTrackingMarker; +struct MovieTrackingTrack; +struct MovieTracking; + +typedef struct MovieReconstructedCamera { + int framenr; + float error; + float mat[4][4]; +} MovieReconstructedCamera; + +typedef struct MovieTrackingCamera { + void *intrinsics; /* intrinsics handle */ + + float sensor_width; /* width of CCD sensor */ + float pixel_aspect; /* pixel aspect ratio */ + float pad; + float focal; /* focal length */ + short units; /* units of focal length user is working with */ + short pad1; + float principal[2]; /* principal point */ + float k1, k2, k3; /* radial distortion */ +} MovieTrackingCamera; + +typedef struct MovieTrackingMarker { + float pos[2]; /* 2d position of marker on frame (in unified 0..1 space) */ + int framenr; /* number of frame marker is associated with */ + int flag; /* Marker's flag (alive, ...) */ +} MovieTrackingMarker; + +typedef struct MovieTrackingTrack { + struct MovieTrackingTrack *next, *prev; + + char name[24]; + + /* ** setings ** */ + float pat_min[2], pat_max[2]; /* positions of left-bottom and right-top corners of pattern (in unified 0..1 space) */ + float search_min[2], search_max[2]; /* positions of left-bottom and right-top corners of search area (in unified 0..1 space) */ + float offset[2]; /* offset to "parenting" point */ + + /* ** track ** */ + int markersnr; /* count of markers in track */ + int last_marker; /* most recently used marker */ + MovieTrackingMarker *markers; /* markers in track */ + + /* ** reconstruction data ** */ + float bundle_pos[3]; /* reconstructed position */ + float error; /* average track reprojection error */ + + int pad; + + /* ** UI editing ** */ + int flag, pat_flag, search_flag; /* flags (selection, ...) */ + short transflag; /* transform flags */ + char pad3[2]; + float color[3]; /* custom color for track */ + + /* tracking algorithm to use; can be KLT or SAD */ + short tracker; + char pad4[2]; + + /* ** SAD tracker settings ** */ + float minimum_correlation; /* minimal correlation which is still treated as successful tracking */ + + /* ** KLT tracker settings ** */ + int pyramid_levels; /* number of pyramid levels to use for KLT tracking */ + char pad5[4]; +} MovieTrackingTrack; + +typedef struct MovieTrackingSettings { + /* ** common tracker settings ** */ + short speed; /* speed of tracking */ + short frames_limit; /* number of frames to be tarcked during single tracking session (if TRACKING_FRAMES_LIMIT is set) */ + short margin; /* margin from frame boundaries */ + char pad[2]; + + int adjframes; /* re-adjust every N frames */ + + /* ** reconstruction settings ** */ + int keyframe1, keyframe2; /* two keyframes for reconstrution initialization */ + + /* ** tool settings ** */ + + /* set scale */ + float dist; /* distance between two bundles used for scene scaling */ + + /* cleanup */ + int clean_frames, clean_action; + float clean_error; +} MovieTrackingSettings; + +typedef struct MovieTrackingStabilization { + int flag; + int tot_track, act_track; /* total number and index of active track in list */ + + /* 2d stabilization */ + float maxscale; /* max auto-scale factor */ + MovieTrackingTrack *rot_track; /* track used to stabilize rotation */ + + float locinf, scaleinf, rotinf; /* influence on location, scale and rotation */ + + /* some pre-computing run-time variables */ + int ok, pad; /* are precomputed values and scaled buf relevant? */ + float scale; /* autoscale factor */ + + struct ImBuf *scaleibuf; /* currently scaled ibuf */ +} MovieTrackingStabilization; + +typedef struct MovieTrackingReconstruction { + int flag; + + float error; /* average error of reconstruction */ + + int last_camera; /* most recently used camera */ + int camnr; /* number of reconstructed cameras */ + struct MovieReconstructedCamera *cameras; /* reconstructed cameras */ +} MovieTrackingReconstruction; + +typedef struct MovieTracking { + MovieTrackingSettings settings; /* different tracking-related settings */ + char pad2[4]; + + MovieTrackingCamera camera; /* camera intrinsics */ + ListBase tracks; /* all tracks */ + MovieTrackingReconstruction reconstruction; /* reconstruction data */ + MovieTrackingStabilization stabilization; /* stabilization data */ + MovieTrackingTrack *act_track; /* active track */ +} MovieTracking; + +/* MovieTrackingCamera->units */ +enum { + CAMERA_UNITS_PX = 0, + CAMERA_UNITS_MM +}; + +/* MovieTrackingMarker->flag */ +#define MARKER_DISABLED (1<<0) +#define MARKER_TRACKED (1<<1) +#define MARKER_GRAPH_SEL (1<<2) + +/* MovieTrackingTrack->flag */ +#define TRACK_HAS_BUNDLE (1<<1) +#define TRACK_DISABLE_RED (1<<2) +#define TRACK_DISABLE_GREEN (1<<3) +#define TRACK_DISABLE_BLUE (1<<4) +#define TRACK_HIDDEN (1<<5) +#define TRACK_LOCKED (1<<6) +#define TRACK_CUSTOMCOLOR (1<<7) +#define TRACK_USE_2D_STAB (1<<8) + +/* MovieTrackingSettings->tracker */ +#define TRACKER_KLT 0 +#define TRACKER_SAD 1 + +/* MovieTrackingSettings->speed */ +#define TRACKING_SPEED_FASTEST 0 +#define TRACKING_SPEED_REALTIME 1 +#define TRACKING_SPEED_HALF 2 +#define TRACKING_SPEED_QUARTER 4 +#define TRACKING_SPEED_DOUBLE 5 + +/* MovieTrackingStrabilization->flag */ +#define TRACKING_2D_STABILIZATION (1<<0) +#define TRACKING_AUTOSCALE (1<<1) + +/* MovieTrackingReconstruction->flag */ +#define TRACKING_RECONSTRUCTED (1<<0) + +#define TRACKING_CLEAN_SELECT 0 +#define TRACKING_CLEAN_DELETE_TRACK 1 +#define TRACKING_CLEAN_DELETE_SEGMENT 2 + +#endif diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index f54c83d6612..76d52d5b6d4 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -234,6 +234,11 @@ typedef struct ThemeSpace { char handle_vertex_select[4]; char handle_vertex_size; + + char marker_outline[4], marker[4], act_marker[4], sel_marker[4], dis_marker[4], lock_marker[4]; + char bundle_solid[4]; + char path_before[4], path_after[4]; + char camera_path[4]; char hpad[7]; char preview_back[4]; @@ -279,6 +284,7 @@ typedef struct bTheme { ThemeSpace tlogic; ThemeSpace tuserpref; ThemeSpace tconsole; + ThemeSpace tclip; /* 20 sets of bone colors for this theme */ ThemeWireColor tarm[20]; diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index aaf4186945e..93f4b209712 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -38,6 +38,8 @@ struct Tex; struct SpaceLink; struct Base; struct BoundBox; +struct MovieClip; +struct MovieClipUser; struct RenderInfo; struct RenderEngine; struct bGPdata; @@ -55,6 +57,7 @@ struct wmTimer; #include "DNA_listBase.h" #include "DNA_image_types.h" +#include "DNA_movieclip_types.h" /* ******************************** */ @@ -67,10 +70,12 @@ typedef struct BGpic { struct Image *ima; struct ImageUser iuser; + struct MovieClip *clip; + struct MovieClipUser cuser; float xof, yof, size, blend; short view; short flag; - float pad2; + short source, pad; } BGpic; /* ********************************* */ @@ -146,7 +151,12 @@ typedef struct View3D { float blockscale; short blockhandler[8]; - float viewquat[4], dist, pad1; /* XXX depricated */ + float viewquat[4], dist; /* XXX depricated */ + + float bundle_size; /* size of bundles in reconstructed data */ + short bundle_drawtype; /* display style for bundle */ + + char pad[6]; unsigned int lay_used; /* used while drawing */ @@ -248,6 +258,9 @@ typedef struct View3D { #define V3D_DISPGP 16 #define V3D_LOCK_CAMERA 32 #define V3D_RENDER_SHADOW 64 /* This is a runtime only flag that's used to tell draw_mesh_object() that we're doing a shadow pass instead of a regular draw */ +#define V3D_SHOW_RECONSTRUCTION 128 +#define V3D_SHOW_CAMERAPATH 256 +#define V3D_SHOW_BUNDLENAME 512 /* View3D->around */ #define V3D_CENTER 0 @@ -294,6 +307,12 @@ typedef struct View3D { /* BGPic->flag */ /* may want to use 1 for select ?*/ #define V3D_BGPIC_EXPANDED 2 +#define V3D_BGPIC_CAMERACLIP 4 + +/* BGPic->source */ +/* may want to use 1 for select ?*/ +#define V3D_BGPIC_IMAGE 0 +#define V3D_BGPIC_MOVIE 1 #define RV3D_CAMZOOM_MIN -30 #define RV3D_CAMZOOM_MAX 600 diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 22df8e8d1c7..c060eb186c9 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -131,6 +131,8 @@ const char *includefiles[] = { "DNA_boid_types.h", "DNA_smoke_types.h", "DNA_speaker_types.h", + "DNA_movieclip_types.h", + "DNA_tracking_types.h", "DNA_dynamicpaint_types.h", // empty string to indicate end of includefiles @@ -1197,5 +1199,7 @@ int main(int argc, char ** argv) #include "DNA_boid_types.h" #include "DNA_smoke_types.h" #include "DNA_speaker_types.h" +#include "DNA_movieclip_types.h" +#include "DNA_tracking_types.h" #include "DNA_dynamicpaint_types.h" /* end of list */ diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 8fff1928bbd..bcab4c58b4f 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -475,6 +475,7 @@ extern StructRNA RNA_SpaceTimeline; extern StructRNA RNA_SpaceUVEditor; extern StructRNA RNA_SpaceUserPreferences; extern StructRNA RNA_SpaceView3D; +extern StructRNA RNA_SpaceClipEditor; extern StructRNA RNA_Speaker; extern StructRNA RNA_SpeedControlSequence; extern StructRNA RNA_Spline; diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 012333e5da0..9bc532afa11 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -60,6 +60,7 @@ set(DEFSRC rna_mesh.c rna_meta.c rna_modifier.c + rna_movieclip.c rna_nla.c rna_nodetree.c rna_object.c @@ -83,6 +84,7 @@ set(DEFSRC rna_text.c rna_texture.c rna_timeline.c + rna_tracking.c rna_ui.c rna_userdef.c rna_vfont.c diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index d4a9cf1f830..1eaeaf8278f 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -2480,6 +2480,8 @@ static RNAProcessItem PROCESS_ITEMS[]= { {"rna_vfont.c", NULL, RNA_def_vfont}, {"rna_wm.c", "rna_wm_api.c", RNA_def_wm}, {"rna_world.c", NULL, RNA_def_world}, + {"rna_movieclip.c", NULL, RNA_def_movieclip}, + {"rna_tracking.c", NULL, RNA_def_tracking}, {NULL, NULL}}; static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const char *api_filename) diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index e4692d32338..eed178b238d 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -143,6 +143,7 @@ short RNA_type_to_ID_code(StructRNA *type) if(RNA_struct_is_a(type, &RNA_VectorFont)) return ID_VF; if(RNA_struct_is_a(type, &RNA_World)) return ID_WO; if(RNA_struct_is_a(type, &RNA_WindowManager)) return ID_WM; + if(RNA_struct_is_a(type, &RNA_MovieClip)) return ID_MC; return 0; } @@ -177,6 +178,7 @@ StructRNA *ID_code_to_RNA_type(short idcode) case ID_VF: return &RNA_VectorFont; case ID_WO: return &RNA_World; case ID_WM: return &RNA_WindowManager; + case ID_MC: return &RNA_MovieClip; default: return &RNA_ID; } } diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index e67ab012dc9..1ea1a4e3e7b 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -283,7 +283,7 @@ static void rna_EditBone_connected_check(EditBone *ebone) if(ebone->parent) { if(ebone->flag & BONE_CONNECTED) { /* Attach this bone to its parent */ - VECCOPY(ebone->head, ebone->parent->tail); + copy_v3_v3(ebone->head, ebone->parent->tail); if(ebone->flag & BONE_ROOTSEL) ebone->parent->flag |= BONE_TIPSEL; @@ -350,7 +350,7 @@ static void rna_EditBone_matrix_get(PointerRNA *ptr, float *values) sub_v3_v3v3(delta, ebone->tail, ebone->head); vec_roll_to_mat3(delta, ebone->roll, tmat); copy_m4_m3(mat, tmat); - VECCOPY(mat[3], ebone->head); + copy_v3_v3(mat[3], ebone->head); memcpy(values, mat, 16 * sizeof(float)); } @@ -363,12 +363,12 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po /* update our parent */ if(ebone->parent && ebone->flag & BONE_CONNECTED) - VECCOPY(ebone->parent->tail, ebone->head) + copy_v3_v3(ebone->parent->tail, ebone->head); /* update our children if necessary */ for(child = arm->edbo->first; child; child=child->next) if(child->parent == ebone && (child->flag & BONE_CONNECTED)) - VECCOPY(child->head, ebone->tail); + copy_v3_v3(child->head, ebone->tail); if(arm->flag & ARM_MIRROR_EDIT) { eboflip= ED_armature_bone_get_mirrored(arm->edbo, ebone); @@ -381,12 +381,12 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po /* update our parent */ if(eboflip->parent && eboflip->flag & BONE_CONNECTED) - VECCOPY(eboflip->parent->tail, eboflip->head); + copy_v3_v3(eboflip->parent->tail, eboflip->head); /* update our children if necessary */ for(child = arm->edbo->first; child; child=child->next) if(child->parent == eboflip && (child->flag & BONE_CONNECTED)) - VECCOPY (child->head, eboflip->tail); + copy_v3_v3 (child->head, eboflip->tail); } } diff --git a/source/blender/makesrna/intern/rna_camera_api.c b/source/blender/makesrna/intern/rna_camera_api.c index bf3db58e35e..2af0524861a 100644 --- a/source/blender/makesrna/intern/rna_camera_api.c +++ b/source/blender/makesrna/intern/rna_camera_api.c @@ -36,6 +36,8 @@ #ifdef RNA_RUNTIME #include "DNA_scene_types.h" + +#include "BKE_camera.h" #include "BKE_context.h" #include "BKE_object.h" diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index fdbb4f09f93..e1e4f3929b2 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -64,9 +64,11 @@ EnumPropertyItem constraint_type_items[] ={ {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", ICON_CONSTRAINT_DATA, "Track To", "Legacy tracking constraint prone to twisting artifacts"}, {0, "", 0, "Relationship", ""}, {CONSTRAINT_TYPE_ACTION, "ACTION", ICON_CONSTRAINT_DATA, "Action", ""}, + {CONSTRAINT_TYPE_CAMERASOLVER, "CAMERA_SOLVER", ICON_CONSTRAINT_DATA, "Camera Solver", ""}, {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", ICON_CONSTRAINT_DATA, "Child Of", ""}, {CONSTRAINT_TYPE_MINMAX, "FLOOR", ICON_CONSTRAINT_DATA, "Floor", ""}, {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", ICON_CONSTRAINT_DATA, "Follow Path", ""}, + {CONSTRAINT_TYPE_FOLLOWTRACK, "FOLLOW_TRACK", ICON_CONSTRAINT_DATA, "Follow Track", ""}, {CONSTRAINT_TYPE_PIVOT, "PIVOT", ICON_CONSTRAINT_DATA, "Pivot", ""}, {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", ICON_CONSTRAINT_DATA, "Rigid Body Joint", ""}, {CONSTRAINT_TYPE_PYTHON, "SCRIPT", ICON_CONSTRAINT_DATA, "Script", ""}, @@ -156,6 +158,10 @@ static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr) return &RNA_CopyTransformsConstraint; case CONSTRAINT_TYPE_PIVOT: return &RNA_PivotConstraint; + case CONSTRAINT_TYPE_FOLLOWTRACK: + return &RNA_FollowTrackConstraint; + case CONSTRAINT_TYPE_CAMERASOLVER: + return &RNA_CameraSolverConstraint; default: return &RNA_UnknownType; } @@ -2026,6 +2032,70 @@ static void rna_def_constraint_pivot(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); } +static void rna_def_constraint_follow_track(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem reference_items[] = { + {FOLLOWTRACK_TRACK, "TRACK", 0, "Track", "Use 2D track position as reference"}, + {FOLLOWTRACK_BUNDLE, "BUNDLE", 0, "Bundle", "Use 3D reconstructed bundle position as reference"}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "FollowTrackConstraint", "Constraint"); + RNA_def_struct_ui_text(srna, "Follow Track Constraint", "Locks motion to the target motion track"); + RNA_def_struct_sdna_from(srna, "bFollowTrackConstraint", "data"); + + /* movie clip */ + prop= RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "clip"); + RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + + /* track */ + prop= RNA_def_property(srna, "track", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "track"); + RNA_def_property_ui_text(prop, "Track", "Movie tracking track to follow"); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + + /* reference */ + prop= RNA_def_property(srna, "reference", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "reference"); + RNA_def_property_enum_items(prop, reference_items); + RNA_def_property_ui_text(prop, "Reference", "Reference source to follow"); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + /* use default clip */ + prop= RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", FOLLOWTRACK_ACTIVECLIP); + RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene"); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); +} + +static void rna_def_constraint_camera_solver(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "CameraSolverConstraint", "Constraint"); + RNA_def_struct_ui_text(srna, "Follow Track Constraint", "Locks motion to the reconstructed camera movenment"); + RNA_def_struct_sdna_from(srna, "bCameraSolverConstraint", "data"); + + /* movie clip */ + prop= RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "clip"); + RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + + /* use default clip */ + prop= RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", CAMERASOLVER_ACTIVECLIP); + RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene"); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); +} + /* base struct for constraints */ void RNA_def_constraint(BlenderRNA *brna) { @@ -2136,6 +2206,8 @@ void RNA_def_constraint(BlenderRNA *brna) rna_def_constraint_damped_track(brna); rna_def_constraint_spline_ik(brna); rna_def_constraint_pivot(brna); + rna_def_constraint_follow_track(brna); + rna_def_constraint_camera_solver(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 56b003a5530..e9f8ecd1ef2 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -178,6 +178,8 @@ void RNA_def_userdef(struct BlenderRNA *brna); void RNA_def_vfont(struct BlenderRNA *brna); void RNA_def_wm(struct BlenderRNA *brna); void RNA_def_world(struct BlenderRNA *brna); +void RNA_def_movieclip(struct BlenderRNA *brna); +void RNA_def_tracking(struct BlenderRNA *brna); /* Common Define functions */ @@ -291,6 +293,7 @@ void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop); +void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop); /* ID Properties */ diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 076bdfe1964..be03da6839d 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -245,6 +245,12 @@ static void rna_Main_wm_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) rna_iterator_listbase_begin(iter, &bmain->wm, NULL); } +static void rna_Main_movieclips_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + Main *bmain= (Main*)ptr->data; + rna_iterator_listbase_begin(iter, &bmain->movieclip, NULL); +} + #ifdef UNIT_TEST static PointerRNA rna_Test_test_get(PointerRNA *ptr) @@ -307,6 +313,7 @@ void RNA_def_main(BlenderRNA *brna) {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks", RNA_def_main_actions}, {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks", RNA_def_main_particles}, {"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks", RNA_def_main_gpencil}, + {"movieclips", "MovieClip", "rna_Main_movieclips_begin", "Movie Clips", "Movie Clip datablocks", RNA_def_main_movieclips}, {NULL, NULL, NULL, NULL, NULL, NULL}}; int i; diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 1b80e33b40c..f568f6de855 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -43,9 +43,11 @@ #ifdef RNA_RUNTIME #include "BKE_main.h" +#include "BKE_camera.h" #include "BKE_curve.h" #include "BKE_mesh.h" #include "BKE_armature.h" +#include "BKE_lamp.h" #include "BKE_library.h" #include "BKE_object.h" #include "BKE_material.h" @@ -64,6 +66,7 @@ #include "BKE_node.h" #include "BKE_depsgraph.h" #include "BKE_speaker.h" +#include "BKE_movieclip.h" #include "DNA_armature_types.h" #include "DNA_camera_types.h" @@ -83,6 +86,7 @@ #include "DNA_particle_types.h" #include "DNA_vfont_types.h" #include "DNA_node_types.h" +#include "DNA_movieclip_types.h" #include "ED_screen.h" @@ -519,6 +523,26 @@ void rna_Main_particles_remove(Main *bmain, ReportList *reports, ParticleSetting /* XXX python now has invalid pointer? */ } +MovieClip *rna_Main_movieclip_load(Main *UNUSED(bmain), ReportList *reports, const char *filepath) +{ + MovieClip *clip; + + errno= 0; + clip= BKE_add_movieclip_file(filepath); + + if(!clip) + BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unable to load movie clip"); + + return clip; +} + +void rna_Main_movieclips_remove(Main *bmain, MovieClip *clip) +{ + unlink_movieclip(bmain, clip); + free_libblock(&bmain->movieclip, clip); + /* XXX python now has invalid pointer? */ +} + /* tag functions, all the same */ void rna_Main_cameras_tag(Main *bmain, int value) { tag_main_lb(&bmain->camera, value); } void rna_Main_scenes_tag(Main *bmain, int value) { tag_main_lb(&bmain->scene, value); } @@ -548,6 +572,7 @@ void rna_Main_armatures_tag(Main *bmain, int value) { tag_main_lb(&bmain->armatu void rna_Main_actions_tag(Main *bmain, int value) { tag_main_lb(&bmain->action, value); } void rna_Main_particles_tag(Main *bmain, int value) { tag_main_lb(&bmain->particle, value); } void rna_Main_gpencil_tag(Main *bmain, int value) { tag_main_lb(&bmain->gpencil, value); } +void rna_Main_movieclips_tag(Main *bmain, int value) { tag_main_lb(&bmain->text, value); } static int rna_Main_cameras_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_CA); } static int rna_Main_scenes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SCE); } @@ -1466,5 +1491,36 @@ void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_boolean_funcs(prop, "rna_Main_gpencil_is_updated_get", NULL); } +void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + FunctionRNA *func; + PropertyRNA *parm; + + RNA_def_property_srna(cprop, "BlendDataMovieClips"); + srna= RNA_def_struct(brna, "BlendDataMovieClips", NULL); + RNA_def_struct_sdna(srna, "Main"); + RNA_def_struct_ui_text(srna, "Main Movie Clips", "Collection of movie clips"); + + func= RNA_def_function(srna, "tag", "rna_Main_movieclips_tag"); + parm= RNA_def_boolean(func, "value", 0, "Value", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "remove", "rna_Main_movieclips_remove"); + RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile."); + parm= RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove"); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + + /* load func */ + func= RNA_def_function(srna, "load", "rna_Main_movieclip_load"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + RNA_def_function_ui_description(func, "Add a new movie clip to the main database from a file"); + parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock"); + RNA_def_property_flag(parm, PROP_REQUIRED); + /* return type */ + parm= RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip datablock"); + RNA_def_function_return(func, parm); +} + #endif diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c new file mode 100644 index 00000000000..afdf3cd9c46 --- /dev/null +++ b/source/blender/makesrna/intern/rna_movieclip.c @@ -0,0 +1,278 @@ +/* + * ***** 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. + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/makesrna/intern/rna_movieclip.c + * \ingroup RNA + */ + + +#include <stdlib.h> +#include <limits.h> + +#include "MEM_guardedalloc.h" + +#include "BKE_movieclip.h" +#include "BKE_tracking.h" + +#include "RNA_define.h" + +#include "rna_internal.h" + +#include "DNA_movieclip_types.h" +#include "DNA_scene_types.h" + +#include "WM_types.h" + +#include "IMB_imbuf_types.h" +#include "IMB_imbuf.h" + +#ifdef RNA_RUNTIME + +#include "BKE_depsgraph.h" + +static void rna_MovieClip_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + + BKE_movieclip_reload(clip); + DAG_id_tag_update(&clip->id, 0); +} + +static void rna_MovieClip_size_get(PointerRNA *ptr, int *values) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + + values[0]= clip->lastsize[0]; + values[1]= clip->lastsize[1]; +} + +static void rna_MovieClip_resolution_get(PointerRNA *ptr, float *values) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + ImBuf *ibuf; + + ibuf= BKE_movieclip_get_ibuf(clip, NULL); + if (ibuf) { + values[0]= ibuf->ppm[0]; + values[1]= ibuf->ppm[1]; + + IMB_freeImBuf(ibuf); + } + else { + values[0]= 0; + values[1]= 0; + } +} + +#else + +static void rna_def_movieclip_proxy(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static const EnumPropertyItem clip_tc_items[]= { + {IMB_TC_NONE, "NONE", 0, "No TC in use", ""}, + {IMB_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", "use images in the order as they are recorded"}, + {IMB_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", "use global timestamp written by recording device"}, + {IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)", "interpolate a global timestamp using the record date and time written by recording device"}, + {0, NULL, 0, NULL, NULL}}; + + srna = RNA_def_struct(brna, "MovieClipProxy", NULL); + RNA_def_struct_ui_text(srna, "Movie Clip Proxy", "Proxy parameters for a movie clip"); + RNA_def_struct_sdna(srna, "MovieClipProxy"); + + /* build proxy sized */ + prop= RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", IMB_PROXY_25); + RNA_def_property_ui_text(prop, "25%", "Build 25% proxy resolution"); + + prop= RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", IMB_PROXY_50); + RNA_def_property_ui_text(prop, "50%", "Build 50% proxy resolution"); + + prop= RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", IMB_PROXY_75); + RNA_def_property_ui_text(prop, "75%", "Build 75% proxy resolution"); + + prop= RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", IMB_PROXY_100); + RNA_def_property_ui_text(prop, "100%", "Build 100% proxy resolution"); + + prop= RNA_def_property(srna, "build_undistorted", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_flag", MCLIP_PROXY_BUILD_UNDISTORT); + RNA_def_property_ui_text(prop, "Build Undistorted", "Also build undistorted proxies for selected sizes"); + + /* build timecodes */ + prop= RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_RECORD_RUN); + RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index"); + + prop= RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_FREE_RUN); + RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index"); + + prop= RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN); + RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time"); + + /* quality of proxied image */ + prop= RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "quality"); + RNA_def_property_ui_text(prop, "Quality", "JPEG Quality of proxies to build"); + RNA_def_property_ui_range(prop, 1, 100, 1, 0); + + prop= RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "tc"); + RNA_def_property_enum_items(prop, clip_tc_items); + RNA_def_property_ui_text(prop, "Timecode", ""); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* directory */ + prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH); + RNA_def_property_string_sdna(prop, NULL, "dir"); + RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update"); +} + +static void rna_def_moviecliUser(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem clip_render_size_items[] = { + {MCLIP_PROXY_RENDER_SIZE_25, "PROXY_25", 0, "Proxy size 25%", ""}, + {MCLIP_PROXY_RENDER_SIZE_50, "PROXY_50", 0, "Proxy size 50%", ""}, + {MCLIP_PROXY_RENDER_SIZE_75, "PROXY_75", 0, "Proxy size 75%", ""}, + {MCLIP_PROXY_RENDER_SIZE_100, "PROXY_100", 0, "Proxy size 100%", ""}, + {MCLIP_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "MovieClipUser", NULL); + RNA_def_struct_ui_text(srna, "Movie Clip User", "Parameters defining how a MovieClip datablock is used by another datablock"); + + prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_TIME); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_int_sdna(prop, NULL, "framenr"); + RNA_def_property_range(prop, MINAFRAME, MAXFRAME); + RNA_def_property_ui_text(prop, "Current Frame", "Current frame number in movie or image sequence"); + + /* render size */ + prop= RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "render_size"); + RNA_def_property_enum_items(prop, clip_render_size_items); + RNA_def_property_ui_text(prop, "Proxy render size", "Draw preview using full resolution or different proxy resolutions"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* render undistorted */ + prop= RNA_def_property(srna, "use_render_undistorted", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "render_flag", MCLIP_PROXY_RENDER_UNDISTORT); + RNA_def_property_ui_text(prop, "Render Undistorted", "Draw preview using undistorted proxy"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); +} + +static void rna_def_movieClipScopes(BlenderRNA *brna) +{ + StructRNA *srna; + + srna= RNA_def_struct(brna, "MovieClipScopes", NULL); + RNA_def_struct_ui_text(srna, "MovieClipScopes", "Scopes for statistical view of a movie clip"); +} + + +static void rna_def_movieclip(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem clip_source_items[]= { + {MCLIP_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"}, + {MCLIP_SRC_MOVIE, "MOVIE", 0, "Movie File", "Movie file"}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "MovieClip", "ID"); + RNA_def_struct_ui_text(srna, "MovieClip", "MovieClip datablock referencing an external movie file"); + RNA_def_struct_ui_icon(srna, ICON_SEQUENCE); + + prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); + RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_ui_text(prop, "File Path", "Filename of the text file"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update"); + + prop= RNA_def_property(srna, "tracking", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "MovieTracking"); + + prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "MovieClipProxy"); + + /* use proxy */ + prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY); + RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this clip"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + prop= RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" , "Width and height in pixels, zero when image data cant be loaded" , 0 , 0); + RNA_def_property_int_funcs(prop, "rna_MovieClip_size_get" , NULL, NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + + prop= RNA_def_float_vector(srna, "resolution" , 2 , NULL , 0, 0, "Resolution" , "X/Y pixels per meter" , 0 , 0); + RNA_def_property_float_funcs(prop, "rna_MovieClip_resolution_get", NULL, NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + + prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ); + RNA_def_property_float_sdna(prop, NULL, "aspx"); + RNA_def_property_array(prop, 2); + RNA_def_property_range(prop, 0.1f, 5000.0f); + RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2); + RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this clip, does not affect rendering"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* source */ + prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, clip_source_items); + RNA_def_property_ui_text(prop, "Source", "Where the clip comes from"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + + /* custom proxy directory */ + prop= RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY_CUSTOM_DIR); + RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update"); + + /* grease pencil */ + prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "gpd"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_struct_type(prop, "GreasePencil"); + RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this movie clip"); +} + +void RNA_def_movieclip(BlenderRNA *brna) +{ + rna_def_movieclip(brna); + rna_def_movieclip_proxy(brna); + rna_def_moviecliUser(brna); + rna_def_movieClipScopes(brna); +} + +#endif diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 1445cf3b537..f024ad3addd 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2414,6 +2414,84 @@ static void def_cmp_ycc(StructRNA *srna) RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } +static void def_cmp_movieclip(StructRNA *srna) +{ + PropertyRNA *prop; + + prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "id"); + RNA_def_property_struct_type(prop, "MovieClip"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Movie Clip", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + RNA_def_struct_sdna_from(srna, "MovieClipUser", "storage"); +} + +static void def_cmp_stabilize2d(StructRNA *srna) +{ + PropertyRNA *prop; + + static EnumPropertyItem filter_type_items[] = { + {0, "NEAREST", 0, "Nearest", ""}, + {1, "BILINEAR", 0, "Bilinear", ""}, + {2, "BICUBIC", 0, "Bicubic", ""}, + {0, NULL, 0, NULL, NULL}}; + + prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "id"); + RNA_def_property_struct_type(prop, "MovieClip"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Movie Clip", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, filter_type_items); + RNA_def_property_ui_text(prop, "Filter", "Method to use to filter stabilization"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); +} + +static void def_cmp_moviedistortion(StructRNA *srna) +{ + PropertyRNA *prop; + + static EnumPropertyItem distortion_type_items[] = { + {0, "UNDISTORT", 0, "Undistort", ""}, + {1, "DISTORT", 0, "Distort", ""}, + {0, NULL, 0, NULL, NULL}}; + + prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "id"); + RNA_def_property_struct_type(prop, "MovieClip"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Movie Clip", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "distortion_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, distortion_type_items); + RNA_def_property_ui_text(prop, "Distortion", "Distortion to use to filter image"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); +} + +static void dev_cmd_transform(StructRNA *srna) +{ + PropertyRNA *prop; + + static EnumPropertyItem filter_type_items[] = { + {0, "NEAREST", 0, "Nearest", ""}, + {1, "BILINEAR", 0, "Bilinear", ""}, + {2, "BICUBIC", 0, "Bicubic", ""}, + {0, NULL, 0, NULL, NULL}}; + + prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, filter_type_items); + RNA_def_property_ui_text(prop, "Filter", "Method to use to filter transform"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); +} + /* -- Texture Nodes --------------------------------------------------------- */ diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h index 1bbf47db094..2545826cd46 100644 --- a/source/blender/makesrna/intern/rna_nodetree_types.h +++ b/source/blender/makesrna/intern/rna_nodetree_types.h @@ -117,6 +117,10 @@ DefNode( CompositorNode, CMP_NODE_COLOR_MATTE, def_cmp_color_matte, "COLOR DefNode( CompositorNode, CMP_NODE_DIST_MATTE, def_cmp_distance_matte, "DISTANCE_MATTE", DistanceMatte, "Distance Matte", "" ) DefNode( CompositorNode, CMP_NODE_COLORBALANCE, def_cmp_colorbalance, "COLORBALANCE", ColorBalance, "Color Balance", "" ) DefNode( CompositorNode, CMP_NODE_HUECORRECT, def_cmp_huecorrect, "HUECORRECT", HueCorrect, "Hue Correct", "" ) +DefNode( CompositorNode, CMP_NODE_MOVIECLIP, def_cmp_movieclip, "MOVIECLIP", MovieClip, "MovieClip", "" ) +DefNode( CompositorNode, CMP_NODE_TRANSFORM, dev_cmd_transform, "TRANSFORM", Transform, "Transform", "" ) +DefNode( CompositorNode, CMP_NODE_STABILIZE2D, def_cmp_stabilize2d, "STABILIZE2D", Stabilize, "Stabilize 2D", "" ) +DefNode( CompositorNode, CMP_NODE_MOVIEDISTORTION,def_cmp_moviedistortion,"MOVIEDISTORTION",MovieDistortion, "Movie Distortion", "" ) DefNode( TextureNode, TEX_NODE_OUTPUT, def_tex_output, "OUTPUT", Output, "Output", "" ) DefNode( TextureNode, TEX_NODE_CHECKER, 0, "CHECKER", Checker, "Checker", "" ) diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index be2375f5716..6e797146f12 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -2210,13 +2210,20 @@ static void rna_def_object(BlenderRNA *brna) rna_def_animviz_common(srna); rna_def_motionpath_common(srna); - /* duplicates */ - // XXX: evil old crap + /* slow parenting */ + // XXX: evil old crap prop= RNA_def_property(srna, "use_slow_parent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "partype", PARSLOW); - RNA_def_property_ui_text(prop, "Slow Parent", "Create a delay in the parent relationship"); + RNA_def_property_ui_text(prop, "Slow Parent", "Create a delay in the parent relationship (Beware: this isn't renderfarm safe and may be invalid after jumping around the timeline)"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); - + + prop= RNA_def_property(srna, "slow_parent_offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_TIME); + RNA_def_property_float_sdna(prop, NULL, "sf"); + RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); + RNA_def_property_ui_text(prop, "Slow Parent Offset", "Amount of delay in the parent relationship"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + + /* duplicates */ prop= RNA_def_property(srna, "dupli_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "transflag"); RNA_def_property_enum_items(prop, dupli_items); @@ -2285,34 +2292,7 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "is_duplicator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLI); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - - /* time offset */ - prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_TIME); - RNA_def_property_float_sdna(prop, NULL, "sf"); - RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Time Offset", "Animation offset in frames for F-Curve and dupligroup instances"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); - - prop= RNA_def_property(srna, "use_time_offset_edit", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_OB); - RNA_def_property_ui_text(prop, "Time Offset Edit", - "Use time offset when inserting keys and display time offset for F-Curve and action views"); - - prop= RNA_def_property(srna, "use_time_offset_parent", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARENT); - RNA_def_property_ui_text(prop, "Time Offset Parent", "Apply the time offset to this object's parent relationship"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); - - prop= RNA_def_property(srna, "use_time_offset_particle", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARTICLE); - RNA_def_property_ui_text(prop, "Time Offset Particle", "Let the time offset work on the particle effect"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); - - prop= RNA_def_property(srna, "use_time_offset_add_parent", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARENTADD); - RNA_def_property_ui_text(prop, "Time Offset Add Parent", "Add the parent's time offset value"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); - + /* drawing */ prop= RNA_def_property(srna, "draw_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dt"); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 63fce2d9edb..b1d4654f76b 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1074,6 +1074,15 @@ static void rna_Scene_update_active_object_data(Main *UNUSED(bmain), Scene *scen } } +static void rna_SceneCamera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + Scene *scene= (Scene*)ptr->id.data; + Object *camera= scene->camera; + + if(camera) + DAG_id_tag_update(&camera->id, 0); +} + #else static void rna_def_transform_orientation(BlenderRNA *brna) @@ -2428,13 +2437,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "xsch"); RNA_def_property_range(prop, 4, 10000); RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update"); prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ysch"); RNA_def_property_range(prop, 4, 10000); RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update"); prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE); RNA_def_property_int_sdna(prop, NULL, "size"); @@ -2459,13 +2468,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "xasp"); RNA_def_property_range(prop, 1.0f, 200.0f); RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update"); prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yasp"); RNA_def_property_range(prop, 1.0f, 200.0f); RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update"); /* JPEG and AVI JPEG */ @@ -3752,6 +3761,14 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_struct_type(prop, "TransformOrientation"); RNA_def_property_ui_text(prop, "Transform Orientations", ""); + /* active MovieClip */ + prop= RNA_def_property(srna, "active_clip", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "clip"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_struct_type(prop, "MovieClip"); + RNA_def_property_ui_text(prop, "Active Movie Clip", "Active movie clip used for constraints and viewport drawing"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + /* Nestled Data */ rna_def_tool_settings(brna); rna_def_unit_settings(brna); diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index 795ea417d90..c8792ef30f3 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -288,6 +288,11 @@ static void rna_def_screen(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_NODES); RNA_def_property_ui_text(prop, "Node Editors", ""); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); + + prop= RNA_def_property(srna, "use_play_clip_editors", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_CLIPS); + RNA_def_property_ui_text(prop, "Clip Editors", ""); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); } void RNA_def_screen(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 2aa99b5941a..928ed15755a 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -70,6 +70,7 @@ EnumPropertyItem space_type_items[] = { {SPACE_LOGIC, "LOGIC_EDITOR", 0, "Logic Editor", ""}, {SPACE_CONSOLE, "CONSOLE", 0, "Python Console", ""}, {SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""}, + {SPACE_CLIP, "CLIP_EDITOR", 0, "Clip Editor", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem draw_channels_items[] = { @@ -126,6 +127,7 @@ EnumPropertyItem viewport_shade_items[] = { #include "ED_screen.h" #include "ED_view3d.h" #include "ED_sequencer.h" +#include "ED_clip.h" #include "IMB_imbuf_types.h" @@ -166,6 +168,8 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr) return &RNA_SpaceConsole; case SPACE_USERPREF: return &RNA_SpaceUserPreferences; + case SPACE_CLIP: + return &RNA_SpaceClipEditor; default: return &RNA_Space; } @@ -883,6 +887,15 @@ static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value) bgpic->blend = 1.0f - value; } +static BGpic *rna_BackgroundImage_add(View3D *v3d) +{ + BGpic *bgpic= ED_view3D_background_image_add(v3d);; + + WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL); + + return bgpic; +} + /* Space Node Editor */ static int rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, PointerRNA value) @@ -955,6 +968,34 @@ static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C, return item; } +static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, PointerRNA value) +{ + SpaceClip *sc= (SpaceClip*)(ptr->data); + + ED_space_clip_set(NULL, sc, (MovieClip*)value.data); +} + +static void rna_SpaceClipEditor_clip_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + SpaceClip *sc= (SpaceClip*)(ptr->data); + + sc->scopes.ok= 0; +} + +static void rna_SpaceClipEditor_lock_selection_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + SpaceClip *sc= (SpaceClip*)(ptr->data); + + sc->xlockof= 0.f; + sc->ylockof= 0.f; +} + +static void rna_SpaceClipEditor_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + ScrArea *sa= rna_area_from_space(ptr); + ED_area_tag_refresh(sa); +} + #else static void rna_def_space(BlenderRNA *brna) @@ -1170,21 +1211,46 @@ static void rna_def_background_image(BlenderRNA *brna) {(1<<RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", "Show background image in camera view"}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem bgpic_source_items[] = { + {V3D_BGPIC_IMAGE, "IMAGE", 0, "Image", ""}, + {V3D_BGPIC_MOVIE, "MOVIE", 0, "Movie", ""}, + {0, NULL, 0, NULL, NULL} + }; + srna= RNA_def_struct(brna, "BackgroundImage", NULL); RNA_def_struct_sdna(srna, "BGpic"); RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3d View background"); + prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "source"); + RNA_def_property_enum_items(prop, bgpic_source_items); + RNA_def_property_ui_text(prop, "Background Source", "Data source used for background"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ima"); RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + prop= RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "clip"); + RNA_def_property_ui_text(prop, "MovieClip", "Movie clip displayed and edited in this space"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "iuser"); RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + prop= RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "MovieClipUser"); + RNA_def_property_pointer_sdna(prop, NULL, "cuser"); + RNA_def_property_ui_text(prop, "Clip User", "Parameters defining which frame of the movie clip is displayed"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xof"); @@ -1220,6 +1286,28 @@ static void rna_def_background_image(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface"); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); + prop= RNA_def_property(srna, "use_camera_clip", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_CAMERACLIP); + RNA_def_property_ui_text(prop, "Camera Clip", "Use movie clip from active scene camera"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); +} + +static void rna_def_backgroundImages(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + FunctionRNA *func; + PropertyRNA *parm; + + RNA_def_property_srna(cprop, "BackgroundImages"); + srna= RNA_def_struct(brna, "BackgroundImages", NULL); + RNA_def_struct_sdna(srna, "View3D"); + RNA_def_struct_ui_text(srna, "Background Images", "Collection of background images"); + + func= RNA_def_function(srna, "add", "rna_BackgroundImage_add"); + RNA_def_function_ui_description(func, "Add new background image"); + + parm= RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background"); + RNA_def_function_return(func, parm); } static void rna_def_space_view3d(BlenderRNA *brna) @@ -1243,6 +1331,16 @@ static void rna_def_space_view3d(BlenderRNA *brna) {RV3D_CAMOB, "CAMERA", 0, "Camera", ""}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem bundle_drawtype_items[] = { + {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""}, + {OB_ARROWS, "ARROWS", 0, "Arrows", ""}, + {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""}, + {OB_CIRCLE, "CIRCLE", 0, "Circle", ""}, + {OB_CUBE, "CUBE", 0, "Cube", ""}, + {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""}, + {OB_EMPTY_CONE, "CONE", 0, "Cone", ""}, + {0, NULL, 0, NULL, NULL}}; + srna= RNA_def_struct(brna, "SpaceView3D", "Space"); RNA_def_struct_sdna(srna, "View3D"); RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data"); @@ -1386,6 +1484,7 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_struct_type(prop, "BackgroundImage"); RNA_def_property_ui_text(prop, "Background Images", "List of background images"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + rna_def_backgroundImages(brna, prop); prop= RNA_def_property(srna, "show_background_images", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPICS); @@ -1471,6 +1570,33 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_quadview_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Quad View Region", "3D region that defines the quad view settings"); + prop= RNA_def_property(srna, "show_reconstruction", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_RECONSTRUCTION); + RNA_def_property_ui_text(prop, "Show Reconstruction", "Display reconstruction data from active movie clip"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + prop= RNA_def_property(srna, "bundle_draw_size", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0, FLT_MAX); + RNA_def_property_float_sdna(prop, NULL, "bundle_size"); + RNA_def_property_ui_text(prop, "Bundle Size", "Display size of bundles from reconstructed data"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + prop= RNA_def_property(srna, "bundle_draw_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "bundle_drawtype"); + RNA_def_property_enum_items(prop, bundle_drawtype_items); + RNA_def_property_ui_text(prop, "Bundle Display Type", "Viewport display style for bundles"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + prop= RNA_def_property(srna, "show_camera_path", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_CAMERAPATH); + RNA_def_property_ui_text(prop, "Show Camera Path", "Show reconstructed path of camera"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + prop= RNA_def_property(srna, "show_bundle_name", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_BUNDLENAME); + RNA_def_property_ui_text(prop, "Show Bundle Name", "Show names for bundle objects"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + /* region */ srna= RNA_def_struct(brna, "RegionView3D", NULL); @@ -1542,6 +1668,17 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_ui_text(prop, "Distance", "Distance to the view location"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + prop= RNA_def_property(srna, "view_camera_zoom", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "camzoom"); + RNA_def_property_ui_text(prop, "Camera Zoom", "Zoom factor in camera view"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + prop= RNA_def_property(srna, "view_camera_offset", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "camdx"); + RNA_def_property_array(prop, 2); + RNA_def_property_ui_text(prop, "Camera Offset", "View shift in camera view"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); } static void rna_def_space_buttons(BlenderRNA *brna) @@ -2443,9 +2580,9 @@ static void rna_def_space_filebrowser(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "params"); RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser"); - prop= RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE); + prop= RNA_def_property(srna, "active_operator", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "op"); - RNA_def_property_ui_text(prop, "Operator", ""); + RNA_def_property_ui_text(prop, "Active Operator", ""); } static void rna_def_space_info(BlenderRNA *brna) @@ -2664,6 +2801,172 @@ static void rna_def_space_logic(BlenderRNA *brna) } +static void rna_def_space_clip(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem mode_items[] = { + {SC_MODE_TRACKING, "TRACKING", ICON_ANIM_DATA, "Tracking", "Show tracking and solving tools"}, + {SC_MODE_RECONSTRUCTION, "RECONSTRUCTION", ICON_SNAP_FACE, "Reconstruction", "Show tracking/reconstruction tools"}, + {SC_MODE_DISTORTION, "DISTORTION", ICON_GRID, "Distortion", "Show distortion tools"}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem view_items[] = { + {SC_VIEW_CLIP, "CLIP", ICON_SEQUENCE, "Clip", "Show editing clip preview"}, + {SC_VIEW_GRAPH, "GRAPH", ICON_IPO, "Graph", "Show graph view for active element"}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "SpaceClipEditor", "Space"); + RNA_def_struct_sdna(srna, "SpaceClip"); + RNA_def_struct_ui_text(srna, "Space Clip Editor", "Clip editor space data"); + + /* movieclip */ + prop= RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Movie Clip", "Movie clip displayed and edited in this space"); + RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceClipEditor_clip_set", NULL, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* clip user */ + prop= RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "MovieClipUser"); + RNA_def_property_pointer_sdna(prop, NULL, "user"); + RNA_def_property_ui_text(prop, "Movie Clip User", "Parameters defining which frame of the movie clip is displayed"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* mode */ + prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "mode"); + RNA_def_property_enum_items(prop, mode_items); + RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, "rna_SpaceClipEditor_clip_mode_update"); + + /* view */ + prop= RNA_def_property(srna, "view", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "view"); + RNA_def_property_enum_items(prop, view_items); + RNA_def_property_ui_text(prop, "View", "Type of the clip editor view"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, "rna_SpaceClipEditor_view_type_update"); + + /* show pattern */ + prop= RNA_def_property(srna, "show_marker_pattern", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Show Marker Pattern", "Show pattern boundbox for markers"); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_MARKER_PATTERN); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* show search */ + prop= RNA_def_property(srna, "show_marker_search", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Show Marker Search", "Show search boundbox for markers"); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_MARKER_SEARCH); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* show pyramid */ + prop= RNA_def_property(srna, "show_pyramid_levels", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Show Pyramid ", "Show patterns for each pyramid level for markers (KLT only)"); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_PYRAMID_LEVELS); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* lock to selection */ + prop= RNA_def_property(srna, "lock_selection", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Lock to Selection", "Lock viewport to selected markers during playback"); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_LOCK_SELECTION); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, "rna_SpaceClipEditor_lock_selection_update"); + + /* show markers pathes */ + prop= RNA_def_property(srna, "show_track_path", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_TRACK_PATH); + RNA_def_property_ui_text(prop, "Show Track Path", "Show path of how track moves"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* path length */ + prop= RNA_def_property(srna, "path_length", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "path_length"); + RNA_def_property_range(prop, 0, 50); + RNA_def_property_ui_text(prop, "Path Length", "Length of displaying path, in frames"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* show tiny markers */ + prop= RNA_def_property(srna, "show_tiny_markers", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Show Tiny Markers", "Show markers tiny"); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_TINY_MARKER); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* show bundles */ + prop= RNA_def_property(srna, "show_bundles", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Show Bundles", "Show projection of bundles into footage"); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_BUNDLES); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* mute footage */ + prop= RNA_def_property(srna, "use_mute_footage", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Mute Footage", "Mute footage and show black background instead"); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_MUTE_FOOTAGE); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* hide disabled */ + prop= RNA_def_property(srna, "show_disabled", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Show Disabled", "Show disabled tracks from the footage"); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SC_HIDE_DISABLED); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* scopes */ + prop= RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "scopes"); + RNA_def_property_struct_type(prop, "MovieClipScopes"); + RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize movie clip statistics"); + + /* show names */ + prop= RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_NAMES); + RNA_def_property_ui_text(prop, "Show Names", "Show track names and status"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* show grid */ + prop= RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRID); + RNA_def_property_ui_text(prop, "Show Grid", "Show grid showing lens distortion"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* show stable */ + prop= RNA_def_property(srna, "show_stable", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_STABLE); + RNA_def_property_ui_text(prop, "Show Stable", "Show stable footage in editor (if stabilization is enabled)"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* manual calibration */ + prop= RNA_def_property(srna, "use_manual_calibration", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_MANUAL_CALIBRATION); + RNA_def_property_ui_text(prop, "Manual Calibration", "Use manual calibration helpers"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* show stable */ + prop= RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GPENCIL); + RNA_def_property_ui_text(prop, "Show Grease Pencil", "Show grease pencil strokes over the footage"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* show filters */ + prop= RNA_def_property(srna, "show_filters", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_FILTERS); + RNA_def_property_ui_text(prop, "Show Filters", "Show filters for graph editor"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* show graph_frames */ + prop= RNA_def_property(srna, "show_graph_frames", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRAPH_FRAMES); + RNA_def_property_ui_text(prop, "Show Frames", "Show curves for frames in graph editor"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* show graph_tracks */ + prop= RNA_def_property(srna, "show_graph_tracks", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRAPH_TRACKS); + RNA_def_property_ui_text(prop, "Show Tracks", "Show curves for tracks in graph editor"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); +} + + void RNA_def_space(BlenderRNA *brna) { rna_def_space(brna); @@ -2686,6 +2989,7 @@ void RNA_def_space(BlenderRNA *brna) rna_def_space_userpref(brna); rna_def_space_node(brna); rna_def_space_logic(brna); + rna_def_space_clip(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_texture_api.c b/source/blender/makesrna/intern/rna_texture_api.c index d4e39a5a8e4..f1a6bb1b921 100644 --- a/source/blender/makesrna/intern/rna_texture_api.c +++ b/source/blender/makesrna/intern/rna_texture_api.c @@ -118,10 +118,10 @@ void RNA_api_environment_map(StructRNA *srna) RNA_def_pointer(func, "scene", "Scene", "", "Overrides the scene from which image parameters are taken"); - parm = RNA_def_float_array(func, "layout", 12, default_layout, 0.0f, 0.0f, "File layout", - "Flat array describing the X,Y position of each cube face in the " - "output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] " - "(use -1 to skip a face)", 0.0f, 0.0f); + RNA_def_float_array(func, "layout", 12, default_layout, 0.0f, 0.0f, "File layout", + "Flat array describing the X,Y position of each cube face in the " + "output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] " + "(use -1 to skip a face)", 0.0f, 0.0f); } #endif diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c new file mode 100644 index 00000000000..f72fd3d465c --- /dev/null +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -0,0 +1,772 @@ +/* + * ***** 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. + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/makesrna/intern/rna_tracking.c + * \ingroup RNA + */ + + +#include <stdlib.h> +#include <limits.h> + +#include "MEM_guardedalloc.h" + +#include "BKE_movieclip.h" +#include "BKE_tracking.h" + +#include "RNA_define.h" + +#include "rna_internal.h" + +#include "DNA_movieclip_types.h" +#include "DNA_scene_types.h" + +#include "WM_types.h" + +#ifdef RNA_RUNTIME + +#include "BKE_depsgraph.h" +#include "BKE_node.h" + +#include "IMB_imbuf.h" + +#include "WM_api.h" + +static void rna_tracking_tracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + rna_iterator_listbase_begin(iter, &clip->tracking.tracks, NULL); +} + +static void rna_tracking_tracks_add(MovieTracking *tracking, int frame, int number) +{ + int a; + + for(a= 0; a<number; a++) + BKE_tracking_add_track(tracking, 0, 0, frame, 1, 1); + + WM_main_add_notifier(NC_MOVIECLIP|NA_EDITED, NULL); +} + +static PointerRNA rna_tracking_active_track_get(PointerRNA *ptr) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + + return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingTrack, clip->tracking.act_track); +} + +static void rna_tracking_active_track_set(PointerRNA *ptr, PointerRNA value) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + MovieTrackingTrack *track= (MovieTrackingTrack *)value.data; + int index= BLI_findindex(&clip->tracking.tracks, track); + + if(index>=0) clip->tracking.act_track= track; + else clip->tracking.act_track= NULL; +} + +void rna_trackingTrack_name_set(PointerRNA *ptr, const char *value) +{ + MovieClip *clip= (MovieClip *)ptr->id.data; + MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data; + BLI_strncpy(track->name, value, sizeof(track->name)); + + BKE_track_unique_name(&clip->tracking, track); +} + +static void rna_tracking_trackerPattern_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data; + + BKE_tracking_clamp_track(track, CLAMP_PAT_DIM); +} + +static void rna_tracking_trackerSearch_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data; + + BKE_tracking_clamp_track(track, CLAMP_SEARCH_DIM); +} + +static void rna_tracking_trackerAlgorithm_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data; + + if(track->tracker==TRACKER_KLT) + BKE_tracking_clamp_track(track, CLAMP_PYRAMID_LEVELS); + else + BKE_tracking_clamp_track(track, CLAMP_SEARCH_DIM); +} + +static void rna_tracking_trackerPyramid_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data; + + BKE_tracking_clamp_track(track, CLAMP_PYRAMID_LEVELS); +} + +static int rna_tracking_markers_length(PointerRNA *ptr) +{ + MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data; + + return track->markersnr; +} + +static float rna_trackingCamera_focal_mm_get(PointerRNA *ptr) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + MovieTrackingCamera *camera= &clip->tracking.camera; + float val= camera->focal; + + if(clip->lastsize[0]) + val= val*camera->sensor_width/(float)clip->lastsize[0]; + + return val; +} + +static void rna_trackingCamera_focal_mm_set(PointerRNA *ptr, float value) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + MovieTrackingCamera *camera= &clip->tracking.camera; + + if(clip->lastsize[0]) + value= clip->lastsize[0]*value/camera->sensor_width; + + camera->focal= value; +} + +static int rna_track_2d_stabilization(CollectionPropertyIterator *UNUSED(iter), void *data) +{ + MovieTrackingTrack *track= (MovieTrackingTrack*)data; + + if((track->flag&TRACK_USE_2D_STAB)==0) + return 1; + + return 0; +} + +static void rna_tracking_stabTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + rna_iterator_listbase_begin(iter, &clip->tracking.tracks, rna_track_2d_stabilization); +} + +static int rna_tracking_stabTracks_active_index_get(PointerRNA *ptr) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + return clip->tracking.stabilization.act_track; +} + +static void rna_tracking_stabTracks_active_index_set(PointerRNA *ptr, int value) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + clip->tracking.stabilization.act_track= value; +} + +static void rna_tracking_stabTracks_active_index_range(PointerRNA *ptr, int *min, int *max) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + + *min= 0; + *max= clip->tracking.stabilization.tot_track-1; + *max= MAX2(0, *max); +} + +static void rna_tracking_flushUpdate(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + MovieTrackingStabilization *stab= &clip->tracking.stabilization; + + stab->ok= 0; + + nodeUpdateID(scene->nodetree, &clip->id); + + WM_main_add_notifier(NC_SCENE|ND_NODES, NULL); + DAG_id_tag_update(&clip->id, 0); +} + +/* API */ + +static MovieTrackingMarker *rna_trackingTrack_marker_find_frame(MovieTrackingTrack *track, int framenr) +{ + return BKE_tracking_get_marker(track, framenr); +} + +#else + +static int rna_matrix_dimsize_4x4[]= {4, 4}; + +static void rna_def_trackingSettings(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem speed_items[] = { + {0, "FASTEST", 0, "Fastest", "Track as fast as it's possible"}, + {TRACKING_SPEED_DOUBLE, "DOUBLE", 0, "Double", "Track with double speed"}, + {TRACKING_SPEED_REALTIME, "REALTIME", 0, "Realtime", "Track with realtime speed"}, + {TRACKING_SPEED_HALF, "HALF", 0, "Half", "Track with half of realtime speed"}, + {TRACKING_SPEED_QUARTER, "QUARTER", 0, "Quarter", "Track with quarter of realtime speed"}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem cleanup_items[] = { + {TRACKING_CLEAN_SELECT, "SELECT", 0, "Select", "Select unclean tracks"}, + {TRACKING_CLEAN_DELETE_TRACK, "DELETE_TRACK", 0, "Delete Track", "Delete unclean tracks"}, + {TRACKING_CLEAN_DELETE_SEGMENT, "DELETE_SEGMENTS", 0, "Delete Segments", "Delete unclean segments of tracks"}, + {0, NULL, 0, NULL, NULL} + }; + + srna= RNA_def_struct(brna, "MovieTrackingSettings", NULL); + RNA_def_struct_ui_text(srna, "Movie tracking settings", "Match moving settings"); + + /* speed */ + prop= RNA_def_property(srna, "speed", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, speed_items); + RNA_def_property_ui_text(prop, "Speed", "Speed to make tracking with"); + + /* limit frames */ + prop= RNA_def_property(srna, "frames_limit", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "frames_limit"); + RNA_def_property_range(prop, 0, INT_MAX); + RNA_def_property_ui_text(prop, "Frames Limit", "Amount of frames to be tracked during single tracking operation"); + + /* adjust frames */ + prop= RNA_def_property(srna, "frames_adjust", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "adjframes"); + RNA_def_property_range(prop, 0, INT_MAX); + RNA_def_property_ui_text(prop, "Adjust Frames", "Automatically re-adjust marker position using position on each N frames. 0 means only keyframed position is used"); + + /* margin */ + prop= RNA_def_property(srna, "margin", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "margin"); + RNA_def_property_range(prop, 0, 300); + RNA_def_property_ui_text(prop, "Margin", "Margin for markers from image boundary"); + + /* keyframe_a */ + prop= RNA_def_property(srna, "keyframe_a", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "keyframe1"); + RNA_def_property_ui_text(prop, "Keyframe A", "First keyframe used for reconstruction initialization"); + + /* keyframe_b */ + prop= RNA_def_property(srna, "keyframe_b", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "keyframe2"); + RNA_def_property_ui_text(prop, "Keyframe B", "Second keyframe used for reconstruction initialization"); + + /* tool settings */ + + /* distance */ + prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_float_sdna(prop, NULL, "dist"); + RNA_def_property_ui_text(prop, "Distance", "Distance between two bundles used for scene scaling"); + + /* frames count */ + prop= RNA_def_property(srna, "clean_frames", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "clean_frames"); + RNA_def_property_range(prop, 0, INT_MAX); + RNA_def_property_ui_text(prop, "Tracked Frames", "Effect on tracks which are tracked less than the specified amount of frames"); + + /* reprojection error */ + prop= RNA_def_property(srna, "clean_error", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_float_sdna(prop, NULL, "clean_error"); + RNA_def_property_range(prop, 0, FLT_MAX); + RNA_def_property_ui_text(prop, "Reprojection Error", "Effect on tracks which have a larger reprojection error"); + + /* cleanup action */ + prop= RNA_def_property(srna, "clean_action", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "clean_action"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, cleanup_items); + RNA_def_property_ui_text(prop, "Action", "Cleanup action to execute"); +} + +static void rna_def_trackingCamera(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem camera_units_items[] = { + {CAMERA_UNITS_PX, "PIXELS", 0, "px", "Use pixels for units of focal length"}, + {CAMERA_UNITS_MM, "MILLIMETERS", 0, "mm", "Use millimeters for units of focal length"}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "MovieTrackingCamera", NULL); + RNA_def_struct_ui_text(srna, "Movie tracking camera data", "Match-moving camera data for tracking"); + + /* Sensor */ + prop= RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "sensor_width"); + RNA_def_property_range(prop, 0.0f, 500.0f); + RNA_def_property_ui_text(prop, "Sensor", "Width of CCD sensor in millimeters"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); + + /* Focal Length */ + prop= RNA_def_property(srna, "focal_length", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "focal"); + RNA_def_property_range(prop, 0.0f, 5000.0f); + RNA_def_property_float_funcs(prop, "rna_trackingCamera_focal_mm_get", "rna_trackingCamera_focal_mm_set", NULL); + RNA_def_property_ui_text(prop, "Focal Length", "Camera's focal length"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); + + /* Focal Length in pixels */ + prop= RNA_def_property(srna, "focal_length_pixels", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "focal"); + RNA_def_property_range(prop, 0.0f, 5000.0f); + RNA_def_property_ui_text(prop, "Focal Length", "Camera's focal length"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); + + /* Units */ + prop= RNA_def_property(srna, "units", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "units"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, camera_units_items); + RNA_def_property_ui_text(prop, "Units", "Units used for camera focal length"); + + /* Principal Point */ + prop= RNA_def_property(srna, "principal", PROP_FLOAT, PROP_NONE); + RNA_def_property_array(prop, 2); + RNA_def_property_float_sdna(prop, NULL, "principal"); + RNA_def_property_ui_text(prop, "Principal Point", "Optical center of lens"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); + + /* Radial distortion parameters */ + prop= RNA_def_property(srna, "k1", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "k1"); + RNA_def_property_ui_range(prop, -10, 10, .1, 3); + RNA_def_property_ui_text(prop, "K1", "First coefficient of third order polynomial radial distortion"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate"); + + prop= RNA_def_property(srna, "k2", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "k2"); + RNA_def_property_ui_range(prop, -10, 10, .1, 3); + RNA_def_property_ui_text(prop, "K2", "Second coefficient of third order polynomial radial distortion"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate"); + + prop= RNA_def_property(srna, "k3", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "k3"); + RNA_def_property_ui_range(prop, -10, 10, .1, 3); + RNA_def_property_ui_text(prop, "K3", "Third coefficient of third order polynomial radial distortion"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate"); + + /* pixel aspect */ + prop= RNA_def_property(srna, "pixel_aspect", PROP_FLOAT, PROP_XYZ); + RNA_def_property_float_sdna(prop, NULL, "pixel_aspect"); + RNA_def_property_range(prop, 0.1f, 5000.0f); + RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2); + RNA_def_property_ui_text(prop, "Pixel Aspect", "Pixel aspect ratio"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); +} + +static void rna_def_trackingMarker(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "MovieTrackingMarker", NULL); + RNA_def_struct_ui_text(srna, "Movie tracking marker data", "Match-moving marker data for tracking"); + + /* position */ + prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); + RNA_def_property_array(prop, 2); + RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5); + RNA_def_property_float_sdna(prop, NULL, "pos"); + RNA_def_property_ui_text(prop, "Position", "Marker position at frame in normalized coordinates"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); + + /* frame */ + prop= RNA_def_property(srna, "frame", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can't be safty edited for now, need to re-sort markers array after change */ + RNA_def_property_int_sdna(prop, NULL, "framenr"); + RNA_def_property_ui_text(prop, "Frame", "Frame number marker is keyframed on"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); + + /* enable */ + prop= RNA_def_property(srna, "enable", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", MARKER_DISABLED); + RNA_def_property_ui_text(prop, "Enable", "Is marker enabled for current frame"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); +} + +static void rna_def_trackingTrack(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + FunctionRNA *func; + PropertyRNA *parm; + + static EnumPropertyItem tracker_items[] = { + {TRACKER_SAD, "SAD", 0, "SAD", "Sum of Absolute Differences tracker"}, + {TRACKER_KLT, "KLT", 0, "KLT", "Kanade–Lucas–Tomasi racker"}, + {0, NULL, 0, NULL, NULL}}; + + rna_def_trackingMarker(brna); + + srna= RNA_def_struct(brna, "MovieTrackingTrack", NULL); + RNA_def_struct_ui_text(srna, "Movie tracking track data", "Match-moving track data for tracking"); + RNA_def_struct_ui_icon(srna, ICON_ANIM_DATA); + + /* name */ + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + RNA_def_property_ui_text(prop, "Name", "Unique name of track"); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_trackingTrack_name_set"); + RNA_def_property_string_maxlength(prop, MAX_ID_NAME); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); + RNA_def_struct_name_property(srna, prop); + + /* Pattern */ + prop= RNA_def_property(srna, "pattern_min", PROP_FLOAT, PROP_TRANSLATION); + RNA_def_property_array(prop, 2); + RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5); + RNA_def_property_float_sdna(prop, NULL, "pat_min"); + RNA_def_property_ui_text(prop, "Pattern Min", "Left-bottom corner of pattern area in normalized coordinates relative to marker position"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPattern_update"); + + prop= RNA_def_property(srna, "pattern_max", PROP_FLOAT, PROP_TRANSLATION); + RNA_def_property_array(prop, 2); + RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5); + RNA_def_property_float_sdna(prop, NULL, "pat_max"); + RNA_def_property_ui_text(prop, "Pattern Max", "Right-bottom corner of pattern area in normalized coordinates relative to marker position"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPattern_update"); + + /* Search */ + prop= RNA_def_property(srna, "search_min", PROP_FLOAT, PROP_TRANSLATION); + RNA_def_property_array(prop, 2); + RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5); + RNA_def_property_float_sdna(prop, NULL, "search_min"); + RNA_def_property_ui_text(prop, "Search Min", "Left-bottom corner of search area in normalized coordinates relative to marker position"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerSearch_update"); + + prop= RNA_def_property(srna, "search_max", PROP_FLOAT, PROP_TRANSLATION); + RNA_def_property_array(prop, 2); + RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5); + RNA_def_property_float_sdna(prop, NULL, "search_max"); + RNA_def_property_ui_text(prop, "Search Max", "Right-bottom corner of search area in normalized coordinates relative to marker position"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerSearch_update"); + + /* tracking algorithm */ + prop= RNA_def_property(srna, "tracker", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, tracker_items); + RNA_def_property_ui_text(prop, "Tracker", "Tracking algorithm to use"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerAlgorithm_update"); + + /* pyramid level for pyramid klt tracking */ + prop= RNA_def_property(srna, "pyramid_levels", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "pyramid_levels"); + RNA_def_property_range(prop, 1, 16); + RNA_def_property_ui_text(prop, "Pyramid levels", "Number of pyramid levels for KLT tracking"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPyramid_update"); + + /* minmal correlation - only used for SAD tracker */ + prop= RNA_def_property(srna, "correlation_min", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_float_sdna(prop, NULL, "minimum_correlation"); + RNA_def_property_range(prop, -1.0f, 1.0f); + RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3); + RNA_def_property_ui_text(prop, "Correlation", "Minimal value of correlation between mathed pattern and reference which is still treated as successful tracking"); + + /* markers */ + prop= RNA_def_property(srna, "markers", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "MovieTrackingMarker"); + RNA_def_property_collection_sdna(prop, NULL, "markers", "markersnr"); + RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, "rna_tracking_markers_length", NULL, NULL, NULL); + RNA_def_property_ui_text(prop, "Markers", "Collection of markers in track"); + + /* ** channels ** */ + + /* use_red_channel */ + prop= RNA_def_property(srna, "use_red_channel", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_RED); + RNA_def_property_ui_text(prop, "Use Red Channel", "Use red channel from footage for tracking"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* use_green_channel */ + prop= RNA_def_property(srna, "use_green_channel", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_GREEN); + RNA_def_property_ui_text(prop, "Use Green Channel", "Use green channel from footage for tracking"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* use_blue_channel */ + prop= RNA_def_property(srna, "use_blue_channel", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_BLUE); + RNA_def_property_ui_text(prop, "Use Blue Channel", "Use blue channel from footage for tracking"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* has bundle */ + prop= RNA_def_property(srna, "has_bundle", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_HAS_BUNDLE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Has Bundle", "True if track has a valid bundle"); + + /* bundle position */ + prop= RNA_def_property(srna, "bundle", PROP_FLOAT, PROP_TRANSLATION); + RNA_def_property_array(prop, 3); + RNA_def_property_float_sdna(prop, NULL, "bundle_pos"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Bundle", "Position of bundle reconstructed from this track"); + + /* hide */ + prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_HIDDEN); + RNA_def_property_ui_text(prop, "Hide", "Track is hidden"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* locked */ + prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_LOCKED); + RNA_def_property_ui_text(prop, "Lock", "Track is locked and all changes to it are disabled"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* custom color */ + prop= RNA_def_property(srna, "use_custom_color", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_CUSTOMCOLOR); + RNA_def_property_ui_text(prop, "Custom Color", "Use custom color instead of theme-defined"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* color */ + prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); + RNA_def_property_array(prop, 3); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Color", "Color of the track in the Clip Editor"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* average error */ + prop= RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "error"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Average Error", "Average error of re-projection"); + + /* ** api ** */ + + func= RNA_def_function(srna, "marker_find_frame", "rna_trackingTrack_marker_find_frame"); + RNA_def_function_ui_description(func, "Get marker for specified frame"); + parm= RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", "type for the new spline", MINFRAME, MAXFRAME); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "marker", "MovieTrackingMarker", "", "Marker for specified frame"); + RNA_def_function_return(func, parm); +} + +static void rna_def_trackingStabilization(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "MovieTrackingStabilization", NULL); + RNA_def_struct_ui_text(srna, "Movie tracking stabilization data", "Match-moving stabilization data for tracking"); + + /* 2d stabilization */ + prop= RNA_def_property(srna, "use_2d_stabilization", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_2D_STABILIZATION); + RNA_def_property_ui_text(prop, "Use 2D stabilization", "Use 2D stabilization for footage"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); + + /* tracks */ + prop= RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_funcs(prop, "rna_tracking_stabTracks_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0); + RNA_def_property_struct_type(prop, "MovieTrackingTrack"); + RNA_def_property_ui_text(prop, "Tracks", "Collection of tracks used for stabilization"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); + + /* rotation track */ + prop= RNA_def_property(srna, "rotation_track", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "rot_track"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Rotation Track", "Track used to compensate rotation"); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate"); + + /* active track index */ + prop= RNA_def_property(srna, "active_track_index", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "act_track"); + RNA_def_property_int_funcs(prop, "rna_tracking_stabTracks_active_index_get", "rna_tracking_stabTracks_active_index_set", "rna_tracking_stabTracks_active_index_range"); + RNA_def_property_ui_text(prop, "Active Track Index", "Index of active track in stabilization tracks list"); + + /* autoscale */ + prop= RNA_def_property(srna, "use_autoscale", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_AUTOSCALE); + RNA_def_property_ui_text(prop, "Autoscale", "Automatically scale footage to cover unfilled areas when stabilizating"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); + + /* max scale */ + prop= RNA_def_property(srna, "scale_max", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "maxscale"); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_ui_text(prop, "Miximal Scale", "Maximal value for scale factor"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); + + /* influence_location */ + prop= RNA_def_property(srna, "influence_location", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "locinf"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Location Influence", "Influence of stabilization algorithm on footage location"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); + + /* influence_scale */ + prop= RNA_def_property(srna, "influence_scale", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "scaleinf"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Scale Influence", "Influence of stabilization algorithm on footage scale"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); + + /* influence_rotation */ + prop= RNA_def_property(srna, "influence_rotation", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "rotinf"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Rotation Influence", "Influence of stabilization algorithm on footage rotation"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); +} + +static void rna_def_reconstructedCamera(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "MovieReconstructedCamera", NULL); + RNA_def_struct_ui_text(srna, "Movie tracking reconstructed camera data", "Match-moving reconstructed camera data from tracker"); + + /* frame */ + prop= RNA_def_property(srna, "frame", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_int_sdna(prop, NULL, "framenr"); + RNA_def_property_ui_text(prop, "Frame", "Frame number marker is keyframed on"); + + /* matrix */ + prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); + RNA_def_property_float_sdna(prop, NULL, "mat"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); + RNA_def_property_ui_text(prop, "Matrix", "Worldspace transformation matrix"); + + /* average_error */ + prop= RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "error"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Average Error", "Average error of resonctruction"); +} + +static void rna_def_trackingReconstruction(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + rna_def_reconstructedCamera(brna); + + srna= RNA_def_struct(brna, "MovieTrackingReconstruction", NULL); + RNA_def_struct_ui_text(srna, "Movie tracking reconstruction data", "Match-moving reconstruction data from tracker"); + + /* is_valid */ + prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_RECONSTRUCTED); + RNA_def_property_ui_text(prop, "Reconstructed", "Is tracking data contains valid reconstruction information"); + + /* average_error */ + prop= RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "error"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Average Error", "Average error of resonctruction"); + + /* cameras */ + prop= RNA_def_property(srna, "cameras", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "MovieReconstructedCamera"); + RNA_def_property_collection_sdna(prop, NULL, "cameras", "camnr"); + RNA_def_property_ui_text(prop, "Cameras", "Collection of solved cameras"); +} + +static void rna_def_trackingTracks(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + FunctionRNA *func; + PropertyRNA *prop; + + RNA_def_property_srna(cprop, "MovieTrackingTracks"); + srna= RNA_def_struct(brna, "MovieTrackingTracks", NULL); + RNA_def_struct_sdna(srna, "MovieTracking"); + RNA_def_struct_ui_text(srna, "Movie Tracks", "Collection of movie tracking tracks"); + + func= RNA_def_function(srna, "add", "rna_tracking_tracks_add"); + RNA_def_function_ui_description(func, "Add a number of tracks to this movie clip"); + RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", "Frame number to add tracks on", MINFRAME, MAXFRAME); + RNA_def_int(func, "count", 1, 0, INT_MAX, "Number", "Number of tracks to add to the movie clip", 0, INT_MAX); + + /* active track */ + prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "MovieTrackingTrack"); + RNA_def_property_pointer_funcs(prop, "rna_tracking_active_track_get", "rna_tracking_active_track_set", NULL, NULL); + RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK); + RNA_def_property_ui_text(prop, "Active Track", "Active track in this tracking data object"); +} + +static void rna_def_tracking(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + rna_def_trackingSettings(brna); + rna_def_trackingCamera(brna); + rna_def_trackingTrack(brna); + rna_def_trackingStabilization(brna); + rna_def_trackingReconstruction(brna); + + srna= RNA_def_struct(brna, "MovieTracking", NULL); + RNA_def_struct_ui_text(srna, "Movie tracking data", "Match-moving data for tracking"); + + /* settings */ + prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "MovieTrackingSettings"); + + /* camera properties */ + prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "MovieTrackingCamera"); + + /* tracks */ + prop= RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_funcs(prop, "rna_tracking_tracks_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0); + RNA_def_property_struct_type(prop, "MovieTrackingTrack"); + RNA_def_property_ui_text(prop, "Tracks", "Collection of tracks in this tracking data object"); + rna_def_trackingTracks(brna, prop); + + /* stabilization */ + prop= RNA_def_property(srna, "stabilization", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "MovieTrackingStabilization"); + + /* reconstruction */ + prop= RNA_def_property(srna, "reconstruction", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "MovieTrackingReconstruction"); +} + +void RNA_def_tracking(BlenderRNA *brna) +{ + rna_def_tracking(brna); +} + +#endif diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 25c673a168f..a7e7a7b7577 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -397,6 +397,25 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_boolean(func, "compact", 0, "", "Use more compact layout"); + func= RNA_def_function(srna, "template_movieclip", "uiTemplateMovieClip"); + RNA_def_function_ui_description(func, "Item(s). User interface for selecting movie clips and their source paths"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); + api_ui_item_rna_common(func); + RNA_def_boolean(func, "compact", 0, "", "Use more compact layout"); + + func= RNA_def_function(srna, "template_track", "uiTemplateTrack"); + RNA_def_function_ui_description(func, "Item. A movie-track widget to preview tracking image."); + api_ui_item_rna_common(func); + + func= RNA_def_function(srna, "template_marker", "uiTemplateMarker"); + RNA_def_function_ui_description(func, "Item. A widget to control single marker settings."); + api_ui_item_rna_common(func); + parm= RNA_def_pointer(func, "clip_user", "MovieClipUser", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); + parm= RNA_def_pointer(func, "track", "MovieTrackingTrack", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); + RNA_def_boolean(func, "compact", 0, "", "Use more compact layout"); + func= RNA_def_function(srna, "template_list", "uiTemplateList"); RNA_def_function_ui_description(func, "Item. A list widget to display data. e.g. vertexgroups"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); @@ -408,9 +427,9 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "prop_list", "", 0, "", - "Identifier of a string property in each data member, specifying which " - "of its properties should have a widget displayed in its row"); + RNA_def_string(func, "prop_list", "", 0, "", + "Identifier of a string property in each data member, specifying which " + "of its properties should have a widget displayed in its row"); RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display", 0, INT_MAX); RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display", 0, INT_MAX); RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use"); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index fc9c8a241c6..e4e1c78ab3e 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -1030,8 +1030,21 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) RNA_def_property_range(prop, 1, 5); RNA_def_property_ui_text(prop, "Outline Width", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "bundle_solid", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "bundle_solid"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Bundle Solid", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "camera_path", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "camera_path"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Camera Path", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } + static void rna_def_userdef_theme_space_graph(BlenderRNA *brna) { StructRNA *srna; @@ -1741,6 +1754,94 @@ static void rna_def_userdef_theme_colorset(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_userdef_update"); } +static void rna_def_userdef_theme_space_clip(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + /* space_clip */ + + srna= RNA_def_struct(brna, "ThemeClipEditor", NULL); + RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_ui_text(srna, "Theme Clip Editor", "Theme settings for the Movie Clip Editor"); + + rna_def_userdef_theme_spaces_main(srna, SPACE_CLIP); + + prop= RNA_def_property(srna, "marker_outline", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "marker_outline"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Marker Outline Color", "Color of marker's outile"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "marker", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "marker"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Marker Color", "Color of marker"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "active_marker", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "act_marker"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Active Marker", "Color of active marker"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "selected_marker", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "sel_marker"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Selected Marker", "Color of sleected marker"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "disabled_marker", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "dis_marker"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Disabled Marker", "Color of disabled marker"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "locked_marker", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "lock_marker"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Locked Marker", "Color of locked marker"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "path_before", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "path_before"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Path Before", "Color of path before current frame"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "path_after", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "path_after"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Path After", "Color of path after current frame"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Grid", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "cframe"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Current Frame", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Handle Vertex", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Handle Vertex Select", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE); + RNA_def_property_range(prop, 0, 255); + RNA_def_property_ui_text(prop, "Handle Vertex Size", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); +} + static void rna_def_userdef_themes(BlenderRNA *brna) { StructRNA *srna; @@ -1765,6 +1866,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna) {15, "INFO", ICON_INFO, "Info", ""}, {16, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""}, {17, "CONSOLE", ICON_CONSOLE, "Python Console", ""}, + {20, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", ""}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Theme", NULL); @@ -1887,6 +1989,12 @@ static void rna_def_userdef_themes(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "tarm", ""); RNA_def_property_struct_type(prop, "ThemeBoneColorSet"); RNA_def_property_ui_text(prop, "Bone Color Sets", ""); + + prop= RNA_def_property(srna, "clip_editor", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "tclip"); + RNA_def_property_struct_type(prop, "ThemeClipEditor"); + RNA_def_property_ui_text(prop, "Clip Editor", ""); } static void rna_def_userdef_addon(BlenderRNA *brna) @@ -1926,6 +2034,7 @@ static void rna_def_userdef_dothemes(BlenderRNA *brna) rna_def_userdef_theme_space_userpref(brna); rna_def_userdef_theme_space_console(brna); rna_def_userdef_theme_space_logic(brna); + rna_def_userdef_theme_space_clip(brna); rna_def_userdef_theme_colorset(brna); rna_def_userdef_themes(brna); } diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index c7f7fe5feea..dfbdafd7d18 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -821,7 +821,7 @@ static int operator_execute(bContext *C, wmOperator *op) void *ret; int result; - RNA_pointer_create(&CTX_wm_screen(C)->id, op->type->ext.srna, op, &opr); + RNA_pointer_create(NULL, op->type->ext.srna, op, &opr); func= &rna_Operator_execute_func; /* RNA_struct_find_function(&opr, "execute"); */ RNA_parameter_list_create(&list, &opr, func); @@ -847,7 +847,7 @@ static int operator_check(bContext *C, wmOperator *op) void *ret; int result; - RNA_pointer_create(&CTX_wm_screen(C)->id, op->type->ext.srna, op, &opr); + RNA_pointer_create(NULL, op->type->ext.srna, op, &opr); func= &rna_Operator_check_func; /* RNA_struct_find_function(&opr, "check"); */ RNA_parameter_list_create(&list, &opr, func); @@ -872,7 +872,7 @@ static int operator_invoke(bContext *C, wmOperator *op, wmEvent *event) void *ret; int result; - RNA_pointer_create(&CTX_wm_screen(C)->id, op->type->ext.srna, op, &opr); + RNA_pointer_create(NULL, op->type->ext.srna, op, &opr); func= &rna_Operator_invoke_func; /* RNA_struct_find_function(&opr, "invoke"); */ RNA_parameter_list_create(&list, &opr, func); @@ -899,7 +899,7 @@ static int operator_modal(bContext *C, wmOperator *op, wmEvent *event) void *ret; int result; - RNA_pointer_create(&CTX_wm_screen(C)->id, op->type->ext.srna, op, &opr); + RNA_pointer_create(NULL, op->type->ext.srna, op, &opr); func= &rna_Operator_modal_func; /* RNA_struct_find_function(&opr, "modal"); */ RNA_parameter_list_create(&list, &opr, func); @@ -923,7 +923,7 @@ static void operator_draw(bContext *C, wmOperator *op) ParameterList list; FunctionRNA *func; - RNA_pointer_create(&CTX_wm_screen(C)->id, op->type->ext.srna, op, &opr); + RNA_pointer_create(NULL, op->type->ext.srna, op, &opr); func= &rna_Operator_draw_func; /* RNA_struct_find_function(&opr, "draw"); */ RNA_parameter_list_create(&list, &opr, func); @@ -944,7 +944,7 @@ static int operator_cancel(bContext *C, wmOperator *op) void *ret; int result; - RNA_pointer_create(&CTX_wm_screen(C)->id, op->type->ext.srna, op, &opr); + RNA_pointer_create(NULL, op->type->ext.srna, op, &opr); func= &rna_Operator_cancel_func; /* RNA_struct_find_function(&opr, "cancel"); */ RNA_parameter_list_create(&list, &opr, func); diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c index 10c2f6019ed..266bff35bbd 100644 --- a/source/blender/modifiers/intern/MOD_build.c +++ b/source/blender/modifiers/intern/MOD_build.c @@ -75,7 +75,7 @@ static int dependsOnTime(ModifierData *UNUSED(md)) return 1; } -static DerivedMesh *applyModifier(ModifierData *md, Object *ob, +static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), DerivedMesh *derivedData, int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) @@ -106,12 +106,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, faceMap = MEM_callocN(sizeof(*faceMap) * maxFaces, "build modifier faceMap"); for(i = 0; i < maxFaces; ++i) faceMap[i] = i; - if (ob) { - frac = bsystem_time(md->scene, ob, md->scene->r.cfra, - bmd->start - 1.0f) / bmd->length; - } else { - frac = BKE_curframe(md->scene) - bmd->start / bmd->length; - } + frac = BKE_curframe(md->scene) - bmd->start / bmd->length; CLAMP(frac, 0.0f, 1.0f); numFaces = dm->getNumFaces(dm) * frac; diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index 8dcb6f4b4d9..9821c0b3836 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -804,10 +804,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, /* timestep= psys_get_timestep(&sim); */ - //if(part->flag & PART_GLOB_TIME) - cfra= BKE_curframe(scene); - //else - // cfra=bsystem_time(scene, ob,(float)scene->r.cfra,0.0); + cfra= BKE_curframe(scene); /* hash table for vertice <-> particle relations */ vertpahash= BLI_edgehash_new(); diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c index f93e0469686..509c916941f 100644 --- a/source/blender/modifiers/intern/MOD_particleinstance.c +++ b/source/blender/modifiers/intern/MOD_particleinstance.c @@ -257,7 +257,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob, mul_qt_v3(state.rot,mv->co); if(pimd->flag & eParticleInstanceFlag_UseSize) mul_v3_fl(mv->co, size[i/totvert]); - VECADD(mv->co,mv->co,state.co); + add_v3_v3(mv->co, state.co); } mface=result->getFaceArray(result); diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index 4609ee221a4..2c056ad4021 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -198,7 +198,7 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object for(i=0; i<numVerts; i++) { float tmp[3]; - VECCOPY(tmp, vertexCos[i]); + copy_v3_v3(tmp, vertexCos[i]); if(transf) space_transform_apply(transf, tmp); @@ -236,7 +236,7 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object if(transf) space_transform_apply(transf, vertexCos[i]); - VECCOPY(co, vertexCos[i]); + copy_v3_v3(co, vertexCos[i]); //Apply axis limits if(smd->mode != MOD_SIMPLEDEFORM_MODE_BEND) //Bend mode shoulnt have any lock axis diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index 82848c6a5d7..69e7f9cac6b 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -80,6 +80,8 @@ set(SRC composite/nodes/node_composite_mapValue.c composite/nodes/node_composite_math.c composite/nodes/node_composite_mixrgb.c + composite/nodes/node_composite_movieclip.c + composite/nodes/node_composite_moviedistortion.c composite/nodes/node_composite_normal.c composite/nodes/node_composite_normalize.c composite/nodes/node_composite_outputFile.c @@ -93,8 +95,10 @@ set(SRC composite/nodes/node_composite_sepcombYUVA.c composite/nodes/node_composite_setalpha.c composite/nodes/node_composite_splitViewer.c + composite/nodes/node_composite_stabilize2d.c composite/nodes/node_composite_texture.c composite/nodes/node_composite_tonemap.c + composite/nodes/node_composite_transform.c composite/nodes/node_composite_translate.c composite/nodes/node_composite_valToRgb.c composite/nodes/node_composite_value.c diff --git a/source/blender/nodes/NOD_composite.h b/source/blender/nodes/NOD_composite.h index d768a5d794f..f1415a8c8f0 100644 --- a/source/blender/nodes/NOD_composite.h +++ b/source/blender/nodes/NOD_composite.h @@ -52,6 +52,7 @@ void register_node_type_cmp_texture(ListBase *lb); void register_node_type_cmp_value(ListBase *lb); void register_node_type_cmp_rgb(ListBase *lb); void register_node_type_cmp_curve_time(ListBase *lb); +void register_node_type_cmp_movieclip(ListBase *lb); void register_node_type_cmp_composite(ListBase *lb); void register_node_type_cmp_viewer(ListBase *lb); @@ -113,6 +114,9 @@ void register_node_type_cmp_flip(ListBase *lb); void register_node_type_cmp_crop(ListBase *lb); void register_node_type_cmp_displace(ListBase *lb); void register_node_type_cmp_mapuv(ListBase *lb); +void register_node_type_cmp_transform(ListBase *lb); +void register_node_type_cmp_stabilize2d(ListBase *lb); +void register_node_type_cmp_moviedistortion(ListBase *lb); void register_node_type_cmp_glare(ListBase *lb); void register_node_type_cmp_tonemap(ListBase *lb); diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c index 2151176f907..d3f4a5b2999 100644 --- a/source/blender/nodes/composite/node_composite_tree.c +++ b/source/blender/nodes/composite/node_composite_tree.c @@ -45,6 +45,7 @@ #include "BKE_global.h" #include "BKE_main.h" #include "BKE_node.h" +#include "BKE_tracking.h" #include "BKE_utildefines.h" #include "node_exec.h" @@ -168,6 +169,17 @@ static void local_merge(bNodeTree *localtree, bNodeTree *ntree) BKE_image_merge((Image *)lnode->new_node->id, (Image *)lnode->id); } } + else if(lnode->type==CMP_NODE_MOVIEDISTORTION) { + /* special case for distortion node: distortion context is allocating in exec function + and to achive much better performance on further calls this context should be + copied back to original node */ + if(lnode->storage) { + if(lnode->new_node->storage) + BKE_tracking_distortion_destroy(lnode->new_node->storage); + + lnode->new_node->storage= BKE_tracking_distortion_copy(lnode->storage); + } + } for(lsock= lnode->outputs.first; lsock; lsock= lsock->next) { if(ntreeOutputExists(lnode->new_node, lsock->new_sock)) { @@ -806,6 +818,10 @@ int ntreeCompositTagAnimated(bNodeTree *ntree) nodeUpdate(ntree, node); } } + else if(ELEM(node->type, CMP_NODE_MOVIECLIP, CMP_NODE_TRANSFORM)) { + nodeUpdate(ntree, node); + tagged= 1; + } } return tagged; diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c index 929b87618d8..0356ed394f1 100644 --- a/source/blender/nodes/composite/node_composite_util.c +++ b/source/blender/nodes/composite/node_composite_util.c @@ -317,8 +317,8 @@ CompBuf *typecheck_compbuf(CompBuf *inbuf, int type) if(inbuf->rect_procedural) { outbuf->rect_procedural= inbuf->rect_procedural; - VECCOPY(outbuf->procedural_size, inbuf->procedural_size); - VECCOPY(outbuf->procedural_offset, inbuf->procedural_offset); + copy_v3_v3(outbuf->procedural_size, inbuf->procedural_size); + copy_v3_v3(outbuf->procedural_offset, inbuf->procedural_offset); outbuf->procedural_type= inbuf->procedural_type; outbuf->node= inbuf->node; return outbuf; @@ -707,12 +707,12 @@ void do_ycca_to_rgba(bNode *UNUSED(node), float *out, float *in) void do_copy_rgba(bNode *UNUSED(node), float *out, float *in) { - QUATCOPY(out, in); + copy_v4_v4(out, in); } void do_copy_rgb(bNode *UNUSED(node), float *out, float *in) { - VECCOPY(out, in); + copy_v3_v3(out, in); out[3]= 1.0f; } @@ -723,7 +723,7 @@ void do_copy_value(bNode *UNUSED(node), float *out, float *in) void do_copy_a_rgba(bNode *UNUSED(node), float *out, float *in, float *fac) { - VECCOPY(out, in); + copy_v3_v3(out, in); out[3]= *fac; } diff --git a/source/blender/nodes/composite/node_composite_util.h b/source/blender/nodes/composite/node_composite_util.h index 9ebca8688b4..9cac4c477eb 100644 --- a/source/blender/nodes/composite/node_composite_util.h +++ b/source/blender/nodes/composite/node_composite_util.h @@ -44,6 +44,7 @@ #include "DNA_ID.h" #include "DNA_image_types.h" #include "DNA_material_types.h" +#include "DNA_movieclip_types.h" #include "DNA_node_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" @@ -57,13 +58,16 @@ #include "BLI_utildefines.h" #include "BKE_blender.h" +#include "BKE_camera.h" #include "BKE_colortools.h" #include "BKE_global.h" #include "BKE_image.h" #include "BKE_main.h" #include "BKE_material.h" +#include "BKE_movieclip.h" #include "BKE_node.h" #include "BKE_texture.h" +#include "BKE_tracking.h" #include "BKE_library.h" #include "BKE_object.h" @@ -209,4 +213,11 @@ CompBuf* qd_downScaledCopy(CompBuf* src, int scale); void IIR_gauss(CompBuf* src, float sigma, int chan, int xy); /* end utility funcs */ +/* transformations */ + +#define CMP_SCALE_MAX 12000 + +CompBuf* node_composit_transform(CompBuf *cbuf, float x, float y, float angle, float scale, int filter_type); +float *node_composit_get_float_buffer(RenderData *rd, ImBuf *ibuf, int *alloc); + #endif diff --git a/source/blender/nodes/composite/nodes/node_composite_alphaOver.c b/source/blender/nodes/composite/nodes/node_composite_alphaOver.c index b542954948a..4fd4b750178 100644 --- a/source/blender/nodes/composite/nodes/node_composite_alphaOver.c +++ b/source/blender/nodes/composite/nodes/node_composite_alphaOver.c @@ -48,10 +48,10 @@ static void do_alphaover_premul(bNode *UNUSED(node), float *out, float *src, flo { if(over[3]<=0.0f) { - QUATCOPY(out, src); + copy_v4_v4(out, src); } else if(fac[0]==1.0f && over[3]>=1.0f) { - QUATCOPY(out, over); + copy_v4_v4(out, over); } else { float mul= 1.0f - fac[0]*over[3]; @@ -68,10 +68,10 @@ static void do_alphaover_key(bNode *UNUSED(node), float *out, float *src, float { if(over[3]<=0.0f) { - QUATCOPY(out, src); + copy_v4_v4(out, src); } else if(fac[0]==1.0f && over[3]>=1.0f) { - QUATCOPY(out, over); + copy_v4_v4(out, over); } else { float premul= fac[0]*over[3]; @@ -89,10 +89,10 @@ static void do_alphaover_mixed(bNode *node, float *out, float *src, float *over, { if(over[3]<=0.0f) { - QUATCOPY(out, src); + copy_v4_v4(out, src); } else if(fac[0]==1.0f && over[3]>=1.0f) { - QUATCOPY(out, over); + copy_v4_v4(out, over); } else { NodeTwoFloats *ntf= node->storage; diff --git a/source/blender/nodes/composite/nodes/node_composite_blur.c b/source/blender/nodes/composite/nodes/node_composite_blur.c index 188ac653506..d0ddfb47f08 100644 --- a/source/blender/nodes/composite/nodes/node_composite_blur.c +++ b/source/blender/nodes/composite/nodes/node_composite_blur.c @@ -512,7 +512,7 @@ static void blur_with_reference(bNode *node, CompBuf *new, CompBuf *img, CompBuf if(pix==1) dest[0]= src[0]; else - QUATCOPY(dest, src); + copy_v4_v4(dest, src); } else { int minxr= x-refradx<0?-x:-refradx; diff --git a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c index 3dfc3a193a8..b226e562799 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c @@ -52,7 +52,7 @@ static void do_color_key(bNode *node, float *out, float *in) c=node->storage; - VECCOPY(out, in); + copy_v3_v3(out, in); if( /* do hue last because it needs to wrap, and does some more checks */ diff --git a/source/blender/nodes/composite/nodes/node_composite_curves.c b/source/blender/nodes/composite/nodes/node_composite_curves.c index 675710942fb..6f4d32f6573 100644 --- a/source/blender/nodes/composite/nodes/node_composite_curves.c +++ b/source/blender/nodes/composite/nodes/node_composite_curves.c @@ -144,7 +144,7 @@ static void do_curves_fac(bNode *node, float *out, float *in, float *fac) if(*fac>=1.0) curvemapping_evaluate_premulRGBF(node->storage, out, in); else if(*fac<=0.0) { - VECCOPY(out, in); + copy_v3_v3(out, in); } else { float col[4], mfac= 1.0f-*fac; @@ -175,7 +175,7 @@ static void node_composit_exec_curve_rgb(void *UNUSED(data), bNode *node, bNodeS curvemapping_set_black_white(node->storage, in[2]->vec, in[3]->vec); - if(in[0]->vec[0] == 1.0) + if(in[0]->data==NULL && in[0]->vec[0] == 1.0) composit1_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, do_curves, CB_RGBA); else composit2_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[0]->data, in[0]->vec, do_curves_fac, CB_RGBA, CB_VAL); diff --git a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c index c621d524044..17156ab3492 100644 --- a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c @@ -60,7 +60,7 @@ static void do_diff_matte(bNode *node, float *outColor, float *inColor1, float * /*average together the distances*/ difference=difference/3.0; - VECCOPY(outColor, inColor1); + copy_v3_v3(outColor, inColor1); /*make 100% transparent*/ if(difference < tolerence) { diff --git a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c index 401b143aac3..27fe66cbe0d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c @@ -59,7 +59,7 @@ static void do_distance_matte(bNode *node, float *out, float *in) (c->key[1]-in[1])*(c->key[1]-in[1]) + (c->key[2]-in[2])*(c->key[2]-in[2])); - VECCOPY(out, in); + copy_v3_v3(out, in); /*make 100% transparent */ if(distance < tolerence) { diff --git a/source/blender/nodes/composite/nodes/node_composite_filter.c b/source/blender/nodes/composite/nodes/node_composite_filter.c index 071ee84377c..1a0c51fab53 100644 --- a/source/blender/nodes/composite/nodes/node_composite_filter.c +++ b/source/blender/nodes/composite/nodes/node_composite_filter.c @@ -64,7 +64,7 @@ static void do_filter_edge(CompBuf *out, CompBuf *in, float *filter, float fac) fp= out->rect + pix*y*rowlen; if(pix==CB_RGBA) { - QUATCOPY(fp, row2); + copy_v4_v4(fp, row2); fp+= pix; for(x=2; x<rowlen; x++) { @@ -78,7 +78,7 @@ static void do_filter_edge(CompBuf *out, CompBuf *in, float *filter, float fac) /* no alpha... will clear it completely */ fp++; row1++; row2++; row3++; } - QUATCOPY(fp, row2+4); + copy_v4_v4(fp, row2+4); } else if(pix==CB_VAL) { fp+= pix; @@ -138,7 +138,7 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac) fp[1]= row2[3]; } else if(pixlen==3) { - VECCOPY(fp, row2); + copy_v3_v3(fp, row2); fp+= 3; for(x=2; x<rowlen; x++) { @@ -147,10 +147,10 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac) fp++; row1++; row2++; row3++; } } - VECCOPY(fp, row2+3); + copy_v3_v3(fp, row2+3); } else { - QUATCOPY(fp, row2); + copy_v4_v4(fp, row2); fp+= 4; for(x=2; x<rowlen; x++) { @@ -159,7 +159,7 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac) fp++; row1++; row2++; row3++; } } - QUATCOPY(fp, row2+4); + copy_v4_v4(fp, row2+4); } } } diff --git a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c index c2304b37c0d..3c73d07d96c 100644 --- a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c +++ b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c @@ -64,7 +64,7 @@ static void do_hue_sat_fac(bNode *node, float *out, float *in, float *fac) out[3]= in[3]; } else { - QUATCOPY(out, in); + copy_v4_v4(out, in); } } diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c index c1e9d28bb4d..41427c42286 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.c +++ b/source/blender/nodes/composite/nodes/node_composite_image.c @@ -58,6 +58,36 @@ static bNodeSocketTemplate cmp_node_rlayers_out[]= { { -1, 0, "" } }; +/* float buffer from the image with matching color management */ +float *node_composit_get_float_buffer(RenderData *rd, ImBuf *ibuf, int *alloc) +{ + float *rect; + + *alloc= FALSE; + + if(rd->color_mgt_flag & R_COLOR_MANAGEMENT) { + if(ibuf->profile != IB_PROFILE_NONE) { + rect= ibuf->rect_float; + } + else { + rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); + srgb_to_linearrgb_rgba_rgba_buf(rect, ibuf->rect_float, ibuf->x * ibuf->y); + *alloc= TRUE; + } + } + else { + if(ibuf->profile == IB_PROFILE_NONE) { + rect= ibuf->rect_float; + } + else { + rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); + linearrgb_to_srgb_rgba_rgba_buf(rect, ibuf->rect_float, ibuf->x * ibuf->y); + *alloc= TRUE; + } + } + + return rect; +} /* note: this function is used for multilayer too, to ensure uniform handling with BKE_image_get_ibuf() */ @@ -82,26 +112,7 @@ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *i /* now we need a float buffer from the image with matching color management */ /* XXX weak code, multilayer is excluded from this */ if(ibuf->channels == 4 && ima->rr==NULL) { - if(rd->color_mgt_flag & R_COLOR_MANAGEMENT) { - if(ibuf->profile != IB_PROFILE_NONE) { - rect= ibuf->rect_float; - } - else { - rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); - srgb_to_linearrgb_rgba_rgba_buf(rect, ibuf->rect_float, ibuf->x * ibuf->y); - alloc= TRUE; - } - } - else { - if(ibuf->profile == IB_PROFILE_NONE) { - rect= ibuf->rect_float; - } - else { - rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); - linearrgb_to_srgb_rgba_rgba_buf(rect, ibuf->rect_float, ibuf->x * ibuf->y); - alloc= TRUE; - } - } + rect= node_composit_get_float_buffer(rd, ibuf, &alloc); } else { /* non-rgba passes can't use color profiles */ diff --git a/source/blender/nodes/composite/nodes/node_composite_invert.c b/source/blender/nodes/composite/nodes/node_composite_invert.c index c428e37bd35..daf2ee0cbe7 100644 --- a/source/blender/nodes/composite/nodes/node_composite_invert.c +++ b/source/blender/nodes/composite/nodes/node_composite_invert.c @@ -50,7 +50,7 @@ static void do_invert(bNode *node, float *out, float *in) out[1] = 1.0f - in[1]; out[2] = 1.0f - in[2]; } else - VECCOPY(out, in); + copy_v3_v3(out, in); if(node->custom1 & CMP_CHAN_A) out[3] = 1.0f - in[3]; @@ -75,7 +75,7 @@ static void do_invert_fac(bNode *node, float *out, float *in, float *fac) if(node->custom1 & CMP_CHAN_A) col[3] = fac[0]*col[3] + (facm*in[3]); - QUATCOPY(out, col); + copy_v4_v4(out, col); } static void node_composit_exec_invert(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) diff --git a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c index 0f5a2b61b87..275d949da28 100644 --- a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c +++ b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c @@ -47,12 +47,12 @@ static void do_mix_rgb(bNode *node, float *out, float *in1, float *in2, float *f { float col[3]; - VECCOPY(col, in1); + copy_v3_v3(col, in1); if(node->custom2) ramp_blend(node->custom1, col, col+1, col+2, in2[3]*fac[0], in2); else ramp_blend(node->custom1, col, col+1, col+2, fac[0], in2); - VECCOPY(out, col); + copy_v3_v3(out, col); out[3]= in1[3]; } diff --git a/source/blender/nodes/composite/nodes/node_composite_movieclip.c b/source/blender/nodes/composite/nodes/node_composite_movieclip.c new file mode 100644 index 00000000000..8931b899017 --- /dev/null +++ b/source/blender/nodes/composite/nodes/node_composite_movieclip.c @@ -0,0 +1,157 @@ +/* + * ***** 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/nodes/composite/nodes/node_composite_movieclip.c + * \ingroup cmpnodes + */ + + +#include "node_composite_util.h" + +static bNodeSocketTemplate cmp_node_movieclip_out[]= { + { SOCK_RGBA, 0, "Image"}, + { SOCK_FLOAT, 1, "Offset X"}, + { SOCK_FLOAT, 1, "Offset Y"}, + { SOCK_FLOAT, 1, "Scale"}, + { SOCK_FLOAT, 1, "Angle"}, + { -1, 0, "" } +}; + +static CompBuf *node_composit_get_movieclip(RenderData *rd, MovieClip *clip, MovieClipUser *user) +{ + ImBuf *ibuf; + CompBuf *stackbuf; + int type; + + float *rect; + int alloc= FALSE; + + ibuf= BKE_movieclip_get_ibuf(clip, user); + + if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) { + IMB_freeImBuf(ibuf); + return NULL; + } + + if (ibuf->rect_float == NULL || ibuf->userflags&IB_RECT_INVALID) { + IMB_float_from_rect(ibuf); + ibuf->userflags&= ~IB_RECT_INVALID; + } + + /* now we need a float buffer from the image with matching color management */ + if(ibuf->channels == 4) { + rect= node_composit_get_float_buffer(rd, ibuf, &alloc); + } + else { + /* non-rgba passes can't use color profiles */ + rect= ibuf->rect_float; + } + /* done coercing into the correct color management */ + + if(!alloc) { + rect= MEM_dupallocN(rect); + alloc= 1; + } + + type= ibuf->channels; + + if(rd->scemode & R_COMP_CROP) { + stackbuf= get_cropped_compbuf(&rd->disprect, rect, ibuf->x, ibuf->y, type); + if(alloc) + MEM_freeN(rect); + } + else { + /* we put imbuf copy on stack, cbuf knows rect is from other ibuf when freed! */ + stackbuf= alloc_compbuf(ibuf->x, ibuf->y, type, FALSE); + stackbuf->rect= rect; + stackbuf->malloc= alloc; + } + + IMB_freeImBuf(ibuf); + + return stackbuf; +} + +static void node_composit_exec_movieclip(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out) +{ + if(node->id) { + RenderData *rd= data; + MovieClip *clip= (MovieClip *)node->id; + MovieClipUser *user= (MovieClipUser *)node->storage; + CompBuf *stackbuf= NULL; + + BKE_movieclip_user_set_frame(user, rd->cfra); + + stackbuf= node_composit_get_movieclip(rd, clip, user); + + if (stackbuf) { + MovieTrackingStabilization *stab= &clip->tracking.stabilization; + + /* put image on stack */ + out[0]->data= stackbuf; + + if(stab->flag&TRACKING_2D_STABILIZATION) { + float loc[2], scale, angle; + + BKE_tracking_stabilization_data(&clip->tracking, rd->cfra, stackbuf->x, stackbuf->y, + loc, &scale, &angle); + + out[1]->vec[0]= loc[0]; + out[2]->vec[0]= loc[1]; + + out[3]->vec[0]= scale; + out[4]->vec[0]= angle; + } + + /* generate preview */ + generate_preview(data, node, stackbuf); + } + } +} + +static void init(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp)) +{ + MovieClipUser *user= MEM_callocN(sizeof(MovieClipUser), "node movie clip user"); + + node->storage= user; + user->framenr= 1; +} + +void register_node_type_cmp_movieclip(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_MOVIECLIP, "Movie Clip", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS); + node_type_socket_templates(&ntype, NULL, cmp_node_movieclip_out); + node_type_size(&ntype, 120, 80, 300); + node_type_init(&ntype, init); + node_type_storage(&ntype, "MovieClipUser", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_movieclip); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c b/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c new file mode 100644 index 00000000000..439616377a1 --- /dev/null +++ b/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c @@ -0,0 +1,135 @@ +/* + * ***** 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/nodes/composite/nodes/node_composite_moviedistortion.c + * \ingroup cmpnodes + */ + + +#include "node_composite_util.h" + +/* **************** Translate ******************** */ + +static bNodeSocketTemplate cmp_node_moviedistortion_in[]= { + { SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +static bNodeSocketTemplate cmp_node_moviedistortion_out[]= { + { SOCK_RGBA, 0, "Image"}, + { -1, 0, "" } +}; + +static void exec(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) +{ + if(in[0]->data) { + if(node->id) { + MovieClip *clip= (MovieClip *)node->id; + CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA); + CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 0); + ImBuf *ibuf; + + ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0); + + if(ibuf) { + ImBuf *obuf; + MovieTracking *tracking= &clip->tracking; + int width, height; + float overscan= 0.0f; + + ibuf->rect_float= cbuf->rect; + + BKE_movieclip_get_size(clip, NULL, &width, &height); + + if(!node->storage) + node->storage= BKE_tracking_distortion_create(); + + if(node->custom1==0) + obuf= BKE_tracking_distortion_exec(node->storage, tracking, ibuf, width, height, overscan, 1); + else + obuf= BKE_tracking_distortion_exec(node->storage, tracking, ibuf, width, height, overscan, 0); + + stackbuf->rect= obuf->rect_float; + stackbuf->malloc= 1; + + obuf->mall&= ~IB_rectfloat; + obuf->rect_float= NULL; + + IMB_freeImBuf(ibuf); + IMB_freeImBuf(obuf); + } + + /* pass on output and free */ + out[0]->data= stackbuf; + + if(cbuf!=in[0]->data) + free_compbuf(cbuf); + } else { + CompBuf *cbuf= in[0]->data; + CompBuf *stackbuf= pass_on_compbuf(cbuf); + + out[0]->data= stackbuf; + } + } +} + +static const char *label(bNode *node) +{ + if(node->custom1==0) + return "Undistortion"; + else + return "Distortion"; +} + +static void storage_free(bNode *node) +{ + if(node->storage) + BKE_tracking_distortion_destroy(node->storage); + + node->storage= NULL; +} + +void storage_copy(bNode *orig_node, bNode *new_node) +{ + if(orig_node->storage) + new_node->storage= BKE_tracking_distortion_copy(orig_node->storage); +} + +void register_node_type_cmp_moviedistortion(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_MOVIEDISTORTION, "Movie Distortion", NODE_CLASS_DISTORT, NODE_OPTIONS); + node_type_socket_templates(&ntype, cmp_node_moviedistortion_in, cmp_node_moviedistortion_out); + node_type_size(&ntype, 140, 100, 320); + node_type_label(&ntype, label); + node_type_exec(&ntype, exec); + node_type_storage(&ntype, NULL, storage_free, storage_copy); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/composite/nodes/node_composite_normal.c b/source/blender/nodes/composite/nodes/node_composite_normal.c index a19b339e674..4c43871d867 100644 --- a/source/blender/nodes/composite/nodes/node_composite_normal.c +++ b/source/blender/nodes/composite/nodes/node_composite_normal.c @@ -64,9 +64,9 @@ static void node_composit_exec_normal(void *UNUSED(data), bNode *node, bNodeStac /* input no image? then only vector op */ if(in[0]->data==NULL) { - VECCOPY(out[0]->vec, nor); + copy_v3_v3(out[0]->vec, nor); /* render normals point inside... the widget points outside */ - out[1]->vec[0]= -INPR(out[0]->vec, in[0]->vec); + out[1]->vec[0]= -dot_v3v3(out[0]->vec, in[0]->vec); } else if(out[1]->hasoutput) { /* make output size of input image */ diff --git a/source/blender/nodes/composite/nodes/node_composite_normalize.c b/source/blender/nodes/composite/nodes/node_composite_normalize.c index 36206d82d0b..d14f589f3f2 100644 --- a/source/blender/nodes/composite/nodes/node_composite_normalize.c +++ b/source/blender/nodes/composite/nodes/node_composite_normalize.c @@ -69,7 +69,7 @@ static void node_composit_exec_normalize(void *UNUSED(data), bNode *node, bNodeS /* Input has no image buffer? Then pass the value */ if(in[0]->data==NULL) { - QUATCOPY(out[0]->vec, in[0]->vec); + copy_v4_v4(out[0]->vec, in[0]->vec); } else { float min = 1.0f+BLENDER_ZMAX; @@ -109,7 +109,6 @@ void register_node_type_cmp_normalize(ListBase *lb) node_type_socket_templates(&ntype, cmp_node_normalize_in, cmp_node_normalize_out); node_type_size(&ntype, 100, 60, 150); node_type_exec(&ntype, node_composit_exec_normalize); - node_type_storage(&ntype, "TexMapping", NULL, NULL); nodeRegisterType(lb, &ntype); } diff --git a/source/blender/nodes/composite/nodes/node_composite_rgb.c b/source/blender/nodes/composite/nodes/node_composite_rgb.c index a7c820ddce6..12f073a816d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_rgb.c +++ b/source/blender/nodes/composite/nodes/node_composite_rgb.c @@ -55,7 +55,7 @@ static void node_composit_exec_rgb(void *UNUSED(data), bNode *node, bNodeStack * bNodeSocket *sock= node->outputs.first; float *col= ((bNodeSocketValueRGBA*)sock->default_value)->value; - QUATCOPY(out[0]->vec, col); + copy_v4_v4(out[0]->vec, col); } void register_node_type_cmp_rgb(ListBase *lb) diff --git a/source/blender/nodes/composite/nodes/node_composite_scale.c b/source/blender/nodes/composite/nodes/node_composite_scale.c index 5eb789ae0c9..37332c9bd7e 100644 --- a/source/blender/nodes/composite/nodes/node_composite_scale.c +++ b/source/blender/nodes/composite/nodes/node_composite_scale.c @@ -34,8 +34,6 @@ /* **************** Scale ******************** */ -#define CMP_SCALE_MAX 12000 - static bNodeSocketTemplate cmp_node_scale_in[]= { { SOCK_RGBA, 1, "Image", 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_FLOAT, 1, "X", 1.0f, 0.0f, 0.0f, 0.0f, 0.0001f, CMP_SCALE_MAX, PROP_FACTOR}, @@ -110,6 +108,25 @@ static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, b if(cbuf!=in[0]->data) free_compbuf(cbuf); } + else if (node->custom1==CMP_SCALE_ABSOLUTE) { + CompBuf *stackbuf; + int a, x, y; + float *fp; + + x = MAX2((int)in[1]->vec[0], 1); + y = MAX2((int)in[2]->vec[0], 1); + + stackbuf = alloc_compbuf(x, y, CB_RGBA, 1); + fp = stackbuf->rect; + + a = stackbuf->x * stackbuf->y; + while(a--) { + copy_v4_v4(fp, in[0]->vec); + fp += 4; + } + + out[0]->data= stackbuf; + } } void register_node_type_cmp_scale(ListBase *lb) diff --git a/source/blender/nodes/composite/nodes/node_composite_splitViewer.c b/source/blender/nodes/composite/nodes/node_composite_splitViewer.c index 22f3dd3a7b0..b63b42224e2 100644 --- a/source/blender/nodes/composite/nodes/node_composite_splitViewer.c +++ b/source/blender/nodes/composite/nodes/node_composite_splitViewer.c @@ -42,10 +42,10 @@ static bNodeSocketTemplate cmp_node_splitviewer_in[]= { static void do_copy_split_rgba(bNode *UNUSED(node), float *out, float *in1, float *in2, float *fac) { if(*fac==0.0f) { - QUATCOPY(out, in1); + copy_v4_v4(out, in1); } else { - QUATCOPY(out, in2); + copy_v4_v4(out, in2); } } diff --git a/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c b/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c new file mode 100644 index 00000000000..c5d60e65530 --- /dev/null +++ b/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c @@ -0,0 +1,79 @@ +/* + * ***** 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/nodes/composite/nodes/node_composite_stabilize2d.c + * \ingroup cmpnodes + */ + + +#include "node_composite_util.h" + +/* **************** Translate ******************** */ + +static bNodeSocketTemplate cmp_node_stabilize2d_in[]= { + { SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +static bNodeSocketTemplate cmp_node_stabilize2d_out[]= { + { SOCK_RGBA, 0, "Image"}, + { -1, 0, "" } +}; + +static void node_composit_exec_stabilize2d(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + if(in[0]->data && node->id) { + RenderData *rd= data; + MovieClip *clip= (MovieClip *)node->id; + CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA); + CompBuf *stackbuf; + float loc[2], scale, angle; + + BKE_tracking_stabilization_data(&clip->tracking, rd->cfra, cbuf->x, cbuf->y, loc, &scale, &angle); + + stackbuf= node_composit_transform(cbuf, loc[0], loc[1], angle, scale, node->custom1); + + /* pass on output and free */ + out[0]->data= stackbuf; + + if(cbuf!=in[0]->data) + free_compbuf(cbuf); + } +} + +void register_node_type_cmp_stabilize2d(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_STABILIZE2D, "Stabilize 2D", NODE_CLASS_DISTORT, NODE_OPTIONS); + node_type_socket_templates(&ntype, cmp_node_stabilize2d_in, cmp_node_stabilize2d_out); + node_type_size(&ntype, 140, 100, 320); + node_type_exec(&ntype, node_composit_exec_stabilize2d); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/composite/nodes/node_composite_texture.c b/source/blender/nodes/composite/nodes/node_composite_texture.c index 24d7b30f11d..2f54f27e481 100644 --- a/source/blender/nodes/composite/nodes/node_composite_texture.c +++ b/source/blender/nodes/composite/nodes/node_composite_texture.c @@ -80,7 +80,7 @@ static void texture_procedural(CompBuf *cbuf, float *out, float xco, float yco) else col[0]= col[1]= col[2]= col[3]; } else { - VECCOPY(col, nor); + copy_v3_v3(col, nor); } typecheck_compbuf_color(out, col, cbuf->type, cbuf->procedural_type); @@ -101,8 +101,8 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in, prevbuf->rect_procedural= texture_procedural; prevbuf->node= node; - VECCOPY(prevbuf->procedural_offset, in[0]->vec); - VECCOPY(prevbuf->procedural_size, in[1]->vec); + copy_v3_v3(prevbuf->procedural_offset, in[0]->vec); + copy_v3_v3(prevbuf->procedural_size, in[1]->vec); prevbuf->procedural_type= CB_RGBA; composit1_pixel_processor(node, prevbuf, prevbuf, out[0]->vec, do_copy_rgba, CB_RGBA); @@ -118,8 +118,8 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in, stackbuf->rect_procedural= texture_procedural; stackbuf->node= node; - VECCOPY(stackbuf->procedural_offset, in[0]->vec); - VECCOPY(stackbuf->procedural_size, in[1]->vec); + copy_v3_v3(stackbuf->procedural_offset, in[0]->vec); + copy_v3_v3(stackbuf->procedural_size, in[1]->vec); stackbuf->procedural_type= CB_VAL; composit1_pixel_processor(node, stackbuf, stackbuf, out[0]->vec, do_copy_value, CB_VAL); stackbuf->rect_procedural= NULL; @@ -131,8 +131,8 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in, stackbuf->rect_procedural= texture_procedural; stackbuf->node= node; - VECCOPY(stackbuf->procedural_offset, in[0]->vec); - VECCOPY(stackbuf->procedural_size, in[1]->vec); + copy_v3_v3(stackbuf->procedural_offset, in[0]->vec); + copy_v3_v3(stackbuf->procedural_size, in[1]->vec); stackbuf->procedural_type= CB_RGBA; composit1_pixel_processor(node, stackbuf, stackbuf, out[0]->vec, do_copy_rgba, CB_RGBA); stackbuf->rect_procedural= NULL; diff --git a/source/blender/nodes/composite/nodes/node_composite_transform.c b/source/blender/nodes/composite/nodes/node_composite_transform.c new file mode 100644 index 00000000000..de9b8fceaee --- /dev/null +++ b/source/blender/nodes/composite/nodes/node_composite_transform.c @@ -0,0 +1,142 @@ +/* + * ***** 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/nodes/composite/nodes/node_composite_transform.c + * \ingroup cmpnodes + */ + +#include "node_composite_util.h" + +/* **************** Transform ******************** */ + +static bNodeSocketTemplate cmp_node_transform_in[]= { + { SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, + { SOCK_FLOAT, 1, "X", 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f}, + { SOCK_FLOAT, 1, "Y", 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f}, + { SOCK_FLOAT, 1, "Angle", 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_ANGLE}, + { SOCK_FLOAT, 1, "Scale", 1.0f, 0.0f, 0.0f, 0.0f, 0.0001f, CMP_SCALE_MAX}, + { -1, 0, "" } +}; + +static bNodeSocketTemplate cmp_node_transform_out[]= { + { SOCK_RGBA, 0, "Image"}, + { -1, 0, "" } +}; + +CompBuf* node_composit_transform(CompBuf *cbuf, float x, float y, float angle, float scale, int filter_type) +{ + CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); + ImBuf *ibuf, *obuf; + float mat[4][4], lmat[4][4], rmat[4][4], smat[4][4], cmat[4][4], icmat[4][4]; + float svec[3]= {scale, scale, scale}, loc[2]= {x, y}; + + unit_m4(rmat); + unit_m4(lmat); + unit_m4(smat); + unit_m4(cmat); + + /* image center as rotation center */ + cmat[3][0]= (float)cbuf->x/2.0f; + cmat[3][1]= (float)cbuf->y/2.0f; + invert_m4_m4(icmat, cmat); + + size_to_mat4(smat, svec); /* scale matrix */ + add_v2_v2(lmat[3], loc); /* tranlation matrix */ + rotate_m4(rmat, 'Z', angle); /* rotation matrix */ + + /* compose transformation matrix */ + mul_serie_m4(mat, lmat, cmat, rmat, smat, icmat, NULL, NULL, NULL); + + invert_m4(mat); + + ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0); + obuf= IMB_allocImBuf(stackbuf->x, stackbuf->y, 32, 0); + + if(ibuf && obuf) { + int i, j; + + ibuf->rect_float= cbuf->rect; + obuf->rect_float= stackbuf->rect; + + for(j=0; j<cbuf->y; j++) { + for(i=0; i<cbuf->x;i++) { + float vec[3]= {i, j, 0}; + + mul_v3_m4v3(vec, mat, vec); + + switch(filter_type) { + case 0: + neareast_interpolation(ibuf, obuf, vec[0], vec[1], i, j); + break ; + case 1: + bilinear_interpolation(ibuf, obuf, vec[0], vec[1], i, j); + break; + case 2: + bicubic_interpolation(ibuf, obuf, vec[0], vec[1], i, j); + break; + } + } + } + + IMB_freeImBuf(ibuf); + IMB_freeImBuf(obuf); + } + + /* pass on output and free */ + return stackbuf; +} + +static void node_composit_exec_transform(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) +{ + if(in[0]->data) { + CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA); + CompBuf *stackbuf; + + stackbuf= node_composit_transform(cbuf, in[1]->vec[0], in[2]->vec[0], in[3]->vec[0], in[4]->vec[0], node->custom1); + + /* pass on output and free */ + out[0]->data= stackbuf; + + if(cbuf!=in[0]->data) + free_compbuf(cbuf); + } +} + +void register_node_type_cmp_transform(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_TRANSFORM, "Transform", NODE_CLASS_DISTORT, NODE_OPTIONS); + node_type_socket_templates(&ntype, cmp_node_transform_in, cmp_node_transform_out); + node_type_size(&ntype, 140, 100, 320); + node_type_exec(&ntype, node_composit_exec_transform); + + nodeRegisterType(lb, &ntype); +} + + diff --git a/source/blender/nodes/composite/nodes/node_composite_zcombine.c b/source/blender/nodes/composite/nodes/node_composite_zcombine.c index 7aac3539960..868c0d2b5f3 100644 --- a/source/blender/nodes/composite/nodes/node_composite_zcombine.c +++ b/source/blender/nodes/composite/nodes/node_composite_zcombine.c @@ -65,7 +65,7 @@ static void do_zcombine(bNode *node, float *out, float *src1, float *z1, float * } else { // do combination based solely on z value - QUATCOPY(out, src1); + copy_v4_v4(out, src1); } } else { @@ -80,7 +80,7 @@ static void do_zcombine(bNode *node, float *out, float *src1, float *z1, float * } else { // do combination based solely on z value - QUATCOPY(out, src1); + copy_v4_v4(out, src1); } if(node->custom2) diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c index b0ef6ccccbf..dd72f7662d0 100644 --- a/source/blender/nodes/shader/node_shader_util.c +++ b/source/blender/nodes/shader/node_shader_util.c @@ -55,12 +55,12 @@ void nodestack_get_vec(float *in, short type_in, bNodeStack *ns) in[2]= from[0]; } else { - VECCOPY(in, from); + copy_v3_v3(in, from); } } else { /* type_in==SOCK_RGBA */ if(ns->sockettype==SOCK_RGBA) { - QUATCOPY(in, from); + copy_v4_v4(in, from); } else if(ns->sockettype==SOCK_FLOAT) { in[0]= from[0]; @@ -69,7 +69,7 @@ void nodestack_get_vec(float *in, short type_in, bNodeStack *ns) in[3]= 1.0f; } else { - VECCOPY(in, from); + copy_v3_v3(in, from); in[3]= 1.0f; } } @@ -142,13 +142,13 @@ void nodeShaderSynchronizeID(bNode *node, int copyto) if(copyto) { switch(a) { case MAT_IN_COLOR: - VECCOPY(&ma->r, ((bNodeSocketValueRGBA*)sock->default_value)->value); break; + copy_v3_v3(&ma->r, ((bNodeSocketValueRGBA*)sock->default_value)->value); break; case MAT_IN_SPEC: - VECCOPY(&ma->specr, ((bNodeSocketValueRGBA*)sock->default_value)->value); break; + copy_v3_v3(&ma->specr, ((bNodeSocketValueRGBA*)sock->default_value)->value); break; case MAT_IN_REFL: ma->ref= ((bNodeSocketValueFloat*)sock->default_value)->value; break; case MAT_IN_MIR: - VECCOPY(&ma->mirr, ((bNodeSocketValueRGBA*)sock->default_value)->value); break; + copy_v3_v3(&ma->mirr, ((bNodeSocketValueRGBA*)sock->default_value)->value); break; case MAT_IN_AMB: ma->amb= ((bNodeSocketValueFloat*)sock->default_value)->value; break; case MAT_IN_EMIT: @@ -166,13 +166,13 @@ void nodeShaderSynchronizeID(bNode *node, int copyto) else { switch(a) { case MAT_IN_COLOR: - VECCOPY(((bNodeSocketValueRGBA*)sock->default_value)->value, &ma->r); break; + copy_v3_v3(((bNodeSocketValueRGBA*)sock->default_value)->value, &ma->r); break; case MAT_IN_SPEC: - VECCOPY(((bNodeSocketValueRGBA*)sock->default_value)->value, &ma->specr); break; + copy_v3_v3(((bNodeSocketValueRGBA*)sock->default_value)->value, &ma->specr); break; case MAT_IN_REFL: ((bNodeSocketValueFloat*)sock->default_value)->value= ma->ref; break; case MAT_IN_MIR: - VECCOPY(((bNodeSocketValueRGBA*)sock->default_value)->value, &ma->mirr); break; + copy_v3_v3(((bNodeSocketValueRGBA*)sock->default_value)->value, &ma->mirr); break; case MAT_IN_AMB: ((bNodeSocketValueFloat*)sock->default_value)->value= ma->amb; break; case MAT_IN_EMIT: @@ -198,7 +198,7 @@ void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, bNodeStack *ns) { memset(gs, 0, sizeof(*gs)); - QUATCOPY(gs->vec, ns->vec); + copy_v4_v4(gs->vec, ns->vec); gs->link= ns->data; if (type == SOCK_FLOAT) diff --git a/source/blender/nodes/shader/nodes/node_shader_camera.c b/source/blender/nodes/shader/nodes/node_shader_camera.c index c7882a6e0e2..02efbd63aba 100644 --- a/source/blender/nodes/shader/nodes/node_shader_camera.c +++ b/source/blender/nodes/shader/nodes/node_shader_camera.c @@ -46,7 +46,7 @@ static void node_shader_exec_camera(void *data, bNode *UNUSED(node), bNodeStack if(data) { ShadeInput *shi= ((ShaderCallData *)data)->shi; /* Data we need for shading. */ - VECCOPY(out[0]->vec, shi->co); /* get view vector */ + copy_v3_v3(out[0]->vec, shi->co); /* get view vector */ out[1]->vec[0]= fabs(shi->co[2]); /* get view z-depth */ out[2]->vec[0]= normalize_v3(out[0]->vec); /* get view distance */ } diff --git a/source/blender/nodes/shader/nodes/node_shader_geom.c b/source/blender/nodes/shader/nodes/node_shader_geom.c index ab4931f12ac..6547194b33a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_geom.c +++ b/source/blender/nodes/shader/nodes/node_shader_geom.c @@ -91,7 +91,7 @@ static void node_shader_exec_geom(void *data, bNode *node, bNodeStack **UNUSED(i } } - VECCOPY(out[GEOM_OUT_VCOL]->vec, scol->col); + copy_v3_v3(out[GEOM_OUT_VCOL]->vec, scol->col); out[GEOM_OUT_VCOL]->vec[3]= scol->col[3]; out[GEOM_OUT_VCOL_ALPHA]->vec[0]= scol->col[3]; } diff --git a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c index 7fb31d80ffc..1207196381d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c +++ b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c @@ -65,7 +65,7 @@ static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float *hue, float *s out[2]= mfac*in[2] + *fac*col[2]; } else { - QUATCOPY(out, in); + copy_v4_v4(out, in); } } diff --git a/source/blender/nodes/shader/nodes/node_shader_invert.c b/source/blender/nodes/shader/nodes/node_shader_invert.c index 066ff14a870..e3dacefbcf2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_invert.c +++ b/source/blender/nodes/shader/nodes/node_shader_invert.c @@ -64,7 +64,7 @@ bNodeStack **out) col[2] = in[0]->vec[0]*col[2] + (facm*in[1]->vec[2]); } - VECCOPY(out[0]->vec, col); + copy_v3_v3(out[0]->vec, col); } static int gpu_shader_invert(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) diff --git a/source/blender/nodes/shader/nodes/node_shader_material.c b/source/blender/nodes/shader/nodes/node_shader_material.c index f93928d8884..a74a2567844 100644 --- a/source/blender/nodes/shader/nodes/node_shader_material.c +++ b/source/blender/nodes/shader/nodes/node_shader_material.c @@ -148,13 +148,13 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in, /* write to outputs */ if(node->custom1 & SH_NODE_MAT_DIFF) { - VECCOPY(col, shrnode.combined); + copy_v3_v3(col, shrnode.combined); if(!(node->custom1 & SH_NODE_MAT_SPEC)) { sub_v3_v3(col, shrnode.spec); } } else if(node->custom1 & SH_NODE_MAT_SPEC) { - VECCOPY(col, shrnode.spec); + copy_v3_v3(col, shrnode.spec); } else col[0]= col[1]= col[2]= 0.0f; @@ -164,7 +164,7 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in, if(shi->do_preview) nodeAddToPreview(node, col, shi->xs, shi->ys, shi->do_manage); - VECCOPY(out[MAT_OUT_COLOR]->vec, col); + copy_v3_v3(out[MAT_OUT_COLOR]->vec, col); out[MAT_OUT_ALPHA]->vec[0]= shrnode.alpha; if(node->custom1 & SH_NODE_MAT_NEG) { @@ -173,15 +173,15 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in, shi->vn[2]= -shi->vn[2]; } - VECCOPY(out[MAT_OUT_NORMAL]->vec, shi->vn); + copy_v3_v3(out[MAT_OUT_NORMAL]->vec, shi->vn); /* Extended material options */ if (node->type == SH_NODE_MATERIAL_EXT) { /* Shadow, Reflect, Refract, Radiosity, Speed seem to cause problems inside * a node tree :( */ - VECCOPY(out[MAT_OUT_DIFFUSE]->vec, shrnode.diff); - VECCOPY(out[MAT_OUT_SPEC]->vec, shrnode.spec); - VECCOPY(out[MAT_OUT_AO]->vec, shrnode.ao); + copy_v3_v3(out[MAT_OUT_DIFFUSE]->vec, shrnode.diff); + copy_v3_v3(out[MAT_OUT_SPEC]->vec, shrnode.spec); + copy_v3_v3(out[MAT_OUT_AO]->vec, shrnode.ao); } /* copy passes, now just active node */ diff --git a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c index 7aed6bce4c4..7692956368c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c @@ -59,7 +59,7 @@ static void node_shader_exec_mix_rgb(void *UNUSED(data), bNode *node, bNodeStack nodestack_get_vec(vec, SOCK_VECTOR, in[2]); ramp_blend(node->custom1, col, col+1, col+2, fac, vec); - VECCOPY(out[0]->vec, col); + copy_v3_v3(out[0]->vec, col); } static int gpu_shader_mix_rgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) diff --git a/source/blender/nodes/shader/nodes/node_shader_normal.c b/source/blender/nodes/shader/nodes/node_shader_normal.c index c23c6d328cf..40f2f65a193 100644 --- a/source/blender/nodes/shader/nodes/node_shader_normal.c +++ b/source/blender/nodes/shader/nodes/node_shader_normal.c @@ -66,7 +66,7 @@ static void node_shader_exec_normal(void *UNUSED(data), bNode *node, bNodeStack nodestack_get_vec(vec, SOCK_VECTOR, in[0]); - VECCOPY(out[0]->vec, ((bNodeSocketValueVector*)sock->default_value)->value); + copy_v3_v3(out[0]->vec, ((bNodeSocketValueVector*)sock->default_value)->value); /* render normals point inside... the widget points outside */ out[1]->vec[0]= -INPR(out[0]->vec, vec); } diff --git a/source/blender/nodes/shader/nodes/node_shader_output.c b/source/blender/nodes/shader/nodes/node_shader_output.c index ea7fae8f961..22e3cab532d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output.c +++ b/source/blender/nodes/shader/nodes/node_shader_output.c @@ -57,10 +57,10 @@ static void node_shader_exec_output(void *data, bNode *node, bNodeStack **in, bN if(node->flag & NODE_DO_OUTPUT) { ShadeResult *shr= ((ShaderCallData *)data)->shr; - QUATCOPY(shr->combined, col); + copy_v4_v4(shr->combined, col); shr->alpha= col[3]; - // VECCOPY(shr->nor, in[3]->vec); + // copy_v3_v3(shr->nor, in[3]->vec); } } } diff --git a/source/blender/nodes/shader/nodes/node_shader_rgb.c b/source/blender/nodes/shader/nodes/node_shader_rgb.c index 1a0b4ea616b..67c0ec165ca 100644 --- a/source/blender/nodes/shader/nodes/node_shader_rgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_rgb.c @@ -54,7 +54,7 @@ static void node_shader_exec_rgb(void *UNUSED(data), bNode *node, bNodeStack **U bNodeSocket *sock= node->outputs.first; float *col= ((bNodeSocketValueRGBA*)sock->default_value)->value; - VECCOPY(out[0]->vec, col); + copy_v3_v3(out[0]->vec, col); } static int gpu_shader_rgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) diff --git a/source/blender/nodes/shader/nodes/node_shader_texture.c b/source/blender/nodes/shader/nodes/node_shader_texture.c index 588cdc1da83..42460e141e2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_texture.c +++ b/source/blender/nodes/shader/nodes/node_shader_texture.c @@ -82,7 +82,7 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b retval= multitex_nodes((Tex *)node->id, vec, NULL, NULL, 0, &texres, thread, which_output, NULL, NULL); } else { - VECCOPY(vec, shi->lo); + copy_v3_v3(vec, shi->lo); retval= multitex_nodes((Tex *)node->id, vec, NULL, NULL, 0, &texres, thread, which_output, NULL, NULL); } @@ -111,7 +111,7 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b out[1]->vec[3]= 1.0f; } - VECCOPY(out[2]->vec, nor); + copy_v3_v3(out[2]->vec, nor); if(shi->do_preview) nodeAddToPreview(node, out[1]->vec, shi->xs, shi->ys, shi->do_manage); diff --git a/source/blender/nodes/texture/nodes/node_texture_bricks.c b/source/blender/nodes/texture/nodes/node_texture_bricks.c index 2011426b845..0700085a787 100644 --- a/source/blender/nodes/texture/nodes/node_texture_bricks.c +++ b/source/blender/nodes/texture/nodes/node_texture_bricks.c @@ -107,9 +107,9 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor if( ins_x < mortar_thickness || ins_y < mortar_thickness || ins_x > (brick_width - mortar_thickness) || ins_y > (row_height - mortar_thickness) ) { - QUATCOPY( out, mortar ); + copy_v4_v4( out, mortar ); } else { - QUATCOPY( out, bricks1 ); + copy_v4_v4( out, bricks1 ); ramp_blend( MA_RAMP_BLEND, out, out+1, out+2, tint, bricks2 ); } } diff --git a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c index 111d6e78023..3346592f7d3 100644 --- a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c +++ b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c @@ -66,7 +66,7 @@ static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float hue, float sat out[2]= mfac*in[2] + fac*col[2]; } else { - QUATCOPY(out, in); + copy_v4_v4(out, in); } } diff --git a/source/blender/nodes/texture/nodes/node_texture_image.c b/source/blender/nodes/texture/nodes/node_texture_image.c index 3a81ecb1466..0ead3a3dec2 100644 --- a/source/blender/nodes/texture/nodes/node_texture_image.c +++ b/source/blender/nodes/texture/nodes/node_texture_image.c @@ -76,7 +76,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNUSED(i while( py >= ibuf->y ) py -= ibuf->y; result = ibuf->rect_float + py*ibuf->x*4 + px*4; - QUATCOPY( out, result ); + copy_v4_v4( out, result ); } } } diff --git a/source/blender/nodes/texture/nodes/node_texture_invert.c b/source/blender/nodes/texture/nodes/node_texture_invert.c index 3ad11026f28..5ee60d02e32 100644 --- a/source/blender/nodes/texture/nodes/node_texture_invert.c +++ b/source/blender/nodes/texture/nodes/node_texture_invert.c @@ -54,7 +54,7 @@ static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack ** col[1] = 1.0f - col[1]; col[2] = 1.0f - col[2]; - VECCOPY(out, col); + copy_v3_v3(out, col); out[3] = col[3]; } diff --git a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c index c68adf2f4aa..e3b5119c797 100644 --- a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c +++ b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c @@ -55,7 +55,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor CLAMP(fac, 0.0f, 1.0f); - QUATCOPY(out, col1); + copy_v4_v4(out, col1); ramp_blend(node->custom1, out, out+1, out+2, fac, col2); } diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c index d9ac8700be1..3012d313db5 100644 --- a/source/blender/nodes/texture/nodes/node_texture_proc.c +++ b/source/blender/nodes/texture/nodes/node_texture_proc.c @@ -75,10 +75,10 @@ static void do_proc(float *result, TexParams *p, float *col1, float *col2, char return; if(textype & TEX_RGB) { - QUATCOPY(result, &texres.tr); + copy_v4_v4(result, &texres.tr); } else { - QUATCOPY(result, col1); + copy_v4_v4(result, col1); ramp_blend(MA_RAMP_BLEND, result, result+1, result+2, texres.tin, col2); } } diff --git a/source/blender/nodes/texture/nodes/node_texture_texture.c b/source/blender/nodes/texture/nodes/node_texture_texture.c index 1b8eb3aabc6..667570582fe 100644 --- a/source/blender/nodes/texture/nodes/node_texture_texture.c +++ b/source/blender/nodes/texture/nodes/node_texture_texture.c @@ -65,7 +65,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor if(node->custom2 || node->need_exec==0) { /* this node refers to its own texture tree! */ - QUATCOPY(out, (fabs(co[0] - co[1]) < .01) ? white : red ); + copy_v4_v4(out, (fabs(co[0] - co[1]) < .01) ? white : red ); } else if(nodetex) { TexResult texres; @@ -81,10 +81,10 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor &texres, thread, 0, p->shi, p->mtex); if(textype & TEX_RGB) { - QUATCOPY(out, &texres.tr); + copy_v4_v4(out, &texres.tr); } else { - QUATCOPY(out, col1); + copy_v4_v4(out, col1); ramp_blend(MA_RAMP_BLEND, out, out+1, out+2, texres.tin, col2); } } diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c index 441c4b6438a..03d66e918d5 100644 --- a/source/blender/python/generic/bgl.c +++ b/source/blender/python/generic/bgl.c @@ -1,5 +1,4 @@ -/* - * +/* * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -21,20 +20,21 @@ * * This is a new part of Blender. * - * Contributor(s): Willian P. Germano + * Contributor(s): Willian P. Germano, Campbell Barton * * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/python/generic/bgl.c * \ingroup pygen + * + * This file is the 'bgl' module which wraps OpenGL functions and constants, + * allowing script writers to make OpenGL calls in their Python scripts. + * + * \note + * This module is very similar to 'PyOpenGL' which could replace 'bgl' one day. */ - -/* This file is the 'bgl' module. - * The BGL submodule "wraps" OpenGL functions and constants, - * allowing script writers to make OpenGL calls in their Python scripts. */ - #include <Python.h> #include "bgl.h" /*This must come first */ diff --git a/source/blender/python/generic/bgl.h b/source/blender/python/generic/bgl.h index 6df534a3940..2e02900d69f 100644 --- a/source/blender/python/generic/bgl.h +++ b/source/blender/python/generic/bgl.h @@ -1,5 +1,4 @@ -/* - * +/* * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/python/generic/blf_py_api.c b/source/blender/python/generic/blf_py_api.c index a9cd16c70f0..a4373e46e23 100644 --- a/source/blender/python/generic/blf_py_api.c +++ b/source/blender/python/generic/blf_py_api.c @@ -22,9 +22,10 @@ /** \file blender/python/generic/blf_py_api.c * \ingroup pygen + * + * This file defines the 'bgl' module, used for drawing text in OpenGL. */ - #include <Python.h> #include "blf_py_api.h" diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index acfe6ee80bf..88e2da16eb5 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -17,14 +17,19 @@ * * This is a new part of Blender. * - * Contributor(s): Willian P. Germano, - * Campbell Barton + * Contributor(s): Willian P. Germano, Campbell Barton * * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/python/generic/bpy_internal_import.c * \ingroup pygen + * + * This file defines replacements for pythons '__import__' and 'imp.reload' + * functions which can import from blender textblocks. + * + * \note + * This should eventually be replaced by import hooks (pep 302). */ diff --git a/source/blender/python/generic/noise_py_api.c b/source/blender/python/generic/noise_py_api.c index 6afb1a00e2f..c12cc1ccdd2 100644 --- a/source/blender/python/generic/noise_py_api.c +++ b/source/blender/python/generic/noise_py_api.c @@ -1,8 +1,4 @@ /* - * - * Blender.Noise BPython module implementation. - * This submodule has functions to generate noise of various types. - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -24,13 +20,16 @@ * * This is a new part of Blender. * - * Contributor(s): eeshlo + * Contributor(s): eeshlo, Campbell Barton * * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/python/generic/noise_py_api.c * \ingroup pygen + * + * This file defines the 'noise' module, a general purpose module to access + * blenders noise functions. */ diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c index eb4ecf79941..7fbd8baa558 100644 --- a/source/blender/python/generic/py_capi_utils.c +++ b/source/blender/python/generic/py_capi_utils.c @@ -20,6 +20,13 @@ /** \file blender/python/generic/py_capi_utils.c * \ingroup pygen + * + * Extend upon CPython's API, filling in some gaps, these functions use PyC_ + * prefix to distinguish them apart from CPython. + * + * \note + * This module should only depend on CPython, however it currently uses + * BLI_string_utf8() for unicode conversion. */ diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index dfb7a1e8f75..2df907f3a12 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -22,11 +22,11 @@ /** \file blender/python/intern/bpy.c * \ingroup pythonintern + * + * This file defines the '_bpy' module which is used by python's 'bpy' package + * to access C defined builtin functions. + * A script writer should never directly access this module. */ - - -/* This file defines the '_bpy' module which is used by python's 'bpy' package. - * a script writer should never directly access this module */ #define WITH_PYTHON /* for AUD_PyInit.h, possibly others */ diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index cc3b88722b6..b5ae225fda7 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -22,6 +22,10 @@ /** \file blender/python/intern/bpy_app.c * \ingroup pythonintern + * + * This file defines a 'PyStructSequence' accessed via 'bpy.app', mostly + * exposing static applications variables such as version and buildinfo + * however some writable variables have been added such as 'debug' and 'tempdir' */ diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index f130a4bcc5c..edab92b295b 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -22,6 +22,10 @@ /** \file blender/python/intern/bpy_app_handlers.c * \ingroup pythonintern + * + * This file defines a 'PyStructSequence' accessed via 'bpy.app.handlers', + * which exposes various lists that the script author can add callback + * functions into (called via blenders generic BLI_cb api) */ #include <Python.h> diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index 0fe1d2d26ba..12fb5ed43b4 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -22,6 +22,10 @@ /** \file blender/python/intern/bpy_driver.c * \ingroup pythonintern + * + * This file defines the 'BPY_driver_exec' to execute python driver expressions, + * called by the animation system, there are also some utility functions + * to deal with the namespace used for driver execution. */ /* ****************************************** */ diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index ea2266c99b4..ffa9e5cc27c 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -23,6 +23,10 @@ /** \file blender/python/intern/bpy_interface.c * \ingroup pythonintern + * + * This file deals with embedding the python interpreter within blender, + * starting and stopping python and exposing blender/python modules so they can + * be accesses from scripts. */ diff --git a/source/blender/python/intern/bpy_interface_atexit.c b/source/blender/python/intern/bpy_interface_atexit.c index aa5b934891c..a0cf3c38503 100644 --- a/source/blender/python/intern/bpy_interface_atexit.c +++ b/source/blender/python/intern/bpy_interface_atexit.c @@ -22,6 +22,10 @@ /** \file blender/python/intern/bpy_interface_atexit.c * \ingroup pythonintern + * + * This file inserts an exit callback into pythons 'atexit' module. + * Without this sys.exit() can crash because blender is not properly closing + * resources. */ diff --git a/source/blender/python/intern/bpy_intern_string.c b/source/blender/python/intern/bpy_intern_string.c index 32d329e11b3..4f206c4c365 100644 --- a/source/blender/python/intern/bpy_intern_string.c +++ b/source/blender/python/intern/bpy_intern_string.c @@ -22,6 +22,10 @@ /** \file blender/python/intern/bpy_intern_string.c * \ingroup pythonintern + * + * Store python versions of strings frequently used for python lookups + * to avoid converting, creating the hash and freeing every time as + * PyDict_GetItemString and PyObject_GetAttrString do. */ #include <Python.h> diff --git a/source/blender/python/intern/bpy_library.c b/source/blender/python/intern/bpy_library.c index 382a513f40a..b91948cc0b8 100644 --- a/source/blender/python/intern/bpy_library.c +++ b/source/blender/python/intern/bpy_library.c @@ -22,6 +22,13 @@ /** \file blender/python/intern/bpy_library.c * \ingroup pythonintern + * + * This file exposed blend file library appending/linking to python, typically + * this would be done via RNA api but in this case a hand written python api + * allows us to use pythons context manager (__enter__ and __exit__). + * + * Everything here is exposed via bpy.data.libraries.load(...) which returns + * a context manager. */ /* nifty feature. swap out strings for RNA data */ @@ -71,8 +78,8 @@ static PyObject *bpy_lib_dir(BPy_Library *self); static PyMethodDef bpy_lib_methods[]= { {"__enter__", (PyCFunction)bpy_lib_enter, METH_NOARGS}, - {"__exit__", (PyCFunction)bpy_lib_exit, METH_VARARGS}, - {"__dir__", (PyCFunction)bpy_lib_dir, METH_NOARGS}, + {"__exit__", (PyCFunction)bpy_lib_exit, METH_VARARGS}, + {"__dir__", (PyCFunction)bpy_lib_dir, METH_NOARGS}, {NULL} /* sentinel */ }; @@ -283,7 +290,7 @@ static void bpy_lib_exit_warn_idname(BPy_Library *self, const char *name_plural, PyObject *exc, *val, *tb; PyErr_Fetch(&exc, &val, &tb); if (PyErr_WarnFormat(PyExc_UserWarning, 1, - "load: '%s' does not contain %s[\"%s\"]", + "load: '%s' does not contain %s[\"%s\"]", self->abspath, name_plural, idname)) { /* Spurious errors can appear at shutdown */ if (PyErr_ExceptionMatches(PyExc_Warning)) { @@ -298,7 +305,7 @@ static void bpy_lib_exit_warn_type(BPy_Library *self, PyObject *item) PyObject *exc, *val, *tb; PyErr_Fetch(&exc, &val, &tb); if (PyErr_WarnFormat(PyExc_UserWarning, 1, - "load: '%s' expected a string type, not a %.200s", + "load: '%s' expected a string type, not a %.200s", self->abspath, Py_TYPE(item)->tp_name)) { /* Spurious errors can appear at shutdown */ if (PyErr_ExceptionMatches(PyExc_Warning)) { diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 70a5d79e9ac..3fd4e8a128b 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -1,6 +1,4 @@ - /* - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -24,6 +22,13 @@ /** \file blender/python/intern/bpy_operator.c * \ingroup pythonintern + * + * This file defines '_bpy.ops', an internal python module which gives python + * the ability to inspect and call both C and Python defined operators. + * + * \note + * This module is exposed to the user via 'release/scripts/modules/bpy/ops.py' + * which fakes exposing operators as modules/functions using its own classes. */ diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index cb460f2fa08..aa458925202 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -22,6 +22,11 @@ /** \file blender/python/intern/bpy_operator_wrap.c * \ingroup pythonintern + * + * This file is so python can define operators that C can call into. + * The generic callback functions for python operators are defines in + * 'rna_wm.c', some calling into functions here to do python specific + * functionality. */ diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index cfd2e5556a1..4dbaf5db4a4 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -22,6 +22,10 @@ /** \file blender/python/intern/bpy_props.c * \ingroup pythonintern + * + * This file defines 'bpy.props' module used so scripts can define their own + * rna properties for use with python operators or adding new properties to + * existing blender types. */ @@ -254,7 +258,7 @@ static int bpy_prop_callback_assign(struct PropertyRNA *prop, PyObject *update_c { /* assume this is already checked for type and arg length */ if (update_cb) { - PyObject **py_data= MEM_callocN(sizeof(PyObject *) * BPY_DATA_CB_SLOT_SIZE, "bpy_prop_callback_assign"); + PyObject **py_data= MEM_callocN(sizeof(PyObject *) * BPY_DATA_CB_SLOT_SIZE, __func__); RNA_def_property_update_runtime(prop, (void *)bpy_prop_update_cb); py_data[BPY_DATA_CB_SLOT_UPDATE]= update_cb; RNA_def_py_data(prop, py_data); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 3411bceda69..44e26a56db6 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -22,9 +22,14 @@ /** \file blender/python/intern/bpy_rna.c * \ingroup pythonintern + * + * This file is the main interface between python and blenders data api (RNA), + * exposing RNA to python so blender data can be accessed in a python like way. + * + * The two main types are 'BPy_StructRNA' and 'BPy_PropertyRNA' - the base + * classes for most of the data python accesses in blender. */ - #include <Python.h> #include <stddef.h> @@ -6470,7 +6475,9 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param const int is_operator= RNA_struct_is_a(ptr->type, &RNA_Operator); const char *func_id= RNA_function_identifier(func); /* testing, for correctness, not operator and not draw function */ - const short is_readonly= strstr("draw", func_id) || /*strstr("render", func_id) ||*/ !is_operator; + const short is_readonly= ((strncmp("draw", func_id, 4) ==0) || /* draw or draw_header */ + /*strstr("render", func_id) ||*/ + !is_operator); #endif py_class= RNA_struct_py_type_get(ptr->type); diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index 4ebb407f4d6..edc6e672238 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -22,6 +22,8 @@ /** \file blender/python/intern/bpy_rna_anim.c * \ingroup pythonintern + * + * This file defines the animation related methods used in bpy_rna.c */ #include <Python.h> diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c index eda2511a187..73e9e0a44d9 100644 --- a/source/blender/python/intern/bpy_rna_array.c +++ b/source/blender/python/intern/bpy_rna_array.c @@ -15,13 +15,15 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * Contributor(s): Arystanbek Dyussenov + * Contributor(s): Arystanbek Dyussenov, Campbell Barton * * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/python/intern/bpy_rna_array.c * \ingroup pythonintern + * + * This file deals with array access for 'BPy_PropertyArrayRNA' from bpy_rna.c */ #include <Python.h> diff --git a/source/blender/python/intern/bpy_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c index af6fc88097b..85f950947a7 100644 --- a/source/blender/python/intern/bpy_rna_callback.c +++ b/source/blender/python/intern/bpy_rna_callback.c @@ -22,6 +22,9 @@ /** \file blender/python/intern/bpy_rna_callback.c * \ingroup pythonintern + * + * This file currently exposes callbacks for interface regions but may be + * extended later. */ diff --git a/source/blender/python/intern/bpy_traceback.c b/source/blender/python/intern/bpy_traceback.c index aa21627a279..5045f6708b5 100644 --- a/source/blender/python/intern/bpy_traceback.c +++ b/source/blender/python/intern/bpy_traceback.c @@ -20,6 +20,9 @@ /** \file blender/python/intern/bpy_traceback.c * \ingroup pythonintern + * + * This file contains utility functions for getting data from a python stack + * trace. */ diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index bec3a07d32a..fb42f7d59e0 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -22,9 +22,11 @@ /** \file blender/python/intern/bpy_util.c * \ingroup pythonintern + * + * This file contains blender/python utility functions for the api's internal + * use (unrelated to 'bpy.utils') */ - #include <Python.h> #include "bpy_util.h" diff --git a/source/blender/python/intern/gpu.c b/source/blender/python/intern/gpu.c index 1162491ee26..57ce7b59067 100644 --- a/source/blender/python/intern/gpu.c +++ b/source/blender/python/intern/gpu.c @@ -27,6 +27,9 @@ /** \file blender/python/intern/gpu.c * \ingroup pythonintern + * + * This file defines the 'gpu' module, used to get GLSL shader code and data + * from blender materials. */ /* python redefines */ diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c index e8721a3a91d..3518c8008c6 100644 --- a/source/blender/python/mathutils/mathutils_geometry.c +++ b/source/blender/python/mathutils/mathutils_geometry.c @@ -97,14 +97,14 @@ static PyObject *M_Geometry_intersect_ray_tri(PyObject *UNUSED(self), PyObject* if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1 || BaseMath_ReadCallback(vec3) == -1 || BaseMath_ReadCallback(ray) == -1 || BaseMath_ReadCallback(ray_off) == -1) return NULL; - VECCOPY(v1, vec1->vec); - VECCOPY(v2, vec2->vec); - VECCOPY(v3, vec3->vec); + copy_v3_v3(v1, vec1->vec); + copy_v3_v3(v2, vec2->vec); + copy_v3_v3(v3, vec3->vec); - VECCOPY(dir, ray->vec); + copy_v3_v3(dir, ray->vec); normalize_v3(dir); - VECCOPY(orig, ray_off->vec); + copy_v3_v3(orig, ray_off->vec); /* find vectors for two edges sharing v1 */ sub_v3_v3v3(e1, v2, v1); @@ -189,10 +189,10 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject int result; if (vec1->size == 3) { - VECCOPY(v1, vec1->vec); - VECCOPY(v2, vec2->vec); - VECCOPY(v3, vec3->vec); - VECCOPY(v4, vec4->vec); + copy_v3_v3(v1, vec1->vec); + copy_v3_v3(v2, vec2->vec); + copy_v3_v3(v3, vec3->vec); + copy_v3_v3(v4, vec4->vec); } else { v1[0]= vec1->vec[0]; diff --git a/source/blender/render/intern/include/rendercore.h b/source/blender/render/intern/include/rendercore.h index 5a544c46255..08f73ccbe0d 100644 --- a/source/blender/render/intern/include/rendercore.h +++ b/source/blender/render/intern/include/rendercore.h @@ -42,7 +42,6 @@ /* vector defines */ #define CROSS(dest, a, b) { dest[0]= a[1] * b[2] - a[2] * b[1]; dest[1]= a[2] * b[0] - a[0] * b[2]; dest[2]= a[0] * b[1] - a[1] * b[0]; } -#define VECMUL(dest, f) { dest[0]*= f; dest[1]*= f; dest[2]*= f; } struct HaloRen; struct ShadeInput; diff --git a/source/blender/render/intern/include/zbuf.h b/source/blender/render/intern/include/zbuf.h index 6567cdacf0e..c467c31b5a6 100644 --- a/source/blender/render/intern/include/zbuf.h +++ b/source/blender/render/intern/include/zbuf.h @@ -135,7 +135,7 @@ void zbufclipwire(struct ZSpan *zspan, int obi, int zvlnr, int ec, float *ho1, f /* exported to shadeinput.c */ void zbuf_make_winmat(Render *re, float winmat[][4]); -void zbuf_render_project(float winmat[][4], float *co, float *ho); +void zbuf_render_project(float winmat[][4], const float co[3], float ho[4]); #endif diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 4c210d34284..00805be2e42 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -478,11 +478,11 @@ static void calc_tangent_vector(ObjectRen *obr, VertexTangent **vtangents, MemAr if(do_tangent) { tav= RE_vertren_get_tangent(obr, v1, 1); - VECADD(tav, tav, tang); + add_v3_v3(tav, tang); tav= RE_vertren_get_tangent(obr, v2, 1); - VECADD(tav, tav, tang); + add_v3_v3(tav, tang); tav= RE_vertren_get_tangent(obr, v3, 1); - VECADD(tav, tav, tang); + add_v3_v3(tav, tang); } if(do_nmap_tangent) { @@ -496,11 +496,11 @@ static void calc_tangent_vector(ObjectRen *obr, VertexTangent **vtangents, MemAr if(do_tangent) { tav= RE_vertren_get_tangent(obr, v1, 1); - VECADD(tav, tav, tang); + add_v3_v3(tav, tang); tav= RE_vertren_get_tangent(obr, v3, 1); - VECADD(tav, tav, tang); + add_v3_v3(tav, tang); tav= RE_vertren_get_tangent(obr, v4, 1); - VECADD(tav, tav, tang); + add_v3_v3(tav, tang); } if(do_nmap_tangent) { @@ -1357,20 +1357,20 @@ static void particle_billboard(Render *re, ObjectRen *obr, Material *ma, Particl psys_make_billboard(bb, xvec, yvec, zvec, bb_center); - VECADD(vlr->v1->co, bb_center, xvec); - VECADD(vlr->v1->co, vlr->v1->co, yvec); + add_v3_v3v3(vlr->v1->co, bb_center, xvec); + add_v3_v3(vlr->v1->co, yvec); mul_m4_v3(re->viewmat, vlr->v1->co); - VECSUB(vlr->v2->co, bb_center, xvec); - VECADD(vlr->v2->co, vlr->v2->co, yvec); + sub_v3_v3v3(vlr->v2->co, bb_center, xvec); + add_v3_v3(vlr->v2->co, yvec); mul_m4_v3(re->viewmat, vlr->v2->co); - VECSUB(vlr->v3->co, bb_center, xvec); - VECSUB(vlr->v3->co, vlr->v3->co, yvec); + sub_v3_v3v3(vlr->v3->co, bb_center, xvec); + sub_v3_v3v3(vlr->v3->co, vlr->v3->co, yvec); mul_m4_v3(re->viewmat, vlr->v3->co); - VECADD(vlr->v4->co, bb_center, xvec); - VECSUB(vlr->v4->co, vlr->v4->co, yvec); + add_v3_v3v3(vlr->v4->co, bb_center, xvec); + sub_v3_v3(vlr->v4->co, yvec); mul_m4_v3(re->viewmat, vlr->v4->co); normal_quad_v3( vlr->n,vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co); @@ -1968,8 +1968,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem if(k==1){ sd.first = 1; sd.time = 0.0f; - VECSUB(loc0,loc1,loc); - VECADD(loc0,loc1,loc0); + sub_v3_v3v3(loc0,loc1,loc); + add_v3_v3v3(loc0,loc1,loc0); particle_curve(re, obr, psmd->dm, ma, &sd, loc1, loc0, seed, pa_co); } @@ -3475,7 +3475,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) float * ftang = RE_vlakren_get_nmap_tangent(obr, vlr, 1); for(vindex=0; vindex<nr_verts; vindex++) { - QUATCOPY(ftang+vindex*4, tangent+a*16+rev_tab[vindex]*4); + copy_v4_v4(ftang+vindex*4, tangent+a*16+rev_tab[vindex]*4); mul_mat3_m4_v3(mat, ftang+vindex*4); normalize_v3(ftang+vindex*4); } @@ -3579,7 +3579,7 @@ static void initshadowbuf(Render *re, LampRen *lar, float mat[][4]) if(shb==NULL) return; - VECCOPY(shb->co, lar->co); + VECCOPY(shb->co, lar->co); /* int copy */ /* percentage render: keep track of min and max */ shb->size= (lar->bufsize*re->r.size)/100; @@ -4190,7 +4190,7 @@ static void check_non_flat_quads(ObjectRen *obr) v2= vlr->v2; v3= vlr->v3; v4= vlr->v4; - VECSUB(nor, v1->co, v2->co); + sub_v3_v3v3(nor, v1->co, v2->co); if( ABS(nor[0])<FLT_EPSILON10 && ABS(nor[1])<FLT_EPSILON10 && ABS(nor[2])<FLT_EPSILON10 ) { vlr->v1= v2; vlr->v2= v3; @@ -4198,19 +4198,19 @@ static void check_non_flat_quads(ObjectRen *obr) vlr->v4= NULL; } else { - VECSUB(nor, v2->co, v3->co); + sub_v3_v3v3(nor, v2->co, v3->co); if( ABS(nor[0])<FLT_EPSILON10 && ABS(nor[1])<FLT_EPSILON10 && ABS(nor[2])<FLT_EPSILON10 ) { vlr->v2= v3; vlr->v3= v4; vlr->v4= NULL; } else { - VECSUB(nor, v3->co, v4->co); + sub_v3_v3v3(nor, v3->co, v4->co); if( ABS(nor[0])<FLT_EPSILON10 && ABS(nor[1])<FLT_EPSILON10 && ABS(nor[2])<FLT_EPSILON10 ) { vlr->v4= NULL; } else { - VECSUB(nor, v4->co, v1->co); + sub_v3_v3v3(nor, v4->co, v1->co); if( ABS(nor[0])<FLT_EPSILON10 && ABS(nor[1])<FLT_EPSILON10 && ABS(nor[2])<FLT_EPSILON10 ) { vlr->v4= NULL; } @@ -5397,12 +5397,12 @@ static void calculate_speedvectors(Render *re, ObjectInstanceRen *obi, float *ve interp_weights_face_v3( w,co1, co2, co3, co4, strand->vert->co); - speed[0]= speed[1]= speed[2]= speed[3]= 0.0f; - QUATADDFAC(speed, speed, winspeed[face[0]], w[0]); - QUATADDFAC(speed, speed, winspeed[face[1]], w[1]); - QUATADDFAC(speed, speed, winspeed[face[2]], w[2]); + zero_v4(speed); + madd_v4_v4fl(speed, winspeed[face[0]], w[0]); + madd_v4_v4fl(speed, winspeed[face[1]], w[1]); + madd_v4_v4fl(speed, winspeed[face[2]], w[2]); if(face[3]) - QUATADDFAC(speed, speed, winspeed[face[3]], w[3]); + madd_v4_v4fl(speed, winspeed[face[3]], w[3]); } } diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 2f20c328405..6ea62828601 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -704,7 +704,7 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe } /* rotate to envmap space, if object is set */ - VECCOPY(vec, texvec); + copy_v3_v3(vec, texvec); if(env->object) mul_m3_v3(env->obimat, vec); else mul_mat3_m4_v3(R.viewinv, vec); diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index 719b9674b80..d1f7059416d 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -88,11 +88,11 @@ static void ibuf_get_color(float *col, struct ImBuf *ibuf, int x, int y) if(ibuf->rect_float) { if(ibuf->channels==4) { float *fp= ibuf->rect_float + 4*ofs; - QUATCOPY(col, fp); + copy_v4_v4(col, fp); } else if(ibuf->channels==3) { float *fp= ibuf->rect_float + 3*ofs; - VECCOPY(col, fp); + copy_v3_v3(col, fp); col[3]= 1.0f; } else { diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index f8e4ee8f6a7..7bd8dad6502 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -53,6 +53,7 @@ #include "DNA_scene_types.h" +#include "BKE_camera.h" #include "BKE_global.h" #include "BKE_material.h" #include "BKE_object.h" diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index a2363472694..7434425d24b 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -172,7 +172,7 @@ static void occ_shade(ShadeSample *ssamp, ObjectInstanceRen *obi, VlakRen *vlr, shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 2); /* set up view vector */ - VECCOPY(shi->view, shi->co); + copy_v3_v3(shi->view, shi->co); normalize_v3(shi->view); /* cache for shadow */ @@ -205,7 +205,7 @@ static void occ_shade(ShadeSample *ssamp, ObjectInstanceRen *obi, VlakRen *vlr, shade_input_set_shade_texco(shi); shade_material_loop(shi, shr); /* todo: nodes */ - VECCOPY(rad, shr->combined); + copy_v3_v3(rad, shr->combined); } static void occ_build_shade(Render *re, OcclusionTree *tree) @@ -339,10 +339,10 @@ static void occ_face(const OccFace *face, float co[3], float normal[3], float *a } if(area) { - VECCOPY(v1, vlr->v1->co); - VECCOPY(v2, vlr->v2->co); - VECCOPY(v3, vlr->v3->co); - if(vlr->v4) VECCOPY(v4, vlr->v4->co); + copy_v3_v3(v1, vlr->v1->co); + copy_v3_v3(v2, vlr->v2->co); + copy_v3_v3(v3, vlr->v3->co); + if(vlr->v4) copy_v3_v3(v4, vlr->v4->co); if(obi->flag & R_TRANSFORMED) { mul_m4_v3(obi->mat, v1); @@ -439,14 +439,14 @@ static void occ_build_dco(OcclusionTree *tree, OccNode *node, const float co[3], else if(node->child[b].node) { OccNode *child= node->child[b].node; occ_build_dco(tree, child, co, dco); - VECCOPY(nco, child->co); + copy_v3_v3(nco, child->co); } else { continue; } - VECSUB(d, nco, co); - dist= INPR(d, d); + sub_v3_v3v3(d, nco, co); + dist= dot_v3v3(d, d); if(dist > *dco) *dco= dist; } @@ -604,7 +604,7 @@ static void occ_build_recursive(OcclusionTree *tree, OccNode *node, int begin, i if(child) { node->area += child->area; sh_add(node->sh, node->sh, child->sh); - VECADDFAC(node->co, node->co, child->co, child->area); + madd_v3_v3fl(node->co, child->co, child->area); } } @@ -745,7 +745,7 @@ static void occ_free_tree(OcclusionTree *tree) /* ------------------------- Traversal --------------------------- */ -static float occ_solid_angle(OccNode *node, float *v, float d2, float invd2, float *receivenormal) +static float occ_solid_angle(OccNode *node, const float v[3], float d2, float invd2, const float receivenormal[3]) { float dotreceive, dotemit; float ev[3]; @@ -754,7 +754,7 @@ static float occ_solid_angle(OccNode *node, float *v, float d2, float invd2, flo ev[1]= -v[1]*invd2; ev[2]= -v[2]*invd2; dotemit= sh_eval(node->sh, ev); - dotreceive= INPR(receivenormal, v)*invd2; + dotreceive= dot_v3v3(receivenormal, v)*invd2; CLAMP(dotemit, 0.0f, 1.0f); CLAMP(dotreceive, 0.0f, 1.0f); @@ -762,24 +762,24 @@ static float occ_solid_angle(OccNode *node, float *v, float d2, float invd2, flo return ((node->area*dotemit*dotreceive)/(d2 + node->area*INVPI))*INVPI; } -static void VecAddDir(float *result, float *v1, float *v2, float fac) +static void VecAddDir(float result[3], const float v1[3], const float v2[3], const float fac) { result[0]= v1[0] + fac*(v2[0] - v1[0]); result[1]= v1[1] + fac*(v2[1] - v1[1]); result[2]= v1[2] + fac*(v2[2] - v1[2]); } -static int occ_visible_quad(float *p, float *n, float *v0, float *v1, float *v2, float *q0, float *q1, float *q2, float *q3) +static int occ_visible_quad(float *p, const float n[3], const float v0[3], const float *v1, const float *v2, float q0[3], float q1[3], float q2[3], float q3[3]) { static const float epsilon = 1e-6f; float c, sd[3]; - c= INPR(n, p); + c= dot_v3v3(n, p); /* signed distances from the vertices to the plane. */ - sd[0]= INPR(n, v0) - c; - sd[1]= INPR(n, v1) - c; - sd[2]= INPR(n, v2) - c; + sd[0]= dot_v3v3(n, v0) - c; + sd[1]= dot_v3v3(n, v1) - c; + sd[2]= dot_v3v3(n, v2) - c; if(fabsf(sd[0]) < epsilon) sd[0] = 0.0f; if(fabsf(sd[1]) < epsilon) sd[1] = 0.0f; @@ -789,70 +789,70 @@ static int occ_visible_quad(float *p, float *n, float *v0, float *v1, float *v2, if(sd[1] > 0) { if(sd[2] > 0) { // +++ - VECCOPY(q0, v0); - VECCOPY(q1, v1); - VECCOPY(q2, v2); - VECCOPY(q3, q2); + copy_v3_v3(q0, v0); + copy_v3_v3(q1, v1); + copy_v3_v3(q2, v2); + copy_v3_v3(q3, q2); } else if(sd[2] < 0) { // ++- - VECCOPY(q0, v0); - VECCOPY(q1, v1); + copy_v3_v3(q0, v0); + copy_v3_v3(q1, v1); VecAddDir(q2, v1, v2, (sd[1]/(sd[1]-sd[2]))); VecAddDir(q3, v0, v2, (sd[0]/(sd[0]-sd[2]))); } else { // ++0 - VECCOPY(q0, v0); - VECCOPY(q1, v1); - VECCOPY(q2, v2); - VECCOPY(q3, q2); + copy_v3_v3(q0, v0); + copy_v3_v3(q1, v1); + copy_v3_v3(q2, v2); + copy_v3_v3(q3, q2); } } else if(sd[1] < 0) { if(sd[2] > 0) { // +-+ - VECCOPY(q0, v0); + copy_v3_v3(q0, v0); VecAddDir(q1, v0, v1, (sd[0]/(sd[0]-sd[1]))); VecAddDir(q2, v1, v2, (sd[1]/(sd[1]-sd[2]))); - VECCOPY(q3, v2); + copy_v3_v3(q3, v2); } else if(sd[2] < 0) { // +-- - VECCOPY(q0, v0); + copy_v3_v3(q0, v0); VecAddDir(q1, v0, v1, (sd[0]/(sd[0]-sd[1]))); VecAddDir(q2, v0, v2, (sd[0]/(sd[0]-sd[2]))); - VECCOPY(q3, q2); + copy_v3_v3(q3, q2); } else { // +-0 - VECCOPY(q0, v0); + copy_v3_v3(q0, v0); VecAddDir(q1, v0, v1, (sd[0]/(sd[0]-sd[1]))); - VECCOPY(q2, v2); - VECCOPY(q3, q2); + copy_v3_v3(q2, v2); + copy_v3_v3(q3, q2); } } else { if(sd[2] > 0) { // +0+ - VECCOPY(q0, v0); - VECCOPY(q1, v1); - VECCOPY(q2, v2); - VECCOPY(q3, q2); + copy_v3_v3(q0, v0); + copy_v3_v3(q1, v1); + copy_v3_v3(q2, v2); + copy_v3_v3(q3, q2); } else if(sd[2] < 0) { // +0- - VECCOPY(q0, v0); - VECCOPY(q1, v1); + copy_v3_v3(q0, v0); + copy_v3_v3(q1, v1); VecAddDir(q2, v0, v2, (sd[0]/(sd[0]-sd[2]))); - VECCOPY(q3, q2); + copy_v3_v3(q3, q2); } else { // +00 - VECCOPY(q0, v0); - VECCOPY(q1, v1); - VECCOPY(q2, v2); - VECCOPY(q3, q2); + copy_v3_v3(q0, v0); + copy_v3_v3(q1, v1); + copy_v3_v3(q2, v2); + copy_v3_v3(q3, q2); } } } @@ -861,23 +861,23 @@ static int occ_visible_quad(float *p, float *n, float *v0, float *v1, float *v2, if(sd[2] > 0) { // -++ VecAddDir(q0, v0, v1, (sd[0]/(sd[0]-sd[1]))); - VECCOPY(q1, v1); - VECCOPY(q2, v2); + copy_v3_v3(q1, v1); + copy_v3_v3(q2, v2); VecAddDir(q3, v0, v2, (sd[0]/(sd[0]-sd[2]))); } else if(sd[2] < 0) { // -+- VecAddDir(q0, v0, v1, (sd[0]/(sd[0]-sd[1]))); - VECCOPY(q1, v1); + copy_v3_v3(q1, v1); VecAddDir(q2, v1, v2, (sd[1]/(sd[1]-sd[2]))); - VECCOPY(q3, q2); + copy_v3_v3(q3, q2); } else { // -+0 VecAddDir(q0, v0, v1, (sd[0]/(sd[0]-sd[1]))); - VECCOPY(q1, v1); - VECCOPY(q2, v2); - VECCOPY(q3, q2); + copy_v3_v3(q1, v1); + copy_v3_v3(q2, v2); + copy_v3_v3(q3, q2); } } else if(sd[1] < 0) { @@ -885,8 +885,8 @@ static int occ_visible_quad(float *p, float *n, float *v0, float *v1, float *v2, // --+ VecAddDir(q0, v0, v2, (sd[0]/(sd[0]-sd[2]))); VecAddDir(q1, v1, v2, (sd[1]/(sd[1]-sd[2]))); - VECCOPY(q2, v2); - VECCOPY(q3, q2); + copy_v3_v3(q2, v2); + copy_v3_v3(q3, q2); } else if(sd[2] < 0) { // --- @@ -901,9 +901,9 @@ static int occ_visible_quad(float *p, float *n, float *v0, float *v1, float *v2, if(sd[2] > 0) { // -0+ VecAddDir(q0, v0, v2, (sd[0]/(sd[0]-sd[2]))); - VECCOPY(q1, v1); - VECCOPY(q2, v2); - VECCOPY(q3, q2); + copy_v3_v3(q1, v1); + copy_v3_v3(q2, v2); + copy_v3_v3(q3, q2); } else if(sd[2] < 0) { // -0- @@ -919,33 +919,33 @@ static int occ_visible_quad(float *p, float *n, float *v0, float *v1, float *v2, if(sd[1] > 0) { if(sd[2] > 0) { // 0++ - VECCOPY(q0, v0); - VECCOPY(q1, v1); - VECCOPY(q2, v2); - VECCOPY(q3, q2); + copy_v3_v3(q0, v0); + copy_v3_v3(q1, v1); + copy_v3_v3(q2, v2); + copy_v3_v3(q3, q2); } else if(sd[2] < 0) { // 0+- - VECCOPY(q0, v0); - VECCOPY(q1, v1); + copy_v3_v3(q0, v0); + copy_v3_v3(q1, v1); VecAddDir(q2, v1, v2, (sd[1]/(sd[1]-sd[2]))); - VECCOPY(q3, q2); + copy_v3_v3(q3, q2); } else { // 0+0 - VECCOPY(q0, v0); - VECCOPY(q1, v1); - VECCOPY(q2, v2); - VECCOPY(q3, q2); + copy_v3_v3(q0, v0); + copy_v3_v3(q1, v1); + copy_v3_v3(q2, v2); + copy_v3_v3(q3, q2); } } else if(sd[1] < 0) { if(sd[2] > 0) { // 0-+ - VECCOPY(q0, v0); + copy_v3_v3(q0, v0); VecAddDir(q1, v1, v2, (sd[1]/(sd[1]-sd[2]))); - VECCOPY(q2, v2); - VECCOPY(q3, q2); + copy_v3_v3(q2, v2); + copy_v3_v3(q3, q2); } else if(sd[2] < 0) { // 0-- @@ -959,10 +959,10 @@ static int occ_visible_quad(float *p, float *n, float *v0, float *v1, float *v2, else { if(sd[2] > 0) { // 00+ - VECCOPY(q0, v0); - VECCOPY(q1, v1); - VECCOPY(q2, v2); - VECCOPY(q3, q2); + copy_v3_v3(q0, v0); + copy_v3_v3(q1, v1); + copy_v3_v3(q2, v2); + copy_v3_v3(q3, q2); } else if(sd[2] < 0) { // 00- @@ -1117,7 +1117,7 @@ static void normalizef(float *n) { float d; - d= INPR(n, n); + d= dot_v3v3(n, n); if(d > 1.0e-35F) { d= 1.0f/sqrtf(d); @@ -1128,15 +1128,15 @@ static void normalizef(float *n) } } -static float occ_quad_form_factor(float *p, float *n, float *q0, float *q1, float *q2, float *q3) +static float occ_quad_form_factor(const float p[3], const float n[3], const float q0[3], const float q1[3], const float q2[3], const float q3[3]) { float r0[3], r1[3], r2[3], r3[3], g0[3], g1[3], g2[3], g3[3]; float a1, a2, a3, a4, dot1, dot2, dot3, dot4, result; - VECSUB(r0, q0, p); - VECSUB(r1, q1, p); - VECSUB(r2, q2, p); - VECSUB(r3, q3, p); + sub_v3_v3v3(r0, q0, p); + sub_v3_v3v3(r1, q1, p); + sub_v3_v3v3(r2, q2, p); + sub_v3_v3v3(r3, q3, p); normalizef(r0); normalizef(r1); @@ -1148,15 +1148,15 @@ static float occ_quad_form_factor(float *p, float *n, float *q0, float *q1, floa cross_v3_v3v3(g2, r3, r2); normalizef(g2); cross_v3_v3v3(g3, r0, r3); normalizef(g3); - a1= saacosf(INPR(r0, r1)); - a2= saacosf(INPR(r1, r2)); - a3= saacosf(INPR(r2, r3)); - a4= saacosf(INPR(r3, r0)); + a1= saacosf(dot_v3v3(r0, r1)); + a2= saacosf(dot_v3v3(r1, r2)); + a3= saacosf(dot_v3v3(r2, r3)); + a4= saacosf(dot_v3v3(r3, r0)); - dot1= INPR(n, g0); - dot2= INPR(n, g1); - dot3= INPR(n, g2); - dot4= INPR(n, g3); + dot1= dot_v3v3(n, g0); + dot2= dot_v3v3(n, g1); + dot3= dot_v3v3(n, g2); + dot4= dot_v3v3(n, g3); result= (a1*dot1 + a2*dot2 + a3*dot3 + a4*dot4)*0.5f/(float)M_PI; result= MAX2(result, 0.0f); @@ -1173,9 +1173,9 @@ static float occ_form_factor(OccFace *face, float *p, float *n) obi= &R.objectinstance[face->obi]; vlr= RE_findOrAddVlak(obi->obr, face->facenr); - VECCOPY(v1, vlr->v1->co); - VECCOPY(v2, vlr->v2->co); - VECCOPY(v3, vlr->v3->co); + copy_v3_v3(v1, vlr->v1->co); + copy_v3_v3(v2, vlr->v2->co); + copy_v3_v3(v3, vlr->v3->co); if(obi->flag & R_TRANSFORMED) { mul_m4_v3(obi->mat, v1); @@ -1187,7 +1187,7 @@ static float occ_form_factor(OccFace *face, float *p, float *n) contrib += occ_quad_form_factor(p, n, q0, q1, q2, q3); if(vlr->v4) { - VECCOPY(v4, vlr->v4->co); + copy_v3_v3(v4, vlr->v4->co); if(obi->flag & R_TRANSFORMED) mul_m4_v3(obi->mat, v4); @@ -1207,9 +1207,9 @@ static void occ_lookup(OcclusionTree *tree, int thread, OccFace *exclude, float int b, f, totstack; /* init variables */ - VECCOPY(p, pp); - VECCOPY(n, pn); - VECADDFAC(p, p, n, 1e-4f); + copy_v3_v3(p, pp); + copy_v3_v3(n, pn); + madd_v3_v3fl(p, n, 1e-4f); if(bentn) copy_v3_v3(bentn, n); @@ -1229,8 +1229,8 @@ static void occ_lookup(OcclusionTree *tree, int thread, OccFace *exclude, float /* pop point off the stack */ node= stack[--totstack]; - VECSUB(v, node->co, p); - d2= INPR(v, v) + 1e-16f; + sub_v3_v3v3(v, node->co, p); + d2= dot_v3v3(v, v) + 1e-16f; emitarea= MAX2(node->area, node->dco); if(d2*error > emitarea) { @@ -1270,8 +1270,8 @@ static void occ_lookup(OcclusionTree *tree, int thread, OccFace *exclude, float if(!exclude || !(face->obi == exclude->obi && face->facenr == exclude->facenr)) { if(bentn || distfac != 0.0f) { occ_face(face, co, NULL, NULL); - VECSUB(v, co, p); - d2= INPR(v, v) + 1e-16f; + sub_v3_v3v3(v, co, p); + d2= dot_v3v3(v, v) + 1e-16f; fac= (distfac == 0.0f)? 1.0f: 1.0f/(1.0f + distfac*d2); if(fac < 0.01f) @@ -1368,7 +1368,7 @@ static void occ_compute_passes(Render *re, OcclusionTree *tree, int totpass) for(i=0; i<tree->totface; i++) { occ_face(&tree->face[i], co, n, NULL); negate_v3(n); - VECADDFAC(co, co, n, 1e-8f); + madd_v3_v3fl(co, n, 1e-8f); occ_lookup(tree, 0, &tree->face[i], co, n, &occ[i], NULL, NULL); if(re->test_break(re->tbh)) @@ -1484,12 +1484,12 @@ static int sample_occ_cache(OcclusionTree *tree, float *co, float *n, int x, int if(cache->sample && cache->step) { sample= &cache->sample[(y-cache->y)*cache->w + (x-cache->x)]; if(sample->filled) { - VECSUB(d, sample->co, co); - dist2= INPR(d, d); - if(dist2 < 0.5f*sample->dist2 && INPR(sample->n, n) > 0.98f) { - VECCOPY(ao, sample->ao); - VECCOPY(env, sample->env); - VECCOPY(indirect, sample->indirect); + sub_v3_v3v3(d, sample->co, co); + dist2= dot_v3v3(d, d); + if(dist2 < 0.5f*sample->dist2 && dot_v3v3(sample->n, n) > 0.98f) { + copy_v3_v3(ao, sample->ao); + copy_v3_v3(env, sample->env); + copy_v3_v3(indirect, sample->indirect); return 1; } } @@ -1534,11 +1534,11 @@ static int sample_occ_cache(OcclusionTree *tree, float *co, float *n, int x, int wb[0]= tx*ty; for(i=0; i<4; i++) { - VECSUB(d, samples[i]->co, co); - //dist2= INPR(d, d); + sub_v3_v3v3(d, samples[i]->co, co); + //dist2= dot_v3v3(d, d); wz[i]= 1.0f; //(samples[i]->dist2/(1e-4f + dist2)); - wn[i]= pow(INPR(samples[i]->n, n), 32.0f); + wn[i]= pow(dot_v3v3(samples[i]->n, n), 32.0f); w= wb[i]*wn[i]*wz[i]; @@ -1633,9 +1633,9 @@ static void *exec_strandsurface_sample(void *data) negate_v3(n); sample_occ_tree(re, re->occlusiontree, NULL, co, n, othread->thread, 0, ao, env, indirect); - VECCOPY(othread->faceao[a], ao); - VECCOPY(othread->faceenv[a], env); - VECCOPY(othread->faceindirect[a], indirect); + copy_v3_v3(othread->faceao[a], ao); + copy_v3_v3(othread->faceenv[a], env); + copy_v3_v3(othread->faceindirect[a], indirect); } return 0; @@ -1701,27 +1701,27 @@ void make_occ_tree(Render *re) for(a=0; a<mesh->totface; a++) { face= mesh->face[a]; - VECCOPY(ao, faceao[a]); - VECCOPY(env, faceenv[a]); - VECCOPY(indirect, faceindirect[a]); + copy_v3_v3(ao, faceao[a]); + copy_v3_v3(env, faceenv[a]); + copy_v3_v3(indirect, faceindirect[a]); - VECADD(mesh->ao[face[0]], mesh->ao[face[0]], ao); - VECADD(mesh->env[face[0]], mesh->env[face[0]], env); - VECADD(mesh->indirect[face[0]], mesh->indirect[face[0]], indirect); + add_v3_v3(mesh->ao[face[0]], ao); + add_v3_v3(mesh->env[face[0]], env); + add_v3_v3(mesh->indirect[face[0]], indirect); count[face[0]]++; - VECADD(mesh->ao[face[1]], mesh->ao[face[1]], ao); - VECADD(mesh->env[face[1]], mesh->env[face[1]], env); - VECADD(mesh->indirect[face[1]], mesh->indirect[face[1]], indirect); + add_v3_v3(mesh->ao[face[1]], ao); + add_v3_v3(mesh->env[face[1]], env); + add_v3_v3(mesh->indirect[face[1]], indirect); count[face[1]]++; - VECADD(mesh->ao[face[2]], mesh->ao[face[2]], ao); - VECADD(mesh->env[face[2]], mesh->env[face[2]], env); - VECADD(mesh->indirect[face[2]], mesh->indirect[face[2]], indirect); + add_v3_v3(mesh->ao[face[2]], ao); + add_v3_v3(mesh->env[face[2]], env); + add_v3_v3(mesh->indirect[face[2]], indirect); count[face[2]]++; if(face[3]) { - VECADD(mesh->ao[face[3]], mesh->ao[face[3]], ao); - VECADD(mesh->env[face[3]], mesh->env[face[3]], env); - VECADD(mesh->indirect[face[3]], mesh->indirect[face[3]], indirect); + add_v3_v3(mesh->ao[face[3]], ao); + add_v3_v3(mesh->env[face[3]], env); + add_v3_v3(mesh->indirect[face[3]], indirect); count[face[3]]++; } } @@ -1784,7 +1784,7 @@ void sample_occ(Render *re, ShadeInput *shi) sample->intensity= MAX3(sample->ao[0], sample->ao[1], sample->ao[2]); sample->intensity= MAX2(sample->intensity, MAX3(sample->env[0], sample->env[1], sample->env[2])); sample->intensity= MAX2(sample->intensity, MAX3(sample->indirect[0], sample->indirect[1], sample->indirect[2])); - sample->dist2= INPR(shi->dxco, shi->dxco) + INPR(shi->dyco, shi->dyco); + sample->dist2= dot_v3v3(shi->dxco, shi->dxco) + dot_v3v3(shi->dyco, shi->dyco); sample->filled= 1; } } @@ -1879,7 +1879,7 @@ void cache_occ_samples(Render *re, RenderPart *pa, ShadeSample *ssamp) sample->intensity= MAX3(sample->ao[0], sample->ao[1], sample->ao[2]); sample->intensity= MAX2(sample->intensity, MAX3(sample->env[0], sample->env[1], sample->env[2])); sample->intensity= MAX2(sample->intensity, MAX3(sample->indirect[0], sample->indirect[1], sample->indirect[2])); - sample->dist2= INPR(shi->dxco, shi->dxco) + INPR(shi->dyco, shi->dyco); + sample->dist2= dot_v3v3(shi->dxco, shi->dxco) + dot_v3v3(shi->dyco, shi->dyco); sample->x= shi->xs; sample->y= shi->ys; sample->filled= 1; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index de5d037675e..d4bd8f8a693 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -48,6 +48,7 @@ #include "MEM_guardedalloc.h" #include "BKE_animsys.h" /* <------ should this be here?, needed for sequencer update */ +#include "BKE_camera.h" #include "BKE_global.h" #include "BKE_image.h" #include "BKE_main.h" diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index dfd10687a33..36709408496 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -84,7 +84,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3]) ir= ig= ib= 0.0; - VECCOPY(rco, har->co); + copy_v3_v3(rco, har->co); dco[0]=dco[1]=dco[2]= 1.0f/har->rad; vn= har->no; @@ -97,7 +97,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3]) /* lampdist cacluation */ if(lar->type==LA_SUN || lar->type==LA_HEMI) { - VECCOPY(lv, lar->vec); + copy_v3_v3(lv, lar->vec); lampdist= 1.0; } else { @@ -146,7 +146,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3]) memset(&shi, 0, sizeof(ShadeInput)); /* end warning! - Campbell */ - VECCOPY(shi.co, rco); + copy_v3_v3(shi.co, rco); shi.osatex= 0; do_lamp_tex(lar, lv, &shi, lacol, LA_TEXTURE); } @@ -158,7 +158,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3]) float x, lvrot[3]; /* rotate view to lampspace */ - VECCOPY(lvrot, lv); + copy_v3_v3(lvrot, lv); mul_m3_v3(lar->imat, lvrot); x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2])); @@ -610,7 +610,7 @@ void shadeSkyPixel(float collector[4], float fx, float fy, short thread) if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) { /* 1. solid color */ - VECCOPY(collector, &R.wrld.horr); + copy_v3_v3(collector, &R.wrld.horr); collector[3] = 0.0f; } diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 5f5a4e9c638..5b81ea85914 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -153,7 +153,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa state.time = cfra; if(psys_get_particle_state(&sim, i, &state, 0)) { - VECCOPY(partco, state.co); + copy_v3_v3(partco, state.co); if (pd->psys_cache_space == TEX_PD_OBJECTSPACE) mul_m4_v3(ob->imat, partco); @@ -217,7 +217,7 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, Object *ob) for(i=0; i < pd->totpoints; i++, mvert++) { float co[3]; - VECCOPY(co, mvert->co); + copy_v3_v3(co, mvert->co); switch(pd->ob_cache_space) { case TEX_PD_OBJECTSPACE: @@ -423,7 +423,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) (pd->flag&TEX_PD_FALLOFF_CURVE ? pd->falloff_curve : NULL), pd->falloff_speed_scale*0.001f); noise_fac = pd->noise_fac * 0.5f; /* better default */ - VECCOPY(co, texvec); + copy_v3_v3(co, texvec); if (point_data_used(pd)) { /* does a BVH lookup to find accumulated density and additional point data * @@ -480,7 +480,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) if (pd->coba) { if (do_colorband(pd->coba, age, col)) { texres->talpha= 1; - VECCOPY(&texres->tr, col); + copy_v3_v3(&texres->tr, col); texres->tin *= col[3]; texres->ta = texres->tin; } @@ -493,7 +493,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) if (pd->coba) { if (do_colorband(pd->coba, speed, col)) { texres->talpha= 1; - VECCOPY(&texres->tr, col); + copy_v3_v3(&texres->tr, col); texres->tin *= col[3]; texres->ta = texres->tin; } @@ -503,7 +503,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) case TEX_PD_COLOR_PARTVEL: texres->talpha= 1; mul_v3_fl(vec, pd->speed_scale); - VECCOPY(&texres->tr, vec); + copy_v3_v3(&texres->tr, vec); texres->ta = texres->tin; break; case TEX_PD_COLOR_CONSTANT: diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index a02c5681e5e..1a58a665e0a 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -1593,7 +1593,7 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr) } /* put back together */ if(shi->combinedflag & SCE_PASS_SPEC) - VECADD(shr->combined, diff, shr->spec) /* no ; */ + add_v3_v3v3(shr->combined, diff, shr->spec); else copy_v3_v3(shr->combined, diff); } diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 0c1e9096940..a77efdeaa0d 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -2302,7 +2302,7 @@ void do_material_tex(ShadeInput *shi, Render *re) else texres.nor= NULL; if(warpdone) { - VECADD(tempvec, co, warpvec); + add_v3_v3v3(tempvec, co, warpvec); co= tempvec; } diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index d2683f26c3a..456702e0827 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -562,7 +562,7 @@ static void add_passes(RenderLayer *rl, int offset, ShadeInput *shi, ShadeResult float *fp; fp= rl->rectf + 4*offset; - QUATCOPY(fp, shr->combined); + copy_v4_v4(fp, shr->combined); for(rpass= rl->passes.first; rpass; rpass= rpass->next) { float *col= NULL, uvcol[3]; @@ -695,7 +695,7 @@ static void sky_tile(RenderPart *pa, RenderLayer *rl) } if(pass[3]==0.0f) { - QUATCOPY(pass, col); + copy_v4_v4(pass, col); } else { addAlphaUnderFloat(pass, col); @@ -768,18 +768,17 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl) continue; } - VECCOPY(tmp_rgb, rgbrect); + copy_v3_v3(tmp_rgb, rgbrect); if(rgbrect[3]!=1.0f) { /* de-premul */ - float div= 1.0f/rgbrect[3]; - VECMUL(tmp_rgb, div); + mul_v3_fl(tmp_rgb, 1.0f/rgbrect[3]); } shadeAtmPixel(lar->sunsky, tmp_rgb, x, y, *zrect); if(rgbrect[3]!=1.0f) { /* premul */ - VECMUL(tmp_rgb, rgbrect[3]); + mul_v3_fl(tmp_rgb, rgbrect[3]); } if(done==0) { - VECCOPY(rgb, tmp_rgb); + copy_v3_v3(rgb, tmp_rgb); done = 1; } else{ @@ -793,7 +792,7 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl) /* if at least for one sun lamp aerial perspective was applied*/ if(done) { - VECCOPY(rgbrect, rgb); + copy_v3_v3(rgbrect, rgb); } } } @@ -1533,13 +1532,13 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe then clamp to avoid a too large contribution from a single pixel */ shi->osatex= 1; - VECCOPY(nor, shi->facenor); + copy_v3_v3(nor, shi->facenor); calc_view_vector(shi->facenor, sx, sy); normalize_v3(shi->facenor); shade_input_set_viewco(shi, x, y, sx, sy, z); orthoarea= len_v3(shi->dxco)*len_v3(shi->dyco); - VECCOPY(shi->facenor, nor); + copy_v3_v3(shi->facenor, nor); shade_input_set_viewco(shi, x, y, sx, sy, z); *area= len_v3(shi->dxco)*len_v3(shi->dyco); *area= MIN2(*area, 2.0f*orthoarea); @@ -1572,8 +1571,8 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe shade_samples_do_AO(ssamp); shade_material_loop(shi, &shr); - VECCOPY(co, shi->co); - VECCOPY(color, shr.combined); + copy_v3_v3(co, shi->co); + copy_v3_v3(color, shr.combined); /* texture blending */ /* texfac= shi->mat->sss_texfac; */ /* UNUSED */ @@ -1711,7 +1710,7 @@ void zbufshade_sss_tile(RenderPart *pa) totpoint++; - VECADD(fcol, fcol, color); + add_v3_v3(fcol, color); fcol[3]= 1.0f; } @@ -1730,7 +1729,7 @@ void zbufshade_sss_tile(RenderPart *pa) shade_sample_sss(&ssamp, mat, obi, vlr, quad, x, y, *rz, co[totpoint], color[totpoint], &area[totpoint]); - VECADD(fcol, fcol, color[totpoint]); + add_v3_v3(fcol, color[totpoint]); fcol[3]= 1.0f; totpoint++; } @@ -1753,7 +1752,7 @@ void zbufshade_sss_tile(RenderPart *pa) /* to indicate this is a back sample */ area[totpoint]= -area[totpoint]; - VECADD(fcol, fcol, color[totpoint]); + add_v3_v3(fcol, color[totpoint]); fcol[3]= 1.0f; totpoint++; } @@ -2068,7 +2067,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua if(bs->type==RE_BAKE_NORMALS) { float nor[3]; - VECCOPY(nor, shi->vn); + copy_v3_v3(nor, shi->vn); if(R.r.bake_normal_space == R_BAKE_SPACE_CAMERA); else if(R.r.bake_normal_space == R_BAKE_SPACE_TANGENT) { @@ -2076,16 +2075,16 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua /* bitangent */ if(tvn && ttang) { - VECCOPY(mat[0], ttang); + copy_v3_v3(mat[0], ttang); cross_v3_v3v3(mat[1], tvn, ttang); mul_v3_fl(mat[1], ttang[3]); - VECCOPY(mat[2], tvn); + copy_v3_v3(mat[2], tvn); } else { - VECCOPY(mat[0], shi->nmaptang); + copy_v3_v3(mat[0], shi->nmaptang); cross_v3_v3v3(mat[1], shi->nmapnorm, shi->nmaptang); mul_v3_fl(mat[1], shi->nmaptang[3]); - VECCOPY(mat[2], shi->nmapnorm); + copy_v3_v3(mat[2], shi->nmapnorm); } invert_m3_m3(imat, mat); @@ -2115,7 +2114,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua shr.alpha = shi->alpha; } else if(bs->type==RE_BAKE_SHADOW) { - VECCOPY(shr.combined, shr.shad); + copy_v3_v3(shr.combined, shr.shad); shr.alpha = shi->alpha; } else if(bs->type==RE_BAKE_SPEC_COLOR) { @@ -2158,7 +2157,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua if(bs->rect_float) { float *col= bs->rect_float + 4*(bs->rectx*y + x); - VECCOPY(col, shr.combined); + copy_v3_v3(col, shr.combined); if (bs->type==RE_BAKE_ALL || bs->type==RE_BAKE_TEXTURE) { col[3]= shr.alpha; } else { @@ -2336,16 +2335,16 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v) if(obi->flag & R_TRANSFORMED) mul_m4_v3(obi->mat, shi->co); - VECCOPY(shi->dxco, bs->dxco); - VECCOPY(shi->dyco, bs->dyco); + copy_v3_v3(shi->dxco, bs->dxco); + copy_v3_v3(shi->dyco, bs->dyco); quad= bs->quad; bake_set_shade_input(obi, vlr, shi, quad, 0, x, y, u, v); if(bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT) { shade_input_set_shade_texco(shi); - VECCOPY(tvn, shi->nmapnorm); - QUATCOPY(ttang, shi->nmaptang); + copy_v3_v3(tvn, shi->nmapnorm); + copy_v4_v4(ttang, shi->nmaptang); } /* if we are doing selected to active baking, find point on other face */ @@ -2359,7 +2358,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v) memset(&minisec, 0, sizeof(minisec)); minco[0]= minco[1]= minco[2]= 0.0f; - VECCOPY(bs->dir, shi->vn); + copy_v3_v3(bs->dir, shi->vn); for(sign=-1; sign<=1; sign+=2) { memset(&isec, 0, sizeof(isec)); @@ -2375,7 +2374,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v) if(!hit || len_v3v3(shi->co, co) < len_v3v3(shi->co, minco)) { minisec= isec; mindist= dist; - VECCOPY(minco, co); + copy_v3_v3(minco, co); hit= 1; dir = sign; } @@ -2395,7 +2394,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v) obi= (ObjectInstanceRen*)minisec.hit.ob; vlr= (VlakRen*)minisec.hit.face; quad= (minisec.isect == 2); - VECCOPY(shi->co, minco); + copy_v3_v3(shi->co, minco); u= -minisec.u; v= -minisec.v; diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 274fa4469e0..f3eb2234778 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -672,7 +672,7 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar) else ver++; if(clipflag[a]) { - VECCOPY(vec, ver->co); + copy_v3_v3(vec, ver->co); mul_m4_v3(obviewmat, vec); /* Z on visible side of lamp space */ if(vec[2] < 0.0f) { @@ -2063,7 +2063,7 @@ static int viewpixel_to_lampbuf(ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *v float dface, fac, siz; RE_vlakren_get_normal(&R, obi, vlr, nor); - VECCOPY(v1, vlr->v1->co); + copy_v3_v3(v1, vlr->v1->co); if(obi->flag & R_TRANSFORMED) mul_m4_v3(obi->mat, v1); @@ -2463,7 +2463,7 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la samp->facenr= apn->p[a] & ~RE_QUAD_OFFS; samp->shadfac= &apn->shadfac[a]; - VECCOPY(samp->zco, zco); + copy_v3_v3(samp->zco, zco); bound_rectf((rctf *)&root.box, samp->zco); } } @@ -2479,7 +2479,7 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la samp->facenr= apn->p[a] & ~RE_QUAD_OFFS; samp->shadfac= &apn->shadfac[a]; - VECCOPY(samp->zco, zco); + copy_v3_v3(samp->zco, zco); bound_rectf((rctf *)&root.box, samp->zco); } } diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 928139659d1..f2a053e89d9 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -127,8 +127,8 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr) if(shi->passflag & SCE_PASS_SHADOW) VECADDISFAC(shr->shad, shr_t.shad, fac); - VECMUL(shi->vn, -1.0f); - VECMUL(shi->facenor, -1.0f); + negate_v3(shi->vn); + negate_v3(shi->facenor); } /* depth >= 1 when ray-shading */ diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index e259c37f280..fde4eab37b0 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -495,10 +495,10 @@ static float area_lamp_energy_multisample(LampRen *lar, float *co, float *vn) vec[2]= 0.0f; mul_m3_v3(lar->mat, vec); - VECADD(area[0], lar->area[0], vec); - VECADD(area[1], lar->area[1], vec); - VECADD(area[2], lar->area[2], vec); - VECADD(area[3], lar->area[3], vec); + add_v3_v3v3(area[0], lar->area[0], vec); + add_v3_v3v3(area[1], lar->area[1], vec); + add_v3_v3v3(area[2], lar->area[2], vec); + add_v3_v3v3(area[3], lar->area[3], vec); intens+= area_lamp_energy(area, co, vn); @@ -1117,12 +1117,12 @@ void lamp_get_shadow(LampRen *lar, ShadeInput *shi, float inp, float shadfac[4], } if(shi->depth==0) { - QUATCOPY(lss->shadfac, shadfac); + copy_v4_v4(lss->shadfac, shadfac); lss->samplenr= shi->samplenr; } } else { - QUATCOPY(shadfac, lss->shadfac); + copy_v4_v4(shadfac, lss->shadfac); } } @@ -1891,16 +1891,16 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) /* and add emit and spec */ if(shi->combinedflag & SCE_PASS_EMIT) - VECADD(shr->combined, shr->combined, shr->emit); + add_v3_v3(shr->combined, shr->emit); if(shi->combinedflag & SCE_PASS_SPEC) - VECADD(shr->combined, shr->combined, shr->spec); + add_v3_v3(shr->combined, shr->spec); /* modulate by the object color */ if((ma->shade_flag & MA_OBCOLOR) && shi->obr->ob) { if(!(ma->sss_flag & MA_DIFF_SSS) || !sss_pass_done(&R, ma)) { float obcol[4]; - QUATCOPY(obcol, shi->obr->ob->col); + copy_v4_v4(obcol, shi->obr->ob->col); CLAMP(obcol[3], 0.0f, 1.0f); shr->combined[0] *= obcol[0]; diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c index cf97a63d8a0..4192aaf42aa 100644 --- a/source/blender/render/intern/source/sss.c +++ b/source/blender/render/intern/source/sss.c @@ -1,4 +1,4 @@ -/* +/* * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -452,11 +452,11 @@ static void compute_radiance(ScatterTree *tree, float *co, float *rad) mul_v3_fl(result.rad, tree->ss[0]->frontweight); mul_v3_fl(result.backrad, tree->ss[0]->backweight); - VECCOPY(rad, result.rad); - VECADD(backrad, result.rad, result.backrad); + copy_v3_v3(rad, result.rad); + add_v3_v3v3(backrad, result.rad, result.backrad); - VECCOPY(rdsum, result.rdsum); - VECADD(backrdsum, result.rdsum, result.backrdsum); + copy_v3_v3(rdsum, result.rdsum); + add_v3_v3v3(backrdsum, result.rdsum, result.backrdsum); if(rdsum[0] > 1e-16f) rad[0]= tree->ss[0]->color*rad[0]/rdsum[0]; if(rdsum[1] > 1e-16f) rad[1]= tree->ss[1]->color*rad[1]/rdsum[1]; @@ -761,8 +761,8 @@ ScatterTree *scatter_tree_new(ScatterSettings *ss[3], float scale, float error, INIT_MINMAX(tree->min, tree->max); for(i=0; i<totpoint; i++) { - VECCOPY(points[i].co, co[i]); - VECCOPY(points[i].rad, color[i]); + copy_v3_v3(points[i].co, co[i]); + copy_v3_v3(points[i].rad, color[i]); points[i].area= fabsf(area[i])/(tree->scale*tree->scale); points[i].back= (area[i] < 0.0f); @@ -818,7 +818,7 @@ void scatter_tree_sample(ScatterTree *tree, float *co, float *color) { float sco[3]; - VECCOPY(sco, co); + copy_v3_v3(sco, co); mul_v3_fl(sco, 1.0f/tree->scale); compute_radiance(tree, sco, color); diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c index ed12c08c193..633c7ca1847 100644 --- a/source/blender/render/intern/source/strand.c +++ b/source/blender/render/intern/source/strand.c @@ -98,10 +98,10 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint) t= spoint->t; type= (strandbuf->flag & R_STRAND_BSPLINE)? KEY_BSPLINE: KEY_CARDINAL; - VECCOPY(p[0], sseg->v[0]->co); - VECCOPY(p[1], sseg->v[1]->co); - VECCOPY(p[2], sseg->v[2]->co); - VECCOPY(p[3], sseg->v[3]->co); + copy_v3_v3(p[0], sseg->v[0]->co); + copy_v3_v3(p[1], sseg->v[1]->co); + copy_v3_v3(p[2], sseg->v[2]->co); + copy_v3_v3(p[3], sseg->v[3]->co); if(sseg->obi->flag & R_TRANSFORMED) { mul_m4_v3(sseg->obi->mat, p[0]); @@ -111,7 +111,7 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint) } if(t == 0.0f) { - VECCOPY(spoint->co, p[1]); + copy_v3_v3(spoint->co, p[1]); spoint->strandco= sseg->v[1]->strandco; spoint->dtstrandco= (sseg->v[2]->strandco - sseg->v[0]->strandco); @@ -119,7 +119,7 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint) spoint->dtstrandco *= 0.5f; } else if(t == 1.0f) { - VECCOPY(spoint->co, p[2]); + copy_v3_v3(spoint->co, p[2]); spoint->strandco= sseg->v[2]->strandco; spoint->dtstrandco= (sseg->v[3]->strandco - sseg->v[1]->strandco); @@ -139,12 +139,9 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint) spoint->dtco[1]= data[0]*p[0][1] + data[1]*p[1][1] + data[2]*p[2][1] + data[3]*p[3][1]; spoint->dtco[2]= data[0]*p[0][2] + data[1]*p[1][2] + data[2]*p[2][2] + data[3]*p[3][2]; - VECCOPY(spoint->tan, spoint->dtco); - normalize_v3(spoint->tan); - - VECCOPY(spoint->nor, spoint->co); - VECMUL(spoint->nor, -1.0f); - normalize_v3(spoint->nor); + normalize_v3_v3(spoint->tan, spoint->dtco); + normalize_v3_v3(spoint->nor, spoint->co); + negate_v3(spoint->nor); spoint->width= strand_eval_width(ma, spoint->strandco); @@ -183,7 +180,7 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint) sub_v3_v3v3(spoint->co1, spoint->co, cross); add_v3_v3v3(spoint->co2, spoint->co, cross); - VECCOPY(spoint->dsco, cross); + copy_v3_v3(spoint->dsco, cross); } /* *************** */ @@ -617,10 +614,10 @@ static void do_scanconvert_strand(Render *UNUSED(re), StrandPart *spart, ZSpan * { float jco1[3], jco2[3], jco3[3], jco4[3], jx, jy; - VECCOPY(jco1, co1); - VECCOPY(jco2, co2); - VECCOPY(jco3, co3); - VECCOPY(jco4, co4); + copy_v3_v3(jco1, co1); + copy_v3_v3(jco2, co2); + copy_v3_v3(jco3, co3); + copy_v3_v3(jco4, co4); if(spart->jit) { jx= -spart->jit[sample][0]; @@ -1008,7 +1005,7 @@ StrandSurface *cache_strand_surface(Render *re, ObjectRen *obr, DerivedMesh *dm, mvert= dm->getVertArray(dm); for(a=0; a<mesh->totvert; a++, mvert++) { - VECCOPY(co[a], mvert->co); + copy_v3_v3(co[a], mvert->co); mul_m4_v3(mat, co[a]); } @@ -1047,7 +1044,7 @@ void strand_minmax(StrandRen *strand, float *min, float *max, float width) int a; for(a=0, svert=strand->vert; a<strand->totvert; a++, svert++) { - VECCOPY(vec, svert->co); + copy_v3_v3(vec, svert->co); DO_MINMAX(vec, min, max); if(width!=0.0f) { diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index 850db5a55d4..29eea081672 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -102,8 +102,8 @@ static int point_inside_obi(RayObject *tree, ObjectInstanceRen *UNUSED(obi), flo int final_depth=0, depth=0, limit=20; /* set up the isect */ - VECCOPY(isect.start, co); - VECCOPY(isect.dir, dir); + copy_v3_v3(isect.start, co); + copy_v3_v3(isect.dir, dir); isect.mode= RE_RAY_MIRROR; isect.last_hit= NULL; isect.lay= -1; @@ -623,7 +623,7 @@ static void precache_init_parts(Render *re, RayObject *tree, ShadeInput *shi, Ob copy_v3_v3(pa->bbmin, bbmin); copy_v3_v3(pa->voxel, voxel); - VECCOPY(pa->res, res); + copy_v3_v3_int(pa->res, res); pa->minx = minx; pa->maxx = maxx; pa->miny = miny; pa->maxy = maxy; diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index 90a0fbb697b..ce5561b3e34 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -241,7 +241,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra) size_t i; float *heat; - VECCOPY(vd->resol, smd->domain->res); + copy_v3_v3_int(vd->resol, smd->domain->res); totRes= vd_resol_size(vd); // scaling heat values from -2.0-2.0 to 0.0-1.0 @@ -262,7 +262,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra) size_t i; float *xvel, *yvel, *zvel; - VECCOPY(vd->resol, smd->domain->res); + copy_v3_v3_int(vd->resol, smd->domain->res); totRes= vd_resol_size(vd); // scaling heat values from -2.0-2.0 to 0.0-1.0 @@ -286,7 +286,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra) smoke_turbulence_get_res(smd->domain->wt, vd->resol); density = smoke_turbulence_get_density(smd->domain->wt); } else { - VECCOPY(vd->resol, smd->domain->res); + copy_v3_v3_int(vd->resol, smd->domain->res); density = smoke_get_density(smd->domain->fluid); } diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 7a8779ee969..8b383992e65 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -444,12 +444,12 @@ static void zbuflineAc(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec /* all lines from left to right */ if(vec1[0]<vec2[0]) { - VECCOPY(v1, vec1); - VECCOPY(v2, vec2); + copy_v3_v3(v1, vec1); + copy_v3_v3(v2, vec2); } else { - VECCOPY(v2, vec1); - VECCOPY(v1, vec2); + copy_v3_v3(v2, vec1); + copy_v3_v3(v1, vec2); dx= -dx; dy= -dy; } @@ -512,12 +512,12 @@ static void zbuflineAc(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec /* all lines from top to bottom */ if(vec1[1]<vec2[1]) { - VECCOPY(v1, vec1); - VECCOPY(v2, vec2); + copy_v3_v3(v1, vec1); + copy_v3_v3(v2, vec2); } else { - VECCOPY(v2, vec1); - VECCOPY(v1, vec2); + copy_v3_v3(v2, vec1); + copy_v3_v3(v1, vec2); dx= -dx; dy= -dy; } @@ -598,12 +598,12 @@ static void zbufline(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec2) /* all lines from left to right */ if(vec1[0]<vec2[0]) { - VECCOPY(v1, vec1); - VECCOPY(v2, vec2); + copy_v3_v3(v1, vec1); + copy_v3_v3(v2, vec2); } else { - VECCOPY(v2, vec1); - VECCOPY(v1, vec2); + copy_v3_v3(v2, vec1); + copy_v3_v3(v1, vec2); dx= -dx; dy= -dy; } @@ -656,12 +656,12 @@ static void zbufline(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec2) else { /* all lines from top to bottom */ if(vec1[1]<vec2[1]) { - VECCOPY(v1, vec1); - VECCOPY(v2, vec2); + copy_v3_v3(v1, vec1); + copy_v3_v3(v2, vec2); } else { - VECCOPY(v2, vec1); - VECCOPY(v1, vec2); + copy_v3_v3(v2, vec1); + copy_v3_v3(v1, vec2); dx= -dx; dy= -dy; } @@ -728,12 +728,12 @@ static void zbufline_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), flo /* all lines from left to right */ if(vec1[0]<vec2[0]) { - VECCOPY(v1, vec1); - VECCOPY(v2, vec2); + copy_v3_v3(v1, vec1); + copy_v3_v3(v2, vec2); } else { - VECCOPY(v2, vec1); - VECCOPY(v1, vec2); + copy_v3_v3(v2, vec1); + copy_v3_v3(v1, vec2); dx= -dx; dy= -dy; } @@ -784,12 +784,12 @@ static void zbufline_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), flo else { /* all lines from top to bottom */ if(vec1[1]<vec2[1]) { - VECCOPY(v1, vec1); - VECCOPY(v2, vec2); + copy_v3_v3(v1, vec1); + copy_v3_v3(v2, vec2); } else { - VECCOPY(v2, vec1); - VECCOPY(v1, vec2); + copy_v3_v3(v2, vec1); + copy_v3_v3(v1, vec2); dx= -dx; dy= -dy; } @@ -925,8 +925,8 @@ void zbufclipwire(ZSpan *zspan, int obi, int zvlnr, int ec, float *ho1, float *h else { /* clipping */ if(ec & ME_V1V2) { - QUATCOPY(vez, ho1); - QUATCOPY(vez+4, ho2); + copy_v4_v4(vez, ho1); + copy_v4_v4(vez+4, ho2); if( clipline(vez, vez+4)) { hoco_to_zco(zspan, vez, vez); hoco_to_zco(zspan, vez+4, vez+4); @@ -934,8 +934,8 @@ void zbufclipwire(ZSpan *zspan, int obi, int zvlnr, int ec, float *ho1, float *h } } if(ec & ME_V2V3) { - QUATCOPY(vez, ho2); - QUATCOPY(vez+4, ho3); + copy_v4_v4(vez, ho2); + copy_v4_v4(vez+4, ho3); if( clipline(vez, vez+4)) { hoco_to_zco(zspan, vez, vez); hoco_to_zco(zspan, vez+4, vez+4); @@ -944,8 +944,8 @@ void zbufclipwire(ZSpan *zspan, int obi, int zvlnr, int ec, float *ho1, float *h } if(ho4) { if(ec & ME_V3V4) { - QUATCOPY(vez, ho3); - QUATCOPY(vez+4, ho4); + copy_v4_v4(vez, ho3); + copy_v4_v4(vez+4, ho4); if( clipline(vez, vez+4)) { hoco_to_zco(zspan, vez, vez); hoco_to_zco(zspan, vez+4, vez+4); @@ -953,8 +953,8 @@ void zbufclipwire(ZSpan *zspan, int obi, int zvlnr, int ec, float *ho1, float *h } } if(ec & ME_V4V1) { - QUATCOPY(vez, ho4); - QUATCOPY(vez+4, ho1); + copy_v4_v4(vez, ho4); + copy_v4_v4(vez+4, ho1); if( clipline(vez, vez+4)) { hoco_to_zco(zspan, vez, vez); hoco_to_zco(zspan, vez+4, vez+4); @@ -964,8 +964,8 @@ void zbufclipwire(ZSpan *zspan, int obi, int zvlnr, int ec, float *ho1, float *h } else { if(ec & ME_V3V1) { - QUATCOPY(vez, ho3); - QUATCOPY(vez+4, ho1); + copy_v4_v4(vez, ho3); + copy_v4_v4(vez+4, ho1); if( clipline(vez, vez+4)) { hoco_to_zco(zspan, vez, vez); hoco_to_zco(zspan, vez+4, vez+4); @@ -1748,7 +1748,7 @@ static int zbuf_shadow_project(ZbufProjectCache *cache, int index, float winmat[ int cindex= index & 255; if(cache[cindex].index == index) { - QUATCOPY(ho, cache[cindex].ho); + copy_v4_v4(ho, cache[cindex].ho); return cache[cindex].clip; } else { @@ -1756,7 +1756,7 @@ static int zbuf_shadow_project(ZbufProjectCache *cache, int index, float winmat[ projectvert(co, winmat, ho); clipflag= testclip(ho); - QUATCOPY(cache[cindex].ho, ho); + copy_v4_v4(cache[cindex].ho, ho); cache[cindex].clip= clipflag; cache[cindex].index= index; @@ -1778,13 +1778,13 @@ static int zbuf_part_project(ZbufProjectCache *cache, int index, float winmat[][ int cindex= index & 255; if(cache[cindex].index == index) { - QUATCOPY(ho, cache[cindex].ho); + copy_v4_v4(ho, cache[cindex].ho); return cache[cindex].clip; } else { float wco; int clipflag= 0; - VECCOPY(vec, co) + copy_v3_v3(vec, co); projectvert(co, winmat, ho); wco= ho[3]; @@ -1793,7 +1793,7 @@ static int zbuf_part_project(ZbufProjectCache *cache, int index, float winmat[][ if(ho[1] > bounds[3]*wco) clipflag |= 4; else if(ho[1] < bounds[2]*wco) clipflag |= 8; - QUATCOPY(cache[cindex].ho, ho); + copy_v4_v4(cache[cindex].ho, ho); cache[cindex].clip= clipflag; cache[cindex].index= index; @@ -1801,11 +1801,11 @@ static int zbuf_part_project(ZbufProjectCache *cache, int index, float winmat[][ } } -void zbuf_render_project(float winmat[][4], float *co, float *ho) +void zbuf_render_project(float winmat[][4], const float co[3], float ho[4]) { float vec[3]; - VECCOPY(vec, co) + copy_v3_v3(vec, co); projectvert(vec, winmat, ho); } @@ -3348,7 +3348,7 @@ static int zbuffer_abuf(Render *re, RenderPart *pa, APixstr *APixbuf, ListBase * mul= 0x7FFFFFFF; zval= mul*(1.0f+ho1[2]/ho1[3]); - VECCOPY(vec, v1->co); + copy_v3_v3(vec, v1->co); /* z is negative, otherwise its being clipped */ vec[2]-= ma->zoffs; projectverto(vec, obwinmat, hoco); @@ -3474,7 +3474,7 @@ void add_transp_speed(RenderLayer *rl, int offset, float *speed, float alpha, in if(fp[3]==PASS_VECTOR_MAX) fp[3]= 0.0f; } else if(rdrect==NULL || rdrect[offset]==0 || alpha>0.95f) { - QUATCOPY(fp, speed); + copy_v4_v4(fp, speed); } else { /* add minimum speed in pixel */ @@ -3866,7 +3866,7 @@ static int addtosamp_shr(ShadeResult *samp_shr, ShadeSample *ssamp, int addpassf samp_shr->z= MIN2(samp_shr->z, shr->z); if(addpassflag & SCE_PASS_VECTOR) { - QUATCOPY(samp_shr->winspeed, shr->winspeed); + copy_v4_v4(samp_shr->winspeed, shr->winspeed); } /* optim... */ if(addpassflag & ~(SCE_PASS_VECTOR)) { diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index dbcc478990a..758cf7bd61c 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -166,6 +166,7 @@ typedef struct wmNotifier { #define NC_NODE (17<<24) #define NC_ID (18<<24) #define NC_LOGIC (19<<24) +#define NC_MOVIECLIP (20<<24) /* data type, 256 entries is enough, it can overlap */ #define NOTE_DATA 0x00FF0000 @@ -275,6 +276,7 @@ typedef struct wmNotifier { #define ND_SPACE_SEQUENCER (16<<16) #define ND_SPACE_NODE_VIEW (17<<16) #define ND_SPACE_CHANGED (18<<16) /*sent to a new editor type after it's replaced an old one*/ +#define ND_SPACE_CLIP (19<<16) /* subtype, 256 entries too */ #define NOTE_SUBTYPE 0x0000FF00 diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 83e4681251f..8d7e812a386 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -733,7 +733,7 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re /* send the OnSave event */ for (li= G.main->library.first; li; li= li->id.next) { if (BLI_path_cmp(li->filepath, filepath) == 0) { - BKE_reportf(reports, RPT_ERROR, "Can't overwrite used library '%.200s'", filepath); + BKE_reportf(reports, RPT_ERROR, "Can't overwrite used library '%.240s'", filepath); return -1; } } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 933066513e2..f12dec6459a 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -270,7 +270,7 @@ static int wm_macro_modal(bContext *C, wmOperator *op, wmEvent *event) int retval= OPERATOR_FINISHED; if(opm==NULL) - printf("macro error, calling NULL modal()\n"); + printf("%s: macro error, calling NULL modal()\n", __func__); else { retval = opm->type->modal(C, opm, event); OPERATOR_RETVAL_CHECK(retval); @@ -341,7 +341,7 @@ wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *nam wmOperatorType *ot; if(WM_operatortype_find(idname, TRUE)) { - printf("Macro error: operator %s exists\n", idname); + printf("%s: macro error: operator %s exists\n", __func__, idname); return NULL; } @@ -658,10 +658,11 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) uiLayout *layout; if(prop==NULL) { - printf("WM_menu_invoke: %s has no enum property set\n", op->type->idname); + printf("%s: %s has no enum property set\n", __func__, op->type->idname); } else if (RNA_property_type(prop) != PROP_ENUM) { - printf("WM_menu_invoke: %s \"%s\" is not an enum property\n", op->type->idname, RNA_property_identifier(prop)); + printf("%s: %s \"%s\" is not an enum property\n", + __func__, op->type->idname, RNA_property_identifier(prop)); } else if (RNA_property_is_set(op->ptr, RNA_property_identifier(prop))) { const int retval= op->type->exec(C, op); @@ -686,10 +687,12 @@ static void operator_enum_search_cb(const struct bContext *C, void *arg_ot, cons PropertyRNA *prop= ot->prop; if(prop==NULL) { - printf("WM_enum_search_invoke: %s has no enum property set\n", ot->idname); + printf("%s: %s has no enum property set\n", + __func__, ot->idname); } else if (RNA_property_type(prop) != PROP_ENUM) { - printf("WM_enum_search_invoke: %s \"%s\" is not an enum property\n", ot->idname, RNA_property_identifier(prop)); + printf("%s: %s \"%s\" is not an enum property\n", + __func__, ot->idname, RNA_property_identifier(prop)); } else { PointerRNA ptr; @@ -725,7 +728,7 @@ static void operator_enum_call_cb(struct bContext *C, void *arg1, void *arg2) WM_operator_properties_free(&props_ptr); } else { - printf("operator_enum_call_cb: op->prop for '%s' is NULL\n", ot->idname); + printf("%s: op->prop for '%s' is NULL\n", __func__, ot->idname); } } } @@ -2619,7 +2622,7 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event) memcpy(gesture->customdata, old_lasso, 2*sizeof(short)*gesture->size); gesture->size = gesture->size + WM_LASSO_MIN_POINTS; MEM_freeN(old_lasso); - printf("realloc\n"); + // printf("realloc\n"); } { @@ -3622,6 +3625,7 @@ static void gesture_circle_modal_keymap(wmKeyConfig *keyconf) /* assign map to operators */ WM_modalkeymap_assign(keymap, "VIEW3D_OT_select_circle"); WM_modalkeymap_assign(keymap, "UV_OT_circle_select"); + WM_modalkeymap_assign(keymap, "CLIP_OT_select_circle"); } @@ -3701,6 +3705,7 @@ static void gesture_border_modal_keymap(wmKeyConfig *keyconf) WM_modalkeymap_assign(keymap, "SEQUENCER_OT_select_border"); WM_modalkeymap_assign(keymap, "SEQUENCER_OT_view_ghost_border"); WM_modalkeymap_assign(keymap, "UV_OT_select_border"); + WM_modalkeymap_assign(keymap, "CLIP_OT_select_border"); WM_modalkeymap_assign(keymap, "VIEW2D_OT_zoom_border"); WM_modalkeymap_assign(keymap, "VIEW3D_OT_clip_border"); WM_modalkeymap_assign(keymap, "VIEW3D_OT_render_border"); diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt index 701ad244fc1..3c93d718bb3 100644 --- a/source/blenderplayer/CMakeLists.txt +++ b/source/blenderplayer/CMakeLists.txt @@ -166,6 +166,12 @@ endif() list(APPEND BLENDER_SORTED_LIBS extern_colamd) + if(WITH_LIBMV) + list(APPEND BLENDER_SORTED_LIBS extern_libmv) + endif() + + list(APPEND BLENDER_SORTED_LIBS extern_colamd) + if(WITH_MOD_DECIMATE) list(APPEND BLENDER_SORTED_LIBS bf_intern_decimate) endif() diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 174c24b819e..cab22ccd3ab 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -198,6 +198,7 @@ void ED_space_image_paint_update(struct wmWindowManager *wm, struct ToolSettings void ED_space_image_set(struct bContext *C, struct SpaceImage *sima, struct Scene *scene, struct Object *obedit, struct Image *ima){} struct ImBuf *ED_space_image_buffer(struct SpaceImage *sima){return (struct ImBuf *) NULL;} void ED_screen_set_scene(struct bContext *C, struct Scene *scene){} +void ED_space_clip_set(struct bContext *C, struct SpaceClip *sc, struct MovieClip *clip){} void ED_area_tag_redraw_regiontype(struct ScrArea *sa, int regiontype){} void ED_render_engine_changed(struct Main *bmain) {} @@ -255,6 +256,7 @@ void ED_view3d_scene_layers_update(struct Main *bmain, struct Scene *scene){} int ED_view3d_scene_layer_set(int lay, const int *values){return 0;} void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar){} void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist){} +struct BGpic *ED_view3D_background_image_add(struct View3D *v3d){return (struct BGpic *) NULL;} void view3d_apply_mat4(float mat[][4], float *ofs, float *quat, float *dist){} int text_file_modified(struct Text *text){return 0;} void ED_node_shader_default(struct Material *ma){} @@ -373,6 +375,9 @@ void uiTemplateReportsBanner(struct uiLayout *layout, struct bContext *C, struct void uiTemplateWaveform(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand){} void uiTemplateVectorscope(struct uiLayout *_self, struct PointerRNA *data, char* property, int expand){} void uiTemplateKeymapItemProperties(struct uiLayout *layout, struct PointerRNA *ptr){} +void uiTemplateMovieClip(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, int compact){} +void uiTemplateTrack(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname){} +void uiTemplateMarker(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname, PointerRNA *userptr, PointerRNA *trackptr, int compact){} /* rna render */ struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h){return (struct RenderResult *) NULL;} diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 867ea37e0a1..b0e5427500b 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -68,6 +68,11 @@ if(WITH_IMAGE_HDR) add_definitions(-DWITH_HDR) endif() +if(WITH_LIBMV) + blender_include_dirs(../../extern/libmv) + add_definitions(-DWITH_LIBMV) +endif() + if(WITH_PYTHON) blender_include_dirs(../blender/python) add_definitions(-DWITH_PYTHON) @@ -570,6 +575,14 @@ elseif(WIN32) DESTINATION ${TARGETDIR} ) + if(WITH_OPENIMAGEIO) + install( + FILES + ${LIBDIR}/openimageio/bin/OpenImageIO.dll + DESTINATION ${TARGETDIR} + ) + endif() + elseif(APPLE) set(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app) set(SOURCEINFO ${SOURCEDIR}/Contents/Info.plist) @@ -715,6 +728,9 @@ elseif(APPLE) endif() endif() +# install more files specified elsewhere +delayed_do_install(${TARGETDIR_VER}) + unset(BLENDER_TEXT_FILES) @@ -758,6 +774,7 @@ endif() bf_editor_space_time bf_editor_space_userpref bf_editor_space_view3d + bf_editor_space_clip bf_editor_text bf_editor_transform @@ -815,6 +832,7 @@ endif() extern_minilzo extern_lzma extern_colamd + extern_libmv ge_logic_ketsji extern_recastnavigation ge_phys_common @@ -838,6 +856,10 @@ endif() bf_intern_mikktspace ) + if(WITH_LIBMV) + list(APPEND BLENDER_SORTED_LIBS extern_libmv) + endif() + if(WITH_MOD_CLOTH_ELTOPO) list(APPEND BLENDER_SORTED_LIBS extern_eltopo) endif() diff --git a/source/creator/creator.c b/source/creator/creator.c index 39ea82f141f..1f6f4d85f43 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -120,6 +120,10 @@ #include "binreloc.h" #endif +#ifdef WITH_LIBMV +#include "libmv-capi.h" +#endif + // from buildinfo.c #ifdef BUILD_DATE extern char build_date[]; @@ -352,6 +356,10 @@ static int debug_mode(int UNUSED(argc), const char **UNUSED(argv), void *data) printf("Build: %s %s %s %s\n", build_date, build_time, build_platform, build_type); #endif // WITH_BUILDINFO +#ifdef WITH_LIBMV + libmv_startDebugLogging(); +#endif + BLI_argsPrint(data); return 0; } @@ -1132,6 +1140,10 @@ int main(int argc, const char **argv) br_init( NULL ); #endif +#ifdef WITH_LIBMV + libmv_initLogging(argv[0]); +#endif + setCallbacks(); #ifdef __APPLE__ /* patch to ignore argument finder gives us (pid?) */ diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index a6d02db8cea..abc45293542 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -445,9 +445,9 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, pchan= get_pose_channel(m_userpose, string); // adds the channel if its not there. if(pchan) { - VECCOPY (pchan->loc, matrix[3]); - mat4_to_size( pchan->size,matrix); - mat4_to_quat( pchan->quat,matrix); + copy_v3_v3(pchan->loc, matrix[3]); + mat4_to_size(pchan->size, matrix); + mat4_to_quat(pchan->quat, matrix); } } else { diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index 2fb774dad44..29300281bb5 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -40,7 +40,7 @@ class BL_ActionActuator : public SCA_IActuator { public: - Py_Header; + Py_Header BL_ActionActuator(SCA_IObject* gameobj, const STR_String& propname, const STR_String& framepropname, @@ -70,8 +70,8 @@ public: #ifdef WITH_PYTHON - KX_PYMETHOD_O(BL_ActionActuator,GetChannel); - KX_PYMETHOD_DOC(BL_ActionActuator,setChannel); + KX_PYMETHOD_O(BL_ActionActuator,GetChannel) + KX_PYMETHOD_DOC(BL_ActionActuator,setChannel) static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Converter/BL_ArmatureActuator.h b/source/gameengine/Converter/BL_ArmatureActuator.h index 8390444613c..344b76ec278 100644 --- a/source/gameengine/Converter/BL_ArmatureActuator.h +++ b/source/gameengine/Converter/BL_ArmatureActuator.h @@ -46,7 +46,7 @@ class BL_ArmatureActuator : public SCA_IActuator { - Py_Header; + Py_Header public: BL_ArmatureActuator(SCA_IObject* gameobj, int type, diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.h b/source/gameengine/Converter/BL_ArmatureConstraint.h index 49a331e78a5..2abb36ff937 100644 --- a/source/gameengine/Converter/BL_ArmatureConstraint.h +++ b/source/gameengine/Converter/BL_ArmatureConstraint.h @@ -52,7 +52,7 @@ struct bPose; */ class BL_ArmatureConstraint : public PyObjectPlus { - Py_Header; + Py_Header private: struct bConstraint* m_constraint; diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index 836cfab6b49..5a44e1022ff 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -162,8 +162,8 @@ void game_blend_poses(bPose *dst, bPose *src, float srcweight/*, short mode*/) if (schan->rotmode == ROT_MODE_QUAT) { float dquat[4], squat[4]; - QUATCOPY(dquat, dchan->quat); - QUATCOPY(squat, schan->quat); + copy_qt_qt(dquat, dchan->quat); + copy_qt_qt(squat, schan->quat); if (mode==ACTSTRIPMODE_BLEND) interp_qt_qtqt(dchan->quat, dquat, squat, srcweight); else { diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h index 9847558f708..745ffac0cb2 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.h +++ b/source/gameengine/Converter/BL_ArmatureObject.h @@ -51,7 +51,7 @@ class KX_BlenderSceneConverter; class BL_ArmatureObject : public KX_GameObject { - Py_Header; + Py_Header public: double GetLastFrame (); diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h index c4251b3c503..90f44acb672 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.h +++ b/source/gameengine/Converter/BL_ShapeActionActuator.h @@ -42,7 +42,7 @@ struct Key; class BL_ShapeActionActuator : public SCA_IActuator { public: - Py_Header; + Py_Header BL_ShapeActionActuator(SCA_IObject* gameobj, const STR_String& propname, const STR_String& framepropname, diff --git a/source/gameengine/Expressions/Expression.h b/source/gameengine/Expressions/Expression.h index 875bd758b68..b9232477c34 100644 --- a/source/gameengine/Expressions/Expression.h +++ b/source/gameengine/Expressions/Expression.h @@ -24,19 +24,25 @@ //extern int gRefCountExpr; // only for debugging purposes (detect mem.leaks) -#define PLUGIN_DECLARE_SERIAL_EXPRESSION(class_name,base_class_name) \ -public: \ - virtual base_class_name * Copy() { return new class_name; } \ - virtual bool EdSerialize(CompressorArchive& arch,class CFactoryManager* facmgr,bool bIsStoring); \ - virtual bool EdIdSerialize(CompressorArchive& arch,class CFactoryManager* facmgr,bool bIsStoring) \ -{ \ - if (bIsStoring) \ - { \ - unsigned char exprID = GetExpressionID(); \ - arch << exprID; \ - } \ - return true; \ -} \ +#define PLUGIN_DECLARE_SERIAL_EXPRESSION(class_name, base_class_name) \ +public: \ + virtual base_class_name * Copy() { \ + return new class_name; \ + } \ + virtual bool EdSerialize(CompressorArchive& arch, \ + class CFactoryManager* facmgr, \ + bool bIsStoring); \ + virtual bool EdIdSerialize(CompressorArchive& arch, \ + class CFactoryManager* facmgr, \ + bool bIsStoring) \ + { \ + if (bIsStoring) \ + { \ + unsigned char exprID = GetExpressionID(); \ + arch << exprID; \ + } \ + return true; \ + } \ diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h index 76451215f82..26c11cccc7a 100644 --- a/source/gameengine/Expressions/ListValue.h +++ b/source/gameengine/Expressions/ListValue.h @@ -23,7 +23,7 @@ class CListValue : public CPropValue { - Py_Header; + Py_Header //PLUGIN_DECLARE_SERIAL (CListValue,CValue) public: @@ -58,7 +58,7 @@ public: void Resize(int num); void SetValue(int i,CValue* val); CValue* GetValue(int i){ assertd(i < m_pValueArray.size()); return m_pValueArray[i];} - int GetCount() { return m_pValueArray.size();}; + int GetCount() { return m_pValueArray.size(); } virtual const STR_String & GetText(); bool CheckEqual(CValue* first,CValue* second); diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 87f776a726e..f263bf15f02 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -470,7 +470,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * case KX_PYATTRIBUTE_TYPE_STRING: { STR_String *val = reinterpret_cast<STR_String*>(ptr); - return PyUnicode_FromString(*val); + return PyUnicode_From_STR_String(*val); } case KX_PYATTRIBUTE_TYPE_CHAR: { @@ -1171,6 +1171,11 @@ PyObject *PyObjectPlus::NewProxyPlus_Ext(PyObjectPlus *self, PyTypeObject *tp, v return self->m_proxy; } +PyObject *PyUnicode_From_STR_String(const STR_String& str) +{ + return PyUnicode_FromStringAndSize(str.ReadPtr(), str.Length()); +} + /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// /* deprecation warning management */ diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index f7bd1b91466..3e1c54b0cc7 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -29,11 +29,12 @@ * \ingroup expressions */ +#ifndef _PY_OBJECT_PLUS_H +#define _PY_OBJECT_PLUS_H + /* for now keep weakrefs optional */ #define USE_WEAKREFS -#ifndef _adr_py_lib_h_ // only process once, -#define _adr_py_lib_h_ // even if multiply included #ifndef __cplusplus // c++ only #error Must be compiled with C++ @@ -45,10 +46,6 @@ #include "SG_QList.h" #include <stddef.h> -/*------------------------------ - * Python defines -------------------------------*/ - #ifdef WITH_PYTHON #ifdef USE_MATHUTILS extern "C" { @@ -110,7 +107,7 @@ typedef struct PyObjectPlus_Proxy { #define BGE_PROXY_PYOWNS(_self) (((PyObjectPlus_Proxy *)_self)->py_owns) #define BGE_PROXY_PYREF(_self) (((PyObjectPlus_Proxy *)_self)->py_ref) #ifdef USE_WEAKREFS - #define BGE_PROXY_WKREF(_self) (((PyObjectPlus_Proxy *)_self)->in_weakreflist) +# define BGE_PROXY_WKREF(_self) (((PyObjectPlus_Proxy *)_self)->in_weakreflist) #endif /* Note, sometimes we dont care what BGE type this is as long as its a proxy */ @@ -124,45 +121,61 @@ typedef struct PyObjectPlus_Proxy { // PyC++ class // AttributesPtr correspond to attributes of proxy generic pointer // each PyC++ class must be registered in KX_PythonInitTypes.cpp -#define __Py_Header \ - public: \ - static PyTypeObject Type; \ - static PyMethodDef Methods[]; \ - static PyAttributeDef Attributes[]; \ - virtual PyTypeObject *GetType(void) {return &Type;}; \ - virtual PyObject *GetProxy() {return GetProxyPlus_Ext(this, &Type, NULL);}; \ - virtual PyObject *NewProxy(bool py_owns) {return NewProxyPlus_Ext(this, &Type, NULL, py_owns);}; \ +#define __Py_Header \ +public: \ + static PyTypeObject Type; \ + static PyMethodDef Methods[]; \ + static PyAttributeDef Attributes[]; \ + virtual PyTypeObject *GetType(void) { \ + return &Type; \ + } \ + virtual PyObject *GetProxy() { \ + return GetProxyPlus_Ext(this, &Type, NULL); \ + } \ + virtual PyObject *NewProxy(bool py_owns) { \ + return NewProxyPlus_Ext(this, &Type, NULL, py_owns); \ + } \ // leave above line empty (macro)! // use this macro for class that use generic pointer in proxy // GetProxy() and NewProxy() must be defined to set the correct pointer in the proxy -#define __Py_HeaderPtr \ - public: \ - static PyTypeObject Type; \ - static PyMethodDef Methods[]; \ - static PyAttributeDef Attributes[]; \ - static PyAttributeDef AttributesPtr[]; \ - virtual PyTypeObject *GetType(void) {return &Type;}; \ - virtual PyObject *GetProxy(); \ - virtual PyObject *NewProxy(bool py_owns); \ +#define __Py_HeaderPtr \ +public: \ + static PyTypeObject Type; \ + static PyMethodDef Methods[]; \ + static PyAttributeDef Attributes[]; \ + static PyAttributeDef AttributesPtr[]; \ + virtual PyTypeObject *GetType(void) { \ + return &Type; \ + } \ + virtual PyObject *GetProxy(); \ + virtual PyObject *NewProxy(bool py_owns); \ // leave above line empty (macro)! #ifdef WITH_CXX_GUARDEDALLOC -#define Py_Header __Py_Header \ - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, Type.tp_name); } \ - void operator delete(void *mem) { MEM_freeN(mem); } \ +#define Py_Header __Py_Header \ + void *operator new(size_t num_bytes) { \ + return MEM_mallocN(num_bytes, Type.tp_name); \ + } \ + void operator delete(void *mem) { \ + MEM_freeN(mem); \ + } \ #else -#define Py_Header __Py_Header +# define Py_Header __Py_Header #endif #ifdef WITH_CXX_GUARDEDALLOC -#define Py_HeaderPtr __Py_HeaderPtr \ - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, Type.tp_name); } \ - void operator delete( void *mem ) { MEM_freeN(mem); } \ +#define Py_HeaderPtr __Py_HeaderPtr \ + void *operator new(size_t num_bytes) { \ + return MEM_mallocN(num_bytes, Type.tp_name); \ + } \ + void operator delete( void *mem ) { \ + MEM_freeN(mem); \ + } \ #else -#define Py_HeaderPtr __Py_HeaderPtr +# define Py_HeaderPtr __Py_HeaderPtr #endif /* @@ -180,65 +193,109 @@ typedef struct PyObjectPlus_Proxy { * These macros are helpfull when embedding Python routines. The second * macro is one that also requires a documentation string */ -#define KX_PYMETHOD(class_name, method_name) \ - PyObject* Py##method_name(PyObject* args, PyObject* kwds); \ - static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \ - return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \ - }; \ - -#define KX_PYMETHOD_VARARGS(class_name, method_name) \ - PyObject* Py##method_name(PyObject* args); \ - static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \ - return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \ - }; \ - -#define KX_PYMETHOD_NOARGS(class_name, method_name) \ - PyObject* Py##method_name(); \ - static PyObject* sPy##method_name( PyObject* self) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \ - return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \ - }; \ - -#define KX_PYMETHOD_O(class_name, method_name) \ - PyObject* Py##method_name(PyObject* value); \ - static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(value) - " BGE_PROXY_ERROR_MSG); return NULL; } \ - return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \ - }; \ - -#define KX_PYMETHOD_DOC(class_name, method_name) \ - PyObject* Py##method_name(PyObject* args, PyObject* kwds); \ - static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(...) - " BGE_PROXY_ERROR_MSG); return NULL; } \ - return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \ - }; \ - static const char method_name##_doc[]; \ - -#define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \ - PyObject* Py##method_name(PyObject* args); \ - static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(...) - " BGE_PROXY_ERROR_MSG); return NULL; } \ - return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \ - }; \ - static const char method_name##_doc[]; \ - -#define KX_PYMETHOD_DOC_O(class_name, method_name) \ - PyObject* Py##method_name(PyObject* value); \ - static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(value) - " BGE_PROXY_ERROR_MSG); return NULL; } \ - return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \ - }; \ - static const char method_name##_doc[]; \ - -#define KX_PYMETHOD_DOC_NOARGS(class_name, method_name) \ - PyObject* Py##method_name(); \ - static PyObject* sPy##method_name( PyObject* self) { \ - if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \ - return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \ - }; \ - static const char method_name##_doc[]; \ +#define KX_PYMETHOD(class_name, method_name) \ + PyObject* Py##method_name(PyObject* args, PyObject* kwds); \ + static PyObject* \ + sPy##method_name(PyObject* self, PyObject* args, PyObject* kwds) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "() - " \ + BGE_PROXY_ERROR_MSG); \ + return NULL; \ + } \ + return((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \ + } \ + +#define KX_PYMETHOD_VARARGS(class_name, method_name) \ + PyObject* Py##method_name(PyObject* args); \ + static PyObject* \ + sPy##method_name(PyObject* self, PyObject* args) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "() - " \ + BGE_PROXY_ERROR_MSG); return NULL; \ + } \ + return((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \ + } \ + +#define KX_PYMETHOD_NOARGS(class_name, method_name) \ + PyObject* Py##method_name(); \ + static PyObject* \ + sPy##method_name(PyObject* self) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "() - " \ + BGE_PROXY_ERROR_MSG); return NULL; \ + } \ + return((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \ + } \ + +#define KX_PYMETHOD_O(class_name, method_name) \ + PyObject* Py##method_name(PyObject* value); \ + static PyObject* \ + sPy##method_name(PyObject* self, PyObject* value) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "(value) - " \ + BGE_PROXY_ERROR_MSG); return NULL; \ + } \ + return((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \ + } \ + +#define KX_PYMETHOD_DOC(class_name, method_name) \ + PyObject* Py##method_name(PyObject* args, PyObject* kwds); \ + static PyObject* \ + sPy##method_name(PyObject* self, PyObject* args, PyObject* kwds) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "(...) - " \ + BGE_PROXY_ERROR_MSG); return NULL; \ + } \ + return((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \ + } \ + static const char method_name##_doc[]; \ + +#define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \ + PyObject* Py##method_name(PyObject* args); \ + static PyObject* \ + sPy##method_name(PyObject* self, PyObject* args) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "(...) - " \ + BGE_PROXY_ERROR_MSG); \ + return NULL; \ + } \ + return((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \ + } \ + static const char method_name##_doc[]; \ + +#define KX_PYMETHOD_DOC_O(class_name, method_name) \ + PyObject* Py##method_name(PyObject* value); \ + static PyObject* \ + sPy##method_name(PyObject* self, PyObject* value) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "(value) - " \ + BGE_PROXY_ERROR_MSG); \ + return NULL; \ + } \ + return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \ + } \ + static const char method_name##_doc[]; \ + +#define KX_PYMETHOD_DOC_NOARGS(class_name, method_name) \ + PyObject* Py##method_name(); \ + static PyObject* \ + sPy##method_name(PyObject* self) { \ + if(BGE_PROXY_REF(self)==NULL) { \ + PyErr_SetString(PyExc_RuntimeError, \ + #class_name "." #method_name "() - " \ + BGE_PROXY_ERROR_MSG); \ + return NULL; \ + } \ + return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \ + } \ + static const char method_name##_doc[]; \ /* The line above should remain empty */ @@ -290,7 +347,7 @@ enum KX_PYATTRIBUTE_TYPE { KX_PYATTRIBUTE_TYPE_FUNCTION, KX_PYATTRIBUTE_TYPE_VECTOR, KX_PYATTRIBUTE_TYPE_FLAG, - KX_PYATTRIBUTE_TYPE_CHAR, + KX_PYATTRIBUTE_TYPE_CHAR }; enum KX_PYATTRIBUTE_ACCESS { @@ -479,23 +536,31 @@ typedef PyTypeObject * PyParentObject; // Define the PyParent Object #else // WITH_PYTHON #ifdef WITH_CXX_GUARDEDALLOC -#define Py_Header \ - public: \ - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PyObjectPlus"); } \ - void operator delete( void *mem ) { MEM_freeN(mem); } \ +#define Py_Header \ +public: \ + void *operator new(size_t num_bytes) { \ + return MEM_mallocN(num_bytes, "GE:PyObjectPlus"); \ + } \ + void operator delete( void *mem ) { \ + MEM_freeN(mem); \ + } \ -#define Py_HeaderPtr \ - public: \ - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PyObjectPlusPtr"); } \ - void operator delete( void *mem ) { MEM_freeN(mem); } \ +#define Py_HeaderPtr \ +public: \ + void *operator new(size_t num_bytes) { \ + return MEM_mallocN(num_bytes, "GE:PyObjectPlusPtr"); \ + } \ + void operator delete( void *mem ) { \ + MEM_freeN(mem); \ + } \ #else // WITH_CXX_GUARDEDALLOC #define Py_Header \ - public: \ +public: \ #define Py_HeaderPtr \ - public: \ +public: \ #endif // WITH_CXX_GUARDEDALLOC @@ -515,7 +580,7 @@ typedef PyTypeObject * PyParentObject; // Define the PyParent Object // possibility to use them at SCA_ILogicBrick, CValue and PyObjectPlus level. class PyObjectPlus : public SG_QList { // The PyObjectPlus abstract class - Py_Header; // Always start with Py_Header + Py_Header // Always start with Py_Header public: PyObjectPlus(); @@ -580,6 +645,8 @@ public: #ifdef WITH_PYTHON PyObject *py_getattr_dict(PyObject *pydict, PyObject *tp_dict); + +PyObject *PyUnicode_From_STR_String(const STR_String& str); #endif -#endif // _adr_py_lib_h_ +#endif // _PY_OBJECT_PLUS_H diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 41c0850a779..91fdbb0dabc 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -532,7 +532,7 @@ PyAttributeDef CValue::Attributes[] = { PyObject * CValue::pyattr_get_name(void * self_v, const KX_PYATTRIBUTE_DEF * attrdef) { CValue * self = static_cast<CValue *> (self_v); - return PyUnicode_FromString(self->GetName()); + return PyUnicode_From_STR_String(self->GetName()); } CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) @@ -596,22 +596,24 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) } -PyObject* CValue::ConvertKeysToPython( void ) +PyObject* CValue::ConvertKeysToPython(void) { - PyObject *pylist = PyList_New( 0 ); - PyObject *pystr; - if (m_pNamedPropertyArray) { + PyObject *pylist= PyList_New(m_pNamedPropertyArray->size()); + Py_ssize_t i= 0; + std::map<STR_String,CValue*>::iterator it; for (it= m_pNamedPropertyArray->begin(); (it != m_pNamedPropertyArray->end()); it++) { - pystr = PyUnicode_FromString( (*it).first ); - PyList_Append(pylist, pystr); - Py_DECREF( pystr ); + PyList_SET_ITEM(pylist, i++, PyUnicode_From_STR_String((*it).first)); } + + return pylist; + } + else { + return PyList_New(0); } - return pylist; } #endif // WITH_PYTHON diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 955e688ad7b..f9697a55d3f 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -200,7 +200,7 @@ public: class CValue : public PyObjectPlus { -Py_Header; +Py_Header public: enum AllocationTYPE { STACKVALUE = 0, @@ -319,7 +319,7 @@ public: virtual const STR_String & GetText() = 0; virtual double GetNumber() = 0; - double* ZeroVector() { return m_sZeroVec; }; + double* ZeroVector() { return m_sZeroVec; } virtual double* GetVector3(bool bGetTransformedVec = false); virtual STR_String& GetName() = 0; // Retrieve the name of the value @@ -348,11 +348,11 @@ public: virtual bool IsSelected() { return m_ValFlags.Selected; } inline bool IsReleaseRequested() { return m_ValFlags.ReleaseRequested; } virtual bool IsVisible() { return m_ValFlags.Visible;} - virtual void SetCustomFlag1(bool bCustomFlag) { m_ValFlags.CustomFlag1 = bCustomFlag;}; - virtual bool IsCustomFlag1() { return m_ValFlags.CustomFlag1;}; + virtual void SetCustomFlag1(bool bCustomFlag) { m_ValFlags.CustomFlag1 = bCustomFlag;} + virtual bool IsCustomFlag1() { return m_ValFlags.CustomFlag1;} - virtual void SetCustomFlag2(bool bCustomFlag) { m_ValFlags.CustomFlag2 = bCustomFlag;}; - virtual bool IsCustomFlag2() { return m_ValFlags.CustomFlag2;}; + virtual void SetCustomFlag2(bool bCustomFlag) { m_ValFlags.CustomFlag2 = bCustomFlag;} + virtual bool IsCustomFlag2() { return m_ValFlags.CustomFlag2;} protected: virtual void DisableRefCount(); // Disable reference counting for this value @@ -379,18 +379,23 @@ private: // of object. So, for *any* CValue-derived object this should be set to CValue, // for *any* CExpression-derived object this should be set to CExpression. // -#define PLUGIN_DECLARE_SERIAL(class_name, root_base_class_name) \ -public: \ - virtual root_base_class_name * Copy() { return new class_name; } \ - virtual bool EdSerialize(CompressorArchive& arch,class CFactoryManager* facmgr,bool bIsStoring); \ - virtual bool EdIdSerialize(CompressorArchive& arch,class CFactoryManager* facmgr,bool bIsStoring) \ -{ \ - if (bIsStoring) \ - arch.StoreString(#class_name); \ - \ - return false; \ -} \ - +#define PLUGIN_DECLARE_SERIAL(class_name, root_base_class_name) \ +public: \ + virtual root_base_class_name *Copy() { \ + return new class_name; \ + } \ + virtual bool EdSerialize(CompressorArchive& arch, \ + class CFactoryManager* facmgr, \ + bool bIsStoring); \ + virtual bool EdIdSerialize(CompressorArchive& arch, \ + class CFactoryManager* facmgr, \ + bool bIsStoring) \ + { \ + if (bIsStoring) \ + arch.StoreString(#class_name); \ + return false; \ + } \ + //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -424,7 +429,7 @@ public: //if (namefromprop.Length() > 0) // return namefromprop; return m_strNewName; - }; // name of Value + } // name of Value protected: STR_String m_strNewName; // Identification diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.h b/source/gameengine/GameLogic/SCA_2DFilterActuator.h index ec4c4a1cbcf..42446b7a2b1 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.h +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.h @@ -37,7 +37,7 @@ class SCA_2DFilterActuator : public SCA_IActuator { - Py_Header; + Py_Header private: vector<STR_String> m_propNames; diff --git a/source/gameengine/GameLogic/SCA_ANDController.h b/source/gameengine/GameLogic/SCA_ANDController.h index e39dea547a2..363bca630aa 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.h +++ b/source/gameengine/GameLogic/SCA_ANDController.h @@ -39,7 +39,7 @@ class SCA_ANDController : public SCA_IController { - Py_Header; + Py_Header //virtual void Trigger(class SCA_LogicManager* logicmgr); public: SCA_ANDController(SCA_IObject* gameobj); diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.h b/source/gameengine/GameLogic/SCA_ActuatorSensor.h index 9b5793787a2..e7a7525bb40 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.h +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.h @@ -40,7 +40,7 @@ class SCA_ActuatorSensor : public SCA_ISensor { - Py_Header; + Py_Header STR_String m_checkactname; bool m_lastresult; bool m_midresult; diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.h b/source/gameengine/GameLogic/SCA_AlwaysSensor.h index 41e9a9612c6..8748793d9a3 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.h +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.h @@ -38,7 +38,7 @@ class SCA_AlwaysSensor : public SCA_ISensor { - Py_Header; + Py_Header bool m_alwaysresult; public: SCA_AlwaysSensor(class SCA_EventManager* eventmgr, diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.h b/source/gameengine/GameLogic/SCA_DelaySensor.h index fea713502b4..ccb8f00c548 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.h +++ b/source/gameengine/GameLogic/SCA_DelaySensor.h @@ -38,7 +38,7 @@ class SCA_DelaySensor : public SCA_ISensor { - Py_Header; + Py_Header bool m_lastResult; bool m_repeat; int m_delay; diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.h b/source/gameengine/GameLogic/SCA_ExpressionController.h index 4e549c08ed1..93a3f08c95f 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.h +++ b/source/gameengine/GameLogic/SCA_ExpressionController.h @@ -39,7 +39,7 @@ class SCA_ExpressionController : public SCA_IController { -// Py_Header; +// Py_Header STR_String m_exprText; CExpression* m_exprCache; diff --git a/source/gameengine/GameLogic/SCA_IController.h b/source/gameengine/GameLogic/SCA_IController.h index 795e02dcf78..5481f2ae8e4 100644 --- a/source/gameengine/GameLogic/SCA_IController.h +++ b/source/gameengine/GameLogic/SCA_IController.h @@ -42,7 +42,7 @@ */ class SCA_IController : public SCA_ILogicBrick { - Py_Header; + Py_Header protected: std::vector<class SCA_ISensor*> m_linkedsensors; std::vector<class SCA_IActuator*> m_linkedactuators; diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index 4016c557bf3..87b37a8ef39 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -43,7 +43,7 @@ class SCA_IScene; class SCA_ILogicBrick : public CValue { - Py_Header; + Py_Header protected: SCA_IObject* m_gameobj; int m_Execute_Priority; diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h index 1d16d4f0af7..b0a03de1242 100644 --- a/source/gameengine/GameLogic/SCA_IObject.h +++ b/source/gameengine/GameLogic/SCA_IObject.h @@ -54,7 +54,7 @@ typedef std::vector<SCA_IObject *> SCA_ObjectList; class SCA_IObject : public CValue { - Py_Header; + Py_Header protected: friend class KX_StateActuator; diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index 970faf7d29a..ef082095c0d 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -47,7 +47,7 @@ */ class SCA_ISensor : public SCA_ILogicBrick { - Py_Header; + Py_Header protected: class SCA_EventManager* m_eventmgr; diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h index b4ed2c06d2f..db34ce4cc15 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.h +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h @@ -38,7 +38,7 @@ class SCA_JoystickSensor :public SCA_ISensor { - Py_Header; + Py_Header /** * Axis 1-JOYAXIS_MAX, MUST be followed by m_axisf @@ -128,8 +128,8 @@ public: /* --------------------------------------------------------------------- */ /* Joystick Index */ - KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButtonActiveList); - KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,GetButtonStatus); + KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButtonActiveList) + KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,GetButtonStatus) static PyObject* pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index 37a42cdcbe6..e7283978ae1 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -44,7 +44,7 @@ * exclusive. */ class SCA_KeyboardSensor : public SCA_ISensor { - Py_Header; + Py_Header /** * the key this sensor is sensing for diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.h b/source/gameengine/GameLogic/SCA_MouseSensor.h index ecfa776112a..4bac9c10e13 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.h +++ b/source/gameengine/GameLogic/SCA_MouseSensor.h @@ -39,7 +39,7 @@ class SCA_MouseSensor : public SCA_ISensor { - Py_Header; + Py_Header /** * Use SCA_IInputDevice values to encode the mouse mode for now. diff --git a/source/gameengine/GameLogic/SCA_NANDController.h b/source/gameengine/GameLogic/SCA_NANDController.h index 8eb26127a51..723d2a5fe0d 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.h +++ b/source/gameengine/GameLogic/SCA_NANDController.h @@ -36,7 +36,7 @@ class SCA_NANDController : public SCA_IController { - Py_Header; + Py_Header //virtual void Trigger(class SCA_LogicManager* logicmgr); public: SCA_NANDController(SCA_IObject* gameobj); diff --git a/source/gameengine/GameLogic/SCA_NORController.h b/source/gameengine/GameLogic/SCA_NORController.h index 6580ad7bc8c..26d7e925923 100644 --- a/source/gameengine/GameLogic/SCA_NORController.h +++ b/source/gameengine/GameLogic/SCA_NORController.h @@ -36,7 +36,7 @@ class SCA_NORController : public SCA_IController { - Py_Header; + Py_Header //virtual void Trigger(class SCA_LogicManager* logicmgr); public: SCA_NORController(SCA_IObject* gameobj); diff --git a/source/gameengine/GameLogic/SCA_ORController.h b/source/gameengine/GameLogic/SCA_ORController.h index 4edd34f6302..53debf894a3 100644 --- a/source/gameengine/GameLogic/SCA_ORController.h +++ b/source/gameengine/GameLogic/SCA_ORController.h @@ -36,7 +36,7 @@ class SCA_ORController : public SCA_IController { - Py_Header; + Py_Header //virtual void Trigger(class SCA_LogicManager* logicmgr); public: SCA_ORController(SCA_IObject* gameobj); diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.h b/source/gameengine/GameLogic/SCA_PropertyActuator.h index f4a43a7e21c..17419e34c2a 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.h +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.h @@ -36,7 +36,7 @@ class SCA_PropertyActuator : public SCA_IActuator { - Py_Header; + Py_Header enum KX_ACT_PROP_MODE { KX_ACT_PROP_NODEF = 0, diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.h b/source/gameengine/GameLogic/SCA_PropertySensor.h index c1fe5320546..bf7b1e879f7 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.h +++ b/source/gameengine/GameLogic/SCA_PropertySensor.h @@ -37,7 +37,7 @@ class SCA_PropertySensor : public SCA_ISensor { - Py_Header; + Py_Header //class CExpression* m_rightexpr; int m_checktype; STR_String m_checkpropval; diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index d69358928e6..8a87a734a1c 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -164,7 +164,7 @@ void SCA_PythonController::SetNamespace(PyObject* pythondictionary) /* Without __file__ set the sys.argv[0] is used for the filename * which ends up with lines from the blender binary being printed in the console */ - PyDict_SetItemString(m_pythondictionary, "__file__", PyUnicode_FromString(m_scriptName.Ptr())); + PyDict_SetItemString(m_pythondictionary, "__file__", PyUnicode_From_STR_String(m_scriptName)); } #endif @@ -490,7 +490,7 @@ PyObject* SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRI // static_cast<void *>(dynamic_cast<Derived *>(obj)) - static_cast<void *>(obj) SCA_PythonController* self= static_cast<SCA_PythonController*>(self_v); - return PyUnicode_FromString(self->m_scriptText); + return PyUnicode_From_STR_String(self->m_scriptText); } diff --git a/source/gameengine/GameLogic/SCA_PythonController.h b/source/gameengine/GameLogic/SCA_PythonController.h index 0d22c347861..521a676bf4a 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.h +++ b/source/gameengine/GameLogic/SCA_PythonController.h @@ -42,7 +42,7 @@ class SCA_IObject; class SCA_PythonController : public SCA_IController { - Py_Header; + Py_Header #ifdef WITH_PYTHON struct _object * m_bytecode; /* SCA_PYEXEC_SCRIPT only */ PyObject* m_function; /* SCA_PYEXEC_MODULE only */ diff --git a/source/gameengine/GameLogic/SCA_PythonKeyboard.h b/source/gameengine/GameLogic/SCA_PythonKeyboard.h index 9c761e054f2..7ecf76d1581 100644 --- a/source/gameengine/GameLogic/SCA_PythonKeyboard.h +++ b/source/gameengine/GameLogic/SCA_PythonKeyboard.h @@ -31,7 +31,7 @@ class SCA_PythonKeyboard : public PyObjectPlus { - Py_Header; + Py_Header private: class SCA_IInputDevice *m_keyboard; #ifdef WITH_PYTHON diff --git a/source/gameengine/GameLogic/SCA_PythonMouse.h b/source/gameengine/GameLogic/SCA_PythonMouse.h index dfdf00bc6e9..4ad655dce8f 100644 --- a/source/gameengine/GameLogic/SCA_PythonMouse.h +++ b/source/gameengine/GameLogic/SCA_PythonMouse.h @@ -31,7 +31,7 @@ class SCA_PythonMouse : public PyObjectPlus { - Py_Header; + Py_Header private: class SCA_IInputDevice *m_mouse; class RAS_ICanvas *m_canvas; diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.h b/source/gameengine/GameLogic/SCA_RandomActuator.h index 66d22d5952b..c439b445a5b 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.h +++ b/source/gameengine/GameLogic/SCA_RandomActuator.h @@ -38,7 +38,7 @@ class SCA_RandomActuator : public SCA_IActuator { - Py_Header; + Py_Header /** Property to assign to */ STR_String m_propname; diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.h b/source/gameengine/GameLogic/SCA_RandomSensor.h index f0ae2fd2bde..cec8bcdb445 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.h +++ b/source/gameengine/GameLogic/SCA_RandomSensor.h @@ -39,7 +39,7 @@ class SCA_RandomSensor : public SCA_ISensor { - Py_Header; + Py_Header unsigned int m_currentDraw; int m_iteration; diff --git a/source/gameengine/GameLogic/SCA_XNORController.h b/source/gameengine/GameLogic/SCA_XNORController.h index de0af2ba9d5..c2cdad2cdf4 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.h +++ b/source/gameengine/GameLogic/SCA_XNORController.h @@ -36,7 +36,7 @@ class SCA_XNORController : public SCA_IController { - Py_Header; + Py_Header //virtual void Trigger(class SCA_LogicManager* logicmgr); public: SCA_XNORController(SCA_IObject* gameobj); diff --git a/source/gameengine/GameLogic/SCA_XORController.h b/source/gameengine/GameLogic/SCA_XORController.h index 96098082165..1f38a510046 100644 --- a/source/gameengine/GameLogic/SCA_XORController.h +++ b/source/gameengine/GameLogic/SCA_XORController.h @@ -36,7 +36,7 @@ class SCA_XORController : public SCA_IController { - Py_Header; + Py_Header //virtual void Trigger(class SCA_LogicManager* logicmgr); public: SCA_XORController(SCA_IObject* gameobj); diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h index 41802a0a19f..32872592cc5 100644 --- a/source/gameengine/Ketsji/BL_Shader.h +++ b/source/gameengine/Ketsji/BL_Shader.h @@ -116,7 +116,7 @@ public: */ class BL_Shader : public PyObjectPlus { - Py_Header; + Py_Header private: typedef std::vector<BL_Uniform*> BL_UniformVec; typedef std::vector<BL_DefUniform*> BL_UniformVecDef; diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h index a7db2ed1660..f3447356055 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h @@ -39,7 +39,7 @@ class KX_NetworkMessageActuator : public SCA_IActuator { - Py_Header; + Py_Header bool m_lastEvent; class NG_NetworkScene* m_networkscene; // needed for replication STR_String m_toPropName; diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h index 7ec8f26f8ce..75800d9b9fa 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h @@ -40,7 +40,7 @@ class NG_NetworkScene; class KX_NetworkMessageSensor : public SCA_ISensor { // note: Py_Header MUST BE the first listed here - Py_Header; + Py_Header NG_NetworkScene *m_NetworkScene; // The subject we filter on. diff --git a/source/gameengine/Ketsji/KX_ArmatureSensor.h b/source/gameengine/Ketsji/KX_ArmatureSensor.h index 1b0168266a3..683a54f65de 100644 --- a/source/gameengine/Ketsji/KX_ArmatureSensor.h +++ b/source/gameengine/Ketsji/KX_ArmatureSensor.h @@ -40,7 +40,7 @@ struct bConstraint; class KX_ArmatureSensor : public SCA_ISensor { - Py_Header; + Py_Header //class CExpression* m_rightexpr; protected: diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 236bd6afdc8..2736516bf33 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -32,7 +32,7 @@ class KX_Scene; class KX_BlenderMaterial : public PyObjectPlus, public RAS_IPolyMaterial { - Py_Header; + Py_Header public: // -------------------------------- KX_BlenderMaterial(); diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index 236e914b9e5..e9c4e99aa3b 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -50,7 +50,7 @@ bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok class KX_Camera : public KX_GameObject { - Py_Header; + Py_Header protected: friend class KX_Scene; /** Camera parameters (clips distances, focal length). These diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h index c06904ea56b..a6344ae380a 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.h +++ b/source/gameengine/Ketsji/KX_CameraActuator.h @@ -49,7 +49,7 @@ class KX_CameraActuator : public SCA_IActuator { - Py_Header; + Py_Header private : /** Object that will be tracked. */ SCA_IObject *m_ob; diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.h b/source/gameengine/Ketsji/KX_ConstraintActuator.h index ebaeed9aafe..b513b141f3e 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.h +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.h @@ -42,7 +42,7 @@ class KX_GameObject; class KX_ConstraintActuator : public SCA_IActuator { - Py_Header; + Py_Header protected: // Damp time (int), int m_posDampTime; diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.h b/source/gameengine/Ketsji/KX_ConstraintWrapper.h index 8f559881a2e..980221bd4b3 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.h +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.h @@ -37,7 +37,7 @@ class KX_ConstraintWrapper : public PyObjectPlus { - Py_Header; + Py_Header public: KX_ConstraintWrapper(PHY_ConstraintType ctype,int constraintId,class PHY_IPhysicsEnvironment* physenv); virtual ~KX_ConstraintWrapper (); diff --git a/source/gameengine/Ketsji/KX_FontObject.h b/source/gameengine/Ketsji/KX_FontObject.h index 15d455b7313..8fc7a9e9f28 100644 --- a/source/gameengine/Ketsji/KX_FontObject.h +++ b/source/gameengine/Ketsji/KX_FontObject.h @@ -38,7 +38,7 @@ class KX_FontObject : public KX_GameObject { public: - Py_Header; + Py_Header KX_FontObject( void* sgReplicationInfo, SG_Callbacks callbacks, RAS_IRenderTools* rendertools, diff --git a/source/gameengine/Ketsji/KX_GameActuator.h b/source/gameengine/Ketsji/KX_GameActuator.h index 1c05d152d39..ebc6712a2dd 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.h +++ b/source/gameengine/Ketsji/KX_GameActuator.h @@ -40,7 +40,7 @@ class KX_GameActuator : public SCA_IActuator { - Py_Header; + Py_Header protected: int m_mode; bool m_restart; diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index d3ed9991c31..c240a7fcf84 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1880,7 +1880,7 @@ PyTypeObject KX_GameObject::Type = { PyObject* KX_GameObject::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_GameObject* self= static_cast<KX_GameObject*>(self_v); - return PyUnicode_FromString(self->GetName().ReadPtr()); + return PyUnicode_From_STR_String(self->GetName()); } PyObject* KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -2683,7 +2683,7 @@ PyObject* KX_GameObject::PyGetPhysicsId() PyObject* KX_GameObject::PyGetPropertyNames() { - PyObject *list= ConvertKeysToPython(); + PyObject *list= ConvertKeysToPython(); if(m_attr_dict) { PyObject *key, *value; diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 69bc394cbfc..245a92a96de 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -80,7 +80,7 @@ void KX_GameObject_Mathutils_Callback_Init(void); */ class KX_GameObject : public SCA_IObject { - Py_Header; + Py_Header protected: bool m_bDyna; diff --git a/source/gameengine/Ketsji/KX_IpoActuator.h b/source/gameengine/Ketsji/KX_IpoActuator.h index 5ee008ac5e3..fa26bbaa6e1 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.h +++ b/source/gameengine/Ketsji/KX_IpoActuator.h @@ -37,7 +37,7 @@ class KX_IpoActuator : public SCA_IActuator { - Py_Header; + Py_Header private: /** Computes the IPO start time from the current time and the current frame. */ diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h index cd472311bcf..bb081e6a444 100644 --- a/source/gameengine/Ketsji/KX_Light.h +++ b/source/gameengine/Ketsji/KX_Light.h @@ -44,7 +44,7 @@ class MT_Transform; class KX_LightObject : public KX_GameObject { - Py_Header; + Py_Header protected: RAS_LightObject m_lightobj; class RAS_IRenderTools* m_rendertools; //needed for registering and replication of lightobj diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 754ad511669..fec1d9d296c 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -129,7 +129,7 @@ PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds) return NULL; } - return PyUnicode_FromString(matname.Ptr()); + return PyUnicode_From_STR_String(matname); } @@ -147,7 +147,7 @@ PyObject* KX_MeshProxy::PyGetTextureName(PyObject* args, PyObject* kwds) return NULL; } - return PyUnicode_FromString(matname.Ptr()); + return PyUnicode_From_STR_String(matname); } diff --git a/source/gameengine/Ketsji/KX_MeshProxy.h b/source/gameengine/Ketsji/KX_MeshProxy.h index d5292b5108d..f59418a5de2 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.h +++ b/source/gameengine/Ketsji/KX_MeshProxy.h @@ -41,7 +41,7 @@ bool ConvertPythonToMesh(PyObject * value, class RAS_MeshObject **object, bool p class KX_MeshProxy : public CValue { - Py_Header; + Py_Header class RAS_MeshObject* m_meshobj; public: diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h index 5fb576eec28..277af87f9f2 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h @@ -47,7 +47,7 @@ class KX_RayCast; class KX_MouseFocusSensor : public SCA_MouseSensor { - Py_Header; + Py_Header public: diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.h b/source/gameengine/Ketsji/KX_NavMeshObject.h index 287b2b24fa9..ad128a0891d 100644 --- a/source/gameengine/Ketsji/KX_NavMeshObject.h +++ b/source/gameengine/Ketsji/KX_NavMeshObject.h @@ -36,7 +36,7 @@ class MT_Transform; class KX_NavMeshObject: public KX_GameObject { - Py_Header; + Py_Header protected: dtStatNavMesh* m_navMesh; diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h index 1caea59867a..26adcb993b8 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.h +++ b/source/gameengine/Ketsji/KX_NearSensor.h @@ -41,7 +41,7 @@ struct PHY_CollData; class KX_NearSensor : public KX_TouchSensor { - Py_Header; + Py_Header protected: float m_Margin; float m_ResetMargin; diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index fc6fcb66e28..aa0f844eb88 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -80,7 +80,7 @@ struct KX_LocalFlags { class KX_ObjectActuator : public SCA_IActuator { - Py_Header; + Py_Header MT_Vector3 m_force; MT_Vector3 m_torque; diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index 8531675723a..484b137c2f5 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -41,7 +41,7 @@ class KX_ParentActuator : public SCA_IActuator { - Py_Header; + Py_Header /** Mode */ int m_mode; diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h index 0e4c2e71f3e..4f03c8fbfb1 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h @@ -37,7 +37,7 @@ class KX_PhysicsObjectWrapper : public PyObjectPlus { - Py_Header; + Py_Header public: KX_PhysicsObjectWrapper(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsEnvironment* physenv); virtual ~KX_PhysicsObjectWrapper(); diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index 82a93e76cf3..caef8ba5e2e 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -216,13 +216,13 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, isCollider, KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialName, "getMaterialName() : returns the polygon material name, \"NoMaterial\" if no material\n") { - return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName()); + return PyUnicode_From_STR_String(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName()); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getTextureName, "getTexturelName() : returns the polygon texture name, \"NULL\" if no texture\n") { - return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName()); + return PyUnicode_From_STR_String(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName()); } KX_PYMETHODDEF_DOC(KX_PolyProxy, getVertexIndex, diff --git a/source/gameengine/Ketsji/KX_PolyProxy.h b/source/gameengine/Ketsji/KX_PolyProxy.h index d8046b3fec6..44945e58c2a 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.h +++ b/source/gameengine/Ketsji/KX_PolyProxy.h @@ -38,7 +38,7 @@ class KX_PolyProxy : public CValue { - Py_Header; + Py_Header protected: class RAS_Polygon* m_polygon; class RAS_MeshObject* m_mesh; diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 3147d6ba4c9..29127ec11a0 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -346,13 +346,13 @@ KX_PYMETHODDEF_DOC(KX_PolygonMaterial, activate, "activate(rasty, cachingInfo)") PyObject* KX_PolygonMaterial::pyattr_get_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); - return PyUnicode_FromString(self->m_texturename.ReadPtr()); + return PyUnicode_From_STR_String(self->m_texturename); } PyObject* KX_PolygonMaterial::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); - return PyUnicode_FromString(self->m_materialname.ReadPtr()); + return PyUnicode_From_STR_String(self->m_materialname); } /* this does not seem useful */ diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index 78876c60409..f20a90f7deb 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -55,7 +55,7 @@ struct Image; */ class KX_PolygonMaterial : public PyObjectPlus, public RAS_IPolyMaterial { - Py_Header; + Py_Header private: /** Blender texture face structure. */ MTFace* m_tface; diff --git a/source/gameengine/Ketsji/KX_RadarSensor.h b/source/gameengine/Ketsji/KX_RadarSensor.h index 422313fcfef..ee803d9bdb9 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.h +++ b/source/gameengine/Ketsji/KX_RadarSensor.h @@ -41,7 +41,7 @@ class KX_RadarSensor : public KX_NearSensor { protected: - Py_Header; + Py_Header float m_coneradius; diff --git a/source/gameengine/Ketsji/KX_RaySensor.h b/source/gameengine/Ketsji/KX_RaySensor.h index d797666d6ab..4c0009a5a4c 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.h +++ b/source/gameengine/Ketsji/KX_RaySensor.h @@ -43,7 +43,7 @@ class KX_RayCast; class KX_RaySensor : public SCA_ISensor { - Py_Header; + Py_Header STR_String m_propertyname; bool m_bFindMaterial; bool m_bXRay; diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h index 4bb84663e9e..ec5cf305c3e 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h @@ -45,7 +45,7 @@ class SCA_IScene; class KX_SCA_AddObjectActuator : public SCA_IActuator { - Py_Header; + Py_Header /// Time field: lifetime of the new object int m_timeProp; diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h index eaad67ad0ea..5fefbb8cca5 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h @@ -42,7 +42,7 @@ class KX_SCA_DynamicActuator : public SCA_IActuator { - Py_Header; + Py_Header // dynamics operation to apply to the game object short m_dyn_operation; diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h index a6bbf258398..7a325257e59 100644 --- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h @@ -41,7 +41,7 @@ class SCA_IScene; class KX_SCA_EndObjectActuator : public SCA_IActuator { - Py_Header; + Py_Header SCA_IScene* m_scene; public: diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h index 1e0e2155e62..3e07ec2665c 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h @@ -44,7 +44,7 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator { - Py_Header; + Py_Header // mesh reference (mesh to replace) RAS_MeshObject* m_mesh; diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index f1e0fdc8a50..9b8f7f27d80 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -2117,7 +2117,7 @@ PySequenceMethods KX_Scene::Sequence = { PyObject* KX_Scene::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_Scene* self= static_cast<KX_Scene*>(self_v); - return PyUnicode_FromString(self->GetName().ReadPtr()); + return PyUnicode_From_STR_String(self->GetName()); } PyObject* KX_Scene::pyattr_get_objects(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 67508f5741b..c8070736b7f 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -101,7 +101,7 @@ class KX_ObstacleSimulation; * */ class KX_Scene : public PyObjectPlus, public SCA_IScene { - Py_Header; + Py_Header #ifdef WITH_PYTHON PyObject* m_attr_dict; diff --git a/source/gameengine/Ketsji/KX_SceneActuator.h b/source/gameengine/Ketsji/KX_SceneActuator.h index 30f325a775e..9064146a1d4 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.h +++ b/source/gameengine/Ketsji/KX_SceneActuator.h @@ -38,7 +38,7 @@ class KX_SceneActuator : public SCA_IActuator { - Py_Header; + Py_Header int m_mode; // (restart) has become a toggle internally... not in the interface though diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h index 174bcc8f990..b9119677f4f 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.h +++ b/source/gameengine/Ketsji/KX_SoundActuator.h @@ -57,7 +57,7 @@ typedef struct KX_3DSoundSettings class KX_SoundActuator : public SCA_IActuator { - Py_Header; + Py_Header bool m_isplaying; AUD_Reference<AUD_IFactory> m_sound; float m_volume; diff --git a/source/gameengine/Ketsji/KX_StateActuator.h b/source/gameengine/Ketsji/KX_StateActuator.h index 3d1dc64d891..aa17b687463 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.h +++ b/source/gameengine/Ketsji/KX_StateActuator.h @@ -44,7 +44,7 @@ */ class KX_StateActuator : public SCA_IActuator { - Py_Header; + Py_Header /** Make visible? */ enum { diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.h b/source/gameengine/Ketsji/KX_SteeringActuator.h index 38be7bce57b..a0ae8e0d1d9 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.h +++ b/source/gameengine/Ketsji/KX_SteeringActuator.h @@ -47,7 +47,7 @@ const int MAX_PATH_LENGTH = 128; class KX_SteeringActuator : public SCA_IActuator { - Py_Header; + Py_Header /** Target object */ KX_GameObject *m_target; diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index a111bf31cf6..1fae766aa13 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -51,7 +51,7 @@ class KX_TouchEventManager; class KX_TouchSensor : public SCA_ISensor { protected: - Py_Header; + Py_Header /** * The sensor should only look for objects with this property. diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h index 9d267bfe89a..30e276c0021 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.h +++ b/source/gameengine/Ketsji/KX_TrackToActuator.h @@ -40,7 +40,7 @@ class KX_TrackToActuator : public SCA_IActuator { - Py_Header; + Py_Header // Object reference. Actually, we use the object's 'life' SCA_IObject* m_object; // 3d toggle diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.h b/source/gameengine/Ketsji/KX_VehicleWrapper.h index f750912c95b..f6e360d34a8 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.h +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.h @@ -16,7 +16,7 @@ class PHY_IMotionState; ///Python interface to physics vehicles (primarily 4-wheel cars and 2wheel bikes) class KX_VehicleWrapper : public PyObjectPlus { - Py_Header; + Py_Header std::vector<PHY_IMotionState*> m_motionStates; diff --git a/source/gameengine/Ketsji/KX_VertexProxy.h b/source/gameengine/Ketsji/KX_VertexProxy.h index 4ae662faa12..905a4e0f4ab 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.h +++ b/source/gameengine/Ketsji/KX_VertexProxy.h @@ -38,7 +38,7 @@ class KX_VertexProxy : public CValue { - Py_Header; + Py_Header protected: class RAS_TexVert* m_vertex; diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.h b/source/gameengine/Ketsji/KX_VisibilityActuator.h index 0ffe1de6480..f5c45ecbd99 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.h +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.h @@ -37,7 +37,7 @@ class KX_VisibilityActuator : public SCA_IActuator { - Py_Header; + Py_Header /** Make visible? */ bool m_visible; |