svn merge ^/trunk/blender -r48333:48370
authorCampbell Barton <ideasman42@gmail.com>
Thu, 28 Jun 2012 11:20:19 +0000 (11:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 28 Jun 2012 11:20:19 +0000 (11:20 +0000)
122 files changed:
CMakeLists.txt
SConstruct
build_files/cmake/Modules/FindOpenColorIO.cmake [new file with mode: 0644]
build_files/cmake/macros.cmake
build_files/scons/config/darwin-config.py
build_files/scons/config/linux-config.py
build_files/scons/config/win32-mingw-config.py
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-mingw-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
intern/CMakeLists.txt
intern/SConscript
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_session.cpp
intern/cycles/blender/blender_session.h
intern/cycles/blender/blender_sync.cpp
intern/cycles/blender/blender_sync.h
intern/cycles/blender/blender_util.h
intern/cycles/device/CMakeLists.txt
intern/cycles/device/device.cpp
intern/cycles/device/device.h
intern/cycles/device/device_cpu.cpp
intern/cycles/device/device_cuda.cpp
intern/cycles/device/device_multi.cpp
intern/cycles/device/device_opencl.cpp
intern/cycles/device/device_task.cpp [new file with mode: 0644]
intern/cycles/device/device_task.h [new file with mode: 0644]
intern/cycles/render/buffers.cpp
intern/cycles/render/buffers.h
intern/cycles/render/session.cpp
intern/cycles/render/session.h
intern/cycles/render/tile.cpp
intern/cycles/render/tile.h
intern/cycles/util/util_math.h
intern/opencolorio/CMakeLists.txt [new file with mode: 0644]
intern/opencolorio/SConscript [new file with mode: 0644]
intern/opencolorio/ocio_capi.cpp [new file with mode: 0644]
intern/opencolorio/ocio_capi.h [new file with mode: 0644]
release/datafiles/colormanagement/config.ocio [new file with mode: 0644]
release/datafiles/colormanagement/luts/adx_adx10_to_cdd.spimtx [new file with mode: 0644]
release/datafiles/colormanagement/luts/adx_adx16_to_cdd.spimtx [new file with mode: 0644]
release/datafiles/colormanagement/luts/adx_cdd_to_cid.spimtx [new file with mode: 0644]
release/datafiles/colormanagement/luts/adx_cid_to_rle.py [new file with mode: 0644]
release/datafiles/colormanagement/luts/adx_cid_to_rle.spi1d [new file with mode: 0644]
release/datafiles/colormanagement/luts/adx_exp_to_aces.spimtx [new file with mode: 0644]
release/datafiles/colormanagement/luts/logc800.py [new file with mode: 0644]
release/datafiles/colormanagement/luts/logc800.spi1d [new file with mode: 0644]
release/datafiles/colormanagement/luts/logc_to_aces.spimtx [new file with mode: 0644]
release/datafiles/colormanagement/luts/rec709_to_aces.spimtx [new file with mode: 0644]
release/datafiles/colormanagement/luts/rrt_ut33_dcdm.spi3d [new file with mode: 0644]
release/datafiles/colormanagement/luts/rrt_ut33_p3d60.spi3d [new file with mode: 0644]
release/datafiles/colormanagement/luts/rrt_ut33_p3dci.spi3d [new file with mode: 0644]
release/datafiles/colormanagement/luts/rrt_ut33_rec709.spi3d [new file with mode: 0644]
release/datafiles/colormanagement/luts/rrt_ut33_sRGB.spi3d [new file with mode: 0644]
release/datafiles/colormanagement/luts/slog.py [new file with mode: 0644]
release/datafiles/colormanagement/luts/slog.spi1d [new file with mode: 0644]
release/datafiles/colormanagement/luts/slog10.spi1d [new file with mode: 0644]
release/datafiles/colormanagement/luts/slog2.py [new file with mode: 0644]
release/datafiles/colormanagement/luts/slogf35_to_aces.spimtx [new file with mode: 0644]
release/datafiles/colormanagement/luts/slogf65_to_aces_3200.spimtx [new file with mode: 0644]
release/datafiles/colormanagement/luts/slogf65_to_aces_5500.spimtx [new file with mode: 0644]
release/datafiles/colormanagement/luts/ten_bit_scale.spimtx [new file with mode: 0644]
release/datafiles/splash.png
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_info.py
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/seqcache.c
source/blender/blenloader/intern/readfile.c
source/blender/compositor/CMakeLists.txt
source/blender/compositor/intern/COM_Converter.cpp
source/blender/compositor/nodes/COM_TrackPositionNode.cpp [new file with mode: 0644]
source/blender/compositor/nodes/COM_TrackPositionNode.h [new file with mode: 0644]
source/blender/compositor/operations/COM_TrackPositionOperation.cpp [new file with mode: 0644]
source/blender/compositor/operations/COM_TrackPositionOperation.h [new file with mode: 0644]
source/blender/compositor/operations/COM_ViewerBaseOperation.cpp
source/blender/editors/datafiles/splash.png.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/image_intern.h
source/blender/editors/space_image/space_image.c
source/blender/editors/space_node/drawnode.c
source/blender/imbuf/CMakeLists.txt
source/blender/imbuf/IMB_colormanagement.h [new file with mode: 0644]
source/blender/imbuf/IMB_imbuf.h
source/blender/imbuf/IMB_imbuf_types.h
source/blender/imbuf/IMB_moviecache.h
source/blender/imbuf/SConscript
source/blender/imbuf/intern/IMB_colormanagement_intern.h [new file with mode: 0644]
source/blender/imbuf/intern/IMB_filter.h
source/blender/imbuf/intern/allocimbuf.c
source/blender/imbuf/intern/colormanagement.c [new file with mode: 0644]
source/blender/imbuf/intern/divers.c
source/blender/imbuf/intern/filter.c
source/blender/imbuf/intern/moviecache.c
source/blender/makesdna/DNA_node_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_nodetree_types.h
source/blender/makesrna/intern/rna_render.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_wm.c
source/blender/nodes/CMakeLists.txt
source/blender/nodes/NOD_composite.h
source/blender/nodes/composite/nodes/node_composite_trackpos.c [new file with mode: 0644]
source/blender/render/extern/include/RE_engine.h
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/include/initrender.h
source/blender/render/intern/include/render_result.h
source/blender/render/intern/source/external_engine.c
source/blender/render/intern/source/initrender.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_result.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_window.c
source/blenderplayer/CMakeLists.txt
source/creator/CMakeLists.txt

index dd843e1..72a5ebc 100644 (file)
@@ -130,6 +130,7 @@ option(WITH_FFTW3         "Enable FFTW3 support (Used for smoke and audio effect
 option(WITH_BULLET        "Enable Bullet (Physics Engine)" ON)
 option(WITH_GAMEENGINE    "Enable Game Engine" ON)
 option(WITH_PLAYER        "Build Player" OFF)
+option(WITH_OPENCOLORIO   "Enable OpenColorIO color management" ON)
 
 # GHOST Windowing Library Options
 option(WITH_GHOST_DEBUG   "Enable debugging output for the GHOST library" OFF)
@@ -671,6 +672,24 @@ if(UNIX AND NOT APPLE)
                endif()
        endif()
 
+       if(WITH_OPENCOLORIO)
+               # use lib dir if available and nothing else specified
+               if(LIBDIR AND NOT OPENCOLORIO_ROOT_DIR)
+                       set(OPENCOLORIO_ROOT_DIR ${LIBDIR}/ocio)
+               endif()
+
+               find_package(OpenColorIO)
+
+               set(OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARIES})
+               set(OPENCOLORIO_LIBPATH)  # TODO, remove and reference the absolute path everywhere
+               set(OPENCOLORIO_DEFINITIONS)
+
+               if(NOT OPENCOLORIO_FOUND)
+                       set(WITH_OPENCOLORIO OFF)
+                       message(STATUS "OpenColorIO not found")
+               endif()
+       endif()
+
        # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
        set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++")
 
@@ -1017,6 +1036,14 @@ elseif(WIN32)
                        set(OPENIMAGEIO_DEFINITIONS)
                endif()
 
+               if(WITH_OPENCOLORIO)
+                       set(OPENCOLORIO ${LIBDIR}/opencolorio)
+                       set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
+                       set(OPENCOLORIO_LIBRARIES OpenColorIO)
+                       set_lib_path(OPENCOLORIO_LIBPATH "opencolorio/lib")
+                       set(OPENCOLORIO_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
@@ -1186,6 +1213,14 @@ elseif(WIN32)
                        set(OPENIMAGEIO_DEFINITIONS)
                endif()
                
+               if(WITH_OPENCOLORIO)
+                       set(OPENCOLORIO ${LIBDIR}/opencolorio)
+                       set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
+                       set(OPENCOLORIO_LIBRARIES OpenColorIO)
+                       set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
+                       set(OPENCOLORIO_DEFINITIONS)
+               endif()
+
                set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152")
 
                ## DISABLE - causes linking errors 
@@ -1432,6 +1467,14 @@ elseif(APPLE)
                set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
        endif()
 
+       if(WITH_OPENCOLORIO)
+               set(OPENCOLORIO ${LIBDIR}/opencolorio)
+               set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
+               set(OPENCOLORIO_LIBRARIES OpenColorIO)
+               set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
+               set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
+       endif()
+
        set(EXETYPE MACOSX_BUNDLE)
 
        set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
index 088361a..61120cd 100644 (file)
@@ -609,7 +609,15 @@ if env['OURPLATFORM']!='darwin':
                     kernel_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel')
                     cubin_file = os.path.join(kernel_build_dir, "kernel_%s.cubin" % arch)
                     scriptinstall.append(env.Install(dir=dir,source=cubin_file))
-    
+
+    if env['WITH_BF_OCIO']:
+        dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'datafiles', 'colormanagement')
+        source=os.listdir('release/datafiles/colormanagement')
+        if '.svn' in source: source.remove('.svn')
+        if '_svn' in source: source.remove('_svn')
+        source=['release/datafiles/colormanagement/'+s for s in source]
+        scriptinstall.append(env.Install(dir=dir,source=source))
+
     if env['WITH_BF_INTERNATIONAL']:
         internationalpaths=['release' + os.sep + 'datafiles']
         
@@ -742,6 +750,9 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
     if env['WITH_BF_OIIO'] and env['OURPLATFORM'] != 'win32-mingw':
         dllsources.append('${LCGDIR}/openimageio/bin/OpenImageIO.dll')
 
+    if env['WITH_BF_OCIO'] and env['OURPLATFORM'] != 'win32-mingw':
+        dllsources.append('${LCGDIR}/opencolorio/bin/OpenColorIO.dll')
+
     dllsources.append('#source/icons/blender.exe.manifest')
 
     windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
diff --git a/build_files/cmake/Modules/FindOpenColorIO.cmake b/build_files/cmake/Modules/FindOpenColorIO.cmake
new file mode 100644 (file)
index 0000000..78539ae
--- /dev/null
@@ -0,0 +1,71 @@
+# - Find OpenColorIO library
+# Find the native OpenColorIO includes and library
+# This module defines
+#  OPENCOLORIO_INCLUDE_DIRS, where to find OpenColorIO.h, Set when
+#                            OPENCOLORIO_INCLUDE_DIR is found.
+#  OPENCOLORIO_LIBRARIES, libraries to link against to use OpenColorIO.
+#  OPENCOLORIO_ROOT_DIR, The base directory to search for OpenColorIO.
+#                        This can also be an environment variable.
+#  OPENCOLORIO_FOUND, If false, do not try to use OpenColorIO.
+#
+# also defined, but not for general use are
+#  OPENCOLORIO_LIBRARY, where to find the OpenColorIO library.
+
+#=============================================================================
+# Copyright 2012 Blender Foundation.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+# If OPENCOLORIO_ROOT_DIR was defined in the environment, use it.
+IF(NOT OPENCOLORIO_ROOT_DIR AND NOT $ENV{OPENCOLORIO_ROOT_DIR} STREQUAL "")
+  SET(OPENCOLORIO_ROOT_DIR $ENV{OPENCOLORIO_ROOT_DIR})
+ENDIF()
+
+SET(_opencolorio_SEARCH_DIRS
+  ${OPENCOLORIO_ROOT_DIR}
+  /usr/local
+  /sw # Fink
+  /opt/local # DarwinPorts
+  /opt/csw # Blastwave
+)
+
+FIND_PATH(OPENCOLORIO_INCLUDE_DIR
+  NAMES
+    OpenColorIO/OpenColorIO.h
+  HINTS
+    ${_opencolorio_SEARCH_DIRS}
+  PATH_SUFFIXES
+    include
+)
+
+FIND_LIBRARY(OPENCOLORIO_LIBRARY
+  NAMES
+    OCIO OpenColorIO
+  HINTS
+    ${_opencolorio_SEARCH_DIRS}
+  PATH_SUFFIXES
+    lib64 lib
+  )
+
+# handle the QUIETLY and REQUIRED arguments and set OPENCOLORIO_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenColorIO DEFAULT_MSG
+    OPENCOLORIO_LIBRARY OPENCOLORIO_INCLUDE_DIR)
+
+IF(OPENCOLORIO_FOUND)
+  SET(OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARY})
+  SET(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO_INCLUDE_DIR})
+ENDIF(OPENCOLORIO_FOUND)
+
+MARK_AS_ADVANCED(
+  OPENCOLORIO_INCLUDE_DIR
+  OPENCOLORIO_LIBRARY
+)
+
index 61a89b5..564dbea 100644 (file)
@@ -193,6 +193,9 @@ macro(SETUP_LIBDIRS)
        if(WITH_OPENIMAGEIO)
                link_directories(${OPENIMAGEIO_LIBPATH})
        endif()
+       if(WITH_OPENCOLORIO)
+               link_directories(${OPENCOLORIO_LIBPATH})
+       endif()
        if(WITH_IMAGE_OPENJPEG AND WITH_SYSTEM_OPENJPEG)
                link_directories(${OPENJPEG_LIBPATH})
        endif()
@@ -289,6 +292,9 @@ macro(setup_liblinks
        if(WITH_OPENIMAGEIO)
                target_link_libraries(${target} ${OPENIMAGEIO_LIBRARIES})
        endif()
+       if(WITH_OPENCOLORIO)
+               target_link_libraries(${target} ${OPENCOLORIO_LIBRARIES})
+       endif()
        if(WITH_BOOST)
                target_link_libraries(${target} ${BOOST_LIBRARIES})
        endif()
index e5bce90..0fbe6d2 100644 (file)
@@ -277,6 +277,12 @@ BF_OIIO_INC = BF_OIIO + '/include'
 BF_OIIO_LIB = 'OpenImageIO'
 BF_OIIO_LIBPATH = BF_OIIO + '/lib'
 
+WITH_BF_OCIO = True
+BF_OCIO = LIBDIR + '/opencolorio'
+BF_OCIO_INC = BF_OCIO + '/include'
+BF_OCIO_LIB = 'OpenColorIO'
+BF_OCIO_LIBPATH = BF_OCIO + '/lib'
+
 WITH_BF_BOOST = True
 BF_BOOST = LIBDIR + '/boost'
 BF_BOOST_INC = BF_BOOST + '/include'
index cd97ffe..a63000d 100644 (file)
@@ -210,6 +210,16 @@ BF_OIIO_INC = BF_OIIO + '/include'
 BF_OIIO_LIB = 'OpenImageIO'
 BF_OIIO_LIBPATH = BF_OIIO + '/lib'
 
+WITH_BF_OCIO = True
+WITH_BF_STATICOCIO = False
+BF_OCIO = LIBDIR + '/ocio'
+if not os.path.exists(LCGDIR + '/ocio'):
+    WITH_BF_OCIO = False
+    BF_OCIO = '/usr'
+BF_OCIO_INC = BF_OCIO + '/include'
+BF_OCIO_LIB = 'OpenColorIO yaml-cpp tinyxml'
+BF_OCIO_LIBPATH = BF_OCIO + '/lib'
+
 WITH_BF_BOOST = True
 WITH_BF_STATICBOOST = False
 BF_BOOST = LIBDIR + '/boost'
index 7236519..ff19a47 100644 (file)
@@ -159,6 +159,12 @@ BF_OIIO_INC = BF_OIIO + '/include'
 BF_OIIO_LIB = 'OpenImageIO'
 BF_OIIO_LIBPATH = BF_OIIO + '/lib'
 
+WITH_BF_OCIO = True
+BF_OCIO = LIBDIR + '/opencolorio'
+BF_OCIO_INC = BF_OCIO + '/include'
+BF_OCIO_LIB = 'OpenColorIO'
+BF_OCIO_LIBPATH = BF_OCIO + '/lib'
+
 WITH_BF_BOOST = True
 BF_BOOST = LIBDIR + '/boost'
 BF_BOOST_INC = BF_BOOST + '/include'
index 6b0c433..e51e788 100644 (file)
@@ -156,6 +156,12 @@ BF_OIIO_INC = '${BF_OIIO}/include'
 BF_OIIO_LIB = 'OpenImageIO'
 BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
 
+WITH_BF_OCIO = True
+BF_OCIO = '${LIBDIR}/opencolorio'
+BF_OCIO_INC = '${BF_OCIO}/include'
+BF_OCIO_LIB = 'OpenColorIO'
+BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
+
 WITH_BF_BOOST = True
 BF_BOOST = '${LIBDIR}/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
index 2649c55..1b8ad46 100644 (file)
@@ -159,6 +159,12 @@ BF_OIIO_INC = '${BF_OIIO}/include'
 BF_OIIO_LIB = 'OpenImageIO'
 BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
 
+WITH_BF_OCIO = True
+BF_OCIO = LIBDIR + '/opencolorio'
+BF_OCIO_INC = '${BF_OCIO}/include'
+BF_OCIO_LIB = 'OpenColorIO'
+BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
+
 WITH_BF_BOOST = True
 BF_BOOST = LIBDIR + '/boost'
 BF_BOOST_INC = BF_BOOST + '/include'
index 1f87336..be68e0d 100644 (file)
@@ -153,6 +153,13 @@ BF_OIIO_LIB = 'OpenImageIO'
 BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
 BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
 
+WITH_BF_OCIO = True
+BF_OCIO = '${LIBDIR}/opencolorio'
+BF_OCIO_INC = '${BF_OCIO}/include'
+BF_OCIO_LIB = 'OpenColorIO'
+BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
+BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
+
 WITH_BF_BOOST = True
 BF_BOOST = '${LIBDIR}/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
index 0c5d37f..c5ff080 100644 (file)
@@ -200,6 +200,11 @@ def setup_staticlibs(lenv):
         if lenv['WITH_BF_STATICOIIO']:
             statlibs += Split(lenv['BF_OIIO_LIB_STATIC'])
 
+    if lenv['WITH_BF_OCIO']:
+        libincs += Split(lenv['BF_OCIO_LIBPATH'])
+        if lenv['WITH_BF_STATICOCIO']:
+            statlibs += Split(lenv['BF_OCIO_LIB_STATIC'])
+
     if lenv['WITH_BF_BOOST']:
         libincs += Split(lenv['BF_BOOST_LIBPATH'])
         if lenv['WITH_BF_STATICBOOST']:
@@ -248,6 +253,10 @@ def setup_syslibs(lenv):
         if not lenv['WITH_BF_STATICOIIO']:
             syslibs += Split(lenv['BF_OIIO_LIB'])
 
+    if lenv['WITH_BF_OCIO']:
+        if not lenv['WITH_BF_STATICOCIO']:
+            syslibs += Split(lenv['BF_OCIO_LIB'])
+
     if lenv['WITH_BF_OPENEXR'] and not lenv['WITH_BF_STATICOPENEXR']:
         syslibs += Split(lenv['BF_OPENEXR_LIB'])
     if lenv['WITH_BF_TIFF'] and not lenv['WITH_BF_STATICTIFF']:
index d3a334b..b1467bc 100644 (file)
@@ -162,6 +162,7 @@ def validate_arguments(args, bc):
             'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
             'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES', 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_CYCLES_CUDA_THREADED_COMPILE',
             'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
+            'WITH_BF_OCIO', 'WITH_BF_STATICOCIO', 'BF_OCIO', 'BF_OCIO_INC', 'BF_OCIO_LIB', 'BF_OCIO_LIB_STATIC', 'BF_OCIO_LIBPATH',
             'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH',
             'WITH_BF_LIBMV', 'WITH_BF_CARVE'
             ]
@@ -566,6 +567,14 @@ def read_opts(env, cfg, args):
         ('BF_OIIO_LIBPATH', 'OIIO library path', ''),
         ('BF_OIIO_LIB_STATIC', 'OIIO static library', ''),
 
+        (BoolVariable('WITH_BF_OCIO', 'Build with OpenColorIO', False)),
+        (BoolVariable('WITH_BF_STATICOCIO', 'Staticly link to OpenColorIO', False)),
+        ('BF_OCIO', 'OCIO root path', ''),
+        ('BF_OCIO_INC', 'OCIO include path', ''),
+        ('BF_OCIO_LIB', 'OCIO library', ''),
+        ('BF_OCIO_LIBPATH', 'OCIO library path', ''),
+        ('BF_OCIO_LIB_STATIC', 'OCIO static library', ''),
+
         (BoolVariable('WITH_BF_BOOST', 'Build with Boost', False)),
         (BoolVariable('WITH_BF_STATICBOOST', 'Staticly link to boost', False)),
         ('BF_BOOST', 'Boost root path', ''),
index 71d2ef5..878101d 100644 (file)
@@ -71,3 +71,7 @@ endif()
 if(WIN32)
        add_subdirectory(utfconv)
 endif()
+
+if(WITH_OPENCOLORIO)
+       add_subdirectory(opencolorio)
+endif()
index 3bfdc2c..7213734 100644 (file)
@@ -30,3 +30,6 @@ SConscript(['bsp/SConscript'])
 
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-mingw', 'linuxcross', 'win64-vc'):
     SConscript(['utfconv/SConscript'])
+
+if env['WITH_BF_OCIO']:
+    SConscript(['opencolorio/SConscript'])
index 5234db5..1191d1b 100644 (file)
@@ -197,8 +197,16 @@ class CyclesRender_PT_performance(CyclesButtonsPanel, Panel):
 
         sub = col.column(align=True)
         sub.label(text="Tiles:")
-        sub.prop(cscene, "debug_tile_size")
-        sub.prop(cscene, "debug_min_size")
+
+        sub.prop(rd, "parts_x", text="X")
+        sub.prop(rd, "parts_y", text="Y")
+
+        subsub = sub.column()
+        subsub.enabled = not rd.use_border
+        subsub.prop(rd, "use_save_buffers")
+
+        #sub.prop(cscene, "debug_tile_size")
+        #sub.prop(cscene, "debug_min_size")
 
         col = split.column()
 
index d09e43b..0e4ae06 100644 (file)
@@ -42,8 +42,7 @@ CCL_NAMESPACE_BEGIN
 BlenderSession::BlenderSession(BL::RenderEngine b_engine_, BL::UserPreferences b_userpref_,
        BL::BlendData b_data_, BL::Scene b_scene_)
 : b_engine(b_engine_), b_userpref(b_userpref_), b_data(b_data_), b_scene(b_scene_),
-  b_v3d(PointerRNA_NULL), b_rv3d(PointerRNA_NULL),
-  b_rr(PointerRNA_NULL), b_rlay(PointerRNA_NULL)
+  b_v3d(PointerRNA_NULL), b_rv3d(PointerRNA_NULL)
 {
        /* offline render */
        BL::RenderSettings r = b_scene.render();
@@ -60,7 +59,7 @@ BlenderSession::BlenderSession(BL::RenderEngine b_engine_, BL::UserPreferences b
        BL::BlendData b_data_, BL::Scene b_scene_,
        BL::SpaceView3D b_v3d_, BL::RegionView3D b_rv3d_, int width_, int height_)
 : b_engine(b_engine_), b_userpref(b_userpref_), b_data(b_data_), b_scene(b_scene_),
-  b_v3d(b_v3d_), b_rv3d(b_rv3d_), b_rr(PointerRNA_NULL), b_rlay(PointerRNA_NULL)
+  b_v3d(b_v3d_), b_rv3d(b_rv3d_)
 {
        /* 3d view render */
        width = width_;
@@ -80,7 +79,7 @@ BlenderSession::~BlenderSession()
 void BlenderSession::create_session()
 {
        SceneParams scene_params = BlenderSync::get_scene_params(b_scene, background);
-       SessionParams session_params = BlenderSync::get_session_params(b_userpref, b_scene, background);
+       SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background);
 
        /* reset status/progress */
        last_status = "";
@@ -90,7 +89,7 @@ void BlenderSession::create_session()
        scene = new Scene(scene_params);
 
        /* create sync */
-       sync = new BlenderSync(b_data, b_scene, scene, !background);
+       sync = new BlenderSync(b_engine, b_data, b_scene, scene, !background);
        sync->sync_data(b_v3d, b_engine.camera_override());
 
        if(b_rv3d)
@@ -177,35 +176,76 @@ static PassType get_pass_type(BL::RenderPass b_pass)
        return PASS_NONE;
 }
 
+static BL::RenderResult begin_render_result(BL::RenderEngine b_engine, int x, int y, int w, int h, const char *layername)
+{
+       RenderResult *rrp = RE_engine_begin_result((RenderEngine*)b_engine.ptr.data, x, y, w, h, layername);
+       PointerRNA rrptr;
+       RNA_pointer_create(NULL, &RNA_RenderResult, rrp, &rrptr);
+       return BL::RenderResult(rrptr);
+}
+
+static void end_render_result(BL::RenderEngine b_engine, BL::RenderResult b_rr, bool cancel = false)
+{
+       RE_engine_end_result((RenderEngine*)b_engine.ptr.data, (RenderResult*)b_rr.ptr.data, (int)cancel);
+}
+
+void BlenderSession::write_render_buffers(RenderBuffers *buffers)
+{
+       BufferParams& params = buffers->params;
+       int x = params.full_x - session->tile_manager.params.full_x;
+       int y = params.full_y - session->tile_manager.params.full_y;
+       int w = params.width;
+       int h = params.height;
+
+       /* get render result */
+       BL::RenderResult b_rr = begin_render_result(b_engine, x, y, w, h, b_rlay_name.c_str());
+       BL::RenderResult::layers_iterator b_single_rlay;
+       b_rr.layers.begin(b_single_rlay);
+       BL::RenderLayer b_rlay = *b_single_rlay;
+
+       /* write result */
+       write_render_result(b_rr, b_rlay, buffers);
+       end_render_result(b_engine, b_rr);
+}
+
 void BlenderSession::render()
 {
+       /* set callback to write out render results */
+       session->write_render_buffers_cb = function_bind(&BlenderSession::write_render_buffers, this, _1);
+
        /* get buffer parameters */
-       SessionParams session_params = BlenderSync::get_session_params(b_userpref, b_scene, background);
+       SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background);
        BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, scene->camera, width, height);
-       int w = buffer_params.width, h = buffer_params.height;
-
-       /* create render result */
-       RenderResult *rrp = RE_engine_begin_result((RenderEngine*)b_engine.ptr.data, 0, 0, w, h);
-       PointerRNA rrptr;
-       RNA_pointer_create(NULL, &RNA_RenderResult, rrp, &rrptr);
-       b_rr = BL::RenderResult(rrptr);
 
+       /* render each layer */
        BL::RenderSettings r = b_scene.render();
-       BL::RenderResult::layers_iterator b_iter;
-       BL::RenderLayers b_rr_layers(r.ptr);
+       BL::RenderSettings::layers_iterator b_iter;
        
-       /* render each layer */
-       for(b_rr.layers.begin(b_iter); b_iter != b_rr.layers.end(); ++b_iter) {
-               /* set layer */
-               b_rlay = *b_iter;
+       for(r.layers.begin(b_iter); b_iter != r.layers.end(); ++b_iter) {
+               b_rlay_name = b_iter->name();
+
+               /* temporary render result to find needed passes */
+               BL::RenderResult b_rr = begin_render_result(b_engine, 0, 0, 1, 1, b_rlay_name.c_str());
+               BL::RenderResult::layers_iterator b_single_rlay;
+               b_rr.layers.begin(b_single_rlay);
+
+               /* layer will be missing if it was disabled in the UI */
+               if(b_single_rlay == b_rr.layers.end()) {
+                       end_render_result(b_engine, b_rr, true);
+                       continue;
+               }
+
+               BL::RenderLayer b_rlay = *b_single_rlay;
 
                /* add passes */
                vector<Pass> passes;
                Pass::add(PASS_COMBINED, passes);
 
                if(session_params.device.advanced_shading) {
+
+                       /* loop over passes */
                        BL::RenderLayer::passes_iterator b_pass_iter;
-                       
+
                        for(b_rlay.passes.begin(b_pass_iter); b_pass_iter != b_rlay.passes.end(); ++b_pass_iter) {
                                BL::RenderPass b_pass(*b_pass_iter);
                                PassType pass_type = get_pass_type(b_pass);
@@ -217,13 +257,16 @@ void BlenderSession::render()
                        }
                }
 
+               /* free result without merging */
+               end_render_result(b_engine, b_rr, true);
+
                buffer_params.passes = passes;
                scene->film->tag_passes_update(scene, passes);
                scene->film->tag_update(scene);
                scene->integrator->tag_update(scene);
 
                /* update scene */
-               sync->sync_data(b_v3d, b_engine.camera_override(), b_iter->name().c_str());
+               sync->sync_data(b_v3d, b_engine.camera_override(), b_rlay_name.c_str());
 
                /* update session */
                int samples = sync->get_layer_samples();
@@ -235,20 +278,14 @@ void BlenderSession::render()
 
                if(session->progress.get_cancel())
                        break;
-
-               /* write result */
-               write_render_result();
        }
 
-       /* delete render result */
-       RE_engine_end_result((RenderEngine*)b_engine.ptr.data, (RenderResult*)b_rr.ptr.data);
+       /* clear callback */
+       session->write_render_buffers_cb = NULL;
 }
 
-void BlenderSession::write_render_result()
+void BlenderSession::write_render_result(BL::RenderResult b_rr, BL::RenderLayer b_rlay, RenderBuffers *buffers)
 {
-       /* get state */
-       RenderBuffers *buffers = session->buffers;
-
        /* copy data from device */
        if(!buffers->copy_from_device())
                return;
@@ -289,7 +326,7 @@ void BlenderSession::synchronize()
 {
        /* on session/scene parameter changes, we recreate session entirely */
        SceneParams scene_params = BlenderSync::get_scene_params(b_scene, background);
-       SessionParams session_params = BlenderSync::get_session_params(b_userpref, b_scene, background);
+       SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background);
 
        if(session->params.modified(session_params) ||
           scene->params.modified(scene_params))
@@ -364,7 +401,7 @@ bool BlenderSession::draw(int w, int h)
 
                /* reset if requested */
                if(reset) {
-                       SessionParams session_params = BlenderSync::get_session_params(b_userpref, b_scene, background);
+                       SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background);
                        BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, scene->camera, w, h);
 
                        session->reset(buffer_params, session_params.samples);
@@ -435,7 +472,6 @@ void BlenderSession::tag_redraw()
 
                /* offline render, redraw if timeout passed */
                if(time_dt() - last_redraw_time > 1.0) {
-                       write_render_result();
                        engine_tag_redraw((RenderEngine*)b_engine.ptr.data);
                        last_redraw_time = time_dt();
                }
index b98e3ff..0eda2a1 100644 (file)
@@ -29,6 +29,7 @@ CCL_NAMESPACE_BEGIN
 
 class Scene;
 class Session;
+class RenderBuffers;
 
 class BlenderSession {
 public:
@@ -46,7 +47,8 @@ public:
 
        /* offline render */
        void render();
-       void write_render_result();
+       void write_render_result(BL::RenderResult b_rr, BL::RenderLayer b_rlay, RenderBuffers *buffers);
+       void write_render_buffers(RenderBuffers *buffers);
 
        /* interactive updates */
        void synchronize();
@@ -72,8 +74,7 @@ public:
        BL::Scene b_scene;
        BL::SpaceView3D b_v3d;
        BL::RegionView3D b_rv3d;
-       BL::RenderResult b_rr;
-       BL::RenderLayer b_rlay;
+       string b_rlay_name;
 
        string last_status;
        float last_progress;
index c9d2d68..bc35e6d 100644 (file)
@@ -40,8 +40,9 @@ CCL_NAMESPACE_BEGIN
 
 /* Constructor */
 
-BlenderSync::BlenderSync(BL::BlendData b_data_, BL::Scene b_scene_, Scene *scene_, bool preview_)
-: b_data(b_data_), b_scene(b_scene_),
+BlenderSync::BlenderSync(BL::RenderEngine b_engine_, BL::BlendData b_data_, BL::Scene b_scene_, Scene *scene_, bool preview_)
+: b_engine(b_engine_),
+  b_data(b_data_), b_scene(b_scene_),
   shader_map(&scene_->shaders),
   object_map(&scene_->objects),
   mesh_map(&scene_->meshes),
@@ -284,7 +285,7 @@ bool BlenderSync::get_session_pause(BL::Scene b_scene, bool background)
        return (background)? false: get_boolean(cscene, "preview_pause");
 }
 
-SessionParams BlenderSync::get_session_params(BL::UserPreferences b_userpref, BL::Scene b_scene, bool background)
+SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::UserPreferences b_userpref, BL::Scene b_scene, bool background)
 {
        SessionParams params;
        PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
@@ -338,25 +339,36 @@ SessionParams BlenderSync::get_session_params(BL::UserPreferences b_userpref, BL
                }
        }
 
+       /* tiles */
+       int tile_x = b_engine.tile_x();
+       int tile_y = b_engine.tile_y();
+
+       if(tile_x == 0 || tile_y == 0) {
+               tile_x = get_int(cscene, "debug_tile_size");
+               tile_y = tile_x;
+
+               params.tile_size = make_int2(tile_x, tile_y);
+               params.min_size = get_int(cscene, "debug_min_size");
+       }
+       else {
+               params.tile_size = make_int2(tile_x, tile_y);
+               params.min_size = min(tile_x, tile_y);
+       }
+
        /* other parameters */
        params.threads = b_scene.render().threads();
-       params.tile_size = get_int(cscene, "debug_tile_size");
-       params.min_size = get_int(cscene, "debug_min_size");
+
        params.cancel_timeout = get_float(cscene, "debug_cancel_timeout");
        params.reset_timeout = get_float(cscene, "debug_reset_timeout");
        params.text_timeout = get_float(cscene, "debug_text_timeout");
 
        if(background) {
-               params.progressive = true;
+               params.progressive = false;
                params.min_size = INT_MAX;
        }
        else
                params.progressive = true;
        
-       /* todo: multi device only works with single tiles now */
-       if(params.device.type == DEVICE_MULTI)
-               params.tile_size = INT_MAX;
-
        return params;
 }
 
index 8c31c4b..dcfb7c6 100644 (file)
@@ -49,7 +49,7 @@ class ShaderNode;
 
 class BlenderSync {
 public:
-       BlenderSync(BL::BlendData b_data, BL::Scene b_scene, Scene *scene_, bool preview_);
+       BlenderSync(BL::RenderEngine b_engine_, BL::BlendData b_data, BL::Scene b_scene, Scene *scene_, bool preview_);
        ~BlenderSync();
 
        /* sync */
@@ -61,7 +61,7 @@ public:
 
        /* get parameters */
        static SceneParams get_scene_params(BL::Scene b_scene, bool background);
-       static SessionParams get_session_params(BL::UserPreferences b_userpref, BL::Scene b_scene, bool background);
+       static SessionParams get_session_params(BL::RenderEngine b_engine, BL::UserPreferences b_userpref, BL::Scene b_scene, bool background);
        static bool get_session_pause(BL::Scene b_scene, bool background);
        static BufferParams get_buffer_params(BL::Scene b_scene, Camera *cam, int width, int height);
 
@@ -96,6 +96,7 @@ private:
        int object_count_particles(BL::Object b_ob);
 
        /* variables */
+       BL::RenderEngine b_engine;
        BL::BlendData b_data;
        BL::Scene b_scene;
 
index ebbd4e1..ab1f7cf 100644 (file)
@@ -40,9 +40,9 @@ void rna_Object_create_duplilist(void *ob, void *reports, void *sce);
 void rna_Object_free_duplilist(void *ob, void *reports);
 void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values);
 void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values);
-struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h);
+struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h, const char *layername);
 void RE_engine_update_result(struct RenderEngine *engine, struct RenderResult *result);
-void RE_engine_end_result(struct RenderEngine *engine, struct RenderResult *result);
+void RE_engine_end_result(struct RenderEngine *engine, struct RenderResult *result, int cancel);
 int RE_engine_test_break(struct RenderEngine *engine);
 void RE_engine_update_stats(struct RenderEngine *engine, const char *stats, const char *info);
 void RE_engine_update_progress(struct RenderEngine *engine, float progress);
index 17072d2..6038abd 100644 (file)
@@ -17,6 +17,7 @@ set(SRC
        device_multi.cpp
        device_network.cpp
        device_opencl.cpp
+       device_task.cpp
 )
 
 set(SRC_HEADERS
@@ -24,6 +25,7 @@ set(SRC_HEADERS
        device_memory.h
        device_intern.h
        device_network.h
+       device_task.h
 )
 
 add_definitions(-DGLEW_STATIC)
index 33040f2..9a4d364 100644 (file)
 
 CCL_NAMESPACE_BEGIN
 
-/* Device Task */
-
-DeviceTask::DeviceTask(Type type_)
-: type(type_), x(0), y(0), w(0), h(0), rng_state(0), rgba(0), buffer(0),
-  sample(0), resolution(0),
-  shader_input(0), shader_output(0),
-  shader_eval_type(0), shader_x(0), shader_w(0)
-{
-}
-
-void DeviceTask::split_max_size(list<DeviceTask>& tasks, int max_size)
-{
-       int num;
-
-       if(type == SHADER) {
-               num = (shader_w + max_size - 1)/max_size;
-       }
-       else {
-               max_size = max(1, max_size/w);
-               num = (h + max_size - 1)/max_size;
-       }
-
-       split(tasks, num);
-}
-
-void DeviceTask::split(list<DeviceTask>& tasks, int num)
-{
-       if(type == SHADER) {
-               num = min(shader_w, num);
-
-               for(int i = 0; i < num; i++) {
-                       int tx = shader_x + (shader_w/num)*i;
-                       int tw = (i == num-1)? shader_w - i*(shader_w/num): shader_w/num;
-
-                       DeviceTask task = *this;
-
-                       task.shader_x = tx;
-                       task.shader_w = tw;
-
-                       tasks.push_back(task);
-               }
-       }
-       else {
-               num = min(h, num);
-
-               for(int i = 0; i < num; i++) {
-                       int ty = y + (h/num)*i;
-                       int th = (i == num-1)? h - i*(h/num): h/num;
-
-                       DeviceTask task = *this;
-
-                       task.y = ty;
-                       task.h = th;
-
-                       tasks.push_back(task);
-               }
-       }
-}
-
 /* Device */
 
 void Device::pixels_alloc(device_memory& mem)
index b17abac..2ee2e04 100644 (file)
 #include <stdlib.h>
 
 #include "device_memory.h"
+#include "device_task.h"
 
 #include "util_list.h"
 #include "util_string.h"
-#include "util_task.h"
 #include "util_thread.h"
 #include "util_types.h"
 #include "util_vector.h"
@@ -33,6 +33,7 @@
 CCL_NAMESPACE_BEGIN
 
 class Progress;
+class RenderTile;
 
 /* Device Types */
 
@@ -67,32 +68,6 @@ public:
        }
 };
 
-/* Device Task */
-
-class DeviceTask : public Task {
-public:
-       typedef enum { PATH_TRACE, TONEMAP, SHADER } Type;
-       Type type;
-
-       int x, y, w, h;
-       device_ptr rng_state;
-       device_ptr rgba;
-       device_ptr buffer;
-       int sample;
-       int resolution;
-       int offset, stride;
-
-       device_ptr shader_input;
-       device_ptr shader_output;
-       int shader_eval_type;
-       int shader_x, shader_w;
-
-       DeviceTask(Type type = PATH_TRACE);
-
-       void split(list<DeviceTask>& tasks, int num);
-       void split_max_size(list<DeviceTask>& tasks, int max_size);
-};
-
 /* Device */
 
 class Device {
@@ -150,6 +125,10 @@ public:
        void server_run();
 #endif
 
+       /* multi device */
+       virtual void map_tile(Device *sub_device, RenderTile& tile) {}
+       virtual int device_number(Device *sub_device) { return 0; }
+
        /* static */
        static Device *create(DeviceInfo& info, bool background = true, int threads = 0);
 
index 070b20a..ebd486b 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "osl_shader.h"
 
+#include "buffers.h"
+
 #include "util_debug.h"
 #include "util_foreach.h"
 #include "util_function.h"
@@ -141,28 +143,44 @@ public:
                        OSLShader::thread_init(kg);
 #endif
 
-#ifdef WITH_OPTIMIZED_KERNEL
-               if(system_cpu_support_optimized()) {
-                       for(int y = task.y; y < task.y + task.h; y++) {
-                               for(int x = task.x; x < task.x + task.w; x++)
-                                       kernel_cpu_optimized_path_trace(kg, (float*)task.buffer, (unsigned int*)task.rng_state,
-                                               task.sample, x, y, task.offset, task.stride);
+               RenderTile tile;
+               
+               while(task.acquire_tile(this, tile)) {
+                       float *render_buffer = (float*)tile.buffer;
+                       uint *rng_state = (uint*)tile.rng_state;
+                       int start_sample = tile.start_sample;
+                       int end_sample = tile.start_sample + tile.num_samples;
 
-                               if(task_pool.cancelled())
-                                       break;
+#ifdef WITH_OPTIMIZED_KERNEL
+                       if(system_cpu_support_optimized()) {
+                               for(int y = tile.y; y < tile.y + tile.h; y++) {
+                                       for(int x = tile.x; x < tile.x + tile.w; x++)
+                                               for(int sample = start_sample; sample < end_sample; sample++)
+                                                       kernel_cpu_optimized_path_trace(kg, render_buffer, rng_state,
+                                                               sample, x, y, tile.offset, tile.stride);
+
+                                       if(task_pool.cancelled())
+                                               break;
+                               }
                        }
-               }
-               else
+                       else
 #endif
-               {
-                       for(int y = task.y; y < task.y + task.h; y++) {
-                               for(int x = task.x; x < task.x + task.w; x++)
-                                       kernel_cpu_path_trace(kg, (float*)task.buffer, (unsigned int*)task.rng_state,
-                                               task.sample, x, y, task.offset, task.stride);
-
-                               if(task_pool.cancelled())
-                                       break;
+                       {
+                               for(int y = tile.y; y < tile.y + tile.h; y++) {
+                                       for(int x = tile.x; x < tile.x + tile.w; x++)
+                                               for(int sample = start_sample; sample < end_sample; sample++)
+                                                       kernel_cpu_path_trace(kg, render_buffer, rng_state,
+                                                               sample, x, y, tile.offset, tile.stride);
+
+                                       if(task_pool.cancelled())
+                                               break;
+                               }
                        }
+
+                       task.release_tile(tile);
+
+                       if(task_pool.cancelled())
+                               break;
                }
 
 #ifdef WITH_OSL
@@ -228,8 +246,7 @@ public:
                /* split task into smaller ones, more than number of threads for uneven
                 * workloads where some parts of the image render slower than others */
                list<DeviceTask> tasks;
-
-               task.split(tasks, TaskScheduler::num_threads()*10);
+               task.split(tasks, TaskScheduler::num_threads()+1);
 
                foreach(DeviceTask& task, tasks)
                        task_pool.push(new CPUDeviceTask(this, task));
index 357f991..c297d12 100644 (file)
@@ -23,6 +23,8 @@
 #include "device.h"
 #include "device_intern.h"
 
+#include "buffers.h"
+
 #include "util_cuda.h"
 #include "util_debug.h"
 #include "util_map.h"
@@ -37,6 +39,7 @@ CCL_NAMESPACE_BEGIN
 class CUDADevice : public Device
 {
 public:
+       TaskPool task_pool;
        CUdevice cuDevice;
        CUcontext cuContext;
        CUmodule cuModule;
@@ -192,6 +195,8 @@ public:
 
        ~CUDADevice()
        {
+               task_pool.stop();
+
                cuda_push_context();
                cuda_assert(cuCtxDetach(cuContext))
        }
@@ -466,13 +471,13 @@ public:
                }
        }
 
-       void path_trace(DeviceTask& task)
+       void path_trace(RenderTile& rtile, int sample)
        {
                cuda_push_context();
 
                CUfunction cuPathTrace;
-               CUdeviceptr d_buffer = cuda_device_ptr(task.buffer);
-               CUdeviceptr d_rng_state = cuda_device_ptr(task.rng_state);
+               CUdeviceptr d_buffer = cuda_device_ptr(rtile.buffer);
+               CUdeviceptr d_rng_state = cuda_device_ptr(rtile.rng_state);
 
                /* get kernel function */
                cuda_assert(cuModuleGetFunction(&cuPathTrace, cuModule, "kernel_cuda_path_trace"))
@@ -486,29 +491,28 @@ public:
                cuda_assert(cuParamSetv(cuPathTrace, offset, &d_rng_state, sizeof(d_rng_state)))
                offset += sizeof(d_rng_state);
 
-               int sample = task.sample;
                offset = align_up(offset, __alignof(sample));
 
-               cuda_assert(cuParamSeti(cuPathTrace, offset, task.sample))
-               offset += sizeof(task.sample);
+               cuda_assert(cuParamSeti(cuPathTrace, offset, sample))
+               offset += sizeof(sample);
 
-               cuda_assert(cuParamSeti(cuPathTrace, offset, task.x))
-               offset += sizeof(task.x);
+               cuda_assert(cuParamSeti(cuPathTrace, offset, rtile.x))
+               offset += sizeof(rtile.x);
 
-               cuda_assert(cuParamSeti(cuPathTrace, offset, task.y))
-               offset += sizeof(task.y);
+               cuda_assert(cuParamSeti(cuPathTrace, offset, rtile.y))
+               offset += sizeof(rtile.y);
 
-               cuda_assert(cuParamSeti(cuPathTrace, offset, task.w))
-               offset += sizeof(task.w);
+               cuda_assert(cuParamSeti(cuPathTrace, offset, rtile.w))
+               offset += sizeof(rtile.w);
 
-               cuda_assert(cuParamSeti(cuPathTrace, offset, task.h))
-               offset += sizeof(task.h);
+               cuda_assert(cuParamSeti(cuPathTrace, offset, rtile.h))
+               offset += sizeof(rtile.h);
 
-               cuda_assert(cuParamSeti(cuPathTrace, offset, task.offset))
-               offset += sizeof(task.offset);
+               cuda_assert(cuParamSeti(cuPathTrace, offset, rtile.offset))
+               offset += sizeof(rtile.offset);
 
-               cuda_assert(cuParamSeti(cuPathTrace, offset, task.stride))
-               offset += sizeof(task.stride);
+               cuda_assert(cuParamSeti(cuPathTrace, offset, rtile.stride))
+               offset += sizeof(rtile.stride);
 
                cuda_assert(cuParamSetSize(cuPathTrace, offset))
 
@@ -520,8 +524,8 @@ public:
                int xthreads = 8;
                int ythreads = 8;
 #endif
-               int xblocks = (task.w + xthreads - 1)/xthreads;
-               int yblocks = (task.h + ythreads - 1)/ythreads;
+               int xblocks = (rtile.w + xthreads - 1)/xthreads;
+               int yblocks = (rtile.h + ythreads - 1)/ythreads;
 
                cuda_assert(cuFuncSetCacheConfig(cuPathTrace, CU_FUNC_CACHE_PREFER_L1))
                cuda_assert(cuFuncSetBlockShape(cuPathTrace, xthreads, ythreads, 1))
@@ -530,13 +534,13 @@ public:
                cuda_pop_context();
        }
 
-       void tonemap(DeviceTask& task)
+       void tonemap(DeviceTask& task, device_ptr buffer, device_ptr rgba)
        {
                cuda_push_context();
 
                CUfunction cuFilmConvert;
-               CUdeviceptr d_rgba = map_pixels(task.rgba);
-               CUdeviceptr d_buffer = cuda_device_ptr(task.buffer);
+               CUdeviceptr d_rgba = map_pixels(rgba);
+               CUdeviceptr d_buffer = cuda_device_ptr(buffer);
 
                /* get kernel function */
                cuda_assert(cuModuleGetFunction(&cuFilmConvert, cuModule, "kernel_cuda_tonemap"))
@@ -820,27 +824,67 @@ public:
                Device::draw_pixels(mem, y, w, h, dy, width, height, transparent);
        }
 
-       void task_add(DeviceTask& task)
+       void thread_run(DeviceTask *task)
        {
-               if(task.type == DeviceTask::TONEMAP)
-                       tonemap(task);
-               else if(task.type == DeviceTask::PATH_TRACE)
-                       path_trace(task);
-               else if(task.type == DeviceTask::SHADER)
-                       shader(task);
+               if(task->type == DeviceTask::PATH_TRACE) {
+                       RenderTile tile;
+                       
+                       /* keep rendering tiles until done */
+                       while(task->acquire_tile(this, tile)) {
+                               int start_sample = tile.start_sample;
+                               int end_sample = tile.start_sample + tile.num_samples;
+
+                               for(int sample = start_sample; sample < end_sample; sample++)
+                                       path_trace(tile, sample);
+
+                               cuda_push_context();
+                               cuda_assert(cuCtxSynchronize())
+                               cuda_pop_context();
+
+                               task->release_tile(tile);
+                       }
+               }
+               else if(task->type == DeviceTask::SHADER) {
+                       shader(*task);
+
+                       cuda_push_context();
+                       cuda_assert(cuCtxSynchronize())
+                       cuda_pop_context();
+               }
        }
 
-       void task_wait()
+       class CUDADeviceTask : public DeviceTask {
+       public:
+               CUDADeviceTask(CUDADevice *device, DeviceTask& task)
+               : DeviceTask(task)
+               {
+                       run = function_bind(&CUDADevice::thread_run, device, this);
+               }
+       };
+
+       void task_add(DeviceTask& task)
        {
-               cuda_push_context();
+               if(task.type == DeviceTask::TONEMAP) {
+                       /* must be done in main thread due to opengl access */
+                       tonemap(task, task.buffer, task.rgba);
 
-               cuda_assert(cuCtxSynchronize())
+                       cuda_push_context();
+                       cuda_assert(cuCtxSynchronize())
+                       cuda_pop_context();
+               }
+               else {
+                       task_pool.push(new CUDADeviceTask(this, task));
+               }
+       }
 
-               cuda_pop_context();
+       void task_wait()
+       {
+               task_pool.wait_work();
        }
 
        void task_cancel()
        {
+               task_pool.cancel();
        }
 };
 
index 83e69b9..546ffe5 100644 (file)
@@ -23,6 +23,8 @@
 #include "device_intern.h"
 #include "device_network.h"
 
+#include "buffers.h"
+
 #include "util_foreach.h"
 #include "util_list.h"
 #include "util_map.h"
@@ -255,6 +257,30 @@ public:
                rgba.device_pointer = tmp;
        }
 
+       void map_tile(Device *sub_device, RenderTile& tile)
+       {
+               foreach(SubDevice& sub, devices) {
+                       if(sub.device == sub_device) {
+                               if(tile.buffer) tile.buffer = sub.ptr_map[tile.buffer];
+                               if(tile.rng_state) tile.rng_state = sub.ptr_map[tile.rng_state];
+                               if(tile.rgba) tile.rgba = sub.ptr_map[tile.rgba];
+                       }
+               }
+       }
+
+       int device_number(Device *sub_device)
+       {
+               int i = 0;
+
+               foreach(SubDevice& sub, devices) {
+                       if(sub.device == sub_device)
+                               return i;
+                       i++;
+               }
+
+               return -1;
+       }
+
        void task_add(DeviceTask& task)
        {
                list<DeviceTask> tasks;
@@ -266,7 +292,6 @@ public:
                                tasks.pop_front();
 
                                if(task.buffer) subtask.buffer = sub.ptr_map[task.buffer];
-                               if(task.rng_state) subtask.rng_state = sub.ptr_map[task.rng_state];
                                if(task.rgba) subtask.rgba = sub.ptr_map[task.rgba];
                                if(task.shader_input) subtask.shader_input = sub.ptr_map[task.shader_input];
                                if(task.shader_output) subtask.shader_output = sub.ptr_map[task.shader_output];
index 13ebeff..e287753 100644 (file)
@@ -25,6 +25,8 @@
 #include "device.h"
 #include "device_intern.h"
 
+#include "buffers.h"
+
 #include "util_foreach.h"
 #include "util_map.h"
 #include "util_math.h"
@@ -41,6 +43,7 @@ CCL_NAMESPACE_BEGIN
 class OpenCLDevice : public Device
 {
 public:
+       TaskPool task_pool;
        cl_context cxContext;
        cl_command_queue cqCommandQueue;
        cl_platform_id cpPlatform;
@@ -438,6 +441,8 @@ public:
 
        ~OpenCLDevice()
        {
+               task_pool.stop();
+
                if(null_mem)
                        clReleaseMemObject(CL_MEM_PTR(null_mem));
 
@@ -543,19 +548,19 @@ public:
                return global_size + ((r == 0)? 0: group_size - r);
        }
 
-       void path_trace(DeviceTask& task)
+       void path_trace(RenderTile& rtile, int sample)
        {
                /* cast arguments to cl types */
                cl_mem d_data = CL_MEM_PTR(const_mem_map["__data"]->device_pointer);
-               cl_mem d_buffer = CL_MEM_PTR(task.buffer);
-               cl_mem d_rng_state = CL_MEM_PTR(task.rng_state);
-               cl_int d_x = task.x;
-               cl_int d_y = task.y;
-               cl_int d_w = task.w;
-               cl_int d_h = task.h;
-               cl_int d_sample = task.sample;
-               cl_int d_offset = task.offset;
-               cl_int d_stride = task.stride;
+               cl_mem d_buffer = CL_MEM_PTR(rtile.buffer);
+               cl_mem d_rng_state = CL_MEM_PTR(rtile.rng_state);
+               cl_int d_x = rtile.x;
+               cl_int d_y = rtile.y;
+               cl_int d_w = rtile.w;
+               cl_int d_h = rtile.h;
+               cl_int d_sample = sample;
+               cl_int d_offset = rtile.offset;
+               cl_int d_stride = rtile.stride;
 
                /* sample arguments */
                int narg = 0;
@@ -616,12 +621,12 @@ public:
                return err;
        }
 
-       void tonemap(DeviceTask& task)
+       void tonemap(DeviceTask& task, device_ptr buffer, device_ptr rgba)
        {
                /* cast arguments to cl types */
                cl_mem d_data = CL_MEM_PTR(const_mem_map["__data"]->device_pointer);
-               cl_mem d_rgba = CL_MEM_PTR(task.rgba);
-               cl_mem d_buffer = CL_MEM_PTR(task.buffer);
+               cl_mem d_rgba = CL_MEM_PTR(rgba);
+               cl_mem d_buffer = CL_MEM_PTR(buffer);
                cl_int d_x = task.x;
                cl_int d_y = task.y;
                cl_int d_w = task.w;
@@ -670,30 +675,49 @@ public:
                opencl_assert(clFinish(cqCommandQueue));
        }
 
-       void task_add(DeviceTask& maintask)
+       void thread_run(DeviceTask *task)
        {
-               list<DeviceTask> tasks;
+               if(task->type == DeviceTask::TONEMAP) {
+                       tonemap(*task, task->buffer, task->rgba);
+               }
+               else if(task->type == DeviceTask::PATH_TRACE) {
+                       RenderTile tile;
+                       
+                       /* keep rendering tiles until done */
+                       while(task->acquire_tile(this, tile)) {
+                               int start_sample = tile.start_sample;
+                               int end_sample = tile.start_sample + tile.num_samples;
 
-               /* arbitrary limit to work around apple ATI opencl issue */
-               if(platform_name == "Apple")
-                       maintask.split_max_size(tasks, 76800);
-               else
-                       tasks.push_back(maintask);
+                               for(int sample = start_sample; sample < end_sample; sample++)
+                                       path_trace(tile, sample);
+
+                               task->release_tile(tile);
+                       }
+               }
+       }
 
-               foreach(DeviceTask& task, tasks) {
-                       if(task.type == DeviceTask::TONEMAP)
-                               tonemap(task);
-                       else if(task.type == DeviceTask::PATH_TRACE)
-                               path_trace(task);
+       class OpenCLDeviceTask : public DeviceTask {
+       public:
+               OpenCLDeviceTask(OpenCLDevice *device, DeviceTask& task)
+               : DeviceTask(task)
+               {
+                       run = function_bind(&OpenCLDevice::thread_run, device, this);
                }
+       };
+
+       void task_add(DeviceTask& task)
+       {
+               task_pool.push(new OpenCLDeviceTask(this, task));
        }
 
        void task_wait()
        {
+               task_pool.wait_work();
        }
 
        void task_cancel()
        {
+               task_pool.cancel();
        }
 };
 
diff --git a/intern/cycles/device/device_task.cpp b/intern/cycles/device/device_task.cpp
new file mode 100644 (file)
index 0000000..fe872bc
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * 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.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "device_task.h"
+
+#include "util_algorithm.h"
+
+CCL_NAMESPACE_BEGIN
+
+/* Device Task */
+
+DeviceTask::DeviceTask(Type type_)
+: type(type_), x(0), y(0), w(0), h(0), rgba(0), buffer(0),
+  sample(0), num_samples(1), resolution(0),
+  shader_input(0), shader_output(0),
+  shader_eval_type(0), shader_x(0), shader_w(0)
+{
+}
+
+void DeviceTask::split_max_size(list<DeviceTask>& tasks, int max_size)
+{
+       int num;
+
+       if(type == SHADER) {
+               num = (shader_w + max_size - 1)/max_size;
+       }
+       else {
+               max_size = max(1, max_size/w);
+               num = (h + max_size - 1)/max_size;
+       }
+
+       split(tasks, num);
+}
+
+void DeviceTask::split(list<DeviceTask>& tasks, int num)
+{
+       if(type == SHADER) {
+               num = min(shader_w, num);
+
+               for(int i = 0; i < num; i++) {
+                       int tx = shader_x + (shader_w/num)*i;
+                       int tw = (i == num-1)? shader_w - i*(shader_w/num): shader_w/num;
+
+                       DeviceTask task = *this;
+
+                       task.shader_x = tx;
+                       task.shader_w = tw;
+
+                       tasks.push_back(task);
+               }
+       }
+       else if(type == PATH_TRACE) {
+               for(int i = 0; i < num; i++)
+                       tasks.push_back(*this);
+       }
+       else {
+               num = min(h, num);
+
+               for(int i = 0; i < num; i++) {
+                       int ty = y + (h/num)*i;
+                       int th = (i == num-1)? h - i*(h/num): h/num;
+
+                       DeviceTask task = *this;
+
+                       task.y = ty;
+                       task.h = th;
+
+                       tasks.push_back(task);
+               }
+       }
+}
+
+CCL_NAMESPACE_END
+
diff --git a/intern/cycles/device/device_task.h b/intern/cycles/device/device_task.h
new file mode 100644 (file)
index 0000000..e0433e5
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * 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.
+ */
+
+#ifndef __DEVICE_TASK_H__
+#define __DEVICE_TASK_H__
+
+#include "device_memory.h"
+
+#include "util_function.h"
+#include "util_list.h"
+#include "util_task.h"
+
+CCL_NAMESPACE_BEGIN
+
+/* Device Task */
+
+class Device;
+class RenderBuffers;
+class RenderTile;
+class Tile;
+
+class DeviceTask : public Task {
+public:
+       typedef enum { PATH_TRACE, TONEMAP, SHADER } Type;
+       Type type;
+
+       int x, y, w, h;
+       device_ptr rgba;
+       device_ptr buffer;
+       int sample;
+       int num_samples;
+       int resolution;
+       int offset, stride;
+
+       device_ptr shader_input;
+       device_ptr shader_output;
+       int shader_eval_type;
+       int shader_x, shader_w;
+
+       DeviceTask(Type type = PATH_TRACE);
+
+       void split(list<DeviceTask>& tasks, int num);
+       void split_max_size(list<DeviceTask>& tasks, int max_size);
+
+       boost::function<bool(Device *device, RenderTile&)> acquire_tile;
+       boost::function<void(RenderTile&)> release_tile;
+};
+
+CCL_NAMESPACE_END
+
+#endif /* __DEVICE_TASK_H__ */
+
index a79a359..bd8c6cd 100644 (file)
@@ -74,6 +74,29 @@ int BufferParams::get_passes_size()
        return align_up(size, 4);
 }
 
+/* Render Buffer Task */
+
+RenderTile::RenderTile()
+{
+       x = 0;
+       y = 0;
+       w = 0;
+       h = 0;
+
+       start_sample = 0;
+       num_samples = 0;
+       resolution = 0;
+
+       offset = 0;
+       stride = 0;
+
+       buffer = 0;
+       rng_state = 0;
+       rgba = 0;
+
+       buffers = NULL;
+}
+
 /* Render Buffers */
 
 RenderBuffers::RenderBuffers(Device *device_)
index 78712ed..f8df2b3 100644 (file)
@@ -67,12 +67,11 @@ class RenderBuffers {
 public:
        /* buffer parameters */
        BufferParams params;
+
        /* float buffer */
        device_vector<float> buffer;
        /* random number generator state */
        device_vector<uint> rng_state;
-       /* mutex, must be locked manually by callers */
-       thread_mutex mutex;
 
        RenderBuffers(Device *device);
        ~RenderBuffers();
@@ -105,8 +104,6 @@ public:
        bool transparent;
        /* byte buffer for tonemapped result */
        device_vector<uchar4> rgba;
-       /* mutex, must be locked manually by callers */
-       thread_mutex mutex;
 
        DisplayBuffer(Device *device);
        ~DisplayBuffer();
@@ -124,6 +121,27 @@ protected:
        Device *device;
 };
 
+/* Render Tile
+ * Rendering task on a buffer */
+
+class RenderTile {
+public:
+       int x, y, w, h;
+       int start_sample;
+       int num_samples;
+       int resolution;
+       int offset;
+       int stride;
+
+       device_ptr buffer;
+       device_ptr rng_state;
+       device_ptr rgba;
+
+       RenderBuffers *buffers;
+
+       RenderTile();
+};
+
 CCL_NAMESPACE_END
 
 #endif /* __BUFFERS_H__ */
index a9f7e5b..eddb288 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "util_foreach.h"
 #include "util_function.h"
+#include "util_math.h"
 #include "util_opengl.h"
 #include "util_task.h"
 #include "util_time.h"
@@ -35,15 +36,23 @@ CCL_NAMESPACE_BEGIN
 
 Session::Session(const SessionParams& params_)
 : params(params_),
-  tile_manager(params.progressive, params.samples, params.tile_size, params.min_size)
+  tile_manager(params.progressive, params.samples, params.tile_size, params.min_size,
+       (params.background)? 1: max(params.device.multi_devices.size(), 1))
 {
        device_use_gl = ((params.device.type != DEVICE_CPU) && !params.background);
 
        TaskScheduler::init(params.threads);
 
        device = Device::create(params.device, params.background, params.threads);
-       buffers = new RenderBuffers(device);
-       display = new DisplayBuffer(device);
+
+       if(params.background) {
+               buffers = NULL;
+               display = NULL;
+       }
+       else {
+               buffers = new RenderBuffers(device);
+               display = new DisplayBuffer(device);
+       }
 
        session_thread = NULL;
        scene = NULL;
@@ -81,7 +90,7 @@ Session::~Session()
                wait();
        }
 
-       if(params.output_path != "") {
+       if(display && params.output_path != "") {
                tonemap();
 
                progress.set_status("Writing Image", params.output_path);
@@ -118,8 +127,8 @@ void Session::reset_gpu(BufferParams& buffer_params, int samples)
        /* block for buffer acces and reset immediately. we can't do this
         * in the thread, because we need to allocate an OpenGL buffer, and
         * that only works in the main thread */
-       thread_scoped_lock display_lock(display->mutex);
-       thread_scoped_lock buffers_lock(buffers->mutex);
+       thread_scoped_lock display_lock(display_mutex);
+       thread_scoped_lock buffers_lock(buffers_mutex);
 
        display_outdated = true;
        reset_time = time_dt();
@@ -135,7 +144,7 @@ void Session::reset_gpu(BufferParams& buffer_params, int samples)
 bool Session::draw_gpu(BufferParams& buffer_params)
 {
        /* block for buffer access */
-       thread_scoped_lock display_lock(display->mutex);
+       thread_scoped_lock display_lock(display_mutex);
 
        /* first check we already rendered something */
        if(gpu_draw_ready) {
@@ -145,7 +154,7 @@ bool Session::draw_gpu(BufferParams& buffer_params)
                        /* for CUDA we need to do tonemapping still, since we can
                         * only access GL buffers from the main thread */
                        if(gpu_need_tonemap) {
-                               thread_scoped_lock buffers_lock(buffers->mutex);
+                               thread_scoped_lock buffers_lock(buffers_mutex);
                                tonemap();
                                gpu_need_tonemap = false;
                                gpu_need_tonemap_cond.notify_all();
@@ -226,23 +235,18 @@ void Session::run_gpu()
                        /* buffers mutex is locked entirely while rendering each
                         * sample, and released/reacquired on each iteration to allow
                         * reset and draw in between */
-                       thread_scoped_lock buffers_lock(buffers->mutex);
+                       thread_scoped_lock buffers_lock(buffers_mutex);
 
                        /* update status and timing */
                        update_status_time();
 
                        /* path trace */
-                       foreach(Tile& tile, tile_manager.state.tiles) {
-                               path_trace(tile);
+                       path_trace();
 
-                               device->task_wait();
+                       device->task_wait();
 
-                               if(device->error_message() != "")
-                                       progress.set_cancel(device->error_message());
-
-                               if(progress.get_cancel())
-                                       break;
-                       }
+                       if(device->error_message() != "")
+                               progress.set_cancel(device->error_message());
 
                        /* update status and timing */
                        update_status_time();
@@ -289,7 +293,7 @@ void Session::reset_cpu(BufferParams& buffer_params, int samples)
 
 bool Session::draw_cpu(BufferParams& buffer_params)
 {
-       thread_scoped_lock display_lock(display->mutex);
+       thread_scoped_lock display_lock(display_mutex);
 
        /* first check we already rendered something */
        if(display->draw_ready()) {
@@ -308,13 +312,88 @@ bool Session::draw_cpu(BufferParams& buffer_params)
        return false;
 }
 
+bool Session::acquire_tile(Device *tile_device, RenderTile& rtile)
+{
+       if(progress.get_cancel())
+               return false;
+
+       thread_scoped_lock tile_lock(tile_mutex);
+
+       /* get next tile from manager */
+       Tile tile;
+       int device_num = device->device_number(tile_device);
+
+       if(!tile_manager.next_tile(tile, device_num))
+               return false;
+       
+       /* fill render tile */
+       rtile.x = tile_manager.state.buffer.full_x + tile.x;
+       rtile.y = tile_manager.state.buffer.full_y + tile.y;
+       rtile.w = tile.w;
+       rtile.h = tile.h;
+       rtile.start_sample = tile_manager.state.sample;
+       rtile.num_samples = tile_manager.state.num_samples;
+       rtile.resolution = tile_manager.state.resolution;
+
+       tile_lock.unlock();
+
+       /* in case of a permant buffer, return it, otherwise we will allocate
+        * a new temporary buffer */
+       if(!write_render_buffers_cb) {
+               tile_manager.state.buffer.get_offset_stride(rtile.offset, rtile.stride);
+
+               rtile.buffer = buffers->buffer.device_pointer;
+               rtile.rng_state = buffers->rng_state.device_pointer;
+               rtile.rgba = display->rgba.device_pointer;
+               rtile.buffers = buffers;
+
+               device->map_tile(tile_device, rtile);
+
+               return true;
+       }
+
+       /* fill buffer parameters */
+       BufferParams buffer_params = tile_manager.params;
+       buffer_params.full_x = rtile.x;
+       buffer_params.full_y = rtile.y;
+       buffer_params.width = rtile.w;
+       buffer_params.height = rtile.h;
+
+       buffer_params.get_offset_stride(rtile.offset, rtile.stride);
+
+       /* allocate buffers */
+       RenderBuffers *tilebuffers = new RenderBuffers(tile_device);
+       tilebuffers->reset(tile_device, buffer_params);
+
+       rtile.buffer = tilebuffers->buffer.device_pointer;
+       rtile.rng_state = tilebuffers->rng_state.device_pointer;
+       rtile.rgba = 0;
+       rtile.buffers = tilebuffers;
+
+       return true;
+}
+
+void Session::release_tile(RenderTile& rtile)
+{
+       thread_scoped_lock tile_lock(tile_mutex);
+
+       if(write_render_buffers_cb) {
+               /* todo: optimize this by making it thread safe and removing lock */
+               if(!progress.get_cancel())
+                       write_render_buffers_cb(rtile.buffers);
+               delete rtile.buffers;
+       }
+
+       update_status_time();
+}
+
 void Session::run_cpu()
 {
        {
                /* reset once to start */
                thread_scoped_lock reset_lock(delayed_reset.mutex);
-               thread_scoped_lock buffers_lock(buffers->mutex);
-               thread_scoped_lock display_lock(display->mutex);
+               thread_scoped_lock buffers_lock(buffers_mutex);
+               thread_scoped_lock display_lock(display_mutex);
 
                reset_(delayed_reset.params, delayed_reset.samples);
                delayed_reset.do_reset = false;
@@ -364,7 +443,7 @@ void Session::run_cpu()
                        /* buffers mutex is locked entirely while rendering each
                         * sample, and released/reacquired on each iteration to allow
                         * reset and draw in between */
-                       thread_scoped_lock buffers_lock(buffers->mutex);
+                       thread_scoped_lock buffers_lock(buffers_mutex);
 
                        /* update scene */
                        update_scene();
@@ -379,8 +458,7 @@ void Session::run_cpu()
                        update_status_time();
 
                        /* path trace */
-                       foreach(Tile& tile, tile_manager.state.tiles)
-                               path_trace(tile);
+                       path_trace();
 
                        /* update status and timing */
                        update_status_time();
@@ -396,8 +474,8 @@ void Session::run_cpu()
 
                {
                        thread_scoped_lock reset_lock(delayed_reset.mutex);
-                       thread_scoped_lock buffers_lock(buffers->mutex);
-                       thread_scoped_lock display_lock(display->mutex);
+                       thread_scoped_lock buffers_lock(buffers_mutex);
+                       thread_scoped_lock display_lock(display_mutex);
 
                        if(delayed_reset.do_reset) {
                                /* reset rendering if request from main thread */
@@ -465,10 +543,12 @@ bool Session::draw(BufferParams& buffer_params)
 
 void Session::reset_(BufferParams& buffer_params, int samples)
 {
-       if(buffer_params.modified(buffers->params)) {
-               gpu_draw_ready = false;
-               buffers->reset(device, buffer_params);
-               display->reset(device, buffer_params);
+       if(buffers) {
+               if(buffer_params.modified(buffers->params)) {
+                       gpu_draw_ready = false;
+                       buffers->reset(device, buffer_params);
+                       display->reset(device, buffer_params);
+               }
        }
 
        tile_manager.reset(buffer_params, samples);
@@ -532,8 +612,6 @@ void Session::update_scene()
 {
        thread_scoped_lock scene_lock(scene->mutex);
 
-       progress.set_status("Updating Scene");
-
        /* update camera if dimensions changed for progressive render. the camera
         * knows nothing about progressive or cropped rendering, it just gets the
         * image dimensions passed in */
@@ -548,20 +626,25 @@ void Session::update_scene()
        }
 
        /* update scene */
-       if(scene->need_update())
+       if(scene->need_update()) {
+               progress.set_status("Updating Scene");
                scene->device_update(device, progress);
+       }
 }
 
 void Session::update_status_time(bool show_pause, bool show_done)
 {
        int sample = tile_manager.state.sample;
+       int num_samples = tile_manager.state.num_samples;
        int resolution = tile_manager.state.resolution;
+       int num_tiles = tile_manager.state.num_tiles;
+       int tile = num_tiles - tile_manager.state.tiles.size();
 
        /* update status */
        string status, substatus;
 
        if(!params.progressive)
-               substatus = "Path Tracing";
+               substatus = string_printf("Path Tracing Tile %d/%d", tile, num_tiles);
        else if(params.samples == INT_MAX)
                substatus = string_printf("Path Tracing Sample %d", sample+1);
        else
@@ -585,23 +668,16 @@ void Session::update_status_time(bool show_pause, bool show_done)
        /* negative can happen when we pause a bit before rendering, can discard that */
        if(preview_time < 0.0) preview_time = 0.0;
 
-       progress.set_sample(sample + 1, sample_time);
+       progress.set_sample(sample + num_samples, sample_time);
 }
 
-void Session::path_trace(Tile& tile)
+void Session::path_trace()
 {
        /* add path trace task */
        DeviceTask task(DeviceTask::PATH_TRACE);
-
-       task.x = tile_manager.state.buffer.full_x + tile.x;
-       task.y = tile_manager.state.buffer.full_y + tile.y;
-       task.w = tile.w;
-       task.h = tile.h;
-       task.buffer = buffers->buffer.device_pointer;
-       task.rng_state = buffers->rng_state.device_pointer;
-       task.sample = tile_manager.state.sample;
-       task.resolution = tile_manager.state.resolution;
-       tile_manager.state.buffer.get_offset_stride(task.offset, task.stride);
+       
+       task.acquire_tile = function_bind(&Session::acquire_tile, this, _1, _2);
+       task.release_tile = function_bind(&Session::release_tile, this, _1);
 
        device->task_add(task);
 }
index 90616f0..d06f5b8 100644 (file)
@@ -47,7 +47,7 @@ public:
        bool progressive;
        bool experimental;
        int samples;
-       int tile_size;
+       int2 tile_size;
        int min_size;
        int threads;
 
@@ -63,7 +63,7 @@ public:
                progressive = false;
                experimental = false;
                samples = INT_MAX;
-               tile_size = 64;
+               tile_size = make_int2(64, 64);
                min_size = 64;
                threads = 0;
 
@@ -102,8 +102,11 @@ public:
        DisplayBuffer *display;
        Progress progress;
        SessionParams params;
+       TileManager tile_manager;
        int sample;
 
+       boost::function<void(RenderBuffers*)> write_render_buffers_cb;
+
        Session(const SessionParams& params);
        ~Session();
 
@@ -130,7 +133,7 @@ protected:
        void update_status_time(bool show_pause = false, bool show_done = false);
 
        void tonemap();
-       void path_trace(Tile& tile);
+       void path_trace();
        void reset_(BufferParams& params, int samples);
 
        void run_cpu();
@@ -141,7 +144,9 @@ protected:
        bool draw_gpu(BufferParams& params);
        void reset_gpu(BufferParams& params, int samples);
 
-       TileManager tile_manager;
+       bool acquire_tile(Device *tile_device, RenderTile& tile);
+       void release_tile(RenderTile& tile);
+
        bool device_use_gl;
 
        thread *session_thread;
@@ -155,6 +160,9 @@ protected:
        bool pause;
        thread_condition_variable pause_cond;
        thread_mutex pause_mutex;
+       thread_mutex tile_mutex;
+       thread_mutex buffers_mutex;
+       thread_mutex display_mutex;
 
        bool kernels_loaded;
 
index 04e48d4..0898edf 100644 (file)
 
 CCL_NAMESPACE_BEGIN
 
-TileManager::TileManager(bool progressive_, int samples_, int tile_size_, int min_size_)
+TileManager::TileManager(bool progressive_, int num_samples_, int2 tile_size_, int min_size_, int num_devices_)
 {
        progressive = progressive_;
        tile_size = tile_size_;
        min_size = min_size_;
+       num_devices = num_devices_;
 
        BufferParams buffer_params;
        reset(buffer_params, 0);
@@ -36,7 +37,7 @@ TileManager::~TileManager()
 {
 }
 
-void TileManager::reset(BufferParams& params_, int samples_)
+void TileManager::reset(BufferParams& params_, int num_samples_)
 {
        params = params_;
 
@@ -53,17 +54,19 @@ void TileManager::reset(BufferParams& params_, int samples_)
                }
        }
 
-       samples = samples_;
+       num_samples = num_samples_;
 
        state.buffer = BufferParams();
        state.sample = -1;
+       state.num_tiles = 0;
+       state.num_samples = 0;
        state.resolution = start_resolution;
        state.tiles.clear();
 }
 
-void TileManager::set_samples(int samples_)
+void TileManager::set_samples(int num_samples_)
 {
-       samples = samples_;
+       num_samples = num_samples_;
 }
 
 void TileManager::set_tiles()
@@ -71,24 +74,34 @@ void TileManager::set_tiles()
        int resolution = state.resolution;
        int image_w = max(1, params.width/resolution);
        int image_h = max(1, params.height/resolution);
-       int tile_w = (tile_size >= image_w)? 1: (image_w + tile_size - 1)/tile_size;
-       int tile_h = (tile_size >= image_h)? 1: (image_h + tile_size - 1)/tile_size;
-       int sub_w = image_w/tile_w;
-       int sub_h = image_h/tile_h;
 
        state.tiles.clear();
 
-       for(int tile_y = 0; tile_y < tile_h; tile_y++) {
-               for(int tile_x = 0; tile_x < tile_w; tile_x++) {
-                       int x = tile_x * sub_w;
-                       int y = tile_y * sub_h;
-                       int w = (tile_x == tile_w-1)? image_w - x: sub_w;
-                       int h = (tile_y == tile_h-1)? image_h - y: sub_h;
+       int num = min(image_h, num_devices);
 
-                       state.tiles.push_back(Tile(x, y, w, h));
+       for(int device = 0; device < num; device++) {
+               int device_y = (image_h/num)*device;
+               int device_h = (device == num-1)? image_h - device*(image_h/num): image_h/num;
+
+               int tile_w = (tile_size.x >= image_w)? 1: (image_w + tile_size.x - 1)/tile_size.x;
+               int tile_h = (tile_size.y >= device_h)? 1: (device_h + tile_size.y - 1)/tile_size.y;
+               int sub_w = (image_w + tile_w - 1)/tile_w;
+               int sub_h = (device_h + tile_h - 1)/tile_h;
+
+               for(int tile_y = 0; tile_y < tile_h; tile_y++) {
+                       for(int tile_x = 0; tile_x < tile_w; tile_x++) {
+                               int x = tile_x * sub_w;
+                               int y = tile_y * sub_h;
+                               int w = (tile_x == tile_w-1)? image_w - x: sub_w;
+                               int h = (tile_y == tile_h-1)? device_h - y: sub_h;
+
+                               state.tiles.push_back(Tile(x, y + device_y, w, h, device));
+                       }
                }
        }
 
+       state.num_tiles = state.tiles.size();
+
        state.buffer.width = image_w;
        state.buffer.height = image_h;
 
@@ -98,9 +111,24 @@ void TileManager::set_tiles()
        state.buffer.full_height = max(1, params.full_height/resolution);
 }
 
+bool TileManager::next_tile(Tile& tile, int device)
+{
+       list<Tile>::iterator iter;
+
+       for(iter = state.tiles.begin(); iter != state.tiles.end(); iter++) {
+               if(iter->device == device) {
+                       tile = *iter;
+                       state.tiles.erase(iter);
+                       return true;
+               }
+       }
+
+       return false;
+}
+
 bool TileManager::done()
 {
-       return (state.sample+1 >= samples && state.resolution == 1);
+       return (state.sample+state.num_samples >= num_samples && state.resolution == 1);
 }
 
 bool TileManager::next()
@@ -111,10 +139,17 @@ bool TileManager::next()
        if(progressive && state.resolution > 1) {
                state.sample = 0;
                state.resolution /= 2;
+               state.num_samples = 1;
                set_tiles();
        }
        else {
                state.sample++;
+
+               if(progressive)
+                       state.num_samples = 1;
+               else
+                       state.num_samples = num_samples;
+
                state.resolution = 1;
                set_tiles();
        }
index b6e610c..b9d1fb2 100644 (file)
@@ -31,9 +31,13 @@ CCL_NAMESPACE_BEGIN
 class Tile {
 public:
        int x, y, w, h;
+       int device;
 
-       Tile(int x_, int y_, int w_, int h_)
-       : x(x_), y(y_), w(w_), h(h_) {}
+       Tile()
+       {}
+
+       Tile(int x_, int y_, int w_, int h_, int device_)
+       : x(x_), y(y_), w(w_), h(h_), device(device_) {}
 };
 
 /* Tile Manager */
@@ -45,25 +49,29 @@ public:
        struct State {
                BufferParams buffer;
                int sample;
+               int num_samples;
                int resolution;
+               int num_tiles;
                list<Tile> tiles;
        } state;
 
-       TileManager(bool progressive, int samples, int tile_size, int min_size);
+       TileManager(bool progressive, int num_samples, int2 tile_size, int min_size, int num_devices = 1);
        ~TileManager();
 
-       void reset(BufferParams& params, int samples);
-       void set_samples(int samples);
+       void reset(BufferParams& params, int num_samples);
+       void set_samples(int num_samples);
        bool next();
+       bool next_tile(Tile& tile, int device = 0);
        bool done();
 
 protected:
        void set_tiles();
 
        bool progressive;
-       int samples;
-       int tile_size;
+       int num_samples;
+       int2 tile_size;
        int min_size;
+       int num_devices;
 
        int start_resolution;
 };
index a6bc478..71a5ded 100644 (file)
@@ -277,6 +277,11 @@ __device_inline float cross(const float2 a, const float2 b)
 
 #ifndef __KERNEL_OPENCL__
 
+__device_inline bool operator==(const int2 a, const int2 b)
+{
+       return (a.x == b.x && a.y == b.y);
+}
+
 __device_inline float len(const float2 a)
 {
        return sqrtf(dot(a, a));
diff --git a/intern/opencolorio/CMakeLists.txt b/intern/opencolorio/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8fd383d
--- /dev/null
@@ -0,0 +1,43 @@
+# ***** 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) 2012, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Sergey Sharybin.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(INC
+       .
+       ${OPENCOLORIO_INCLUDE_DIRS}
+)
+
+set(INC_SYS
+
+)
+
+set(SRC
+       ocio_capi.cpp
+       ocio_capi.h
+)
+
+add_definitions(
+)
+
+blender_add_lib(bf_intern_opencolorio "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/intern/opencolorio/SConscript b/intern/opencolorio/SConscript
new file mode 100644 (file)
index 0000000..b92a784
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+
+Import('env')
+
+sources = env.Glob('*.cpp')
+
+incs = '.'
+incs += ' ' + env['BF_OCIO_INC']
+
+env.BlenderLib( 'bf_intern_opencolorio', sources, Split(incs), [], libtype=['extern','player'], priority=[10, 185])
diff --git a/intern/opencolorio/ocio_capi.cpp b/intern/opencolorio/ocio_capi.cpp
new file mode 100644 (file)
index 0000000..7181298
--- /dev/null
@@ -0,0 +1,394 @@
+/*
+ * ***** 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) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Xavier Thomas
+ *                 Lukas Toene
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <iostream>
+
+#include <OpenColorIO/OpenColorIO.h>
+
+
+#define OCIO_CAPI_IMPLEMENTATION
+#include "ocio_capi.h"
+
+ConstConfigRcPtr* OCIO_getCurrentConfig(void)
+{
+       ConstConfigRcPtr* config =  new ConstConfigRcPtr();
+       try
+       {
+               *config = GetCurrentConfig();
+               if(*config)
+                       return config;
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+void OCIO_setCurrentConfig(const ConstConfigRcPtr* config)
+{
+       if(config)
+       {
+               try
+               {
+                       SetCurrentConfig(*config);
+               }
+               catch(Exception & exception)
+               {
+                       std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+               }
+       }
+}
+
+ConstConfigRcPtr* OCIO_configCreateFromEnv(void)
+{
+       ConstConfigRcPtr* config =  new ConstConfigRcPtr();
+       try
+       {
+               *config = Config::CreateFromEnv();
+               if(*config)
+                       return config;
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+
+ConstConfigRcPtr* OCIO_configCreateFromFile(const char* filename)
+{
+       ConstConfigRcPtr* config =  new ConstConfigRcPtr();
+       try
+       {
+               *config = Config::CreateFromFile(filename);
+               if(*config)
+                       return config;
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+void OCIO_configRelease(ConstConfigRcPtr* config)
+{
+       if(config){
+               delete config;
+               config =0;
+       }
+}
+
+int OCIO_configGetNumColorSpaces(ConstConfigRcPtr* config)
+{
+       try
+       {
+               return (*config)->getNumColorSpaces();
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+const char* OCIO_configGetColorSpaceNameByIndex(ConstConfigRcPtr* config, int index)
+{
+       try
+       {
+               return (*config)->getColorSpaceNameByIndex(index);
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+ConstColorSpaceRcPtr* OCIO_configGetColorSpace(ConstConfigRcPtr* config, const char* name)
+{
+       ConstColorSpaceRcPtr* cs =  new ConstColorSpaceRcPtr();
+       try
+       {
+               *cs = (*config)->getColorSpace(name);
+               if(*cs)
+                       return cs;
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+               delete cs;
+       }
+       return 0;
+}
+
+int OCIO_configGetIndexForColorSpace(ConstConfigRcPtr* config, const char* name)
+{
+       try
+       {
+               return (*config)->getIndexForColorSpace(name);
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return -1;
+}
+
+const char* OCIO_configGetDefaultDisplay(ConstConfigRcPtr* config)
+{
+       try
+       {
+               return (*config)->getDefaultDisplay();
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+int OCIO_configGetNumDisplays(ConstConfigRcPtr* config)
+{
+       try
+       {
+               return (*config)->getNumDisplays();
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+const char* OCIO_configGetDisplay(ConstConfigRcPtr* config, int index)
+{
+       try
+       {
+               return (*config)->getDisplay(index);
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+const char* OCIO_configGetDefaultView(ConstConfigRcPtr* config, const char* display)
+{
+       try
+       {
+               return (*config)->getDefaultView(display);
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+int OCIO_configGetNumViews(ConstConfigRcPtr* config, const char* display)
+{
+       try
+       {
+               return (*config)->getNumViews(display);
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+const char* OCIO_configGetView(ConstConfigRcPtr* config, const char* display, int index)
+{
+       try
+       {
+               return (*config)->getView(display, index);
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+const char* OCIO_configGetDisplayColorSpaceName(ConstConfigRcPtr* config, const char* display, const char* view)
+{
+       try
+       {
+               return (*config)->getDisplayColorSpaceName(display, view);
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+
+
+
+void OCIO_colorSpaceRelease(ConstColorSpaceRcPtr* cs)
+{
+       if(cs){
+               delete cs;
+               cs =0;
+       }
+}
+
+
+
+
+
+ConstProcessorRcPtr* OCIO_configGetProcessorWithNames(ConstConfigRcPtr* config, const char* srcName, const char* dstName)
+{
+       ConstProcessorRcPtr* p =  new ConstProcessorRcPtr();
+       try
+       {
+               *p = (*config)->getProcessor(srcName, dstName);
+               if(*p)
+                       return p;
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+extern ConstProcessorRcPtr* OCIO_configGetProcessor(ConstConfigRcPtr* config, ConstTransformRcPtr* transform)
+{
+       ConstProcessorRcPtr* p =  new ConstProcessorRcPtr();
+       try
+       {
+               *p = (*config)->getProcessor(*transform);
+               if(*p)
+                       return p;
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+void OCIO_processorApply(ConstProcessorRcPtr* processor, PackedImageDesc* img)
+{
+       try
+       {
+               (*processor)->apply(*img);
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+}
+
+void OCIO_processorApplyRGB(ConstProcessorRcPtr* processor, float* pixel)
+{
+       (*processor)->applyRGB(pixel);
+}
+
+void OCIO_processorApplyRGBA(ConstProcessorRcPtr* processor, float* pixel)
+{
+       (*processor)->applyRGBA(pixel);
+}
+
+void OCIO_processorRelease(ConstProcessorRcPtr* p)
+{
+       if(p){
+               delete p;
+               p = 0;
+       }
+}
+
+const char* OCIO_colorSpaceGetName(ConstColorSpaceRcPtr* cs)
+{
+       return (*cs)->getName();
+}
+
+const char* OCIO_colorSpaceGetFamily(ConstColorSpaceRcPtr* cs)
+{
+       return (*cs)->getFamily();
+}
+
+
+extern DisplayTransformRcPtr* OCIO_createDisplayTransform(void)
+{
+       DisplayTransformRcPtr* dt =  new DisplayTransformRcPtr();
+       *dt = DisplayTransform::Create();
+       return dt;
+}
+
+extern void OCIO_displayTransformSetInputColorSpaceName(DisplayTransformRcPtr* dt, const char * name)
+{
+       (*dt)->setInputColorSpaceName(name);
+}
+
+extern void OCIO_displayTransformSetDisplay(DisplayTransformRcPtr* dt, const char * name)
+{
+       (*dt)->setDisplay(name);
+}
+
+extern void OCIO_displayTransformSetView(DisplayTransformRcPtr* dt, const char * name)
+{
+       (*dt)->setView(name);
+}
+
+extern void OCIO_displayTransformRelease(DisplayTransformRcPtr* dt)
+{
+       if(dt){
+               delete dt;
+               dt = 0;
+       }
+}
+
+PackedImageDesc* OCIO_createPackedImageDesc(float * data, long width, long height, long numChannels,
+                                                                                       long chanStrideBytes, long xStrideBytes, long yStrideBytes)
+{
+       try
+       {
+               PackedImageDesc* id = new PackedImageDesc(data, width, height, numChannels, chanStrideBytes, xStrideBytes, yStrideBytes);
+               return id;
+       }
+       catch(Exception & exception)
+       {
+               std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+       }
+       return 0;
+}
+
+void OCIO_packedImageDescRelease(PackedImageDesc* id)
+{
+       if(id){
+               delete id;
+               id = 0;
+       }
+}
+
diff --git a/intern/opencolorio/ocio_capi.h b/intern/opencolorio/ocio_capi.h
new file mode 100644 (file)
index 0000000..c5b7acf
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * ***** 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) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Xavier Thomas
+ *                 Lukas Toene
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef OCIO_CAPI_H
+#define OCIO_CAPI_H
+
+
+
+#ifdef __cplusplus
+using namespace OCIO_NAMESPACE;
+extern "C" { 
+#endif
+
+#define OCIO_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
+
+
+#ifndef OCIO_CAPI_IMPLEMENTATION
+       #define OCIO_ROLE_SCENE_LINEAR  "scene_linear"
+       #define OCIO_ROLE_COLOR_PICKING "color_picking"
+       #define OCIO_ROLE_TEXTURE_PAINT "texture_paint"
+       
+       OCIO_DECLARE_HANDLE(ConstConfigRcPtr);
+       OCIO_DECLARE_HANDLE(ConstColorSpaceRcPtr);
+       OCIO_DECLARE_HANDLE(ConstProcessorRcPtr);
+       OCIO_DECLARE_HANDLE(ConstContextRcPtr);
+       OCIO_DECLARE_HANDLE(PackedImageDesc);
+       OCIO_DECLARE_HANDLE(DisplayTransformRcPtr);
+       OCIO_DECLARE_HANDLE(ConstTransformRcPtr);
+#endif
+
+
+extern ConstConfigRcPtr* OCIO_getCurrentConfig(void);
+extern void OCIO_setCurrentConfig(const ConstConfigRcPtr* config);
+
+extern ConstConfigRcPtr* OCIO_configCreateFromEnv(void);
+extern ConstConfigRcPtr* OCIO_configCreateFromFile(const char* filename);
+
+extern void OCIO_configRelease(ConstConfigRcPtr* config);
+
+extern int OCIO_configGetNumColorSpaces(ConstConfigRcPtr* config);
+extern const char* OCIO_configGetColorSpaceNameByIndex(ConstConfigRcPtr* config, int index);
+extern ConstColorSpaceRcPtr* OCIO_configGetColorSpace(ConstConfigRcPtr* config, const char* name);
+extern int OCIO_configGetIndexForColorSpace(ConstConfigRcPtr* config, const char* name);
+
+extern void OCIO_colorSpaceRelease(ConstColorSpaceRcPtr* cs);
+
+extern const char* OCIO_configGetDefaultDisplay(ConstConfigRcPtr* config);
+extern int         OCIO_configGetNumDisplays(ConstConfigRcPtr* config);
+extern const char* OCIO_configGetDisplay(ConstConfigRcPtr* config, int index);
+extern const char* OCIO_configGetDefaultView(ConstConfigRcPtr* config, const char* display);
+extern int         OCIO_configGetNumViews(ConstConfigRcPtr* config, const char* display);
+extern const char* OCIO_configGetView(ConstConfigRcPtr* config, const char* display, int index);
+extern const char* OCIO_configGetDisplayColorSpaceName(ConstConfigRcPtr* config, const char* display, const char* view);
+
+extern ConstProcessorRcPtr* OCIO_configGetProcessorWithNames(ConstConfigRcPtr* config, const char* srcName, const char* dstName);
+extern ConstProcessorRcPtr* OCIO_configGetProcessor(ConstConfigRcPtr* config, ConstTransformRcPtr* transform);
+
+extern void OCIO_processorApply(ConstProcessorRcPtr* processor, PackedImageDesc* img);
+extern void OCIO_processorApplyRGB(ConstProcessorRcPtr* processor, float* pixel);
+extern void OCIO_processorApplyRGBA(ConstProcessorRcPtr* processor, float* pixel);
+
+extern void OCIO_processorRelease(ConstProcessorRcPtr* p);
+
+
+extern const char* OCIO_colorSpaceGetName(ConstColorSpaceRcPtr* cs);
+extern const char* OCIO_colorSpaceGetFamily(ConstColorSpaceRcPtr* cs);
+
+extern DisplayTransformRcPtr* OCIO_createDisplayTransform(void);
+extern void OCIO_displayTransformSetInputColorSpaceName(DisplayTransformRcPtr* dt, const char * name);
+extern void OCIO_displayTransformSetDisplay(DisplayTransformRcPtr* dt, const char * name);
+extern void OCIO_displayTransformSetView(DisplayTransformRcPtr* dt, const char * name);
+extern void OCIO_displayTransformRelease(DisplayTransformRcPtr* dt);
+
+PackedImageDesc* OCIO_createPackedImageDesc(float * data, long width, long height, long numChannels,
+                                                                                       long chanStrideBytes, long xStrideBytes, long yStrideBytes);
+
+extern void OCIO_packedImageDescRelease(PackedImageDesc* p);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //OCIO_CAPI_H
diff --git a/release/datafiles/colormanagement/config.ocio b/release/datafiles/colormanagement/config.ocio
new file mode 100644 (file)
index 0000000..72ec492
--- /dev/null
@@ -0,0 +1,243 @@
+ocio_profile_version: 1
+
+search_path: luts
+strictparsing: true
+luma: [0.2126, 0.7152, 0.0722]
+
+description: RRT version ut33
+
+roles:
+  color_picking: raw
+  color_timing: adx10
+  compositing_log: adx10
+  data: raw
+  default: raw
+  matte_paint: raw
+  reference: aces
+  scene_linear: aces
+  texture_paint: raw
+
+displays:
+  p3dci:
+    - !<View> {name: Raw, colorspace: raw}
+    - !<View> {name: Log, colorspace: adx10}
+    - !<View> {name: RRT, colorspace: rrt_p3dci}
+  sRGB:
+    - !<View> {name: Raw, colorspace: raw}
+    - !<View> {name: Log, colorspace: adx10}
+    - !<View> {name: RRT, colorspace: rrt_srgb}
+  xyz:
+    - !<View> {name: Raw, colorspace: raw}
+    - !<View> {name: Log, colorspace: adx10}
+    - !<View> {name: RRT, colorspace: rrt_xyz}
+
+active_displays: [sRGB, p3dci, xyz]
+active_views: [RRT, Log, Raw]
+
+colorspaces:
+  - !<ColorSpace>
+    name: aces
+    family: aces
+    equalitygroup: 
+    bitdepth: 32f
+    isdata: false
+    allocation: lg2
+    allocationvars: [-8.5, 5]
+
+  - !<ColorSpace>
+    name: raw
+    family: raw
+    equalitygroup: 
+    bitdepth: 32f
+    isdata: true
+    allocation: uniform
+    allocationvars: [0, 1]
+
+  - !<ColorSpace>
+    name: adx10
+    family: adx
+    equalitygroup: 
+    bitdepth: 10ui
+    description: |
+      Film Scan, using the 10-bit Academy Density Encoding
+      
+    isdata: false
+    allocation: uniform
+    allocationvars: [0, 1]
+    to_reference: !<GroupTransform>
+      children:
+        - !<FileTransform> {src: adx_adx10_to_cdd.spimtx}
+        - !<FileTransform> {src: adx_cdd_to_cid.spimtx}
+        - !<FileTransform> {src: adx_cid_to_rle.spi1d, interpolation: linear}
+        - !<LogTransform> {base: 10, direction: inverse}
+        - !<FileTransform> {src: adx_exp_to_aces.spimtx}
+
+  - !<ColorSpace>
+    name: adx16
+    family: adx
+    equalitygroup: 
+    bitdepth: 16ui
+    description: |
+      Film Scan, using the 16-bit Academy Density Encoding
+      
+    isdata: false
+    allocation: uniform
+    allocationvars: [0, 1]
+    to_reference: !<GroupTransform>
+      children:
+        - !<FileTransform> {src: adx_adx16_to_cdd.spimtx}
+        - !<FileTransform> {src: adx_cdd_to_cid.spimtx}
+        - !<FileTransform> {src: adx_cid_to_rle.spi1d, interpolation: linear}
+        - !<LogTransform> {base: 10, direction: inverse}
+        - !<FileTransform> {src: adx_exp_to_aces.spimtx}
+
+  - !<ColorSpace>
+    name: slogf35
+    family: sony
+    equalitygroup: 
+    bitdepth: 10ui
+    description: |
+      Sony 10-bit S-Log, with f35 color primaries
+      
+    isdata: false
+    allocation: uniform
+    allocationvars: [0, 1]
+    to_reference: !<GroupTransform>
+      children:
+        - !<FileTransform> {src: slog10.spi1d, interpolation: linear}
+        - !<FileTransform> {src: slogf35_to_aces.spimtx, interpolation: linear}
+
+  - !<ColorSpace>
+    name: slogf65_3200
+    family: sony
+    equalitygroup: 
+    bitdepth: 10ui
+    description: |
+      Sony 10-bit S-Log, with f65 color primaries
+      
+    isdata: false
+    allocation: uniform
+    allocationvars: [0, 1]
+    to_reference: !<GroupTransform>
+      children:
+        - !<FileTransform> {src: slog10.spi1d, interpolation: linear}
+        - !<FileTransform> {src: slogf65_to_aces_3200.spimtx, interpolation: linear}
+
+  - !<ColorSpace>
+    name: slogf65_5500
+    family: sony
+    equalitygroup: 
+    bitdepth: 10ui
+    description: |
+      Sony 10-bit S-Log, with f65 color primaries
+      
+    isdata: false
+    allocation: uniform
+    allocationvars: [0, 1]
+    to_reference: !<GroupTransform>
+      children:
+        - !<FileTransform> {src: slog10.spi1d, interpolation: linear}
+        - !<FileTransform> {src: slogf65_to_aces_5500.spimtx, interpolation: linear}
+
+  - !<ColorSpace>
+    name: logc
+    family: arri
+    equalitygroup: 
+    bitdepth: 10ui
+    description: |
+      Arri Alexa LogC, V3, Exposure Index 800
+      
+    isdata: false
+    allocation: uniform
+    allocationvars: [0, 1]
+    to_reference: !<GroupTransform>
+      children:
+        - !<FileTransform> {src: logc800.spi1d, interpolation: linear}
+        - !<FileTransform> {src: logc_to_aces.spimtx}
+
+  - !<ColorSpace>
+    name: log
+    family: log
+    equalitygroup: 
+    bitdepth: 32f
+    description: |
+      A mathematically idealized log space, which spans the dynamic range
+      currently being utilized by the ACES RRT. Note: this does not correspond
+      to scanned plates, adx10 is preferred for that purpose.
+      
+    isdata: false
+    allocation: uniform
+    allocationvars: [0, 1]
+    from_reference: !<GroupTransform>
+      children:
+        - !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
+
+  - !<ColorSpace>
+    name: rrt_srgb
+    family: rrt
+    equalitygroup: 
+    bitdepth: 32f
+    isdata: false
+    allocation: uniform
+    allocationvars: [0, 1]
+    from_reference: !<GroupTransform>
+      children:
+        - !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
+        - !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
+        - !<FileTransform> {src: rrt_ut33_sRGB.spi3d, interpolation: tetrahedral}
+
+  - !<ColorSpace>
+    name: rrt_rec709
+    family: rrt
+    equalitygroup: 
+    bitdepth: 32f
+    isdata: false
+    allocation: uniform
+    allocationvars: [0, 1]
+    from_reference: !<GroupTransform>
+      children:
+        - !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
+        - !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
+        - !<FileTransform> {src: rrt_ut33_rec709.spi3d, interpolation: tetrahedral}
+
+  - !<ColorSpace>
+    name: rrt_p3dci
+    family: rrt
+    equalitygroup: 
+    bitdepth: 32f
+    isdata: false
+    allocation: uniform
+    allocationvars: [0, 1]
+    from_reference: !<GroupTransform>
+      children:
+        - !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
+        - !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
+        - !<FileTransform> {src: rrt_ut33_p3dci.spi3d, interpolation: tetrahedral}
+
+  - !<ColorSpace>
+    name: rrt_p3d60
+    family: rrt
+    equalitygroup: 
+    bitdepth: 32f
+    isdata: false
+    allocation: uniform
+    allocationvars: [0, 1]
+    from_reference: !<GroupTransform>
+      children:
+        - !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
+        - !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
+        - !<FileTransform> {src: rrt_ut33_p3d60.spi3d, interpolation: tetrahedral}
+
+  - !<ColorSpace>
+    name: rrt_xyz
+    family: rrt
+    equalitygroup: 
+    bitdepth: 32f
+    isdata: false
+    allocation: uniform
+    allocationvars: [0, 1]
+    from_reference: !<GroupTransform>
+      children:
+        - !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
+        - !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
+        - !<FileTransform> {src: rrt_ut33_dcdm.spi3d, interpolation: tetrahedral}
diff --git a/release/datafiles/colormanagement/luts/adx_adx10_to_cdd.spimtx b/release/datafiles/colormanagement/luts/adx_adx10_to_cdd.spimtx
new file mode 100644 (file)
index 0000000..b1c5c9e
--- /dev/null
@@ -0,0 +1,4 @@
+2.046 0.0 0.0 -12451.65
+0.0 2.046 0.0 -12451.65
+0.0 0.0 2.046 -12451.65
+
diff --git a/release/datafiles/colormanagement/luts/adx_adx16_to_cdd.spimtx b/release/datafiles/colormanagement/luts/adx_adx16_to_cdd.spimtx
new file mode 100644 (file)
index 0000000..348eafa
--- /dev/null
@@ -0,0 +1,4 @@
+8.191875 0.0 0.0 -12451.65
+0.0 8.191875 0.0 -12451.65
+0.0 0.0 8.191875 -12451.65
+
diff --git a/release/datafiles/colormanagement/luts/adx_cdd_to_cid.spimtx b/release/datafiles/colormanagement/luts/adx_cdd_to_cid.spimtx
new file mode 100644 (file)
index 0000000..21eff95
--- /dev/null
@@ -0,0 +1,4 @@
+0.75573 0.22197 0.02230 0
+0.05901 0.96928 -0.02829 0
+0.16134 0.07406 0.76460 0
+
diff --git a/release/datafiles/colormanagement/luts/adx_cid_to_rle.py b/release/datafiles/colormanagement/luts/adx_cid_to_rle.py
new file mode 100644 (file)
index 0000000..c226d4f
--- /dev/null
@@ -0,0 +1,95 @@
+#!/usr/bin/env python
+
+import math, numpy
+
+"""
+
+const float REF_PT = (7120.0 - 1520.0) / 8000.0 * (100.0 / 55.0) - log10(0.18);
+
+const float LUT_1D[11][2] = {
+       {-0.190000000000000, -6.000000000000000},
+       { 0.010000000000000, -2.721718645000000},
+       { 0.028000000000000, -2.521718645000000},
+       { 0.054000000000000, -2.321718645000000},
+       { 0.095000000000000, -2.121718645000000},
+       { 0.145000000000000, -1.921718645000000},
+       { 0.220000000000000, -1.721718645000000},
+       { 0.300000000000000, -1.521718645000000},
+       { 0.400000000000000, -1.321718645000000},
+       { 0.500000000000000, -1.121718645000000},
+       { 0.600000000000000, -0.926545676714876}
+};
+
+       // Convert Channel Independent Density values to Relative Log Exposure values
+       float logE[3];
+       if ( cid[0] <= 0.6) logE[0] = interpolate1D( LUT_1D, cid[0]);
+       if ( cid[1] <= 0.6) logE[1] = interpolate1D( LUT_1D, cid[1]);
+       if ( cid[2] <= 0.6) logE[2] = interpolate1D( LUT_1D, cid[2]);
+
+       if ( cid[0] > 0.6) logE[0] = ( 100.0 / 55.0) * cid[0] - REF_PT;
+       if ( cid[1] > 0.6) logE[1] = ( 100.0 / 55.0) * cid[1] - REF_PT;
+       if ( cid[2] > 0.6) logE[2] = ( 100.0 / 55.0) * cid[2] - REF_PT;
+"""
+
+
+def interpolate1D(x, xp, fp):
+    return numpy.interp(x, xp, fp)
+
+LUT_1D_xp = [-0.190000000000000, 
+              0.010000000000000,
+              0.028000000000000,
+              0.054000000000000,
+              0.095000000000000,
+              0.145000000000000,
+              0.220000000000000,
+              0.300000000000000,
+              0.400000000000000,
+              0.500000000000000,
+              0.600000000000000]
+
+LUT_1D_fp = [-6.000000000000000, 
+             -2.721718645000000,
+             -2.521718645000000,
+             -2.321718645000000,
+             -2.121718645000000,
+             -1.921718645000000,
+             -1.721718645000000,
+             -1.521718645000000,
+             -1.321718645000000,
+             -1.121718645000000,
+             -0.926545676714876]
+
+REF_PT = (7120.0 - 1520.0) / 8000.0 * (100.0 / 55.0) - math.log(0.18, 10.0)
+
+def cid_to_rle(x):
+    if x <= 0.6:
+        return interpolate1D(x, LUT_1D_xp, LUT_1D_fp)
+    return (100.0 / 55.0) * x - REF_PT
+
+def WriteSPI1D(filename, fromMin, fromMax, data):
+    f = file(filename,'w')
+    f.write("Version 1\n")
+    f.write("From %s %s\n" % (fromMin, fromMax))
+    f.write("Length %d\n" % len(data))
+    f.write("Components 1\n")
+    f.write("{\n")
+    for value in data:
+        f.write("        %s\n" % value)
+    f.write("}\n")
+    f.close()
+
+def Fit(value, fromMin, fromMax, toMin, toMax):
+    if fromMin == fromMax:
+        raise ValueError("fromMin == fromMax")
+    return (value - fromMin) / (fromMax - fromMin) * (toMax - toMin) + toMin
+
+NUM_SAMPLES = 2**12
+RANGE = (-0.19, 3.0)
+data = []
+for i in xrange(NUM_SAMPLES):
+    x = i/(NUM_SAMPLES-1.0)
+    x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1])
+    data.append(cid_to_rle(x))
+
+WriteSPI1D('adx_cid_to_rle.spi1d', RANGE[0], RANGE[1], data)
+
diff --git a/release/datafiles/colormanagement/luts/adx_cid_to_rle.spi1d b/release/datafiles/colormanagement/luts/adx_cid_to_rle.spi1d
new file mode 100644 (file)
index 0000000..26b5ae9
--- /dev/null
@@ -0,0 +1,4102 @@
+Version 1
+From -0.19 3.0
+Length 4096
+Components 1
+{
+        -6.0
+        -5.98723111414
+        -5.97446222827
+        -5.96169334241
+        -5.94892445654
+        -5.93615557068
+        -5.92338668482
+        -5.91061779895
+        -5.89784891309
+        -5.88508002723
+        -5.87231114136
+        -5.8595422555
+        -5.84677336963
+        -5.83400448377
+        -5.82123559791
+        -5.80846671204
+        -5.79569782618
+        -5.78292894032
+        -5.77016005445
+        -5.75739116859
+        -5.74462228272
+        -5.73185339686
+        -5.719084511
+        -5.70631562513
+        -5.69354673927
+        -5.68077785341
+        -5.66800896754
+        -5.65524008168
+        -5.64247119581
+        -5.62970230995
+        -5.61693342409
+        -5.60416453822
+        -5.59139565236
+        -5.57862676649
+        -5.56585788063
+        -5.55308899477
+        -5.5403201089
+        -5.52755122304
+        -5.51478233718
+        -5.50201345131
+        -5.48924456545
+        -5.47647567958
+        -5.46370679372
+        -5.45093790786
+        -5.43816902199
+        -5.42540013613
+        -5.41263125027
+        -5.3998623644
+        -5.38709347854
+        -5.37432459267
+        -5.36155570681
+        -5.34878682095
+        -5.33601793508
+        -5.32324904922
+        -5.31048016335
+        -5.29771127749
+        -5.28494239163
+        -5.27217350576
+        -5.2594046199
+        -5.24663573404
+        -5.23386684817
+        -5.22109796231
+        -5.20832907644
+        -5.19556019058
+        -5.18279130472
+        -5.17002241885
+        -5.15725353299
+        -5.14448464713
+        -5.13171576126
+        -5.1189468754
+        -5.10617798953
+        -5.09340910367
+        -5.08064021781
+        -5.06787133194
+        -5.05510244608
+        -5.04233356022
+        -5.02956467435
+        -5.01679578849
+        -5.00402690262
+        -4.99125801676
+        -4.9784891309
+        -4.96572024503
+        -4.95295135917
+        -4.9401824733
+        -4.92741358744
+        -4.91464470158
+        -4.90187581571
+        -4.88910692985
+        -4.87633804399
+        -4.86356915812
+        -4.85080027226
+        -4.83803138639
+        -4.82526250053
+        -4.81249361467
+        -4.7997247288
+        -4.78695584294
+        -4.77418695708
+        -4.76141807121
+        -4.74864918535
+        -4.73588029948
+        -4.72311141362
+        -4.71034252776
+        -4.69757364189
+        -4.68480475603
+        -4.67203587017
+        -4.6592669843
+        -4.64649809844
+        -4.63372921257
+        -4.62096032671
+        -4.60819144085
+        -4.59542255498
+        -4.58265366912
+        -4.56988478325
+        -4.55711589739
+        -4.54434701153
+        -4.53157812566
+        -4.5188092398
+        -4.50604035394
+        -4.49327146807
+        -4.48050258221
+        -4.46773369634
+        -4.45496481048
+        -4.44219592462
+        -4.42942703875
+        -4.41665815289
+        -4.40388926703
+        -4.39112038116
+        -4.3783514953
+        -4.36558260943
+        -4.35281372357
+        -4.34004483771
+        -4.32727595184
+        -4.31450706598
+        -4.30173818011
+        -4.28896929425
+        -4.27620040839
+        -4.26343152252
+        -4.25066263666
+        -4.2378937508
+        -4.22512486493
+        -4.21235597907
+        -4.1995870932
+        -4.18681820734
+        -4.17404932148
+        -4.16128043561
+        -4.14851154975
+        -4.13574266389
+        -4.12297377802
+        -4.11020489216
+        -4.09743600629
+        -4.08466712043
+        -4.07189823457
+        -4.0591293487
+        -4.04636046284
+        -4.03359157698
+        -4.02082269111
+        -4.00805380525
+        -3.99528491938
+        -3.98251603352
+        -3.96974714766
+        -3.95697826179
+        -3.94420937593
+        -3.93144049006
+        -3.9186716042
+        -3.90590271834
+        -3.89313383247
+        -3.88036494661
+        -3.86759606075
+        -3.85482717488
+        -3.84205828902
+        -3.82928940315
+        -3.81652051729
+        -3.80375163143
+        -3.79098274556
+        -3.7782138597
+        -3.76544497384
+        -3.75267608797
+        -3.73990720211
+        -3.72713831624
+        -3.71436943038
+        -3.70160054452
+        -3.68883165865
+        -3.67606277279
+        -3.66329388693
+        -3.65052500106
+        -3.6377561152
+        -3.62498722933
+        -3.61221834347
+        -3.59944945761
+        -3.58668057174
+        -3.57391168588
+        -3.56114280001
+        -3.54837391415
+        -3.53560502829
+        -3.52283614242
+        -3.51006725656
+        -3.4972983707
+        -3.48452948483
+        -3.47176059897
+        -3.4589917131
+        -3.44622282724
+        -3.43345394138
+        -3.42068505551
+        -3.40791616965
+        -3.39514728379
+        -3.38237839792
+        -3.36960951206
+        -3.35684062619
+        -3.34407174033
+        -3.33130285447
+        -3.3185339686
+        -3.30576508274
+        -3.29299619687
+        -3.28022731101
+        -3.26745842515
+        -3.25468953928
+        -3.24192065342
+        -3.22915176756
+        -3.21638288169
+        -3.20361399583
+        -3.19084510996
+        -3.1780762241
+        -3.16530733824
+        -3.15253845237
+        -3.13976956651
+        -3.12700068065
+        -3.11423179478
+        -3.10146290892
+        -3.08869402305
+        -3.07592513719
+        -3.06315625133
+        -3.05038736546
+        -3.0376184796
+        -3.02484959374
+        -3.01208070787
+        -2.99931182201
+        -2.98654293614
+        -2.97377405028
+        -2.96100516442
+        -2.94823627855
+        -2.93546739269
+        -2.92269850682
+        -2.90992962096
+        -2.8971607351
+        -2.88439184923
+        -2.87162296337
+        -2.85885407751
+        -2.84608519164
+        -2.83331630578
+        -2.82054741991
+        -2.80777853405
+        -2.79500964819
+        -2.78224076232
+        -2.76947187646
+        -2.7567029906
+        -2.74393410473
+        -2.73116521887
+        -2.71946657608
+        -2.71081103409
+        -2.7021554921
+        -2.69349995011
+        -2.68484440813
+        -2.67618886614
+        -2.66753332415
+        -2.65887778216
+        -2.65022224017
+        -2.64156669818
+        -2.63291115619
+        -2.6242556142
+        -2.61560007221
+        -2.60694453023
+        -2.59828898824
+        -2.58963344625
+        -2.58097790426
+        -2.57232236227
+        -2.56366682028
+        -2.55501127829
+        -2.5463557363
+        -2.53770019431
+        -2.52904465233
+        -2.52079819793
+        -2.51480589963
+        -2.50881360133
+        -2.50282130303
+        -2.49682900473
+        -2.49083670643
+        -2.48484440813
+        -2.47885210983
+        -2.47285981153
+        -2.46686751323
+        -2.46087521493
+        -2.45488291663
+        -2.44889061833
+        -2.44289832003
+        -2.43690602173
+        -2.43091372343
+        -2.42492142513
+        -2.41892912683
+        -2.41293682853
+        -2.40694453023
+        -2.40095223193
+        -2.39495993363
+        -2.38896763533
+        -2.38297533703
+        -2.37698303873
+        -2.37099074043
+        -2.36499844213
+        -2.35900614383
+        -2.35301384553
+        -2.34702154723
+        -2.34102924893
+        -2.33503695063
+        -2.32904465233
+        -2.32305235403
+        -2.31876441766
+        -2.31496442361
+        -2.31116442957
+        -2.30736443552
+        -2.30356444148
+        -2.29976444744
+        -2.29596445339
+        -2.29216445935
+        -2.2883644653
+        -2.28456447126
+        -2.28076447722
+        -2.27696448317
+        -2.27316448913
+        -2.26936449508
+        -2.26556450104
+        -2.261764507
+        -2.25796451295
+        -2.25416451891
+        -2.25036452487
+        -2.24656453082
+        -2.24276453678
+        -2.23896454273
+        -2.23516454869
+        -2.23136455465
+        -2.2275645606
+        -2.22376456656
+        -2.21996457251
+        -2.21616457847
+        -2.21236458443
+        -2.20856459038
+        -2.20476459634
+        -2.20096460229
+        -2.19716460825
+        -2.19336461421
+        -2.18956462016
+        -2.18576462612
+        -2.18196463208
+        -2.17816463803
+        -2.17436464399
+        -2.17056464994
+        -2.1667646559
+        -2.16296466186
+        -2.15916466781
+        -2.15536467377
+        -2.15156467972
+        -2.14776468568
+        -2.14396469164
+        -2.14016469759
+        -2.13636470355
+        -2.1325647095
+        -2.12876471546
+        -2.12496472142
+        -2.12126443255
+        -2.11814843743
+        -2.11503244231
+        -2.1119164472
+        -2.10880045208
+        -2.10568445697
+        -2.10256846185
+        -2.09945246673
+        -2.09633647162
+        -2.0932204765
+        -2.09010448139
+        -2.08698848627
+        -2.08387249115
+        -2.08075649604
+        -2.07764050092
+        -2.07452450581
+        -2.07140851069
+        -2.06829251557
+        -2.06517652046
+        -2.06206052534
+        -2.05894453023
+        -2.05582853511
+        -2.05271253999
+        -2.04959654488
+        -2.04648054976
+        -2.04336455465
+        -2.04024855953
+        -2.03713256441
+        -2.0340165693
+        -2.03090057418
+        -2.02778457907
+        -2.02466858395
+        -2.02155258883
+        -2.01843659372
+        -2.0153205986
+        -2.01220460349
+        -2.00908860837
+        -2.00597261325
+        -2.00285661814
+        -1.99974062302
+        -1.99662462791
+        -1.99350863279
+        -1.99039263767
+        -1.98727664256
+        -1.98416064744
+        -1.98104465233
+        -1.97792865721
+        -1.97481266209
+        -1.97169666698
+        -1.96858067186
+        -1.96546467675
+        -1.96234868163
+        -1.95923268651
+        -1.9561166914
+        -1.95300069628
+        -1.94988470117
+        -1.94676870605
+        -1.94365271093
+        -1.94053671582
+        -1.9374207207
+        -1.93430472559
+        -1.93118873047
+        -1.92807273535
+        -1.92495674024
+        -1.92184074512
+        -1.919722715
+        -1.91764538493
+        -1.91556805485
+        -1.91349072477
+        -1.91141339469
+        -1.90933606462
+        -1.90725873454
+        -1.90518140446
+        -1.90310407439
+        -1.90102674431
+        -1.89894941423
+        -1.89687208415
+        -1.89479475408
+        -1.892717424
+        -1.89064009392
+        -1.88856276384
+        -1.88648543377
+        -1.88440810369
+        -1.88233077361
+        -1.88025344353
+        -1.87817611346
+        -1.87609878338
+        -1.8740214533
+        -1.87194412323
+        -1.86986679315
+        -1.86778946307
+        -1.86571213299
+        -1.86363480292
+        -1.86155747284
+        -1.85948014276
+        -1.85740281268
+        -1.85532548261
+        -1.85324815253
+        -1.85117082245
+        -1.84909349237
+        -1.8470161623
+        -1.84493883222
+        -1.84286150214
+        -1.84078417207
+        -1.83870684199
+        -1.83662951191
+        -1.83455218183
+        -1.83247485176
+        -1.83039752168
+        -1.8283201916
+        -1.82624286152
+        -1.82416553145
+        -1.82208820137
+        -1.82001087129
+        -1.81793354121
+        -1.81585621114
+        -1.81377888106
+        -1.81170155098
+        -1.80962422091
+        -1.80754689083
+        -1.80546956075
+        -1.80339223067
+        -1.8013149006
+        -1.79923757052
+        -1.79716024044
+        -1.79508291036
+        -1.79300558029
+        -1.79092825021
+        -1.78885092013
+        -1.78677359005
+        -1.78469625998
+        -1.7826189299
+        -1.78054159982
+        -1.77846426975
+        -1.77638693967
+        -1.77430960959
+        -1.77223227951
+        -1.77015494944
+        -1.76807761936
+        -1.76600028928
+        -1.7639229592
+        -1.76184562913
+        -1.75976829905
+        -1.75769096897
+        -1.75561363889
+        -1.75353630882
+        -1.75145897874
+        -1.74938164866
+        -1.74730431859
+        -1.74522698851
+        -1.74314965843
+        -1.74107232835
+        -1.73899499828
+        -1.7369176682
+        -1.73484033812
+        -1.73276300804
+        -1.73068567797
+        -1.72860834789
+        -1.72653101781
+        -1.72445368774
+        -1.72237635766
+        -1.72038775367
+        -1.71844025672
+        -1.71649275977
+        -1.71454526283
+        -1.71259776588
+        -1.71065026893
+        -1.70870277198
+        -1.70675527504
+        -1.70480777809
+        -1.70286028114
+        -1.70091278419
+        -1.69896528725
+        -1.6970177903
+        -1.69507029335
+        -1.6931227964
+        -1.69117529946
+        -1.68922780251
+        -1.68728030556
+        -1.68533280861
+        -1.68338531167
+        -1.68143781472
+        -1.67949031777
+        -1.67754282082
+        -1.67559532388
+        -1.67364782693
+        -1.67170032998
+        -1.66975283303
+        -1.66780533609
+        -1.66585783914
+        -1.66391034219
+        -1.66196284524
+        -1.6600153483
+        -1.65806785135
+        -1.6561203544
+        -1.65417285745
+        -1.65222536051
+        -1.65027786356
+        -1.64833036661
+        -1.64638286966
+        -1.64443537272
+        -1.64248787577
+        -1.64054037882
+        -1.63859288187
+        -1.63664538493
+        -1.63469788798
+        -1.63275039103
+        -1.63080289408
+        -1.62885539714
+        -1.62690790019
+        -1.62496040324
+        -1.62301290629
+        -1.62106540935
+        -1.6191179124
+        -1.61717041545
+        -1.6152229185
+        -1.61327542156
+        -1.61132792461
+        -1.60938042766
+        -1.60743293071
+        -1.60548543377
+        -1.60353793682
+        -1.60159043987
+        -1.59964294292
+        -1.59769544598
+        -1.59574794903
+        -1.59380045208
+        -1.59185295513
+        -1.58990545819
+        -1.58795796124
+        -1.58601046429
+        -1.58406296734
+        -1.5821154704
+        -1.58016797345
+        -1.5782204765
+        -1.57627297955
+        -1.57432548261
+        -1.57237798566
+        -1.57043048871
+        -1.56848299176
+        -1.56653549482
+        -1.56458799787
+        -1.56264050092
+        -1.56069300397
+        -1.55874550703
+        -1.55679801008
+        -1.55485051313
+        -1.55290301618
+        -1.55095551924
+        -1.54900802229
+        -1.54706052534
+        -1.54511302839
+        -1.54316553145
+        -1.5412180345
+        -1.53927053755
+        -1.5373230406
+        -1.53537554366
+        -1.53342804671
+        -1.53148054976
+        -1.52953305281
+        -1.52758555587
+        -1.52563805892
+        -1.52369056197
+        -1.52174306502
+        -1.52018018346
+        -1.5186221859
+        -1.51706418835
+        -1.51550619079
+        -1.51394819323
+        -1.51239019567
+        -1.51083219811
+        -1.50927420056
+        -1.507716203
+        -1.50615820544
+        -1.50460020788
+        -1.50304221032
+        -1.50148421277
+        -1.49992621521
+        -1.49836821765
+        -1.49681022009
+        -1.49525222253
+        -1.49369422498
+        -1.49213622742
+        -1.49057822986
+        -1.4890202323
+        -1.48746223474
+        -1.48590423719
+        -1.48434623963
+        -1.48278824207
+        -1.48123024451
+        -1.47967224695
+        -1.4781142494
+        -1.47655625184
+        -1.47499825428
+        -1.47344025672
+        -1.47188225916
+        -1.47032426161
+        -1.46876626405
+        -1.46720826649
+        -1.46565026893
+        -1.46409227137
+        -1.46253427382
+        -1.46097627626
+        -1.4594182787
+        -1.45786028114
+        -1.45630228358
+        -1.45474428603
+        -1.45318628847
+        -1.45162829091
+        -1.45007029335
+        -1.44851229579
+        -1.44695429824
+        -1.44539630068
+        -1.44383830312
+        -1.44228030556
+        -1.440722308
+        -1.43916431045
+        -1.43760631289
+        -1.43604831533
+        -1.43449031777
+        -1.43293232021
+        -1.43137432266
+        -1.4298163251
+        -1.42825832754
+        -1.42670032998
+        -1.42514233242
+        -1.42358433487
+        -1.42202633731
+        -1.42046833975
+        -1.41891034219
+        -1.41735234463
+        -1.41579434708
+        -1.41423634952
+        -1.41267835196
+        -1.4111203544
+        -1.40956235684
+        -1.40800435929
+        -1.40644636173
+        -1.40488836417
+        -1.40333036661
+        -1.40177236905
+        -1.4002143715
+        -1.39865637394
+        -1.39709837638
+        -1.39554037882
+        -1.39398238126
+        -1.39242438371
+        -1.39086638615
+        -1.38930838859
+        -1.38775039103
+        -1.38619239347
+        -1.38463439592
+        -1.38307639836
+        -1.3815184008
+        -1.37996040324
+        -1.37840240568
+        -1.37684440813
+        -1.37528641057
+        -1.37372841301
+        -1.37217041545
+        -1.37061241789
+        -1.36905442034
+        -1.36749642278
+        -1.36593842522
+        -1.36438042766
+        -1.3628224301
+        -1.36126443255
+        -1.35970643499
+        -1.35814843743
+        -1.35659043987
+        -1.35503244231
+        -1.35347444476
+        -1.3519164472
+        -1.35035844964
+        -1.34880045208
+        -1.34724245452
+        -1.34568445697
+        -1.34412645941
+        -1.34256846185
+        -1.34101046429
+        -1.33945246673
+        -1.33789446918
+        -1.33633647162
+        -1.33477847406
+        -1.3332204765
+        -1.33166247894
+        -1.33010448139
+        -1.32854648383
+        -1.32698848627
+        -1.32543048871
+        -1.32387249115
+        -1.3223144936
+        -1.32075649604
+        -1.31919849848
+        -1.31764050092
+        -1.31608250336
+        -1.31452450581
+        -1.31296650825
+        -1.31140851069
+        -1.30985051313
+        -1.30829251557
+        -1.30673451802
+        -1.30517652046
+        -1.3036185229
+        -1.30206052534
+        -1.30050252778
+        -1.29894453023
+        -1.29738653267
+        -1.29582853511
+        -1.29427053755
+        -1.29271253999
+        -1.29115454244
+        -1.28959654488
+        -1.28803854732
+        -1.28648054976
+        -1.2849225522
+        -1.28336455465
+        -1.28180655709
+        -1.28024855953
+        -1.27869056197
+        -1.27713256441
+        -1.27557456686
+        -1.2740165693
+        -1.27245857174
+        -1.27090057418
+        -1.26934257662
+        -1.26778457907
+        -1.26622658151
+        -1.26466858395
+        -1.26311058639
+        -1.26155258883
+        -1.25999459128
+        -1.25843659372
+        -1.25687859616
+        -1.2553205986
+        -1.25376260104
+        -1.25220460349
+        -1.25064660593
+        -1.24908860837
+        -1.24753061081
+        -1.24597261325
+        -1.2444146157
+        -1.24285661814
+        -1.24129862058
+        -1.23974062302
+        -1.23818262546
+        -1.23662462791
+        -1.23506663035
+        -1.23350863279
+        -1.23195063523
+        -1.23039263767
+        -1.22883464012
+        -1.22727664256
+        -1.225718645
+        -1.22416064744
+        -1.22260264988
+        -1.22104465233
+        -1.21948665477
+        -1.21792865721
+        -1.21637065965
+        -1.21481266209
+        -1.21325466454
+        -1.21169666698
+        -1.21013866942
+        -1.20858067186
+        -1.2070226743
+        -1.20546467675
+        -1.20390667919
+        -1.20234868163
+        -1.20079068407
+        -1.19923268651
+        -1.19767468896
+        -1.1961166914
+        -1.19455869384
+        -1.19300069628
+        -1.19144269872
+        -1.18988470117
+        -1.18832670361
+        -1.18676870605
+        -1.18521070849
+        -1.18365271093
+        -1.18209471338
+        -1.18053671582
+        -1.17897871826
+        -1.1774207207
+        -1.17586272314
+        -1.17430472559
+        -1.17274672803
+        -1.17118873047
+        -1.16963073291
+        -1.16807273535
+        -1.1665147378
+        -1.16495674024
+        -1.16339874268
+        -1.16184074512
+        -1.16028274756
+        -1.15872475001
+        -1.15716675245
+        -1.15560875489
+        -1.15405075733
+        -1.15249275977
+        -1.15093476222
+        -1.14937676466
+        -1.1478187671
+        -1.14626076954
+        -1.14470277198
+        -1.14314477443
+        -1.14158677687
+        -1.14002877931
+        -1.13847078175
+        -1.13691278419
+        -1.13535478664
+        -1.13379678908
+        -1.13223879152
+        -1.13068079396
+        -1.1291227964
+        -1.12756479885
+        -1.12600680129
+        -1.12444880373
+        -1.12289080617
+        -1.12134212084
+        -1.1198217258
+        -1.11830133076
+        -1.11678093572
+        -1.11526054068
+        -1.11374014564
+        -1.1122197506
+        -1.11069935556
+        -1.10917896052
+        -1.10765856548
+        -1.10613817044
+        -1.1046177754
+        -1.10309738036
+        -1.10157698532
+        -1.10005659028
+        -1.09853619524
+        -1.0970158002
+        -1.09549540516
+        -1.09397501012
+        -1.09245461508
+        -1.09093422004
+        -1.089413825
+        -1.08789342996
+        -1.08637303492
+        -1.08485263988
+        -1.08333224484
+        -1.0818118498
+        -1.08029145476
+        -1.07877105972
+        -1.07725066468
+        -1.07573026964
+        -1.0742098746
+        -1.07268947956
+        -1.07116908452
+        -1.06964868948
+        -1.06812829444
+        -1.0666078994
+        -1.06508750436
+        -1.06356710932
+        -1.06204671428
+        -1.06052631924
+        -1.0590059242
+        -1.05748552916
+        -1.05596513412
+        -1.05444473908
+        -1.05292434404
+        -1.051403949
+        -1.04988355396
+        -1.04836315892
+        -1.04684276388
+        -1.04532236884
+        -1.0438019738
+        -1.04228157876
+        -1.04076118372
+        -1.03924078868
+        -1.03772039364
+        -1.0361999986
+        -1.03467960356
+        -1.03315920852
+        -1.03163881348
+        -1.03011841844
+        -1.0285980234
+        -1.02707762836
+        -1.02555723332
+        -1.02403683828
+        -1.02251644324
+        -1.0209960482
+        -1.01947565316
+        -1.01795525812
+        -1.01643486309
+        -1.01491446805
+        -1.01339407301
+        -1.01187367797
+        -1.01035328293
+        -1.00883288789
+        -1.00731249285
+        -1.00579209781
+        -1.00427170277
+        -1.00275130773
+        -1.00123091269
+        -0.999710517646
+        -0.998190122606
+        -0.996669727567
+        -0.995149332527
+        -0.993628937487
+        -0.992108542447
+        -0.990588147407
+        -0.989067752367
+        -0.987547357327
+        -0.986026962287
+        -0.984506567248
+        -0.982986172208
+        -0.981465777168
+        -0.979945382128
+        -0.978424987088
+        -0.976904592048
+        -0.975384197008
+        -0.973863801968
+        -0.972343406929
+        -0.970823011889
+        -0.969302616849
+        -0.967782221809
+        -0.966261826769
+        -0.964741431729
+        -0.963221036689
+        -0.961700641649
+        -0.96018024661
+        -0.95865985157
+        -0.95713945653
+        -0.95561906149
+        -0.95409866645
+        -0.95257827141
+        -0.95105787637
+        -0.94953748133
+        -0.948017086291
+        -0.946496691251
+        -0.944976296211
+        -0.943455901171
+        -0.941935506131
+        -0.940415111091
+        -0.938894716051
+        -0.937374321011
+        -0.935853925972
+        -0.934333530932
+        -0.932813135892
+        -0.931292740852
+        -0.929772345812
+        -0.928251950772
+        -0.926731555732
+        -0.925302475472
+        -0.923886114055
+        -0.922469752639
+        -0.921053391223
+        -0.919637029806
+        -0.91822066839
+        -0.916804306974
+        -0.915387945557
+        -0.913971584141
+        -0.912555222724
+        -0.911138861308
+        -0.909722499892
+        -0.908306138475
+        -0.906889777059
+        -0.905473415643
+        -0.904057054226
+        -0.90264069281
+        -0.901224331394
+        -0.899807969977
+        -0.898391608561
+        -0.896975247144
+        -0.895558885728
+        -0.894142524312
+        -0.892726162895
+        -0.891309801479
+        -0.889893440063
+        -0.888477078646
+        -0.88706071723
+        -0.885644355814
+        -0.884227994397
+        -0.882811632981
+        -0.881395271564
+        -0.879978910148
+        -0.878562548732
+        -0.877146187315
+        -0.875729825899
+        -0.874313464483
+        -0.872897103066
+        -0.87148074165
+        -0.870064380234
+        -0.868648018817
+        -0.867231657401
+        -0.865815295984
+        -0.864398934568
+        -0.862982573152
+        -0.861566211735
+        -0.860149850319
+        -0.858733488903
+        -0.857317127486
+        -0.85590076607
+        -0.854484404654
+        -0.853068043237
+        -0.851651681821
+        -0.850235320405
+        -0.848818958988
+        -0.847402597572
+        -0.845986236155
+        -0.844569874739
+        -0.843153513323
+        -0.841737151906
+        -0.84032079049
+        -0.838904429074
+        -0.837488067657
+        -0.836071706241
+        -0.834655344825
+        -0.833238983408
+        -0.831822621992
+        -0.830406260575
+        -0.828989899159
+        -0.827573537743
+        -0.826157176326
+        -0.82474081491
+        -0.823324453494
+        -0.821908092077
+        -0.820491730661
+        -0.819075369245
+        -0.817659007828
+        -0.816242646412
+        -0.814826284995
+        -0.813409923579
+        -0.811993562163
+        -0.810577200746
+        -0.80916083933
+        -0.807744477914
+        -0.806328116497
+        -0.804911755081
+        -0.803495393665
+        -0.802079032248
+        -0.800662670832
+        -0.799246309416
+        -0.797829947999
+        -0.796413586583
+        -0.794997225166
+        -0.79358086375
+        -0.792164502334
+        -0.790748140917
+        -0.789331779501
+        -0.787915418085
+        -0.786499056668
+        -0.785082695252
+        -0.783666333836
+        -0.782249972419
+        -0.780833611003
+        -0.779417249586
+        -0.77800088817
+        -0.776584526754
+        -0.775168165337
+        -0.773751803921
+        -0.772335442505
+        -0.770919081088
+        -0.769502719672
+        -0.768086358256
+        -0.766669996839
+        -0.765253635423
+        -0.763837274006
+        -0.76242091259
+        -0.761004551174
+        -0.759588189757
+        -0.758171828341
+        -0.756755466925
+        -0.755339105508
+        -0.753922744092
+        -0.752506382676
+        -0.751090021259
+        -0.749673659843
+        -0.748257298426
+        -0.74684093701
+        -0.745424575594
+        -0.744008214177
+        -0.742591852761
+        -0.741175491345
+        -0.739759129928
+        -0.738342768512
+        -0.736926407096
+        -0.735510045679
+        -0.734093684263
+        -0.732677322847
+        -0.73126096143
+        -0.729844600014
+        -0.728428238597
+        -0.727011877181
+        -0.725595515765
+        -0.724179154348
+        -0.722762792932
+        -0.721346431516
+        -0.719930070099
+        -0.718513708683
+        -0.717097347267
+        -0.71568098585
+        -0.714264624434
+        -0.712848263017
+        -0.711431901601
+        -0.710015540185
+        -0.708599178768
+        -0.707182817352
+        -0.705766455936
+        -0.704350094519
+        -0.702933733103
+        -0.701517371687
+        -0.70010101027
+        -0.698684648854
+        -0.697268287437
+        -0.695851926021
+        -0.694435564605
+        -0.693019203188
+        -0.691602841772
+        -0.690186480356
+        -0.688770118939
+        -0.687353757523
+        -0.685937396107
+        -0.68452103469
+        -0.683104673274
+        -0.681688311858
+        -0.680271950441
+        -0.678855589025
+        -0.677439227608
+        -0.676022866192
+        -0.674606504776
+        -0.673190143359
+        -0.671773781943
+        -0.670357420527
+        -0.66894105911
+        -0.667524697694
+        -0.666108336278
+        -0.664691974861
+        -0.663275613445
+        -0.661859252028
+        -0.660442890612
+        -0.659026529196
+        -0.657610167779
+        -0.656193806363
+        -0.654777444947
+        -0.65336108353
+        -0.651944722114
+        -0.650528360698
+        -0.649111999281
+        -0.647695637865
+        -0.646279276448
+        -0.644862915032
+        -0.643446553616
+        -0.642030192199
+        -0.640613830783
+        -0.639197469367
+        -0.63778110795
+        -0.636364746534
+        -0.634948385118
+        -0.633532023701
+        -0.632115662285
+        -0.630699300868
+        -0.629282939452
+        -0.627866578036
+        -0.626450216619
+        -0.625033855203
+        -0.623617493787
+        -0.62220113237
+        -0.620784770954
+        -0.619368409538
+        -0.617952048121
+        -0.616535686705
+        -0.615119325289
+        -0.613702963872
+        -0.612286602456
+        -0.610870241039
+        -0.609453879623
+        -0.608037518207
+        -0.60662115679
+        -0.605204795374
+        -0.603788433958
+        -0.602372072541
+        -0.600955711125
+        -0.599539349709
+        -0.598122988292
+        -0.596706626876
+        -0.595290265459
+        -0.593873904043
+        -0.592457542627
+        -0.59104118121
+        -0.589624819794
+        -0.588208458378
+        -0.586792096961
+        -0.585375735545
+        -0.583959374129
+        -0.582543012712
+        -0.581126651296
+        -0.579710289879
+        -0.578293928463
+        -0.576877567047
+        -0.57546120563
+        -0.574044844214
+        -0.572628482798
+        -0.571212121381
+        -0.569795759965
+        -0.568379398549
+        -0.566963037132
+        -0.565546675716
+        -0.5641303143
+        -0.562713952883
+        -0.561297591467
+        -0.55988123005
+        -0.558464868634
+        -0.557048507218
+        -0.555632145801
+        -0.554215784385
+        -0.552799422969
+        -0.551383061552
+        -0.549966700136
+        -0.54855033872
+        -0.547133977303
+        -0.545717615887
+        -0.54430125447
+        -0.542884893054
+        -0.541468531638
+        -0.540052170221
+        -0.538635808805
+        -0.537219447389
+        -0.535803085972
+        -0.534386724556
+        -0.53297036314
+        -0.531554001723
+        -0.530137640307
+        -0.52872127889
+        -0.527304917474
+        -0.525888556058
+        -0.524472194641
+        -0.523055833225
+        -0.521639471809
+        -0.520223110392
+        -0.518806748976
+        -0.51739038756
+        -0.515974026143
+        -0.514557664727
+        -0.513141303311
+        -0.511724941894
+        -0.510308580478
+        -0.508892219061
+        -0.507475857645
+        -0.506059496229
+        -0.504643134812
+        -0.503226773396
+        -0.50181041198
+        -0.500394050563
+        -0.498977689147
+        -0.497561327731
+        -0.496144966314
+        -0.494728604898
+        -0.493312243481
+        -0.491895882065
+        -0.490479520649
+        -0.489063159232
+        -0.487646797816
+        -0.4862304364
+        -0.484814074983
+        -0.483397713567
+        -0.481981352151
+        -0.480564990734
+        -0.479148629318
+        -0.477732267901
+        -0.476315906485
+        -0.474899545069
+        -0.473483183652
+        -0.472066822236
+        -0.47065046082
+        -0.469234099403
+        -0.467817737987
+        -0.466401376571
+        -0.464985015154
+        -0.463568653738
+        -0.462152292321
+        -0.460735930905
+        -0.459319569489
+        -0.457903208072
+        -0.456486846656
+        -0.45507048524
+        -0.453654123823
+        -0.452237762407
+        -0.450821400991
+        -0.449405039574
+        -0.447988678158
+        -0.446572316742
+        -0.445155955325
+        -0.443739593909
+        -0.442323232492
+        -0.440906871076
+        -0.43949050966
+        -0.438074148243
+        -0.436657786827
+        -0.435241425411
+        -0.433825063994
+        -0.432408702578
+        -0.430992341162
+        -0.429575979745
+        -0.428159618329
+        -0.426743256912
+        -0.425326895496
+        -0.42391053408
+        -0.422494172663
+        -0.421077811247
+        -0.419661449831
+        -0.418245088414
+        -0.416828726998
+        -0.415412365582
+        -0.413996004165
+        -0.412579642749
+        -0.411163281332
+        -0.409746919916
+        -0.4083305585
+        -0.406914197083
+        -0.405497835667
+        -0.404081474251
+        -0.402665112834
+        -0.401248751418
+        -0.399832390002
+        -0.398416028585
+        -0.396999667169
+        -0.395583305753
+        -0.394166944336
+        -0.39275058292
+        -0.391334221503
+        -0.389917860087
+        -0.388501498671
+        -0.387085137254
+        -0.385668775838
+        -0.384252414422
+        -0.382836053005
+        -0.381419691589
+        -0.380003330173
+        -0.378586968756
+        -0.37717060734
+        -0.375754245923
+        -0.374337884507
+        -0.372921523091
+        -0.371505161674
+        -0.370088800258
+        -0.368672438842
+        -0.367256077425
+        -0.365839716009
+        -0.364423354593
+        -0.363006993176
+        -0.36159063176
+        -0.360174270343
+        -0.358757908927
+        -0.357341547511
+        -0.355925186094
+        -0.354508824678
+        -0.353092463262
+        -0.351676101845
+        -0.350259740429
+        -0.348843379013
+        -0.347427017596
+        -0.34601065618
+        -0.344594294763
+        -0.343177933347
+        -0.341761571931
+        -0.340345210514
+        -0.338928849098
+        -0.337512487682
+        -0.336096126265
+        -0.334679764849
+        -0.333263403433
+        -0.331847042016
+        -0.3304306806
+        -0.329014319184
+        -0.327597957767
+        -0.326181596351
+        -0.324765234934
+        -0.323348873518
+        -0.321932512102
+        -0.320516150685
+        -0.319099789269
+        -0.317683427853
+        -0.316267066436
+        -0.31485070502
+        -0.313434343604
+        -0.312017982187
+        -0.310601620771
+        -0.309185259354
+        -0.307768897938
+        -0.306352536522
+        -0.304936175105
+        -0.303519813689
+        -0.302103452273
+        -0.300687090856
+        -0.29927072944
+        -0.297854368024
+        -0.296438006607
+        -0.295021645191
+        -0.293605283774
+        -0.292188922358
+        -0.290772560942
+        -0.289356199525
+        -0.287939838109
+        -0.286523476693
+        -0.285107115276
+        -0.28369075386
+        -0.282274392444
+        -0.280858031027
+        -0.279441669611
+        -0.278025308195
+        -0.276608946778
+        -0.275192585362
+        -0.273776223945
+        -0.272359862529
+        -0.270943501113
+        -0.269527139696
+        -0.26811077828
+        -0.266694416864
+        -0.265278055447
+        -0.263861694031
+        -0.262445332615
+        -0.261028971198
+        -0.259612609782
+        -0.258196248365
+        -0.256779886949
+        -0.255363525533
+        -0.253947164116
+        -0.2525308027
+        -0.251114441284
+        -0.249698079867
+        -0.248281718451
+        -0.246865357035
+        -0.245448995618
+        -0.244032634202
+        -0.242616272785
+        -0.241199911369
+        -0.239783549953
+        -0.238367188536
+        -0.23695082712
+        -0.235534465704
+        -0.234118104287
+        -0.232701742871
+        -0.231285381455
+        -0.229869020038
+        -0.228452658622
+        -0.227036297205
+        -0.225619935789
+        -0.224203574373
+        -0.222787212956
+        -0.22137085154
+        -0.219954490124
+        -0.218538128707
+        -0.217121767291
+        -0.215705405875
+        -0.214289044458
+        -0.212872683042
+        -0.211456321626
+        -0.210039960209
+        -0.208623598793
+        -0.207207237376
+        -0.20579087596
+        -0.204374514544
+        -0.202958153127
+        -0.201541791711
+        -0.200125430295
+        -0.198709068878
+        -0.197292707462
+        -0.195876346046
+        -0.194459984629
+        -0.193043623213
+        -0.191627261796
+        -0.19021090038
+        -0.188794538964
+        -0.187378177547
+        -0.185961816131
+        -0.184545454715
+        -0.183129093298
+        -0.181712731882
+        -0.180296370466
+        -0.178880009049
+        -0.177463647633
+        -0.176047286216
+        -0.1746309248
+        -0.173214563384
+        -0.171798201967
+        -0.170381840551
+        -0.168965479135
+        -0.167549117718
+        -0.166132756302
+        -0.164716394886
+        -0.163300033469
+        -0.161883672053
+        -0.160467310637
+        -0.15905094922
+        -0.157634587804
+        -0.156218226387
+        -0.154801864971
+        -0.153385503555
+        -0.151969142138
+        -0.150552780722
+        -0.149136419306
+        -0.147720057889
+        -0.146303696473
+        -0.144887335057
+        -0.14347097364
+        -0.142054612224
+        -0.140638250807
+        -0.139221889391
+        -0.137805527975
+        -0.136389166558
+        -0.134972805142
+        -0.133556443726
+        -0.132140082309
+        -0.130723720893
+        -0.129307359477
+        -0.12789099806
+        -0.126474636644
+        -0.125058275227
+        -0.123641913811
+        -0.122225552395
+        -0.120809190978
+        -0.119392829562
+        -0.117976468146
+        -0.116560106729
+        -0.115143745313
+        -0.113727383897
+        -0.11231102248
+        -0.110894661064
+        -0.109478299647
+        -0.108061938231
+        -0.106645576815
+        -0.105229215398
+        -0.103812853982
+        -0.102396492566
+        -0.100980131149
+        -0.099563769733
+        -0.0981474083166
+        -0.0967310469002
+        -0.0953146854839
+        -0.0938983240675
+        -0.0924819626512
+        -0.0910656012348
+        -0.0896492398184
+        -0.0882328784021
+        -0.0868165169857
+        -0.0854001555694
+        -0.083983794153
+        -0.0825674327366
+        -0.0811510713203
+        -0.0797347099039
+        -0.0783183484875
+        -0.0769019870712
+        -0.0754856256548
+        -0.0740692642385
+        -0.0726529028221
+        -0.0712365414057
+        -0.0698201799894
+        -0.068403818573
+        -0.0669874571567
+        -0.0655710957403
+        -0.0641547343239
+        -0.0627383729076
+        -0.0613220114912
+        -0.0599056500748
+        -0.0584892886585
+        -0.0570729272421
+        -0.0556565658258
+        -0.0542402044094
+        -0.052823842993
+        -0.0514074815767
+        -0.0499911201603
+        -0.048574758744
+        -0.0471583973276
+        -0.0457420359112
+        -0.0443256744949
+        -0.0429093130785
+        -0.0414929516622
+        -0.0400765902458
+        -0.0386602288294
+        -0.0372438674131
+        -0.0358275059967
+        -0.0344111445803
+        -0.032994783164
+        -0.0315784217476
+        -0.0301620603313
+        -0.0287456989149
+        -0.0273293374985
+        -0.0259129760822
+        -0.0244966146658
+        -0.0230802532495
+        -0.0216638918331
+        -0.0202475304167
+        -0.0188311690004
+        -0.017414807584
+        -0.0159984461676
+        -0.0145820847513
+        -0.0131657233349
+        -0.0117493619186
+        -0.0103330005022
+        -0.00891663908584
+        -0.00750027766948
+        -0.00608391625311
+        -0.00466755483675
+        -0.00325119342039
+        -0.00183483200403
+        -0.00041847058767
+        0.000997890828692
+        0.00241425224505
+        0.00383061366141
+        0.00524697507778
+        0.00666333649414
+        0.0080796979105
+        0.00949605932686
+        0.0109124207432
+        0.0123287821596
+        0.0137451435759
+        0.0151615049923
+        0.0165778664087
+        0.017994227825
+        0.0194105892414
+        0.0208269506578
+        0.0222433120741
+        0.0236596734905
+        0.0250760349068
+        0.0264923963232
+        0.0279087577396
+        0.0293251191559
+        0.0307414805723
+        0.0321578419886
+        0.033574203405
+        0.0349905648214
+        0.0364069262377
+        0.0378232876541
+        0.0392396490705
+        0.0406560104868
+        0.0420723719032
+        0.0434887333195
+        0.0449050947359
+        0.0463214561523
+        0.0477378175686
+        0.049154178985
+        0.0505705404013
+        0.0519869018177
+        0.0534032632341
+        0.0548196246504
+        0.0562359860668
+        0.0576523474831
+        0.0590687088995
+        0.0604850703159
+        0.0619014317322
+        0.0633177931486
+        0.064734154565
+        0.0661505159813
+        0.0675668773977
+        0.068983238814
+        0.0703996002304
+        0.0718159616468
+        0.0732323230631
+        0.0746486844795
+        0.0760650458958
+        0.0774814073122
+        0.0788977687286
+        0.0803141301449
+        0.0817304915613
+        0.0831468529777
+        0.084563214394
+        0.0859795758104
+        0.0873959372267
+        0.0888122986431
+        0.0902286600595
+        0.0916450214758
+        0.0930613828922
+        0.0944777443085
+        0.0958941057249
+        0.0973104671413
+        0.0987268285576
+        0.100143189974
+        0.10155955139
+        0.102975912807
+        0.104392274223
+        0.105808635639
+        0.107224997056
+        0.108641358472
+        0.110057719889
+        0.111474081305
+        0.112890442721
+        0.114306804138
+        0.115723165554
+        0.11713952697
+        0.118555888387
+        0.119972249803
+        0.121388611219
+        0.122804972636
+        0.124221334052
+        0.125637695468
+        0.127054056885
+        0.128470418301
+        0.129886779718
+        0.131303141134
+        0.13271950255
+        0.134135863967
+        0.135552225383
+        0.136968586799
+        0.138384948216
+        0.139801309632
+        0.141217671048
+        0.142634032465
+        0.144050393881
+        0.145466755298
+        0.146883116714
+        0.14829947813
+        0.149715839547
+        0.151132200963
+        0.152548562379
+        0.153964923796
+        0.155381285212
+        0.156797646628
+        0.158214008045
+        0.159630369461
+        0.161046730878
+        0.162463092294
+        0.16387945371
+        0.165295815127
+        0.166712176543
+        0.168128537959
+        0.169544899376
+        0.170961260792
+        0.172377622208
+        0.173793983625
+        0.175210345041
+        0.176626706458
+        0.178043067874
+        0.17945942929
+        0.180875790707
+        0.182292152123
+        0.183708513539
+        0.185124874956
+        0.186541236372
+        0.187957597788
+        0.189373959205
+        0.190790320621
+        0.192206682037
+        0.193623043454
+        0.19503940487
+        0.196455766287
+        0.197872127703
+        0.199288489119
+        0.200704850536
+        0.202121211952
+        0.203537573368
+        0.204953934785
+        0.206370296201
+        0.207786657617
+        0.209203019034
+        0.21061938045
+        0.212035741867
+        0.213452103283
+        0.214868464699
+        0.216284826116
+        0.217701187532
+        0.219117548948
+        0.220533910365
+        0.221950271781
+        0.223366633197
+        0.224782994614
+        0.22619935603
+        0.227615717447
+        0.229032078863
+        0.230448440279
+        0.231864801696
+        0.233281163112
+        0.234697524528
+        0.236113885945
+        0.237530247361
+        0.238946608777
+        0.240362970194
+        0.24177933161
+        0.243195693026
+        0.244612054443
+        0.246028415859
+        0.247444777276
+        0.248861138692
+        0.250277500108
+        0.251693861525
+        0.253110222941
+        0.254526584357
+        0.255942945774
+        0.25735930719
+        0.258775668606
+        0.260192030023
+        0.261608391439
+        0.263024752856
+        0.264441114272
+        0.265857475688
+        0.267273837105
+        0.268690198521
+        0.270106559937
+        0.271522921354
+        0.27293928277
+        0.274355644186
+        0.275772005603
+        0.277188367019
+        0.278604728436
+        0.280021089852
+        0.281437451268
+        0.282853812685
+        0.284270174101
+        0.285686535517
+        0.287102896934
+        0.28851925835
+        0.289935619766
+        0.291351981183
+        0.292768342599
+        0.294184704016
+        0.295601065432
+        0.297017426848
+        0.298433788265
+        0.299850149681
+        0.301266511097
+        0.302682872514
+        0.30409923393
+        0.305515595346
+        0.306931956763
+        0.308348318179
+        0.309764679595
+        0.311181041012
+        0.312597402428
+        0.314013763845
+        0.315430125261
+        0.316846486677
+        0.318262848094
+        0.31967920951
+        0.321095570926
+        0.322511932343
+        0.323928293759
+        0.325344655175
+        0.326761016592
+        0.328177378008
+        0.329593739425
+        0.331010100841
+        0.332426462257
+        0.333842823674
+        0.33525918509
+        0.336675546506
+        0.338091907923
+        0.339508269339
+        0.340924630755
+        0.342340992172
+        0.343757353588
+        0.345173715005
+        0.346590076421
+        0.348006437837
+        0.349422799254
+        0.35083916067
+        0.352255522086
+        0.353671883503
+        0.355088244919
+        0.356504606335
+        0.357920967752
+        0.359337329168
+        0.360753690584
+        0.362170052001
+        0.363586413417
+        0.365002774834
+        0.36641913625
+        0.367835497666
+        0.369251859083
+        0.370668220499
+        0.372084581915
+        0.373500943332
+        0.374917304748
+        0.376333666164
+        0.377750027581
+        0.379166388997
+        0.380582750414
+        0.38199911183
+        0.383415473246
+        0.384831834663
+        0.386248196079
+        0.387664557495
+        0.389080918912
+        0.390497280328
+        0.391913641744
+        0.393330003161
+        0.394746364577
+        0.396162725994
+        0.39757908741
+        0.398995448826
+        0.400411810243
+        0.401828171659
+        0.403244533075
+        0.404660894492
+        0.406077255908
+        0.407493617324
+        0.408909978741
+        0.410326340157
+        0.411742701574
+        0.41315906299
+        0.414575424406
+        0.415991785823
+        0.417408147239
+        0.418824508655
+        0.420240870072
+        0.421657231488
+        0.423073592904
+        0.424489954321
+        0.425906315737
+        0.427322677153
+        0.42873903857
+        0.430155399986
+        0.431571761403
+        0.432988122819
+        0.434404484235
+        0.435820845652
+        0.437237207068
+        0.438653568484
+        0.440069929901
+        0.441486291317
+        0.442902652733
+        0.44431901415
+        0.445735375566
+        0.447151736983
+        0.448568098399
+        0.449984459815
+        0.451400821232
+        0.452817182648
+        0.454233544064
+        0.455649905481
+        0.457066266897
+        0.458482628313
+        0.45989898973
+        0.461315351146
+        0.462731712563
+        0.464148073979
+        0.465564435395
+        0.466980796812
+        0.468397158228
+        0.469813519644
+        0.471229881061
+        0.472646242477
+        0.474062603893
+        0.47547896531
+        0.476895326726
+        0.478311688142
+        0.479728049559
+        0.481144410975
+        0.482560772392
+        0.483977133808
+        0.485393495224
+        0.486809856641
+        0.488226218057
+        0.489642579473
+        0.49105894089
+        0.492475302306
+        0.493891663722
+        0.495308025139
+        0.496724386555
+        0.498140747972
+        0.499557109388
+        0.500973470804
+        0.502389832221
+        0.503806193637
+        0.505222555053
+        0.50663891647
+        0.508055277886
+        0.509471639302
+        0.510888000719
+        0.512304362135
+        0.513720723552
+        0.515137084968
+        0.516553446384
+        0.517969807801
+        0.519386169217
+        0.520802530633
+        0.52221889205
+        0.523635253466
+        0.525051614882
+        0.526467976299
+        0.527884337715
+        0.529300699132
+        0.530717060548
+        0.532133421964
+        0.533549783381
+        0.534966144797
+        0.536382506213
+        0.53779886763
+        0.539215229046
+        0.540631590462
+        0.542047951879
+        0.543464313295
+        0.544880674711
+        0.546297036128
+        0.547713397544
+        0.549129758961
+        0.550546120377
+        0.551962481793
+        0.55337884321
+        0.554795204626
+        0.556211566042
+        0.557627927459
+        0.559044288875
+        0.560460650291
+        0.561877011708
+        0.563293373124
+        0.564709734541
+        0.566126095957
+        0.567542457373
+        0.56895881879
+        0.570375180206
+        0.571791541622
+        0.573207903039
+        0.574624264455
+        0.576040625871
+        0.577456987288
+        0.578873348704
+        0.580289710121
+        0.581706071537
+        0.583122432953
+        0.58453879437
+        0.585955155786
+        0.587371517202
+        0.588787878619
+        0.590204240035
+        0.591620601451
+        0.593036962868
+        0.594453324284
+        0.5958696857
+        0.597286047117
+        0.598702408533
+        0.60011876995
+        0.601535131366
+        0.602951492782
+        0.604367854199
+        0.605784215615
+        0.607200577031
+        0.608616938448
+        0.610033299864
+        0.61144966128
+        0.612866022697
+        0.614282384113
+        0.61569874553
+        0.617115106946
+        0.618531468362
+        0.619947829779
+        0.621364191195
+        0.622780552611
+        0.624196914028
+        0.625613275444
+        0.62702963686
+        0.628445998277
+        0.629862359693
+        0.63127872111
+        0.632695082526
+        0.634111443942
+        0.635527805359
+        0.636944166775
+        0.638360528191
+        0.639776889608
+        0.641193251024
+        0.64260961244
+        0.644025973857
+        0.645442335273
+        0.646858696689
+        0.648275058106
+        0.649691419522
+        0.651107780939
+        0.652524142355
+        0.653940503771
+        0.655356865188
+        0.656773226604
+        0.65818958802
+        0.659605949437
+        0.661022310853
+        0.662438672269
+        0.663855033686
+        0.665271395102
+        0.666687756519
+        0.668104117935
+        0.669520479351
+        0.670936840768
+        0.672353202184
+        0.6737695636
+        0.675185925017
+        0.676602286433
+        0.678018647849
+        0.679435009266
+        0.680851370682
+        0.682267732099
+        0.683684093515
+        0.685100454931
+        0.686516816348
+        0.687933177764
+        0.68934953918
+        0.690765900597
+        0.692182262013
+        0.693598623429
+        0.695014984846
+        0.696431346262
+        0.697847707679
+        0.699264069095
+        0.700680430511
+        0.702096791928
+        0.703513153344
+        0.70492951476
+        0.706345876177
+        0.707762237593
+        0.709178599009
+        0.710594960426
+        0.712011321842
+        0.713427683258
+        0.714844044675
+        0.716260406091
+        0.717676767508
+        0.719093128924
+        0.72050949034
+        0.721925851757
+        0.723342213173
+        0.724758574589
+        0.726174936006
+        0.727591297422
+        0.729007658838
+        0.730424020255
+        0.731840381671
+        0.733256743088
+        0.734673104504
+        0.73608946592
+        0.737505827337
+        0.738922188753
+        0.740338550169
+        0.741754911586
+        0.743171273002
+        0.744587634418
+        0.746003995835
+        0.747420357251
+        0.748836718668
+        0.750253080084
+        0.7516694415
+        0.753085802917
+        0.754502164333
+        0.755918525749
+        0.757334887166
+        0.758751248582
+        0.760167609998
+        0.761583971415
+        0.763000332831
+        0.764416694247
+        0.765833055664
+        0.76724941708
+        0.768665778497
+        0.770082139913
+        0.771498501329
+        0.772914862746
+        0.774331224162
+        0.775747585578
+        0.777163946995
+        0.778580308411
+        0.779996669827
+        0.781413031244
+        0.78282939266
+        0.784245754077
+        0.785662115493
+        0.787078476909
+        0.788494838326
+        0.789911199742
+        0.791327561158
+        0.792743922575
+        0.794160283991
+        0.795576645407
+        0.796993006824
+        0.79840936824
+        0.799825729657
+        0.801242091073
+        0.802658452489
+        0.804074813906
+        0.805491175322
+        0.806907536738
+        0.808323898155
+        0.809740259571
+        0.811156620987
+        0.812572982404
+        0.81398934382
+        0.815405705237
+        0.816822066653
+        0.818238428069
+        0.819654789486
+        0.821071150902
+        0.822487512318
+        0.823903873735
+        0.825320235151
+        0.826736596567
+        0.828152957984
+        0.8295693194
+        0.830985680816
+        0.832402042233
+        0.833818403649
+        0.835234765066
+        0.836651126482
+        0.838067487898
+        0.839483849315
+        0.840900210731
+        0.842316572147
+        0.843732933564
+        0.84514929498
+        0.846565656396
+        0.847982017813
+        0.849398379229
+        0.850814740646
+        0.852231102062
+        0.853647463478
+        0.855063824895
+        0.856480186311
+        0.857896547727
+        0.859312909144
+        0.86072927056
+        0.862145631976
+        0.863561993393
+        0.864978354809
+        0.866394716226
+        0.867811077642
+        0.869227439058
+        0.870643800475
+        0.872060161891
+        0.873476523307
+        0.874892884724
+        0.87630924614
+        0.877725607556
+        0.879141968973
+        0.880558330389
+        0.881974691805
+        0.883391053222
+        0.884807414638
+        0.886223776055
+        0.887640137471
+        0.889056498887
+        0.890472860304
+        0.89188922172
+        0.893305583136
+        0.894721944553
+        0.896138305969
+        0.897554667385
+        0.898971028802
+        0.900387390218
+        0.901803751635
+        0.903220113051
+        0.904636474467
+        0.906052835884
+        0.9074691973
+        0.908885558716
+        0.910301920133
+        0.911718281549
+        0.913134642965
+        0.914551004382
+        0.915967365798
+        0.917383727215
+        0.918800088631
+        0.920216450047
+        0.921632811464
+        0.92304917288
+        0.924465534296
+        0.925881895713
+        0.927298257129
+        0.928714618545
+        0.930130979962
+        0.931547341378
+        0.932963702795
+        0.934380064211
+        0.935796425627
+        0.937212787044
+        0.93862914846
+        0.940045509876
+        0.941461871293
+        0.942878232709
+        0.944294594125
+        0.945710955542
+        0.947127316958
+        0.948543678374
+        0.949960039791
+        0.951376401207
+        0.952792762624
+        0.95420912404
+        0.955625485456
+        0.957041846873
+        0.958458208289
+        0.959874569705
+        0.961290931122
+        0.962707292538
+        0.964123653954
+        0.965540015371
+        0.966956376787
+        0.968372738204
+        0.96978909962
+        0.971205461036
+        0.972621822453
+        0.974038183869
+        0.975454545285
+        0.976870906702
+        0.978287268118
+        0.979703629534
+        0.981119990951
+        0.982536352367
+        0.983952713784
+        0.9853690752
+        0.986785436616
+        0.988201798033
+        0.989618159449
+        0.991034520865
+        0.992450882282
+        0.993867243698
+        0.995283605114
+        0.996699966531
+        0.998116327947
+        0.999532689363
+        1.00094905078
+        1.0023654122
+        1.00378177361
+        1.00519813503
+        1.00661449645
+        1.00803085786
+        1.00944721928
+        1.01086358069
+        1.01227994211
+        1.01369630353
+        1.01511266494
+        1.01652902636
+        1.01794538778
+        1.01936174919
+        1.02077811061
+        1.02219447203
+        1.02361083344
+        1.02502719486
+        1.02644355627
+        1.02785991769
+        1.02927627911
+        1.03069264052
+        1.03210900194
+        1.03352536336
+        1.03494172477
+        1.03635808619
+        1.03777444761
+        1.03919080902
+        1.04060717044
+        1.04202353185
+        1.04343989327
+        1.04485625469
+        1.0462726161
+        1.04768897752
+        1.04910533894
+        1.05052170035
+        1.05193806177
+        1.05335442319
+        1.0547707846
+        1.05618714602
+        1.05760350743
+        1.05901986885
+        1.06043623027
+        1.06185259168
+        1.0632689531
+        1.06468531452
+        1.06610167593
+        1.06751803735
+        1.06893439877
+        1.07035076018
+        1.0717671216
+        1.07318348301
+        1.07459984443
+        1.07601620585
+        1.07743256726
+        1.07884892868
+        1.0802652901
+        1.08168165151
+        1.08309801293
+        1.08451437435
+        1.08593073576
+        1.08734709718
+        1.08876345859
+        1.09017982001
+        1.09159618143
+        1.09301254284
+        1.09442890426
+        1.09584526568
+        1.09726162709
+        1.09867798851
+        1.10009434993
+        1.10151071134
+        1.10292707276
+        1.10434343417
+        1.10575979559
+        1.10717615701
+        1.10859251842
+        1.11000887984
+        1.11142524126
+        1.11284160267
+        1.11425796409
+        1.11567432551
+        1.11709068692
+        1.11850704834
+        1.11992340975
+        1.12133977117
+        1.12275613259
+        1.124172494
+        1.12558885542
+        1.12700521684
+        1.12842157825
+        1.12983793967
+        1.13125430109
+        1.1326706625
+        1.13408702392
+        1.13550338533
+        1.13691974675
+        1.13833610817
+        1.13975246958
+        1.141168831
+        1.14258519242
+        1.14400155383
+        1.14541791525
+        1.14683427667
+        1.14825063808
+        1.1496669995
+        1.15108336091
+        1.15249972233
+        1.15391608375
+        1.15533244516
+        1.15674880658
+        1.158165168
+        1.15958152941
+        1.16099789083
+        1.16241425225
+        1.16383061366
+        1.16524697508
+        1.16666333649
+        1.16807969791
+        1.16949605933
+        1.17091242074
+        1.17232878216
+        1.17374514358
+        1.17516150499
+        1.17657786641
+        1.17799422783
+        1.17941058924
+        1.18082695066
+        1.18224331207
+        1.18365967349
+        1.18507603491
+        1.18649239632
+        1.18790875774
+        1.18932511916
+        1.19074148057
+        1.19215784199
+        1.19357420341
+        1.19499056482
+        1.19640692624
+        1.19782328765
+        1.19923964907
+        1.20065601049
+        1.2020723719
+        1.20348873332
+        1.20490509474
+        1.20632145615
+        1.20773781757
+        1.20915417898
+        1.2105705404
+        1.21198690182
+        1.21340326323
+        1.21481962465
+        1.21623598607
+        1.21765234748
+        1.2190687089
+        1.22048507032
+        1.22190143173
+        1.22331779315
+        1.22473415456
+        1.22615051598
+        1.2275668774
+        1.22898323881
+        1.23039960023
+        1.23181596165
+        1.23323232306
+        1.23464868448
+        1.2360650459
+        1.23748140731
+        1.23889776873
+        1.24031413014
+        1.24173049156
+        1.24314685298
+        1.24456321439
+        1.24597957581
+        1.24739593723
+        1.24881229864
+        1.25022866006
+        1.25164502148
+        1.25306138289
+        1.25447774431
+        1.25589410572
+        1.25731046714
+        1.25872682856
+        1.26014318997
+        1.26155955139
+        1.26297591281
+        1.26439227422
+        1.26580863564
+        1.26722499706
+        1.26864135847
+        1.27005771989
+        1.2714740813
+        1.27289044272
+        1.27430680414
+        1.27572316555
+        1.27713952697
+        1.27855588839
+        1.2799722498
+        1.28138861122
+        1.28280497264
+        1.28422133405
+        1.28563769547
+        1.28705405688
+        1.2884704183
+        1.28988677972
+        1.29130314113
+        1.29271950255
+        1.29413586397
+        1.29555222538
+        1.2969685868
+        1.29838494822
+        1.29980130963
+        1.30121767105
+        1.30263403246
+        1.30405039388
+        1.3054667553
+        1.30688311671
+        1.30829947813
+        1.30971583955
+        1.31113220096
+        1.31254856238
+        1.3139649238
+        1.31538128521
+        1.31679764663
+        1.31821400804
+        1.31963036946
+        1.32104673088
+        1.32246309229
+        1.32387945371
+        1.32529581513
+        1.32671217654
+        1.32812853796
+        1.32954489938
+        1.33096126079
+        1.33237762221
+        1.33379398362
+        1.33521034504
+        1.33662670646
+        1.33804306787
+        1.33945942929
+        1.34087579071
+        1.34229215212
+        1.34370851354
+        1.34512487496
+        1.34654123637
+        1.34795759779
+        1.3493739592
+        1.35079032062
+        1.35220668204
+        1.35362304345
+        1.35503940487
+        1.35645576629
+        1.3578721277
+        1.35928848912
+        1.36070485054
+        1.36212121195
+        1.36353757337
+        1.36495393478
+        1.3663702962
+        1.36778665762
+        1.36920301903
+        1.37061938045
+        1.37203574187
+        1.37345210328
+        1.3748684647
+        1.37628482612
+        1.37770118753
+        1.37911754895
+        1.38053391036
+        1.38195027178
+        1.3833666332
+        1.38478299461
+        1.38619935603
+        1.38761571745
+        1.38903207886
+        1.39044844028
+        1.3918648017
+        1.39328116311
+        1.39469752453
+        1.39611388594
+        1.39753024736
+        1.39894660878
+        1.40036297019
+        1.40177933161
+        1.40319569303
+        1.40461205444
+        1.40602841586
+        1.40744477728
+        1.40886113869
+        1.41027750011
+        1.41169386152
+        1.41311022294
+        1.41452658436
+        1.41594294577
+        1.41735930719
+        1.41877566861
+        1.42019203002
+        1.42160839144
+        1.42302475286
+        1.42444111427
+        1.42585747569
+        1.4272738371
+        1.42869019852
+        1.43010655994
+        1.43152292135
+        1.43293928277
+        1.43435564419
+        1.4357720056
+        1.43718836702
+        1.43860472844
+        1.44002108985
+        1.44143745127
+        1.44285381268
+        1.4442701741
+        1.44568653552
+        1.44710289693
+        1.44851925835
+        1.44993561977
+        1.45135198118
+        1.4527683426
+        1.45418470402
+        1.45560106543
+        1.45701742685
+        1.45843378826
+        1.45985014968
+        1.4612665111
+        1.46268287251
+        1.46409923393
+        1.46551559535
+        1.46693195676
+        1.46834831818
+        1.4697646796
+        1.47118104101
+        1.47259740243
+        1.47401376384
+        1.47543012526
+        1.47684648668
+        1.47826284809
+        1.47967920951
+        1.48109557093
+        1.48251193234
+        1.48392829376
+        1.48534465518
+        1.48676101659
+        1.48817737801
+        1.48959373942
+        1.49101010084
+        1.49242646226
+        1.49384282367
+        1.49525918509
+        1.49667554651
+        1.49809190792
+        1.49950826934
+        1.50092463076
+        1.50234099217
+        1.50375735359
+        1.505173715
+        1.50659007642
+        1.50800643784
+        1.50942279925
+        1.51083916067
+        1.51225552209
+        1.5136718835
+        1.51508824492
+        1.51650460634
+        1.51792096775
+        1.51933732917
+        1.52075369058
+        1.522170052
+        1.52358641342
+        1.52500277483
+        1.52641913625
+        1.52783549767
+        1.52925185908
+        1.5306682205
+        1.53208458192
+        1.53350094333
+        1.53491730475
+        1.53633366616
+        1.53775002758
+        1.539166389
+        1.54058275041
+        1.54199911183
+        1.54341547325
+        1.54483183466
+        1.54624819608
+        1.5476645575
+        1.54908091891
+        1.55049728033
+        1.55191364174
+        1.55333000316
+        1.55474636458
+        1.55616272599
+        1.55757908741
+        1.55899544883
+        1.56041181024
+        1.56182817166
+        1.56324453308
+        1.56466089449
+        1.56607725591
+        1.56749361732
+        1.56890997874
+        1.57032634016
+        1.57174270157
+        1.57315906299
+        1.57457542441
+        1.57599178582
+        1.57740814724
+        1.57882450866
+        1.58024087007
+        1.58165723149
+        1.5830735929
+        1.58448995432
+        1.58590631574
+        1.58732267715
+        1.58873903857
+        1.59015539999
+        1.5915717614
+        1.59298812282
+        1.59440448424
+        1.59582084565
+        1.59723720707
+        1.59865356848
+        1.6000699299
+        1.60148629132
+        1.60290265273
+        1.60431901415
+        1.60573537557
+        1.60715173698
+        1.6085680984
+        1.60998445982
+        1.61140082123
+        1.61281718265
+        1.61423354406
+        1.61564990548
+        1.6170662669
+        1.61848262831
+        1.61989898973
+        1.62131535115
+        1.62273171256
+        1.62414807398
+        1.6255644354
+        1.62698079681
+        1.62839715823
+        1.62981351964
+        1.63122988106
+        1.63264624248
+        1.63406260389
+        1.63547896531
+        1.63689532673
+        1.63831168814
+        1.63972804956
+        1.64114441098
+        1.64256077239
+        1.64397713381
+        1.64539349522
+        1.64680985664
+        1.64822621806
+        1.64964257947
+        1.65105894089
+        1.65247530231
+        1.65389166372
+        1.65530802514
+        1.65672438656
+        1.65814074797
+        1.65955710939
+        1.6609734708
+        1.66238983222
+        1.66380619364
+        1.66522255505
+        1.66663891647
+        1.66805527789
+        1.6694716393
+        1.67088800072
+        1.67230436214
+        1.67372072355
+        1.67513708497
+        1.67655344638
+        1.6779698078
+        1.67938616922
+        1.68080253063
+        1.68221889205
+        1.68363525347
+        1.68505161488
+        1.6864679763
+        1.68788433772
+        1.68930069913
+        1.69071706055
+        1.69213342196
+        1.69354978338
+        1.6949661448
+        1.69638250621
+        1.69779886763
+        1.69921522905
+        1.70063159046
+        1.70204795188
+        1.7034643133
+        1.70488067471
+        1.70629703613
+        1.70771339754
+        1.70912975896
+        1.71054612038
+        1.71196248179
+        1.71337884321
+        1.71479520463
+        1.71621156604
+        1.71762792746
+        1.71904428888
+        1.72046065029
+        1.72187701171
+        1.72329337312
+        1.72470973454
+        1.72612609596
+        1.72754245737
+        1.72895881879
+        1.73037518021
+        1.73179154162
+        1.73320790304
+        1.73462426446
+        1.73604062587
+        1.73745698729
+        1.7388733487
+        1.74028971012
+        1.74170607154
+        1.74312243295
+        1.74453879437
+        1.74595515579
+        1.7473715172
+        1.74878787862
+        1.75020424004
+        1.75162060145
+        1.75303696287
+        1.75445332428
+        1.7558696857
+        1.75728604712
+        1.75870240853
+        1.76011876995
+        1.76153513137
+        1.76295149278
+        1.7643678542
+        1.76578421562
+        1.76720057703
+        1.76861693845
+        1.77003329986
+        1.77144966128
+        1.7728660227
+        1.77428238411
+        1.77569874553
+        1.77711510695
+        1.77853146836
+        1.77994782978
+        1.78136419119
+        1.78278055261
+        1.78419691403
+        1.78561327544
+        1.78702963686
+        1.78844599828
+        1.78986235969
+        1.79127872111
+        1.79269508253
+        1.79411144394
+        1.79552780536
+        1.79694416677
+        1.79836052819
+        1.79977688961
+        1.80119325102
+        1.80260961244
+        1.80402597386
+        1.80544233527
+        1.80685869669
+        1.80827505811
+        1.80969141952
+        1.81110778094
+        1.81252414235
+        1.81394050377
+        1.81535686519
+        1.8167732266
+        1.81818958802
+        1.81960594944
+        1.82102231085
+        1.82243867227
+        1.82385503369
+        1.8252713951
+        1.82668775652
+        1.82810411793
+        1.82952047935
+        1.83093684077
+        1.83235320218
+        1.8337695636
+        1.83518592502
+        1.83660228643
+        1.83801864785
+        1.83943500927
+        1.84085137068
+        1.8422677321
+        1.84368409351
+        1.84510045493
+        1.84651681635
+        1.84793317776
+        1.84934953918
+        1.8507659006
+        1.85218226201
+        1.85359862343
+        1.85501498485
+        1.85643134626
+        1.85784770768
+        1.85926406909
+        1.86068043051
+        1.86209679193
+        1.86351315334
+        1.86492951476
+        1.86634587618
+        1.86776223759
+        1.86917859901
+        1.87059496043
+        1.87201132184
+        1.87342768326
+        1.87484404467
+        1.87626040609
+        1.87767676751
+        1.87909312892
+        1.88050949034
+        1.88192585176
+        1.88334221317
+        1.88475857459
+        1.88617493601
+        1.88759129742
+        1.88900765884
+        1.89042402025
+        1.89184038167
+        1.89325674309
+        1.8946731045
+        1.89608946592
+        1.89750582734
+        1.89892218875
+        1.90033855017
+        1.90175491159
+        1.903171273
+        1.90458763442
+        1.90600399583
+        1.90742035725
+        1.90883671867
+        1.91025308008
+        1.9116694415
+        1.91308580292
+        1.91450216433
+        1.91591852575
+        1.91733488717
+        1.91875124858
+        1.92016761
+        1.92158397141
+        1.92300033283
+        1.92441669425
+        1.92583305566
+        1.92724941708
+        1.9286657785
+        1.93008213991
+        1.93149850133
+        1.93291486275
+        1.93433122416
+        1.93574758558
+        1.93716394699
+        1.93858030841
+        1.93999666983
+        1.94141303124
+        1.94282939266
+        1.94424575408
+        1.94566211549
+        1.94707847691
+        1.94849483833
+        1.94991119974
+        1.95132756116
+        1.95274392257
+        1.95416028399
+        1.95557664541
+        1.95699300682
+        1.95840936824
+        1.95982572966
+        1.96124209107
+        1.96265845249
+        1.96407481391
+        1.96549117532
+        1.96690753674
+        1.96832389815
+        1.96974025957
+        1.97115662099
+        1.9725729824
+        1.97398934382
+        1.97540570524
+        1.97682206665
+        1.97823842807
+        1.97965478949
+        1.9810711509
+        1.98248751232
+        1.98390387373
+        1.98532023515
+        1.98673659657
+        1.98815295798
+        1.9895693194
+        1.99098568082
+        1.99240204223
+        1.99381840365
+        1.99523476507
+        1.99665112648
+        1.9980674879
+        1.99948384931
+        2.00090021073
+        2.00231657215
+        2.00373293356
+        2.00514929498
+        2.0065656564
+        2.00798201781
+        2.00939837923
+        2.01081474065
+        2.01223110206
+        2.01364746348
+        2.01506382489
+        2.01648018631
+        2.01789654773
+        2.01931290914
+        2.02072927056
+        2.02214563198
+        2.02356199339
+        2.02497835481
+        2.02639471623
+        2.02781107764
+        2.02922743906
+        2.03064380047
+        2.03206016189
+        2.03347652331
+        2.03489288472
+        2.03630924614
+        2.03772560756
+        2.03914196897
+        2.04055833039
+        2.04197469181
+        2.04339105322
+        2.04480741464
+        2.04622377605
+        2.04764013747
+        2.04905649889
+        2.0504728603
+        2.05188922172
+        2.05330558314
+        2.05472194455
+        2.05613830597
+        2.05755466739
+        2.0589710288
+        2.06038739022
+        2.06180375163
+        2.06322011305
+        2.06463647447
+        2.06605283588
+        2.0674691973
+        2.06888555872
+        2.07030192013
+        2.07171828155
+        2.07313464297
+        2.07455100438
+        2.0759673658
+        2.07738372721
+        2.07880008863
+        2.08021645005
+        2.08163281146
+        2.08304917288
+        2.0844655343
+        2.08588189571
+        2.08729825713
+        2.08871461855
+        2.09013097996
+        2.09154734138
+        2.09296370279
+        2.09438006421
+        2.09579642563
+        2.09721278704
+        2.09862914846
+        2.10004550988
+        2.10146187129
+        2.10287823271
+        2.10429459413
+        2.10571095554
+        2.10712731696
+        2.10854367837
+        2.10996003979
+        2.11137640121
+        2.11279276262
+        2.11420912404
+        2.11562548546
+        2.11704184687
+        2.11845820829
+        2.11987456971
+        2.12129093112
+        2.12270729254
+        2.12412365395
+        2.12554001537
+        2.12695637679
+        2.1283727382
+        2.12978909962
+        2.13120546104
+        2.13262182245
+        2.13403818387
+        2.13545454529
+        2.1368709067
+        2.13828726812
+        2.13970362953
+        2.14111999095
+        2.14253635237
+        2.14395271378
+        2.1453690752
+        2.14678543662
+        2.14820179803
+        2.14961815945
+        2.15103452087
+        2.15245088228
+        2.1538672437
+        2.15528360511
+        2.15669996653
+        2.15811632795
+        2.15953268936
+        2.16094905078
+        2.1623654122
+        2.16378177361
+        2.16519813503
+        2.16661449645
+        2.16803085786
+        2.16944721928
+        2.17086358069
+        2.17227994211
+        2.17369630353
+        2.17511266494
+        2.17652902636
+        2.17794538778
+        2.17936174919
+        2.18077811061
+        2.18219447203
+        2.18361083344
+        2.18502719486
+        2.18644355627
+        2.18785991769
+        2.18927627911
+        2.19069264052
+        2.19210900194
+        2.19352536336
+        2.19494172477
+        2.19635808619
+        2.19777444761
+        2.19919080902
+        2.20060717044
+        2.20202353185
+        2.20343989327
+        2.20485625469
+        2.2062726161
+        2.20768897752
+        2.20910533894
+        2.21052170035
+        2.21193806177
+        2.21335442319
+        2.2147707846
+        2.21618714602
+        2.21760350743
+        2.21901986885
+        2.22043623027
+        2.22185259168
+        2.2232689531
+        2.22468531452
+        2.22610167593
+        2.22751803735
+        2.22893439877
+        2.23035076018
+        2.2317671216
+        2.23318348301
+        2.23459984443
+        2.23601620585
+        2.23743256726
+        2.23884892868
+        2.2402652901
+        2.24168165151
+        2.24309801293
+        2.24451437435
+        2.24593073576
+        2.24734709718
+        2.24876345859
+        2.25017982001
+        2.25159618143
+        2.25301254284
+        2.25442890426
+        2.25584526568
+        2.25726162709
+        2.25867798851
+        2.26009434993
+        2.26151071134
+        2.26292707276
+        2.26434343417
+        2.26575979559
+        2.26717615701
+        2.26859251842
+        2.27000887984
+        2.27142524126
+        2.27284160267
+        2.27425796409
+        2.27567432551
+        2.27709068692
+        2.27850704834
+        2.27992340975
+        2.28133977117
+        2.28275613259
+        2.284172494
+        2.28558885542
+        2.28700521684
+        2.28842157825
+        2.28983793967
+        2.29125430109
+        2.2926706625
+        2.29408702392
+        2.29550338533
+        2.29691974675
+        2.29833610817
+        2.29975246958
+        2.301168831
+        2.30258519242
+        2.30400155383
+        2.30541791525
+        2.30683427667
+        2.30825063808
+        2.3096669995
+        2.31108336091
+        2.31249972233
+        2.31391608375
+        2.31533244516
+        2.31674880658
+        2.318165168
+        2.31958152941
+        2.32099789083
+        2.32241425225
+        2.32383061366
+        2.32524697508
+        2.32666333649
+        2.32807969791
+        2.32949605933
+        2.33091242074
+        2.33232878216
+        2.33374514358
+        2.33516150499
+        2.33657786641
+        2.33799422783
+        2.33941058924
+        2.34082695066
+        2.34224331207
+        2.34365967349
+        2.34507603491
+        2.34649239632
+        2.34790875774
+        2.34932511916
+        2.35074148057
+        2.35215784199
+        2.35357420341
+        2.35499056482
+        2.35640692624
+        2.35782328765
+        2.35923964907
+        2.36065601049
+        2.3620723719
+        2.36348873332
+        2.36490509474
+        2.36632145615
+        2.36773781757
+        2.36915417898
+        2.3705705404
+        2.37198690182
+        2.37340326323
+        2.37481962465
+        2.37623598607
+        2.37765234748
+        2.3790687089
+        2.38048507032
+        2.38190143173
+        2.38331779315
+        2.38473415456
+        2.38615051598
+        2.3875668774
+        2.38898323881
+        2.39039960023
+        2.39181596165
+        2.39323232306
+        2.39464868448
+        2.3960650459
+        2.39748140731
+        2.39889776873
+        2.40031413014
+        2.40173049156
+        2.40314685298
+        2.40456321439
+        2.40597957581
+        2.40739593723
+        2.40881229864
+        2.41022866006
+        2.41164502148
+        2.41306138289
+        2.41447774431
+        2.41589410572
+        2.41731046714
+        2.41872682856
+        2.42014318997
+        2.42155955139
+        2.42297591281
+        2.42439227422
+        2.42580863564
+        2.42722499706
+        2.42864135847
+        2.43005771989
+        2.4314740813
+        2.43289044272
+        2.43430680414
+        2.43572316555
+        2.43713952697
+        2.43855588839
+        2.4399722498
+        2.44138861122
+        2.44280497264
+        2.44422133405
+        2.44563769547
+        2.44705405688
+        2.4484704183
+        2.44988677972
+        2.45130314113
+        2.45271950255
+        2.45413586397
+        2.45555222538
+        2.4569685868
+        2.45838494822
+        2.45980130963
+        2.46121767105
+        2.46263403246
+        2.46405039388
+        2.4654667553
+        2.46688311671
+        2.46829947813
+        2.46971583955
+        2.47113220096
+        2.47254856238
+        2.4739649238
+        2.47538128521
+        2.47679764663
+        2.47821400804
+        2.47963036946
+        2.48104673088
+        2.48246309229
+        2.48387945371
+        2.48529581513
+        2.48671217654
+        2.48812853796
+        2.48954489938
+        2.49096126079
+        2.49237762221
+        2.49379398362
+        2.49521034504
+        2.49662670646
+        2.49804306787
+        2.49945942929
+        2.50087579071
+        2.50229215212
+        2.50370851354
+        2.50512487496
+        2.50654123637
+        2.50795759779
+        2.5093739592
+        2.51079032062
+        2.51220668204
+        2.51362304345
+        2.51503940487
+        2.51645576629
+        2.5178721277
+        2.51928848912
+        2.52070485054
+        2.52212121195
+        2.52353757337
+        2.52495393478
+        2.5263702962
+        2.52778665762
+        2.52920301903
+        2.53061938045
+        2.53203574187
+        2.53345210328
+        2.5348684647
+        2.53628482612
+        2.53770118753
+        2.53911754895
+        2.54053391036
+        2.54195027178
+        2.5433666332
+        2.54478299461
+        2.54619935603
+        2.54761571745
+        2.54903207886
+        2.55044844028
+        2.5518648017
+        2.55328116311
+        2.55469752453
+        2.55611388594
+        2.55753024736
+        2.55894660878
+        2.56036297019
+        2.56177933161
+        2.56319569303
+        2.56461205444
+        2.56602841586
+        2.56744477728
+        2.56886113869
+        2.57027750011
+        2.57169386152
+        2.57311022294
+        2.57452658436
+        2.57594294577
+        2.57735930719
+        2.57877566861
+        2.58019203002
+        2.58160839144
+        2.58302475286
+        2.58444111427
+        2.58585747569
+        2.5872738371
+        2.58869019852
+        2.59010655994
+        2.59152292135
+        2.59293928277
+        2.59435564419
+        2.5957720056
+        2.59718836702
+        2.59860472844
+        2.60002108985
+        2.60143745127
+        2.60285381268
+        2.6042701741
+        2.60568653552
+        2.60710289693
+        2.60851925835
+        2.60993561977
+        2.61135198118
+        2.6127683426
+        2.61418470402
+        2.61560106543
+        2.61701742685
+        2.61843378826
+        2.61985014968
+        2.6212665111
+        2.62268287251
+        2.62409923393
+        2.62551559535
+        2.62693195676
+        2.62834831818
+        2.6297646796
+        2.63118104101
+        2.63259740243
+        2.63401376384
+        2.63543012526
+        2.63684648668
+        2.63826284809
+        2.63967920951
+        2.64109557093
+        2.64251193234
+        2.64392829376
+        2.64534465518
+        2.64676101659
+        2.64817737801
+        2.64959373942
+        2.65101010084
+        2.65242646226
+        2.65384282367
+        2.65525918509
+        2.65667554651
+        2.65809190792
+        2.65950826934
+        2.66092463076
+        2.66234099217
+        2.66375735359
+        2.665173715
+        2.66659007642
+        2.66800643784
+        2.66942279925
+        2.67083916067
+        2.67225552209
+        2.6736718835
+        2.67508824492
+        2.67650460634
+        2.67792096775
+        2.67933732917
+        2.68075369058
+        2.682170052
+        2.68358641342
+        2.68500277483
+        2.68641913625
+        2.68783549767
+        2.68925185908
+        2.6906682205
+        2.69208458192
+        2.69350094333
+        2.69491730475
+        2.69633366616
+        2.69775002758
+        2.699166389
+        2.70058275041
+        2.70199911183
+        2.70341547325
+        2.70483183466
+        2.70624819608
+        2.7076645575
+        2.70908091891
+        2.71049728033
+        2.71191364174
+        2.71333000316
+        2.71474636458
+        2.71616272599
+        2.71757908741
+        2.71899544883
+        2.72041181024
+        2.72182817166
+        2.72324453308
+        2.72466089449
+        2.72607725591
+        2.72749361732
+        2.72890997874
+        2.73032634016
+        2.73174270157
+        2.73315906299
+        2.73457542441
+        2.73599178582
+        2.73740814724
+        2.73882450866
+        2.74024087007
+        2.74165723149
+        2.7430735929
+        2.74448995432
+        2.74590631574
+        2.74732267715
+        2.74873903857
+        2.75015539999
+        2.7515717614
+        2.75298812282
+        2.75440448424
+        2.75582084565
+        2.75723720707
+        2.75865356848
+        2.7600699299
+        2.76148629132
+        2.76290265273
+        2.76431901415
+        2.76573537557
+        2.76715173698
+        2.7685680984
+        2.76998445982
+        2.77140082123
+        2.77281718265
+        2.77423354406
+        2.77564990548
+        2.7770662669
+        2.77848262831
+        2.77989898973
+        2.78131535115
+        2.78273171256
+        2.78414807398
+        2.7855644354
+        2.78698079681
+        2.78839715823
+        2.78981351964
+        2.79122988106
+        2.79264624248
+        2.79406260389
+        2.79547896531
+        2.79689532673
+        2.79831168814
+        2.79972804956
+        2.80114441098
+        2.80256077239
+        2.80397713381
+        2.80539349522
+        2.80680985664
+        2.80822621806
+        2.80964257947
+        2.81105894089
+        2.81247530231
+        2.81389166372
+        2.81530802514
+        2.81672438656
+        2.81814074797
+        2.81955710939
+        2.8209734708
+        2.82238983222
+        2.82380619364
+        2.82522255505
+        2.82663891647
+        2.82805527789
+        2.8294716393
+        2.83088800072
+        2.83230436214
+        2.83372072355
+        2.83513708497
+        2.83655344638
+        2.8379698078
+        2.83938616922
+        2.84080253063
+        2.84221889205
+        2.84363525347
+        2.84505161488
+        2.8464679763
+        2.84788433772
+        2.84930069913
+        2.85071706055
+        2.85213342196
+        2.85354978338
+        2.8549661448
+        2.85638250621
+        2.85779886763
+        2.85921522905
+        2.86063159046
+        2.86204795188
+        2.8634643133
+        2.86488067471
+        2.86629703613
+        2.86771339754
+        2.86912975896
+        2.87054612038
+        2.87196248179
+        2.87337884321
+        2.87479520463
+        2.87621156604
+        2.87762792746
+        2.87904428888
+        2.88046065029
+        2.88187701171
+        2.88329337312
+        2.88470973454
+        2.88612609596
+        2.88754245737
+        2.88895881879
+        2.89037518021
+        2.89179154162
+        2.89320790304
+        2.89462426446
+        2.89604062587
+        2.89745698729
+        2.8988733487
+        2.90028971012
+        2.90170607154
+        2.90312243295
+        2.90453879437
+        2.90595515579
+        2.9073715172
+        2.90878787862
+        2.91020424004
+        2.91162060145
+        2.91303696287
+        2.91445332428
+        2.9158696857
+        2.91728604712
+        2.91870240853
+        2.92011876995
+        2.92153513137
+        2.92295149278
+        2.9243678542
+        2.92578421562
+        2.92720057703
+        2.92861693845
+        2.93003329986
+        2.93144966128
+        2.9328660227
+        2.93428238411
+        2.93569874553
+        2.93711510695
+        2.93853146836
+        2.93994782978
+        2.94136419119
+        2.94278055261
+        2.94419691403
+        2.94561327544
+        2.94702963686
+        2.94844599828
+        2.94986235969
+        2.95127872111
+        2.95269508253
+        2.95411144394
+        2.95552780536
+        2.95694416677
+        2.95836052819
+        2.95977688961
+        2.96119325102
+        2.96260961244
+        2.96402597386
+        2.96544233527
+        2.96685869669
+        2.96827505811
+        2.96969141952
+        2.97110778094
+        2.97252414235
+        2.97394050377
+        2.97535686519
+        2.9767732266
+        2.97818958802
+        2.97960594944
+        2.98102231085
+        2.98243867227
+        2.98385503369
+        2.9852713951
+        2.98668775652
+        2.98810411793
+        2.98952047935
+        2.99093684077
+        2.99235320218
+        2.9937695636
+        2.99518592502
+        2.99660228643
+        2.99801864785
+        2.99943500927
+        3.00085137068
+        3.0022677321
+        3.00368409351
+        3.00510045493
+        3.00651681635
+        3.00793317776
+        3.00934953918
+        3.0107659006
+        3.01218226201
+        3.01359862343
+        3.01501498485
+        3.01643134626
+        3.01784770768
+        3.01926406909
+        3.02068043051
+        3.02209679193
+        3.02351315334
+        3.02492951476
+        3.02634587618
+        3.02776223759
+        3.02917859901
+        3.03059496043
+        3.03201132184
+        3.03342768326
+        3.03484404467
+        3.03626040609
+        3.03767676751
+        3.03909312892
+        3.04050949034
+        3.04192585176
+        3.04334221317
+        3.04475857459
+        3.04617493601
+        3.04759129742
+        3.04900765884
+        3.05042402025
+        3.05184038167
+        3.05325674309
+        3.0546731045
+        3.05608946592
+        3.05750582734
+        3.05892218875
+        3.06033855017
+        3.06175491159
+        3.063171273
+        3.06458763442
+        3.06600399583
+        3.06742035725
+        3.06883671867
+        3.07025308008
+        3.0716694415
+        3.07308580292
+        3.07450216433
+        3.07591852575
+        3.07733488717
+        3.07875124858
+        3.08016761
+        3.08158397141
+        3.08300033283
+        3.08441669425
+        3.08583305566
+        3.08724941708
+        3.0886657785
+        3.09008213991
+        3.09149850133
+        3.09291486275
+        3.09433122416
+        3.09574758558
+        3.09716394699
+        3.09858030841
+        3.09999666983
+        3.10141303124
+        3.10282939266
+        3.10424575408
+        3.10566211549
+        3.10707847691
+        3.10849483833
+        3.10991119974
+        3.11132756116
+        3.11274392257
+        3.11416028399
+        3.11557664541
+        3.11699300682
+        3.11840936824
+        3.11982572966
+        3.12124209107
+        3.12265845249
+        3.12407481391
+        3.12549117532
+        3.12690753674
+        3.12832389815
+        3.12974025957
+        3.13115662099
+        3.1325729824
+        3.13398934382
+        3.13540570524
+        3.13682206665
+        3.13823842807
+        3.13965478949
+        3.1410711509
+        3.14248751232
+        3.14390387373
+        3.14532023515
+        3.14673659657
+        3.14815295798
+        3.1495693194
+        3.15098568082
+        3.15240204223
+        3.15381840365
+        3.15523476507
+        3.15665112648
+        3.1580674879
+        3.15948384931
+        3.16090021073
+        3.16231657215
+        3.16373293356
+        3.16514929498
+        3.1665656564
+        3.16798201781
+        3.16939837923
+        3.17081474065
+        3.17223110206
+        3.17364746348
+        3.17506382489
+        3.17648018631
+        3.17789654773
+        3.17931290914
+        3.18072927056
+        3.18214563198
+        3.18356199339
+        3.18497835481
+        3.18639471623
+        3.18781107764
+        3.18922743906
+        3.19064380047
+        3.19206016189
+        3.19347652331
+        3.19489288472
+        3.19630924614
+        3.19772560756
+        3.19914196897
+        3.20055833039
+        3.20197469181
+        3.20339105322
+        3.20480741464
+        3.20622377605
+        3.20764013747
+        3.20905649889
+        3.2104728603
+        3.21188922172
+        3.21330558314
+        3.21472194455
+        3.21613830597
+        3.21755466739
+        3.2189710288
+        3.22038739022
+        3.22180375163
+        3.22322011305
+        3.22463647447
+        3.22605283588
+        3.2274691973
+        3.22888555872
+        3.23030192013
+        3.23171828155
+        3.23313464297
+        3.23455100438
+        3.2359673658
+        3.23738372721
+        3.23880008863
+        3.24021645005
+        3.24163281146
+        3.24304917288
+        3.2444655343
+        3.24588189571
+        3.24729825713
+        3.24871461855
+        3.25013097996
+        3.25154734138
+        3.25296370279
+        3.25438006421
+        3.25579642563
+        3.25721278704
+        3.25862914846
+        3.26004550988
+        3.26146187129
+        3.26287823271
+        3.26429459413
+        3.26571095554
+        3.26712731696
+        3.26854367837
+        3.26996003979
+        3.27137640121
+        3.27279276262
+        3.27420912404
+        3.27562548546
+        3.27704184687
+        3.27845820829
+        3.27987456971
+        3.28129093112
+        3.28270729254
+        3.28412365395
+        3.28554001537
+        3.28695637679
+        3.2883727382
+        3.28978909962
+        3.29120546104
+        3.29262182245
+        3.29403818387
+        3.29545454529
+        3.2968709067
+        3.29828726812
+        3.29970362953
+        3.30111999095
+        3.30253635237
+        3.30395271378
+        3.3053690752
+        3.30678543662
+        3.30820179803
+        3.30961815945
+        3.31103452087
+        3.31245088228
+        3.3138672437
+        3.31528360511
+        3.31669996653
+        3.31811632795
+        3.31953268936
+        3.32094905078
+        3.3223654122
+        3.32378177361
+        3.32519813503
+        3.32661449645
+        3.32803085786
+        3.32944721928
+        3.33086358069
+        3.33227994211
+        3.33369630353
+        3.33511266494
+        3.33652902636
+        3.33794538778
+        3.33936174919
+        3.34077811061
+        3.34219447203
+        3.34361083344
+        3.34502719486
+        3.34644355627
+        3.34785991769
+        3.34927627911
+        3.35069264052
+        3.35210900194
+        3.35352536336
+        3.35494172477
+        3.35635808619
+        3.35777444761
+        3.35919080902
+        3.36060717044
+        3.36202353185
+        3.36343989327
+        3.36485625469
+        3.3662726161
+        3.36768897752
+        3.36910533894
+        3.37052170035
+        3.37193806177
+        3.37335442319
+        3.3747707846
+        3.37618714602
+        3.37760350743
+        3.37901986885
+        3.38043623027
+        3.38185259168
+        3.3832689531
+        3.38468531452
+        3.38610167593
+        3.38751803735
+        3.38893439877
+        3.39035076018
+        3.3917671216
+        3.39318348301
+        3.39459984443
+        3.39601620585
+        3.39743256726
+        3.39884892868
+        3.4002652901
+        3.40168165151
+        3.40309801293
+        3.40451437435
+        3.40593073576
+        3.40734709718
+        3.40876345859
+        3.41017982001
+        3.41159618143
+        3.41301254284
+        3.41442890426
+        3.41584526568
+        3.41726162709
+        3.41867798851
+        3.42009434993
+        3.42151071134
+        3.42292707276
+        3.42434343417
+        3.42575979559
+        3.42717615701
+        3.42859251842
+        3.43000887984
+        3.43142524126
+        3.43284160267
+        3.43425796409
+        3.43567432551
+        3.43709068692
+}
diff --git a/release/datafiles/colormanagement/luts/adx_exp_to_aces.spimtx b/release/datafiles/colormanagement/luts/adx_exp_to_aces.spimtx
new file mode 100644 (file)
index 0000000..0c56159
--- /dev/null
@@ -0,0 +1,4 @@
+0.72286 0.12630 0.15084 0
+0.11923 0.76418 0.11659 0
+0.01427 0.08213 0.90359 0
+
diff --git a/release/datafiles/colormanagement/luts/logc800.py b/release/datafiles/colormanagement/luts/logc800.py
new file mode 100644 (file)
index 0000000..fd5bf01
--- /dev/null
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+
+import math
+
+"""
+
+// ARRI ALEXA IDT for ALEXA logC files
+//  with camera EI set to 800
+// Written by v3_IDT_maker.py v0.06 on Thursday 01 March 2012 by alex
+
+float
+normalizedLogCToRelativeExposure(float x) {
+       if (x > 0.149659)
+               return (pow(10,(x - 0.385537) / 0.247189) - 0.052272) / 5.555556;
+       else
+               return (x - 0.092809) / 5.367650;
+}
+
+"""
+
+def logCToLinear(x):
+       if (x > 0.149659):
+               return (math.pow(10.0,(x - 0.385537) / 0.247189) - 0.052272) / 5.555556
+       else:
+               return (x - 0.092809) / 5.367650
+
+def WriteSPI1D(filename, fromMin, fromMax, data):
+    f = file(filename,'w')
+    f.write("Version 1\n")
+    f.write("From %s %s\n" % (fromMin, fromMax))
+    f.write("Length %d\n" % len(data))
+    f.write("Components 1\n")
+    f.write("{\n")
+    for value in data:
+        f.write("        %s\n" % value)
+    f.write("}\n")
+    f.close()
+
+def Fit(value, fromMin, fromMax, toMin, toMax):
+    if fromMin == fromMax:
+        raise ValueError("fromMin == fromMax")
+    return (value - fromMin) / (fromMax - fromMin) * (toMax - toMin) + toMin
+
+NUM_SAMPLES = 2**14
+RANGE = (-0.125, 1.125)
+data = []
+for i in xrange(NUM_SAMPLES):
+    x = i/(NUM_SAMPLES-1.0)
+    x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1])
+    data.append(logCToLinear(x))
+WriteSPI1D('logc800.spi1d', RANGE[0], RANGE[1], data)
diff --git a/release/datafiles/colormanagement/luts/logc800.spi1d b/release/datafiles/colormanagement/luts/logc800.spi1d
new file mode 100644 (file)
index 0000000..6f2bf1e
--- /dev/null
@@ -0,0 +1,16390 @@
+Version 1
+From -0.125 1.125
+Length 16384
+Components 1
+{
+        -0.0405780928339
+        -0.0405638783076
+        -0.0405496637813
+        -0.040535449255
+        -0.0405212347286
+        -0.0405070202023
+        -0.040492805676
+        -0.0404785911497
+        -0.0404643766233
+        -0.040450162097
+        -0.0404359475707
+        -0.0404217330444
+        -0.0404075185181
+        -0.0403933039917
+        -0.0403790894654
+        -0.0403648749391
+        -0.0403506604128
+        -0.0403364458865
+        -0.0403222313601
+        -0.0403080168338
+        -0.0402938023075
+        -0.0402795877812
+        -0.0402653732548
+        -0.0402511587285
+        -0.0402369442022
+        -0.0402227296759
+        -0.0402085151496
+        -0.0401943006232
+        -0.0401800860969
+        -0.0401658715706
+        -0.0401516570443
+        -0.040137442518
+        -0.0401232279916
+        -0.0401090134653
+        -0.040094798939
+        -0.0400805844127
+        -0.0400663698863
+        -0.04005215536
+        -0.0400379408337
+        -0.0400237263074
+        -0.0400095117811
+        -0.0399952972547
+        -0.0399810827284
+        -0.0399668682021
+        -0.0399526536758
+        -0.0399384391495
+        -0.0399242246231
+        -0.0399100100968
+        -0.0398957955705
+        -0.0398815810442
+        -0.0398673665178
+        -0.0398531519915
+        -0.0398389374652
+        -0.0398247229389
+        -0.0398105084126
+        -0.0397962938862
+        -0.0397820793599
+        -0.0397678648336
+        -0.0397536503073
+        -0.039739435781
+        -0.0397252212546
+        -0.0397110067283
+        -0.039696792202
+        -0.0396825776757
+        -0.0396683631493
+        -0.039654148623
+        -0.0396399340967
+        -0.0396257195704
+        -0.0396115050441
+        -0.0395972905177
+        -0.0395830759914
+        -0.0395688614651
+        -0.0395546469388
+        -0.0395404324125
+        -0.0395262178861
+        -0.0395120033598
+        -0.0394977888335
+        -0.0394835743072
+        -0.0394693597808
+        -0.0394551452545
+        -0.0394409307282
+        -0.0394267162019
+        -0.0394125016756
+        -0.0393982871492
+        -0.0393840726229
+        -0.0393698580966
+        -0.0393556435703
+        -0.039341429044
+        -0.0393272145176
+        -0.0393129999913
+        -0.039298785465
+        -0.0392845709387
+        -0.0392703564123
+        -0.039256141886
+        -0.0392419273597
+        -0.0392277128334
+        -0.0392134983071
+        -0.0391992837807
+        -0.0391850692544
+        -0.0391708547281
+        -0.0391566402018
+        -0.0391424256755
+        -0.0391282111491
+        -0.0391139966228
+        -0.0390997820965
+        -0.0390855675702
+        -0.0390713530438
+        -0.0390571385175
+        -0.0390429239912
+        -0.0390287094649
+        -0.0390144949386
+        -0.0390002804122
+        -0.0389860658859
+        -0.0389718513596
+        -0.0389576368333
+        -0.0389434223069
+        -0.0389292077806
+        -0.0389149932543
+        -0.038900778728
+        -0.0388865642017
+        -0.0388723496753
+        -0.038858135149
+        -0.0388439206227
+        -0.0388297060964
+        -0.0388154915701
+        -0.0388012770437
+        -0.0387870625174
+        -0.0387728479911
+        -0.0387586334648
+        -0.0387444189384
+        -0.0387302044121
+        -0.0387159898858
+        -0.0387017753595
+        -0.0386875608332
+        -0.0386733463068
+        -0.0386591317805
+        -0.0386449172542
+        -0.0386307027279
+        -0.0386164882016
+        -0.0386022736752
+        -0.0385880591489
+        -0.0385738446226
+        -0.0385596300963
+        -0.0385454155699
+        -0.0385312010436
+        -0.0385169865173
+        -0.038502771991
+        -0.0384885574647
+        -0.0384743429383
+        -0.038460128412
+        -0.0384459138857
+        -0.0384316993594
+        -0.0384174848331
+        -0.0384032703067
+        -0.0383890557804
+        -0.0383748412541
+        -0.0383606267278
+        -0.0383464122014
+        -0.0383321976751
+        -0.0383179831488
+        -0.0383037686225
+        -0.0382895540962
+        -0.0382753395698
+        -0.0382611250435
+        -0.0382469105172
+        -0.0382326959909
+        -0.0382184814646
+        -0.0382042669382
+        -0.0381900524119
+        -0.0381758378856
+        -0.0381616233593
+        -0.0381474088329
+        -0.0381331943066
+        -0.0381189797803
+        -0.038104765254
+        -0.0380905507277
+        -0.0380763362013
+        -0.038062121675
+        -0.0380479071487
+        -0.0380336926224
+        -0.0380194780961
+        -0.0380052635697
+        -0.0379910490434
+        -0.0379768345171
+        -0.0379626199908
+        -0.0379484054644
+        -0.0379341909381
+        -0.0379199764118
+        -0.0379057618855
+        -0.0378915473592
+        -0.0378773328328
+        -0.0378631183065
+        -0.0378489037802
+        -0.0378346892539
+        -0.0378204747276
+        -0.0378062602012
+        -0.0377920456749
+        -0.0377778311486
+        -0.0377636166223
+        -0.0377494020959
+        -0.0377351875696
+        -0.0377209730433
+        -0.037706758517
+        -0.0376925439907
+        -0.0376783294643
+        -0.037664114938
+        -0.0376499004117
+        -0.0376356858854
+        -0.037621471359
+        -0.0376072568327
+        -0.0375930423064
+        -0.0375788277801
+        -0.0375646132538
+        -0.0375503987274
+        -0.0375361842011
+        -0.0375219696748
+        -0.0375077551485
+        -0.0374935406222
+        -0.0374793260958
+        -0.0374651115695
+        -0.0374508970432
+        -0.0374366825169
+        -0.0374224679905
+        -0.0374082534642
+        -0.0373940389379
+        -0.0373798244116
+        -0.0373656098853
+        -0.0373513953589
+        -0.0373371808326
+        -0.0373229663063
+        -0.03730875178
+        -0.0372945372537
+        -0.0372803227273
+        -0.037266108201
+        -0.0372518936747
+        -0.0372376791484
+        -0.037223464622
+        -0.0372092500957
+        -0.0371950355694
+        -0.0371808210431
+        -0.0371666065168
+        -0.0371523919904
+        -0.0371381774641
+        -0.0371239629378
+        -0.0371097484115
+        -0.0370955338852
+        -0.0370813193588
+        -0.0370671048325
+        -0.0370528903062
+        -0.0370386757799
+        -0.0370244612535
+        -0.0370102467272
+        -0.0369960322009
+        -0.0369818176746
+        -0.0369676031483
+        -0.0369533886219
+        -0.0369391740956
+        -0.0369249595693
+        -0.036910745043
+        -0.0368965305167
+        -0.0368823159903
+        -0.036868101464
+        -0.0368538869377
+        -0.0368396724114
+        -0.036825457885
+        -0.0368112433587
+        -0.0367970288324
+        -0.0367828143061
+        -0.0367685997798
+        -0.0367543852534
+        -0.0367401707271
+        -0.0367259562008
+        -0.0367117416745
+        -0.0366975271482
+        -0.0366833126218
+        -0.0366690980955
+        -0.0366548835692
+        -0.0366406690429
+        -0.0366264545165
+        -0.0366122399902
+        -0.0365980254639
+        -0.0365838109376
+        -0.0365695964113
+        -0.0365553818849
+        -0.0365411673586
+        -0.0365269528323
+        -0.036512738306
+        -0.0364985237797
+        -0.0364843092533
+        -0.036470094727
+        -0.0364558802007
+        -0.0364416656744
+        -0.036427451148
+        -0.0364132366217
+        -0.0363990220954
+        -0.0363848075691
+        -0.0363705930428
+        -0.0363563785164
+        -0.0363421639901
+        -0.0363279494638
+        -0.0363137349375
+        -0.0362995204111
+        -0.0362853058848
+        -0.0362710913585
+        -0.0362568768322
+        -0.0362426623059
+        -0.0362284477795
+        -0.0362142332532
+        -0.0362000187269
+        -0.0361858042006
+        -0.0361715896743
+        -0.0361573751479
+        -0.0361431606216
+        -0.0361289460953
+        -0.036114731569
+        -0.0361005170426
+        -0.0360863025163
+        -0.03607208799
+        -0.0360578734637
+        -0.0360436589374
+        -0.036029444411
+        -0.0360152298847
+        -0.0360010153584
+        -0.0359868008321
+        -0.0359725863058
+        -0.0359583717794
+        -0.0359441572531
+        -0.0359299427268
+        -0.0359157282005
+        -0.0359015136741
+        -0.0358872991478
+        -0.0358730846215
+        -0.0358588700952
+        -0.0358446555689
+        -0.0358304410425
+        -0.0358162265162
+        -0.0358020119899
+        -0.0357877974636
+        -0.0357735829373
+        -0.0357593684109
+        -0.0357451538846
+        -0.0357309393583
+        -0.035716724832
+        -0.0357025103056
+        -0.0356882957793
+        -0.035674081253
+        -0.0356598667267
+        -0.0356456522004
+        -0.035631437674
+        -0.0356172231477
+        -0.0356030086214
+        -0.0355887940951
+        -0.0355745795688
+        -0.0355603650424
+        -0.0355461505161
+        -0.0355319359898
+        -0.0355177214635
+        -0.0355035069371
+        -0.0354892924108
+        -0.0354750778845
+        -0.0354608633582
+        -0.0354466488319
+        -0.0354324343055
+        -0.0354182197792
+        -0.0354040052529
+        -0.0353897907266
+        -0.0353755762003
+        -0.0353613616739
+        -0.0353471471476
+        -0.0353329326213
+        -0.035318718095
+        -0.0353045035686
+        -0.0352902890423
+        -0.035276074516
+        -0.0352618599897
+        -0.0352476454634
+        -0.035233430937
+        -0.0352192164107
+        -0.0352050018844
+        -0.0351907873581
+        -0.0351765728318
+        -0.0351623583054
+        -0.0351481437791
+        -0.0351339292528
+        -0.0351197147265
+        -0.0351055002001
+        -0.0350912856738
+        -0.0350770711475
+        -0.0350628566212
+        -0.0350486420949
+        -0.0350344275685
+        -0.0350202130422
+        -0.0350059985159
+        -0.0349917839896
+        -0.0349775694633
+        -0.0349633549369
+        -0.0349491404106
+        -0.0349349258843
+        -0.034920711358
+        -0.0349064968316
+        -0.0348922823053
+        -0.034878067779
+        -0.0348638532527
+        -0.0348496387264
+        -0.0348354242
+        -0.0348212096737
+        -0.0348069951474
+        -0.0347927806211
+        -0.0347785660947
+        -0.0347643515684
+        -0.0347501370421
+        -0.0347359225158
+        -0.0347217079895
+        -0.0347074934631
+        -0.0346932789368
+        -0.0346790644105
+        -0.0346648498842
+        -0.0346506353579
+        -0.0346364208315
+        -0.0346222063052
+        -0.0346079917789
+        -0.0345937772526
+        -0.0345795627262
+        -0.0345653481999
+        -0.0345511336736
+        -0.0345369191473
+        -0.034522704621
+        -0.0345084900946
+        -0.0344942755683
+        -0.034480061042
+        -0.0344658465157
+        -0.0344516319894
+        -0.034437417463
+        -0.0344232029367
+        -0.0344089884104
+        -0.0343947738841
+        -0.0343805593577
+        -0.0343663448314
+        -0.0343521303051
+        -0.0343379157788
+        -0.0343237012525
+        -0.0343094867261
+        -0.0342952721998
+        -0.0342810576735
+        -0.0342668431472
+        -0.0342526286209
+        -0.0342384140945
+        -0.0342241995682
+        -0.0342099850419
+        -0.0341957705156
+        -0.0341815559892
+        -0.0341673414629
+        -0.0341531269366
+        -0.0341389124103
+        -0.034124697884
+        -0.0341104833576
+        -0.0340962688313
+        -0.034082054305
+        -0.0340678397787
+        -0.0340536252524
+        -0.034039410726
+        -0.0340251961997
+        -0.0340109816734
+        -0.0339967671471
+        -0.0339825526207
+        -0.0339683380944
+        -0.0339541235681
+        -0.0339399090418
+        -0.0339256945155
+        -0.0339114799891
+        -0.0338972654628
+        -0.0338830509365
+        -0.0338688364102
+        -0.0338546218839
+        -0.0338404073575
+        -0.0338261928312
+        -0.0338119783049
+        -0.0337977637786
+        -0.0337835492522
+        -0.0337693347259
+        -0.0337551201996
+        -0.0337409056733
+        -0.033726691147
+        -0.0337124766206
+        -0.0336982620943
+        -0.033684047568
+        -0.0336698330417
+        -0.0336556185154
+        -0.033641403989
+        -0.0336271894627
+        -0.0336129749364
+        -0.0335987604101
+        -0.0335845458837
+        -0.0335703313574
+        -0.0335561168311
+        -0.0335419023048
+        -0.0335276877785
+        -0.0335134732521
+        -0.0334992587258
+        -0.0334850441995
+        -0.0334708296732
+        -0.0334566151468
+        -0.0334424006205
+        -0.0334281860942
+        -0.0334139715679
+        -0.0333997570416
+        -0.0333855425152
+        -0.0333713279889
+        -0.0333571134626
+        -0.0333428989363
+        -0.03332868441
+        -0.0333144698836
+        -0.0333002553573
+        -0.033286040831
+        -0.0332718263047
+        -0.0332576117783
+        -0.033243397252
+        -0.0332291827257
+        -0.0332149681994
+        -0.0332007536731
+        -0.0331865391467
+        -0.0331723246204
+        -0.0331581100941
+        -0.0331438955678
+        -0.0331296810415
+        -0.0331154665151
+        -0.0331012519888
+        -0.0330870374625
+        -0.0330728229362
+        -0.0330586084098
+        -0.0330443938835
+        -0.0330301793572
+        -0.0330159648309
+        -0.0330017503046
+        -0.0329875357782
+        -0.0329733212519
+        -0.0329591067256
+        -0.0329448921993
+        -0.032930677673
+        -0.0329164631466
+        -0.0329022486203
+        -0.032888034094
+        -0.0328738195677
+        -0.0328596050413
+        -0.032845390515
+        -0.0328311759887
+        -0.0328169614624
+        -0.0328027469361
+        -0.0327885324097
+        -0.0327743178834
+        -0.0327601033571
+        -0.0327458888308
+        -0.0327316743045
+        -0.0327174597781
+        -0.0327032452518
+        -0.0326890307255
+        -0.0326748161992
+        -0.0326606016728
+        -0.0326463871465
+        -0.0326321726202
+        -0.0326179580939
+        -0.0326037435676
+        -0.0325895290412
+        -0.0325753145149
+        -0.0325610999886
+        -0.0325468854623
+        -0.032532670936
+        -0.0325184564096
+        -0.0325042418833
+        -0.032490027357
+        -0.0324758128307
+        -0.0324615983043
+        -0.032447383778
+        -0.0324331692517
+        -0.0324189547254
+        -0.0324047401991
+        -0.0323905256727
+        -0.0323763111464
+        -0.0323620966201
+        -0.0323478820938
+        -0.0323336675675
+        -0.0323194530411
+        -0.0323052385148
+        -0.0322910239885
+        -0.0322768094622
+        -0.0322625949358
+        -0.0322483804095
+        -0.0322341658832
+        -0.0322199513569
+        -0.0322057368306
+        -0.0321915223042
+        -0.0321773077779
+        -0.0321630932516
+        -0.0321488787253
+        -0.0321346641989
+        -0.0321204496726
+        -0.0321062351463
+        -0.03209202062
+        -0.0320778060937
+        -0.0320635915673
+        -0.032049377041
+        -0.0320351625147
+        -0.0320209479884
+        -0.0320067334621
+        -0.0319925189357
+        -0.0319783044094
+        -0.0319640898831
+        -0.0319498753568
+        -0.0319356608304
+        -0.0319214463041
+        -0.0319072317778
+        -0.0318930172515
+        -0.0318788027252
+        -0.0318645881988
+        -0.0318503736725
+        -0.0318361591462
+        -0.0318219446199
+        -0.0318077300936
+        -0.0317935155672
+        -0.0317793010409
+        -0.0317650865146
+        -0.0317508719883
+        -0.0317366574619
+        -0.0317224429356
+        -0.0317082284093
+        -0.031694013883
+        -0.0316797993567
+        -0.0316655848303
+        -0.031651370304
+        -0.0316371557777
+        -0.0316229412514
+        -0.0316087267251
+        -0.0315945121987
+        -0.0315802976724
+        -0.0315660831461
+        -0.0315518686198
+        -0.0315376540934
+        -0.0315234395671
+        -0.0315092250408
+        -0.0314950105145
+        -0.0314807959882
+        -0.0314665814618
+        -0.0314523669355
+        -0.0314381524092
+        -0.0314239378829
+        -0.0314097233566
+        -0.0313955088302
+        -0.0313812943039
+        -0.0313670797776
+        -0.0313528652513
+        -0.0313386507249
+        -0.0313244361986
+        -0.0313102216723
+        -0.031296007146
+        -0.0312817926197
+        -0.0312675780933
+        -0.031253363567
+        -0.0312391490407
+        -0.0312249345144
+        -0.0312107199881
+        -0.0311965054617
+        -0.0311822909354
+        -0.0311680764091
+        -0.0311538618828
+        -0.0311396473564
+        -0.0311254328301
+        -0.0311112183038
+        -0.0310970037775
+        -0.0310827892512
+        -0.0310685747248
+        -0.0310543601985
+        -0.0310401456722
+        -0.0310259311459
+        -0.0310117166196
+        -0.0309975020932
+        -0.0309832875669
+        -0.0309690730406
+        -0.0309548585143
+        -0.0309406439879
+        -0.0309264294616
+        -0.0309122149353
+        -0.030898000409
+        -0.0308837858827
+        -0.0308695713563
+        -0.03085535683
+        -0.0308411423037
+        -0.0308269277774
+        -0.0308127132511
+        -0.0307984987247
+        -0.0307842841984
+        -0.0307700696721
+        -0.0307558551458
+        -0.0307416406194
+        -0.0307274260931
+        -0.0307132115668
+        -0.0306989970405
+        -0.0306847825142
+        -0.0306705679878
+        -0.0306563534615
+        -0.0306421389352
+        -0.0306279244089
+        -0.0306137098825
+        -0.0305994953562
+        -0.0305852808299
+        -0.0305710663036
+        -0.0305568517773
+        -0.0305426372509
+        -0.0305284227246
+        -0.0305142081983
+        -0.030499993672
+        -0.0304857791457
+        -0.0304715646193
+        -0.030457350093
+        -0.0304431355667
+        -0.0304289210404
+        -0.030414706514
+        -0.0304004919877
+        -0.0303862774614
+        -0.0303720629351
+        -0.0303578484088
+        -0.0303436338824
+        -0.0303294193561
+        -0.0303152048298
+        -0.0303009903035
+        -0.0302867757772
+        -0.0302725612508
+        -0.0302583467245
+        -0.0302441321982
+        -0.0302299176719
+        -0.0302157031455
+        -0.0302014886192
+        -0.0301872740929
+        -0.0301730595666
+        -0.0301588450403
+        -0.0301446305139
+        -0.0301304159876
+        -0.0301162014613
+        -0.030101986935
+        -0.0300877724087
+        -0.0300735578823
+        -0.030059343356
+        -0.0300451288297
+        -0.0300309143034
+        -0.030016699777
+        -0.0300024852507
+        -0.0299882707244
+        -0.0299740561981
+        -0.0299598416718
+        -0.0299456271454
+        -0.0299314126191
+        -0.0299171980928
+        -0.0299029835665
+        -0.0298887690402
+        -0.0298745545138
+        -0.0298603399875
+        -0.0298461254612
+        -0.0298319109349
+        -0.0298176964085
+        -0.0298034818822
+        -0.0297892673559
+        -0.0297750528296
+        -0.0297608383033
+        -0.0297466237769
+        -0.0297324092506
+        -0.0297181947243
+        -0.029703980198
+        -0.0296897656717
+        -0.0296755511453
+        -0.029661336619
+        -0.0296471220927
+        -0.0296329075664
+        -0.02961869304
+        -0.0296044785137
+        -0.0295902639874
+        -0.0295760494611
+        -0.0295618349348
+        -0.0295476204084
+        -0.0295334058821
+        -0.0295191913558
+        -0.0295049768295
+        -0.0294907623032
+        -0.0294765477768
+        -0.0294623332505
+        -0.0294481187242
+        -0.0294339041979
+        -0.0294196896715
+        -0.0294054751452
+        -0.0293912606189
+        -0.0293770460926
+        -0.0293628315663
+        -0.0293486170399
+        -0.0293344025136
+        -0.0293201879873
+        -0.029305973461
+        -0.0292917589346
+        -0.0292775444083
+        -0.029263329882
+        -0.0292491153557
+        -0.0292349008294
+        -0.029220686303
+        -0.0292064717767
+        -0.0291922572504
+        -0.0291780427241
+        -0.0291638281978
+        -0.0291496136714
+        -0.0291353991451
+        -0.0291211846188
+        -0.0291069700925
+        -0.0290927555661
+        -0.0290785410398
+        -0.0290643265135
+        -0.0290501119872
+        -0.0290358974609
+        -0.0290216829345
+        -0.0290074684082
+        -0.0289932538819
+        -0.0289790393556
+        -0.0289648248293
+        -0.0289506103029
+        -0.0289363957766
+        -0.0289221812503
+        -0.028907966724
+        -0.0288937521976
+        -0.0288795376713
+        -0.028865323145
+        -0.0288511086187
+        -0.0288368940924
+        -0.028822679566
+        -0.0288084650397
+        -0.0287942505134
+        -0.0287800359871
+        -0.0287658214608
+        -0.0287516069344
+        -0.0287373924081
+        -0.0287231778818
+        -0.0287089633555
+        -0.0286947488291
+        -0.0286805343028
+        -0.0286663197765
+        -0.0286521052502
+        -0.0286378907239
+        -0.0286236761975
+        -0.0286094616712
+        -0.0285952471449
+        -0.0285810326186
+        -0.0285668180923
+        -0.0285526035659
+        -0.0285383890396
+        -0.0285241745133
+        -0.028509959987
+        -0.0284957454606
+        -0.0284815309343
+        -0.028467316408
+        -0.0284531018817
+        -0.0284388873554
+        -0.028424672829
+        -0.0284104583027
+        -0.0283962437764
+        -0.0283820292501
+        -0.0283678147238
+        -0.0283536001974
+        -0.0283393856711
+        -0.0283251711448
+        -0.0283109566185
+        -0.0282967420921
+        -0.0282825275658
+        -0.0282683130395
+        -0.0282540985132
+        -0.0282398839869
+        -0.0282256694605
+        -0.0282114549342
+        -0.0281972404079
+        -0.0281830258816
+        -0.0281688113553
+        -0.0281545968289
+        -0.0281403823026
+        -0.0281261677763
+        -0.02811195325
+        -0.0280977387236
+        -0.0280835241973
+        -0.028069309671
+        -0.0280550951447
+        -0.0280408806184
+        -0.028026666092
+        -0.0280124515657
+        -0.0279982370394
+        -0.0279840225131
+        -0.0279698079867
+        -0.0279555934604
+        -0.0279413789341
+        -0.0279271644078
+        -0.0279129498815
+        -0.0278987353551
+        -0.0278845208288
+        -0.0278703063025
+        -0.0278560917762
+        -0.0278418772499
+        -0.0278276627235
+        -0.0278134481972
+        -0.0277992336709
+        -0.0277850191446
+        -0.0277708046182
+        -0.0277565900919
+        -0.0277423755656
+        -0.0277281610393
+        -0.027713946513
+        -0.0276997319866
+        -0.0276855174603
+        -0.027671302934
+        -0.0276570884077
+        -0.0276428738814
+        -0.027628659355
+        -0.0276144448287
+        -0.0276002303024
+        -0.0275860157761
+        -0.0275718012497
+        -0.0275575867234
+        -0.0275433721971
+        -0.0275291576708
+        -0.0275149431445
+        -0.0275007286181
+        -0.0274865140918
+        -0.0274722995655
+        -0.0274580850392
+        -0.0274438705129
+        -0.0274296559865
+        -0.0274154414602
+        -0.0274012269339
+        -0.0273870124076
+        -0.0273727978812
+        -0.0273585833549
+        -0.0273443688286
+        -0.0273301543023
+        -0.027315939776
+        -0.0273017252496
+        -0.0272875107233
+        -0.027273296197
+        -0.0272590816707
+        -0.0272448671444
+        -0.027230652618
+        -0.0272164380917
+        -0.0272022235654
+        -0.0271880090391
+        -0.0271737945127
+        -0.0271595799864
+        -0.0271453654601
+        -0.0271311509338
+        -0.0271169364075
+        -0.0271027218811
+        -0.0270885073548
+        -0.0270742928285
+        -0.0270600783022
+        -0.0270458637759
+        -0.0270316492495
+        -0.0270174347232
+        -0.0270032201969
+        -0.0269890056706
+        -0.0269747911442
+        -0.0269605766179
+        -0.0269463620916
+        -0.0269321475653
+        -0.026917933039
+        -0.0269037185126
+        -0.0268895039863
+        -0.02687528946
+        -0.0268610749337
+        -0.0268468604074
+        -0.026832645881
+        -0.0268184313547
+        -0.0268042168284
+        -0.0267900023021
+        -0.0267757877757
+        -0.0267615732494
+        -0.0267473587231
+        -0.0267331441968
+        -0.0267189296705
+        -0.0267047151441
+        -0.0266905006178
+        -0.0266762860915
+        -0.0266620715652
+        -0.0266478570389
+        -0.0266336425125
+        -0.0266194279862
+        -0.0266052134599
+        -0.0265909989336
+        -0.0265767844072
+        -0.0265625698809
+        -0.0265483553546
+        -0.0265341408283
+        -0.026519926302
+        -0.0265057117756
+        -0.0264914972493
+        -0.026477282723
+        -0.0264630681967
+        -0.0264488536703
+        -0.026434639144
+        -0.0264204246177
+        -0.0264062100914
+        -0.0263919955651
+        -0.0263777810387
+        -0.0263635665124
+        -0.0263493519861
+        -0.0263351374598
+        -0.0263209229335
+        -0.0263067084071
+        -0.0262924938808
+        -0.0262782793545
+        -0.0262640648282
+        -0.0262498503018
+        -0.0262356357755
+        -0.0262214212492
+        -0.0262072067229
+        -0.0261929921966
+        -0.0261787776702
+        -0.0261645631439
+        -0.0261503486176
+        -0.0261361340913
+        -0.026121919565
+        -0.0261077050386
+        -0.0260934905123
+        -0.026079275986
+        -0.0260650614597
+        -0.0260508469333
+        -0.026036632407
+        -0.0260224178807
+        -0.0260082033544
+        -0.0259939888281
+        -0.0259797743017
+        -0.0259655597754
+        -0.0259513452491
+        -0.0259371307228
+        -0.0259229161965
+        -0.0259087016701
+        -0.0258944871438
+        -0.0258802726175
+        -0.0258660580912
+        -0.0258518435648
+        -0.0258376290385
+        -0.0258234145122
+        -0.0258091999859
+        -0.0257949854596
+        -0.0257807709332
+        -0.0257665564069
+        -0.0257523418806
+        -0.0257381273543
+        -0.025723912828
+        -0.0257096983016
+        -0.0256954837753
+        -0.025681269249
+        -0.0256670547227
+        -0.0256528401963
+        -0.02563862567
+        -0.0256244111437
+        -0.0256101966174
+        -0.0255959820911
+        -0.0255817675647
+        -0.0255675530384
+        -0.0255533385121
+        -0.0255391239858
+        -0.0255249094595
+        -0.0255106949331
+        -0.0254964804068
+        -0.0254822658805
+        -0.0254680513542
+        -0.0254538368278
+        -0.0254396223015
+        -0.0254254077752
+        -0.0254111932489
+        -0.0253969787226
+        -0.0253827641962
+        -0.0253685496699
+        -0.0253543351436
+        -0.0253401206173
+        -0.025325906091
+        -0.0253116915646
+        -0.0252974770383
+        -0.025283262512
+        -0.0252690479857
+        -0.0252548334593
+        -0.025240618933
+        -0.0252264044067
+        -0.0252121898804
+        -0.0251979753541
+        -0.0251837608277
+        -0.0251695463014
+        -0.0251553317751
+        -0.0251411172488
+        -0.0251269027224
+        -0.0251126881961
+        -0.0250984736698
+        -0.0250842591435
+        -0.0250700446172
+        -0.0250558300908
+        -0.0250416155645
+        -0.0250274010382
+        -0.0250131865119
+        -0.0249989719856
+        -0.0249847574592
+        -0.0249705429329
+        -0.0249563284066
+        -0.0249421138803
+        -0.0249278993539
+        -0.0249136848276
+        -0.0248994703013
+        -0.024885255775
+        -0.0248710412487
+        -0.0248568267223
+        -0.024842612196
+        -0.0248283976697
+        -0.0248141831434
+        -0.0247999686171
+        -0.0247857540907
+        -0.0247715395644
+        -0.0247573250381
+        -0.0247431105118
+        -0.0247288959854
+        -0.0247146814591
+        -0.0247004669328
+        -0.0246862524065
+        -0.0246720378802
+        -0.0246578233538
+        -0.0246436088275
+        -0.0246293943012
+        -0.0246151797749
+        -0.0246009652486
+        -0.0245867507222
+        -0.0245725361959
+        -0.0245583216696
+        -0.0245441071433
+        -0.0245298926169
+        -0.0245156780906
+        -0.0245014635643
+        -0.024487249038
+        -0.0244730345117
+        -0.0244588199853
+        -0.024444605459
+        -0.0244303909327
+        -0.0244161764064
+        -0.0244019618801
+        -0.0243877473537
+        -0.0243735328274
+        -0.0243593183011
+        -0.0243451037748
+        -0.0243308892484
+        -0.0243166747221
+        -0.0243024601958
+        -0.0242882456695
+        -0.0242740311432
+        -0.0242598166168
+        -0.0242456020905
+        -0.0242313875642
+        -0.0242171730379
+        -0.0242029585116
+        -0.0241887439852
+        -0.0241745294589
+        -0.0241603149326
+        -0.0241461004063
+        -0.0241318858799
+        -0.0241176713536
+        -0.0241034568273
+        -0.024089242301
+        -0.0240750277747
+        -0.0240608132483
+        -0.024046598722
+        -0.0240323841957
+        -0.0240181696694
+        -0.0240039551431
+        -0.0239897406167
+        -0.0239755260904
+        -0.0239613115641
+        -0.0239470970378
+        -0.0239328825114
+        -0.0239186679851
+        -0.0239044534588
+        -0.0238902389325
+        -0.0238760244062
+        -0.0238618098798
+        -0.0238475953535
+        -0.0238333808272
+        -0.0238191663009
+        -0.0238049517745
+        -0.0237907372482
+        -0.0237765227219
+        -0.0237623081956
+        -0.0237480936693
+        -0.0237338791429
+        -0.0237196646166
+        -0.0237054500903
+        -0.023691235564
+        -0.0236770210377
+        -0.0236628065113
+        -0.023648591985
+        -0.0236343774587
+        -0.0236201629324
+        -0.023605948406
+        -0.0235917338797
+        -0.0235775193534
+        -0.0235633048271
+        -0.0235490903008
+        -0.0235348757744
+        -0.0235206612481
+        -0.0235064467218
+        -0.0234922321955
+        -0.0234780176692
+        -0.0234638031428
+        -0.0234495886165
+        -0.0234353740902
+        -0.0234211595639
+        -0.0234069450375
+        -0.0233927305112
+        -0.0233785159849
+        -0.0233643014586
+        -0.0233500869323
+        -0.0233358724059
+        -0.0233216578796
+        -0.0233074433533
+        -0.023293228827
+        -0.0232790143007
+        -0.0232647997743
+        -0.023250585248
+        -0.0232363707217
+        -0.0232221561954
+        -0.023207941669
+        -0.0231937271427
+        -0.0231795126164
+        -0.0231652980901
+        -0.0231510835638
+        -0.0231368690374
+        -0.0231226545111
+        -0.0231084399848
+        -0.0230942254585
+        -0.0230800109322
+        -0.0230657964058
+        -0.0230515818795
+        -0.0230373673532
+        -0.0230231528269
+        -0.0230089383005
+        -0.0229947237742
+        -0.0229805092479
+        -0.0229662947216
+        -0.0229520801953
+        -0.0229378656689
+        -0.0229236511426
+        -0.0229094366163
+        -0.02289522209
+        -0.0228810075637
+        -0.0228667930373
+        -0.022852578511
+        -0.0228383639847
+        -0.0228241494584
+        -0.022809934932
+        -0.0227957204057
+        -0.0227815058794
+        -0.0227672913531
+        -0.0227530768268
+        -0.0227388623004
+        -0.0227246477741
+        -0.0227104332478
+        -0.0226962187215
+        -0.0226820041952
+        -0.0226677896688
+        -0.0226535751425
+        -0.0226393606162
+        -0.0226251460899
+        -0.0226109315635
+        -0.0225967170372
+        -0.0225825025109
+        -0.0225682879846
+        -0.0225540734583
+        -0.0225398589319
+        -0.0225256444056
+        -0.0225114298793
+        -0.022497215353
+        -0.0224830008267
+        -0.0224687863003
+        -0.022454571774
+        -0.0224403572477
+        -0.0224261427214
+        -0.022411928195
+        -0.0223977136687
+        -0.0223834991424
+        -0.0223692846161
+        -0.0223550700898
+        -0.0223408555634
+        -0.0223266410371
+        -0.0223124265108
+        -0.0222982119845
+        -0.0222839974581
+        -0.0222697829318
+        -0.0222555684055
+        -0.0222413538792
+        -0.0222271393529
+        -0.0222129248265
+        -0.0221987103002
+        -0.0221844957739
+        -0.0221702812476
+        -0.0221560667213
+        -0.0221418521949
+        -0.0221276376686
+        -0.0221134231423
+        -0.022099208616
+        -0.0220849940896
+        -0.0220707795633
+        -0.022056565037
+        -0.0220423505107
+        -0.0220281359844
+        -0.022013921458
+        -0.0219997069317
+        -0.0219854924054
+        -0.0219712778791
+        -0.0219570633528
+        -0.0219428488264
+        -0.0219286343001
+        -0.0219144197738
+        -0.0219002052475
+        -0.0218859907211
+        -0.0218717761948
+        -0.0218575616685
+        -0.0218433471422
+        -0.0218291326159
+        -0.0218149180895
+        -0.0218007035632
+        -0.0217864890369
+        -0.0217722745106
+        -0.0217580599843
+        -0.0217438454579
+        -0.0217296309316
+        -0.0217154164053
+        -0.021701201879
+        -0.0216869873526
+        -0.0216727728263
+        -0.0216585583
+        -0.0216443437737
+        -0.0216301292474
+        -0.021615914721
+        -0.0216017001947
+        -0.0215874856684
+        -0.0215732711421
+        -0.0215590566158
+        -0.0215448420894
+        -0.0215306275631
+        -0.0215164130368
+        -0.0215021985105
+        -0.0214879839841
+        -0.0214737694578
+        -0.0214595549315
+        -0.0214453404052
+        -0.0214311258789
+        -0.0214169113525
+        -0.0214026968262
+        -0.0213884822999
+        -0.0213742677736
+        -0.0213600532473
+        -0.0213458387209
+        -0.0213316241946
+        -0.0213174096683
+        -0.021303195142
+        -0.0212889806156
+        -0.0212747660893
+        -0.021260551563
+        -0.0212463370367
+        -0.0212321225104
+        -0.021217907984
+        -0.0212036934577
+        -0.0211894789314
+        -0.0211752644051
+        -0.0211610498788
+        -0.0211468353524
+        -0.0211326208261
+        -0.0211184062998
+        -0.0211041917735
+        -0.0210899772471
+        -0.0210757627208
+        -0.0210615481945
+        -0.0210473336682
+        -0.0210331191419
+        -0.0210189046155
+        -0.0210046900892
+        -0.0209904755629
+        -0.0209762610366
+        -0.0209620465102
+        -0.0209478319839
+        -0.0209336174576
+        -0.0209194029313
+        -0.020905188405
+        -0.0208909738786
+        -0.0208767593523
+        -0.020862544826
+        -0.0208483302997
+        -0.0208341157734
+        -0.020819901247
+        -0.0208056867207
+        -0.0207914721944
+        -0.0207772576681
+        -0.0207630431417
+        -0.0207488286154
+        -0.0207346140891
+        -0.0207203995628
+        -0.0207061850365
+        -0.0206919705101
+        -0.0206777559838
+        -0.0206635414575
+        -0.0206493269312
+        -0.0206351124049
+        -0.0206208978785
+        -0.0206066833522
+        -0.0205924688259
+        -0.0205782542996
+        -0.0205640397732
+        -0.0205498252469
+        -0.0205356107206
+        -0.0205213961943
+        -0.020507181668
+        -0.0204929671416
+        -0.0204787526153
+        -0.020464538089
+        -0.0204503235627
+        -0.0204361090364
+        -0.02042189451
+        -0.0204076799837
+        -0.0203934654574
+        -0.0203792509311
+        -0.0203650364047
+        -0.0203508218784
+        -0.0203366073521
+        -0.0203223928258
+        -0.0203081782995
+        -0.0202939637731
+        -0.0202797492468
+        -0.0202655347205
+        -0.0202513201942
+        -0.0202371056679
+        -0.0202228911415
+        -0.0202086766152
+        -0.0201944620889
+        -0.0201802475626
+        -0.0201660330362
+        -0.0201518185099
+        -0.0201376039836
+        -0.0201233894573
+        -0.020109174931
+        -0.0200949604046
+        -0.0200807458783