├── .gitattributes ├── .gitignore ├── AUTHORS.md ├── CHANGELOG.md ├── CMakeLists.txt ├── CODING.md ├── INSTALL.md ├── LICENSES ├── README.md ├── cmake ├── CMakeLists.txt ├── generated_input │ ├── CMakeLists.txt │ └── yafaray_version_build_info.h.in └── modules │ ├── FindOpenEXR.cmake │ └── message_boolean.cmake ├── include ├── accelerator │ ├── accelerator.h │ ├── accelerator_kdtree_common.h │ ├── accelerator_kdtree_multi_thread.h │ ├── accelerator_kdtree_original.h │ ├── accelerator_simple_test.h │ └── intersect_data.h ├── background │ ├── background.h │ ├── background_constant.h │ ├── background_darksky.h │ ├── background_gradient.h │ ├── background_sunsky.h │ └── background_texture.h ├── camera │ ├── camera.h │ ├── camera_angular.h │ ├── camera_architect.h │ ├── camera_equirectangular.h │ ├── camera_orthographic.h │ └── camera_perspective.h ├── color │ ├── color.h │ ├── color_console.h │ ├── color_conversion.h │ ├── color_layers.h │ ├── color_ramp.h │ ├── color_space.h │ ├── spectral_data.h │ ├── spectrum.h │ └── spectrum_sun.h ├── common │ ├── aa_noise_params.h │ ├── bimap.h │ ├── collection.h │ ├── container.h │ ├── enum.h │ ├── enum_map.h │ ├── file.h │ ├── items.h │ ├── layer.h │ ├── layer_definitions.h │ ├── layers.h │ ├── logger.h │ ├── mask_edge_toon_params.h │ ├── memory_arena.h │ ├── result_flags.h │ ├── string.h │ ├── sysinfo.h │ ├── timer.h │ ├── version_build_info.h │ └── visibility.h ├── format │ ├── format.h │ ├── format_exr.h │ ├── format_hdr.h │ ├── format_hdr_util.h │ ├── format_jpg.h │ ├── format_png.h │ ├── format_png_util.h │ ├── format_tga.h │ ├── format_tga_util.h │ └── format_tif.h ├── geometry │ ├── axis.h │ ├── bound.h │ ├── clip_plane.h │ ├── direction_color.h │ ├── dudv.h │ ├── instance.h │ ├── matrix.h │ ├── object │ │ ├── object.h │ │ ├── object_curve.h │ │ ├── object_mesh.h │ │ └── object_primitive.h │ ├── plane.h │ ├── poly_double.h │ ├── primitive │ │ ├── face_indices.h │ │ ├── primitive.h │ │ ├── primitive_face.h │ │ ├── primitive_instance.h │ │ ├── primitive_polygon.h │ │ ├── primitive_sphere.h │ │ └── vertex_indices.h │ ├── ray.h │ ├── rect.h │ ├── shape │ │ └── shape_polygon.h │ ├── surface.h │ ├── uv.h │ └── vector.h ├── image │ ├── badge.h │ ├── image.h │ ├── image_buffer.h │ ├── image_color.h │ ├── image_layers.h │ ├── image_manipulation.h │ ├── image_manipulation_freetype.h │ ├── image_manipulation_opencv.h │ ├── image_output.h │ └── image_pixel_types.h ├── integrator │ ├── surface │ │ ├── integrator_bidirectional.h │ │ ├── integrator_debug.h │ │ ├── integrator_direct_light.h │ │ ├── integrator_montecarlo.h │ │ ├── integrator_path_tracer.h │ │ ├── integrator_photon_caustic.h │ │ ├── integrator_photon_mapping.h │ │ ├── integrator_sppm.h │ │ ├── integrator_surface.h │ │ └── integrator_tiled.h │ └── volume │ │ ├── integrator_emission.h │ │ ├── integrator_single_scatter.h │ │ ├── integrator_sky.h │ │ └── integrator_volume.h ├── interface │ ├── export │ │ ├── export_c.h │ │ ├── export_python.h │ │ └── export_xml.h │ └── interface.h ├── light │ ├── light.h │ ├── light_area.h │ ├── light_background.h │ ├── light_background_portal.h │ ├── light_directional.h │ ├── light_ies.h │ ├── light_ies_data.h │ ├── light_object_light.h │ ├── light_point.h │ ├── light_sphere.h │ ├── light_spot.h │ └── light_sun.h ├── material │ ├── bsdf.h │ ├── material.h │ ├── material_blend.h │ ├── material_coated_glossy.h │ ├── material_data.h │ ├── material_glass.h │ ├── material_glossy.h │ ├── material_light.h │ ├── material_mask.h │ ├── material_mirror.h │ ├── material_node.h │ ├── material_null.h │ ├── material_rough_glass.h │ ├── material_shiny_diffuse.h │ ├── material_utils_microfacet.h │ ├── sample.h │ └── specular_data.h ├── math │ ├── buffer.h │ ├── buffer_2d.h │ ├── filter.h │ ├── interpolation.h │ ├── interpolation_curve.h │ ├── math.h │ └── random.h ├── noise │ ├── generator │ │ ├── noise_blender.h │ │ ├── noise_cell.h │ │ ├── noise_perlin_improved.h │ │ ├── noise_perlin_standard.h │ │ └── noise_voronoi.h │ ├── musgrave.h │ ├── musgrave │ │ ├── musgrave_fbm.h │ │ ├── musgrave_hetero_terrain.h │ │ ├── musgrave_hybrid_mfractal.h │ │ ├── musgrave_mfractal.h │ │ └── musgrave_ridged_mfractal.h │ └── noise_generator.h ├── param │ ├── class_meta.h │ ├── param.h │ ├── param_meta.h │ └── param_result.h ├── photon │ ├── hashgrid.h │ ├── photon.h │ ├── photon_sample.h │ └── pkdtree.h ├── public_api │ ├── yafaray_c_api.h │ ├── yafaray_c_api_symbols.map │ └── yafaray_c_api_utils.h ├── render │ ├── imagefilm.h │ ├── imagesplitter.h │ ├── progress_bar.h │ ├── render_control.h │ ├── render_data.h │ └── render_monitor.h ├── resource │ ├── guifont.h │ └── yafLogoTiny.h ├── sampler │ ├── halton.h │ ├── sample.h │ └── sample_pdf1d.h ├── scene │ └── scene.h ├── shader │ ├── mix │ │ ├── shader_node_mix_add.h │ │ ├── shader_node_mix_dark.h │ │ ├── shader_node_mix_diff.h │ │ ├── shader_node_mix_light.h │ │ ├── shader_node_mix_mult.h │ │ ├── shader_node_mix_overlay.h │ │ ├── shader_node_mix_screen.h │ │ └── shader_node_mix_sub.h │ ├── node │ │ ├── node_finder.h │ │ ├── node_result.h │ │ └── node_tree_data.h │ ├── shader_node.h │ ├── shader_node_layer.h │ ├── shader_node_mix.h │ ├── shader_node_texture.h │ └── shader_node_value.h ├── texture │ ├── mipmap_params.h │ ├── texture.h │ ├── texture_blend.h │ ├── texture_clouds.h │ ├── texture_distorted_noise.h │ ├── texture_image.h │ ├── texture_marble.h │ ├── texture_musgrave.h │ ├── texture_rgb_cube.h │ ├── texture_voronoi.h │ └── texture_wood.h └── volume │ ├── handler │ ├── volume_handler.h │ ├── volume_handler_beer.h │ └── volume_handler_sss.h │ └── region │ ├── density │ ├── volume_exp_density.h │ ├── volume_grid.h │ ├── volume_noise.h │ └── volume_region_density.h │ ├── volume_region.h │ ├── volume_sky.h │ └── volume_uniform.h ├── src ├── CMakeLists.txt ├── accelerator │ ├── CMakeLists.txt │ ├── accelerator.cc │ ├── accelerator_kdtree_multi_thread.cc │ ├── accelerator_kdtree_original.cc │ └── accelerator_simple_test.cc ├── background │ ├── CMakeLists.txt │ ├── background.cc │ ├── background_constant.cc │ ├── background_darksky.cc │ ├── background_gradient.cc │ ├── background_sunsky.cc │ └── background_texture.cc ├── camera │ ├── CMakeLists.txt │ ├── camera.cc │ ├── camera_angular.cc │ ├── camera_architect.cc │ ├── camera_equirectangular.cc │ ├── camera_orthographic.cc │ └── camera_perspective.cc ├── color │ ├── CMakeLists.txt │ ├── color.cc │ ├── color_console.cc │ ├── color_layers.cc │ ├── color_ramp.cc │ └── spectrum.cc ├── common │ ├── CMakeLists.txt │ ├── container.cc │ ├── file.cc │ ├── items.cc │ ├── layer.cc │ ├── layer_definitions.cc │ ├── layers.cc │ ├── logger.cc │ ├── sysinfo.cc │ ├── timer.cc │ └── version_build_info.cc ├── format │ ├── CMakeLists.txt │ ├── format.cc │ ├── format_exr.cc │ ├── format_hdr.cc │ ├── format_jpg.cc │ ├── format_png.cc │ ├── format_tga.cc │ └── format_tif.cc ├── geometry │ ├── CMakeLists.txt │ ├── direction_color.cc │ ├── instance.cc │ ├── object │ │ ├── CMakeLists.txt │ │ ├── object.cc │ │ ├── object_curve.cc │ │ ├── object_mesh.cc │ │ └── object_primitive.cc │ ├── poly_double.cc │ ├── primitive │ │ ├── CMakeLists.txt │ │ ├── primitive.cc │ │ ├── primitive_instance.cc │ │ ├── primitive_polygon.cc │ │ └── primitive_sphere.cc │ ├── surface.cc │ └── vector.cc ├── image │ ├── CMakeLists.txt │ ├── badge.cc │ ├── image.cc │ ├── image_layers.cc │ ├── image_manipulation.cc │ ├── image_manipulation_freetype.cc │ ├── image_manipulation_opencv.cc │ └── image_output.cc ├── integrator │ ├── CMakeLists.txt │ ├── surface │ │ ├── CMakeLists.txt │ │ ├── integrator_bidirectional.cc │ │ ├── integrator_debug.cc │ │ ├── integrator_direct_light.cc │ │ ├── integrator_montecarlo.cc │ │ ├── integrator_path_tracer.cc │ │ ├── integrator_photon_caustic.cc │ │ ├── integrator_photon_mapping.cc │ │ ├── integrator_sppm.cc │ │ ├── integrator_surface.cc │ │ └── integrator_tiled.cc │ └── volume │ │ ├── CMakeLists.txt │ │ ├── integrator_emission.cc │ │ ├── integrator_single_scatter.cc │ │ ├── integrator_sky.cc │ │ └── integrator_volume.cc ├── interface │ ├── CMakeLists.txt │ ├── export │ │ ├── CMakeLists.txt │ │ ├── export_c.cc │ │ ├── export_python.cc │ │ └── export_xml.cc │ └── interface.cc ├── light │ ├── CMakeLists.txt │ ├── light.cc │ ├── light_area.cc │ ├── light_background.cc │ ├── light_background_portal.cc │ ├── light_directional.cc │ ├── light_ies.cc │ ├── light_object_light.cc │ ├── light_point.cc │ ├── light_sphere.cc │ ├── light_spot.cc │ └── light_sun.cc ├── material │ ├── CMakeLists.txt │ ├── material.cc │ ├── material_blend.cc │ ├── material_coated_glossy.cc │ ├── material_glass.cc │ ├── material_glossy.cc │ ├── material_light.cc │ ├── material_mask.cc │ ├── material_mirror.cc │ ├── material_node.cc │ ├── material_null.cc │ ├── material_rough_glass.cc │ └── material_shiny_diffuse.cc ├── noise │ ├── CMakeLists.txt │ ├── generator │ │ ├── CMakeLists.txt │ │ ├── noise_blender.cc │ │ ├── noise_cell.cc │ │ ├── noise_perlin_improved.cc │ │ ├── noise_perlin_standard.cc │ │ └── noise_voronoi.cc │ ├── musgrave │ │ ├── CMakeLists.txt │ │ ├── musgrave_fbm.cc │ │ ├── musgrave_hetero_terrain.cc │ │ ├── musgrave_hybrid_mfractal.cc │ │ ├── musgrave_mfractal.cc │ │ └── musgrave_ridged_mfractal.cc │ └── noise_generator.cc ├── param │ ├── CMakeLists.txt │ └── param.cc ├── photon │ ├── CMakeLists.txt │ ├── hashgrid.cc │ └── photon.cc ├── public_api │ ├── CMakeLists.txt │ ├── yafaray_c_api_container.cc │ ├── yafaray_c_api_film.cc │ ├── yafaray_c_api_general.cc │ ├── yafaray_c_api_logger.cc │ ├── yafaray_c_api_param_map.cc │ ├── yafaray_c_api_param_map_list.cc │ ├── yafaray_c_api_render_control.cc │ ├── yafaray_c_api_render_monitor.cc │ ├── yafaray_c_api_scene.cc │ └── yafaray_c_api_surface_integrator.cc ├── render │ ├── CMakeLists.txt │ ├── imagefilm.cc │ ├── imagesplitter.cc │ ├── progress_bar.cc │ └── render_monitor.cc ├── sampler │ ├── CMakeLists.txt │ └── halton.cc ├── scene │ ├── CMakeLists.txt │ └── scene.cc ├── shader │ ├── CMakeLists.txt │ ├── shader_node.cc │ ├── shader_node_layer.cc │ ├── shader_node_mix.cc │ ├── shader_node_texture.cc │ └── shader_node_value.cc ├── texture │ ├── CMakeLists.txt │ ├── texture.cc │ ├── texture_blend.cc │ ├── texture_clouds.cc │ ├── texture_distorted_noise.cc │ ├── texture_image.cc │ ├── texture_marble.cc │ ├── texture_musgrave.cc │ ├── texture_rgb_cube.cc │ ├── texture_voronoi.cc │ └── texture_wood.cc └── volume │ ├── CMakeLists.txt │ ├── handler │ ├── CMakeLists.txt │ ├── volume_handler.cc │ ├── volume_handler_beer.cc │ └── volume_handler_sss.cc │ └── region │ ├── CMakeLists.txt │ ├── density │ ├── CMakeLists.txt │ ├── volume_exp_density.cc │ ├── volume_grid.cc │ ├── volume_noise.cc │ └── volume_region_density.cc │ ├── volume_region.cc │ ├── volume_sky.cc │ └── volume_uniform.cc └── tests ├── CMakeLists.txt ├── test00 ├── CMakeLists.txt ├── test00.c └── tex.tga ├── test01 ├── CMakeLists.txt ├── test01.c ├── tex.exr ├── tex.hdr ├── tex.jpg ├── tex.png ├── tex.tga └── tex.tif ├── test02 ├── CMakeLists.txt └── test02.c ├── test03 ├── CMakeLists.txt ├── pixels_texture.tga ├── test03.c ├── tex.exr ├── tex.hdr ├── tex.jpg ├── tex.png ├── tex.tga └── tex.tif ├── test04 ├── CMakeLists.txt ├── test04.c ├── tex.hdr └── tex.tga ├── test05 ├── CMakeLists.txt ├── test05.c ├── tex.hdr └── tex.tga ├── test06 ├── CMakeLists.txt ├── test06.c ├── tex.hdr └── tex.tga ├── test07 ├── CMakeLists.txt ├── test07.c ├── tex.hdr └── tex.tga ├── test08 ├── CMakeLists.txt ├── test08.c ├── tex.hdr └── tex.tga ├── test09 ├── CMakeLists.txt ├── test09.c ├── tex.exr ├── tex.hdr ├── tex.jpg ├── tex.png ├── tex.tga └── tex.tif └── test10 ├── CMakeLists.txt ├── test10.c ├── tex.exr ├── tex.hdr ├── tex.jpg ├── tex.png ├── tex.tga └── tex.tif /.gitattributes: -------------------------------------------------------------------------------- 1 | tests/** linguist-vendored 2 | *.h linguist-language=C++ 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .* 2 | cmake* 3 | build* 4 | make* 5 | !/.gitignore 6 | !/.gitattributes 7 | !/cmake 8 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # This is a rough list of the contributors to YafaRay and is still in # 3 | # progress, so if you know someone is missing please let us know # 4 | ############################################################################### 5 | 6 | Developers for Yafray (up to version 0.0.9): 7 | Alejandro Conty Estévez (jandro) 8 | Alfredo Greef (eshlo) 9 | 10 | Developers for YafaRay (name change after refactor): 11 | Mathias Wein (Lynx) 12 | Bert Buchholz (bert) 13 | Michele Castigliego (subcomandante) 14 | Gustavo Boiko (boiko) 15 | Rodrigo Placencia (DarkTide) 16 | David Bluecame 17 | -------------------------------------------------------------------------------- /INSTALL.md: -------------------------------------------------------------------------------- 1 | libYafaRay uses CMake for the building process in Linux, Windows and MacOSX systems. 2 | 3 | Dependencies: 4 | * Required 5 | * C++17 compliant compiler 6 | * \>=cmake-3.18 7 | 8 | * Optional, depending on options selected in CMake: 9 | * \>=zlib-1.2.8 10 | * \>=opencv-3.1.0 11 | * \>=freetype-2.4.0 12 | * \>=libpng-1.2.56 13 | * \>=jpeg-6b 14 | * \>=tiff-4.0.3 15 | * \>=ilmbase-2.2.0 16 | * \>=openexr-2.2.0 17 | * \>=mingw-std-threads-1.0.0 18 | 19 | Notes about dependencies: 20 | * ZLib is needed if libPNG or OpenEXR are used. 21 | * OpenCV is used to do some image processing, most importantly LDR denoise, edge/toon layers and texture mipmaps for Trilinear or EWA interpolations. 22 | * mingw-std-threads is used only when building with MinGW with the native Win32 threads model 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DESCRIPTION 2 | ----------- 3 | libYafaRay is a free open-source montecarlo raytracing engine released under the LGPL 2.1 license. Raytracing is a rendering technique for generating realistic images by tracing the path of light through a 3D scene. 4 | 5 | For more information, see: www.yafaray.org 6 | 7 | 8 | SOURCE CODE 9 | ----------- 10 | libYafaRay source code is hosted in GitHub: https://github.com/YafaRay/libYafaRay 11 | 12 | 13 | BUG REPORTS / FEATURE REQUESTS 14 | ------------------------------ 15 | Please use the GitHub bug tracking system to report bugs in libYafaRay instead of the YafaRay website bug tracking. 16 | 17 | * GitHub bug tracking (preferred): https://github.com/YafaRay/libYafaRay/issues 18 | 19 | * YafaRay website bug tracking: http://www.yafaray.org/development/bugtracker/yafaray 20 | 21 | 22 | Thank you. 23 | 24 | YafaRay development Team. 25 | -------------------------------------------------------------------------------- /cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_subdirectory(generated_input) -------------------------------------------------------------------------------- /cmake/modules/FindOpenEXR.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Try to find older OpenEXR v2.2.x libraries, and include path. 3 | # Once done this will define: 4 | # 5 | # OPENEXR_FOUND = OpenEXR found. 6 | # OPENEXR_INCLUDE_DIRS = OpenEXR include directories. 7 | # OPENEXR_LIBRARIES = libraries that are needed to use OpenEXR. 8 | # 9 | 10 | find_package(ZLIB) 11 | 12 | if(ZLIB_FOUND) 13 | set(LIBRARY_DIRS 14 | /usr/lib 15 | /usr/local/lib 16 | /sw/lib 17 | /opt/local/lib 18 | $ENV{PROGRAM_FILES}/OpenEXR/lib/static) 19 | 20 | find_path(OPENEXR_INCLUDE_PATH ImfRgbaFile.h 21 | PATH_SUFFIXES OpenEXR 22 | /usr/include 23 | /usr/local/include 24 | /sw/include 25 | /opt/local/include) 26 | 27 | find_library(OPENEXR_HALF_LIBRARY 28 | NAMES Half Half-2_2 Half-2_3 Half-2_4 29 | PATHS ${LIBRARY_DIRS}) 30 | 31 | find_library(OPENEXR_IEX_LIBRARY 32 | NAMES Iex Iex-2_2 Iex-2_3 Iex-2_4 33 | PATHS ${LIBRARY_DIRS}) 34 | 35 | find_library(OPENEXR_IMATH_LIBRARY 36 | NAMES Imath Imath-2_2 Imath-2_3 Imath-2_4 37 | PATHS ${LIBRARY_DIRS}) 38 | 39 | find_library(OPENEXR_ILMIMF_LIBRARY 40 | NAMES IlmImf IlmImf-2_2 IlmImf-2_3 IlmImf-2_4 41 | PATHS ${LIBRARY_DIRS}) 42 | 43 | find_library(OPENEXR_ILMTHREAD_LIBRARY 44 | NAMES IlmThread IlmThread-2_2 IlmThread-2_3 IlmThread-2_4 45 | PATHS ${LIBRARY_DIRS}) 46 | endif() 47 | 48 | IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY) 49 | set(OPENEXR_FOUND TRUE) 50 | set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_PATH} CACHE STRING "The include paths needed to use OpenEXR") 51 | set(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${ZLIB_LIBRARY} CACHE STRING "The libraries needed to use OpenEXR") 52 | if(OPENEXR_ILMTHREAD_LIBRARY) 53 | set(OPENEXR_LIBRARIES ${OPENEXR_LIBRARIES} ${OPENEXR_ILMTHREAD_LIBRARY}) 54 | endif() 55 | endif() 56 | 57 | if(OPENEXR_FOUND) 58 | if(NOT OPENEXR_FIND_QUIETLY) 59 | message(STATUS "Found OpenEXR: ${OPENEXR_ILMIMF_LIBRARY}") 60 | endif() 61 | else() 62 | if(OPENEXR_FIND_REQUIRED) 63 | message(FATAL_ERROR "Could not find OpenEXR library") 64 | endif() 65 | endif() 66 | 67 | mark_as_advanced( 68 | OPENEXR_INCLUDE_DIRS 69 | OPENEXR_LIBRARIES 70 | OPENEXR_ILMIMF_LIBRARY 71 | OPENEXR_IMATH_LIBRARY 72 | OPENEXR_IEX_LIBRARY 73 | OPENEXR_HALF_LIBRARY 74 | ) 75 | -------------------------------------------------------------------------------- /cmake/modules/message_boolean.cmake: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | include_guard() 20 | 21 | # Function to show a message with an appended text that depends on a boolean variable (for example: "with PNG: yes" (or no)) 22 | function(message_boolean MESSAGE BOOL_VAR TEXT_TRUE TEXT_FALSE) 23 | if(${BOOL_VAR}) 24 | message("${MESSAGE}: ${TEXT_TRUE}") 25 | else() 26 | message("${MESSAGE}: ${TEXT_FALSE}") 27 | endif() 28 | endfunction() -------------------------------------------------------------------------------- /include/accelerator/intersect_data.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_INTERSECT_DATA_H 21 | #define LIBYAFARAY_INTERSECT_DATA_H 22 | 23 | #include "color/color.h" 24 | #include "geometry/uv.h" 25 | 26 | namespace yafaray { 27 | 28 | class Primitive; 29 | 30 | struct IntersectData 31 | { 32 | bool isHit() const { return t_hit_ > 0.f; } 33 | void setNoHit() { t_hit_ = 0.f; primitive_ = nullptr; } 34 | alignas(8) float t_hit_ = 0.f; 35 | Uv uv_; 36 | float t_max_ = std::numeric_limits::max(); 37 | const Primitive *primitive_ = nullptr; 38 | Rgb color_ {1.f}; 39 | }; 40 | 41 | } //namespace yafaray 42 | 43 | #endif //LIBYAFARAY_INTERSECT_DATA_H 44 | -------------------------------------------------------------------------------- /include/camera/camera_architect.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_CAMERA_ARCHITECT_H 21 | #define LIBYAFARAY_CAMERA_ARCHITECT_H 22 | 23 | #include "camera/camera_perspective.h" 24 | 25 | namespace yafaray { 26 | 27 | class ParamMap; 28 | class Scene; 29 | 30 | class ArchitectCamera final : public PerspectiveCamera 31 | { 32 | using ThisClassType_t = ArchitectCamera; using ParentClassType_t = PerspectiveCamera; 33 | 34 | public: 35 | inline static std::string getClassName() { return "ArchitectCamera"; } 36 | static std::pair, ParamResult> factory(Logger &logger, const std::string &name, const ParamMap ¶m_map); 37 | [[nodiscard]] std::map getParamMetaMap() const override { return params_.getParamMetaMap(); } 38 | static std::string printMeta(const std::vector &excluded_params) { return class_meta::print(excluded_params); } 39 | ArchitectCamera(Logger &logger, ParamResult ¶m_result, const ParamMap ¶m_map); 40 | 41 | private: 42 | [[nodiscard]] Type type() const override { return Type::Architect; } 43 | void setAxis(const Vec3f &vx, const Vec3f &vy, const Vec3f &vz) override; 44 | Point3f screenproject(const Point3f &p) const override; 45 | }; 46 | 47 | } //namespace yafaray 48 | 49 | #endif // LIBYAFARAY_CAMERA_ARCHITECT_H 50 | -------------------------------------------------------------------------------- /include/camera/camera_equirectangular.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_CAMERA_EQUIRECTANGULAR_H 21 | #define LIBYAFARAY_CAMERA_EQUIRECTANGULAR_H 22 | 23 | #include "camera/camera.h" 24 | 25 | namespace yafaray { 26 | 27 | class ParamMap; 28 | class Scene; 29 | 30 | class EquirectangularCamera final : public Camera 31 | { 32 | using ThisClassType_t = EquirectangularCamera; using ParentClassType_t = Camera; 33 | 34 | public: 35 | inline static std::string getClassName() { return "EquirectangularCamera"; } 36 | static std::pair, ParamResult> factory(Logger &logger, const std::string &name, const ParamMap ¶m_map); 37 | [[nodiscard]] std::map getParamMetaMap() const override { return params_.getParamMetaMap(); } 38 | static std::string printMeta(const std::vector &excluded_params) { return class_meta::print(excluded_params); } 39 | EquirectangularCamera(Logger &logger, ParamResult ¶m_result, const ParamMap ¶m_map); 40 | 41 | private: 42 | [[nodiscard]] Type type() const override { return Type::Equirectangular; } 43 | void setAxis(const Vec3f &vx, const Vec3f &vy, const Vec3f &vz); 44 | CameraRay shootRay(float px, float py, const Uv &uv) const override; 45 | Point3f screenproject(const Point3f &p) const override; 46 | }; 47 | 48 | 49 | } //namespace yafaray 50 | 51 | #endif // LIBYAFARAY_CAMERA_EQUIRECTANGULAR_H 52 | -------------------------------------------------------------------------------- /include/color/color_layers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | */ 20 | 21 | #ifndef YAFARAY_COLOR_LAYERS_H 22 | #define YAFARAY_COLOR_LAYERS_H 23 | 24 | #include "common/layers.h" 25 | #include "color/color.h" 26 | 27 | namespace yafaray { 28 | 29 | class ColorLayers final : public Collection //Actual buffer of colors in the rendering process, one entry for each enabled layer. 30 | { 31 | public: 32 | explicit ColorLayers(const Layers &layers); 33 | void setDefaultColors(); 34 | bool isDefinedAny(const std::vector &types) const; 35 | LayerDef::Flags getFlags() const { return flags_; } 36 | 37 | private: 38 | LayerDef::Flags flags_{LayerDef::Flags::None}; 39 | }; 40 | 41 | } //namespace yafaray 42 | 43 | #endif //YAFARAY_COLOR_LAYERS_H 44 | -------------------------------------------------------------------------------- /include/color/color_space.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_COLOR_SPACE_H 21 | #define LIBYAFARAY_COLOR_SPACE_H 22 | 23 | #include "common/enum.h" 24 | #include "common/enum_map.h" 25 | 26 | namespace yafaray { 27 | 28 | struct ColorSpace : public Enum 29 | { 30 | using Enum::Enum; using Enum::operator=; using Enum::operator==; 31 | enum : ValueType_t 32 | { 33 | RawManualGamma = 1, 34 | LinearRgb = 2, 35 | Srgb = 3, 36 | XyzD65 = 4 37 | }; 38 | inline static const EnumMap map_{{ 39 | {"Raw_Manual_Gamma", RawManualGamma, ""}, 40 | {"LinearRGB", LinearRgb, ""}, 41 | {"sRGB", Srgb, ""}, 42 | {"XYZ", XyzD65, ""}, 43 | }}; 44 | }; 45 | 46 | } //namespace yafaray 47 | 48 | #endif //LIBYAFARAY_COLOR_SPACE_H 49 | -------------------------------------------------------------------------------- /include/color/spectrum.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef YAFARAY_SPECTRUM_H 21 | #define YAFARAY_SPECTRUM_H 22 | 23 | #include "color/color.h" 24 | 25 | namespace yafaray::spectrum 26 | { 27 | 28 | Rgb wl2RgbFromCie(float wl); 29 | std::pair cauchyCoefficients(float ior, float disp_pw); 30 | Rgb wl2Xyz(float wl); 31 | 32 | inline float getIor(float w, float cauchy_a, float cauchy_b) 33 | { 34 | const float wl = 300.f * w + 400.f; 35 | return cauchy_a + cauchy_b / (wl * wl); 36 | } 37 | 38 | inline Rgb wl2Rgb(float w) 39 | { 40 | const float wl = 300.f * w + 400.f; 41 | Rgb wl_col = wl2RgbFromCie(wl); 42 | wl_col *= 2.214032659670777114f; 43 | return wl_col; 44 | } 45 | 46 | } //namespace yafaray::spectrum 47 | 48 | #endif // YAFARAY_SPECTRUM_H 49 | -------------------------------------------------------------------------------- /include/common/aa_noise_params.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_AA_NOISE_PARAMS_H 21 | #define LIBYAFARAY_AA_NOISE_PARAMS_H 22 | 23 | #include "common/enum.h" 24 | #include "common/enum_map.h" 25 | 26 | namespace yafaray { 27 | 28 | struct AaNoiseParams 29 | { 30 | struct DarkDetectionType : public Enum 31 | { 32 | enum : ValueType_t { None, Linear, Curve }; 33 | inline static const EnumMap map_{{ 34 | {"none", None, ""}, 35 | {"linear", Linear, ""}, 36 | {"curve", Curve, ""}, 37 | }}; 38 | }; 39 | int samples_ = 1; 40 | int passes_ = 1; 41 | int inc_samples_ = 1; //!< sample count for additional passes 42 | float threshold_ = 0.05f; 43 | float resampled_floor_ = 0.f; //!< minimum amount of resampled pixels (% of the total pixels) below which we will automatically decrease the threshold value for the next pass 44 | float sample_multiplier_factor_ = 1.f; 45 | float light_sample_multiplier_factor_ = 1.f; 46 | float indirect_sample_multiplier_factor_ = 1.f; 47 | bool detect_color_noise_ = false; 48 | DarkDetectionType dark_detection_type_{DarkDetectionType::None}; 49 | float dark_threshold_factor_ = 0.f; 50 | int variance_edge_size_ = 10; 51 | int variance_pixels_ = 0; 52 | float clamp_samples_ = 0.f; 53 | float clamp_indirect_ = 0.f; 54 | }; 55 | 56 | } //namespace yafaray 57 | 58 | #endif //LIBYAFARAY_AA_NOISE_PARAMS_H 59 | -------------------------------------------------------------------------------- /include/common/enum_map.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * 4 | * This is part of the libYafaRay package 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | */ 21 | 22 | #ifndef LIBYAFARAY_ENUM_MAP_H 23 | #define LIBYAFARAY_ENUM_MAP_H 24 | 25 | #include "common/bimap.h" 26 | #include 27 | #include 28 | 29 | namespace yafaray { 30 | 31 | template 32 | class EnumMap : public BiMap 33 | { 34 | public: 35 | [[nodiscard]] std::string print(T default_value) const; 36 | }; 37 | 38 | template 39 | inline std::string EnumMap::print(T default_value) const 40 | { 41 | std::stringstream ss; 42 | for(const auto &[key, value] : *this) 43 | { 44 | ss << " - '" << key << "'"; 45 | if(!value.second.empty()) ss << " [" << value.second << "]"; 46 | if(value.first == default_value) ss << " (default)"; 47 | ss << std::endl; 48 | } 49 | return ss.str(); 50 | } 51 | 52 | } //namespace yafaray 53 | 54 | #endif //LIBYAFARAY_ENUM_MAP_H 55 | -------------------------------------------------------------------------------- /include/common/layers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | */ 20 | 21 | #ifndef LIBYAFARAY_LAYERS_H 22 | #define LIBYAFARAY_LAYERS_H 23 | 24 | #include "common/collection.h" 25 | #include "image/image.h" 26 | #include "common/layer.h" 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | namespace yafaray { 34 | 35 | class Layers final : public Collection 36 | { 37 | public: 38 | bool isDefined(LayerDef::Type type) const; 39 | bool isDefinedAny(const std::vector &types) const; 40 | Layers getLayersWithImages() const; 41 | Layers getLayersWithExportedImages() const; 42 | std::string printExportedTable() const; 43 | }; 44 | 45 | inline bool Layers::isDefined(LayerDef::Type type) const 46 | { 47 | if(type == LayerDef::Disabled) return false; 48 | else return find(type); 49 | } 50 | 51 | } //namespace yafaray 52 | 53 | #endif // LIBYAFARAY_LAYERS_H 54 | -------------------------------------------------------------------------------- /include/common/result_flags.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by david on 23/10/22. 3 | // 4 | 5 | #ifndef LIBYAFARAY_RESULT_FLAGS_H 6 | #define LIBYAFARAY_RESULT_FLAGS_H 7 | 8 | #include "common/enum.h" 9 | #include "common/enum_map.h" 10 | #include "public_api/yafaray_c_api.h" 11 | #include 12 | #include 13 | #include 14 | 15 | namespace yafaray { 16 | 17 | struct ResultFlags : Enum 18 | { 19 | using Enum::Enum; 20 | inline static const EnumMap map_{{ 21 | {"Ok", YAFARAY_RESULT_OK, ""}, 22 | {"ErrorTypeUnknownParam", YAFARAY_RESULT_ERROR_TYPE_UNKNOWN_PARAM, ""}, 23 | {"WarningUnknownParam", YAFARAY_RESULT_WARNING_UNKNOWN_PARAM, ""}, 24 | {"WarningParamNotSet", YAFARAY_RESULT_WARNING_PARAM_NOT_SET, ""}, 25 | {"ErrorWrongParamType", YAFARAY_RESULT_ERROR_WRONG_PARAM_TYPE, ""}, 26 | {"WarningUnknownEnumOption", YAFARAY_RESULT_WARNING_UNKNOWN_ENUM_OPTION, ""}, 27 | {"ErrorAlreadyExists", YAFARAY_RESULT_ERROR_ALREADY_EXISTS, ""}, 28 | {"ErrorWhileCreating", YAFARAY_RESULT_ERROR_WHILE_CREATING, ""}, 29 | {"ErrorNotFound", YAFARAY_RESULT_ERROR_NOT_FOUND, ""}, 30 | {"WarningOverwritten", YAFARAY_RESULT_WARNING_OVERWRITTEN, ""}, 31 | {"ErrorDuplicatedName", YAFARAY_RESULT_ERROR_DUPLICATED_NAME, ""}, 32 | }}; 33 | [[nodiscard]] bool isOk() const { return value() == YAFARAY_RESULT_OK; } 34 | [[nodiscard]] bool notOk() const { return !isOk(); } 35 | [[nodiscard]] bool hasError() const; 36 | [[nodiscard]] bool hasWarning() const; 37 | }; 38 | 39 | inline bool ResultFlags::hasError() const 40 | { 41 | return has(YAFARAY_RESULT_ERROR_TYPE_UNKNOWN_PARAM) 42 | || has(YAFARAY_RESULT_ERROR_WRONG_PARAM_TYPE) 43 | || has(YAFARAY_RESULT_ERROR_ALREADY_EXISTS) 44 | || has(YAFARAY_RESULT_ERROR_WHILE_CREATING) 45 | || has(YAFARAY_RESULT_ERROR_NOT_FOUND) 46 | || has(YAFARAY_RESULT_ERROR_DUPLICATED_NAME); 47 | } 48 | 49 | inline bool ResultFlags::hasWarning() const 50 | { 51 | return has(YAFARAY_RESULT_WARNING_UNKNOWN_PARAM) 52 | || has(YAFARAY_RESULT_WARNING_UNKNOWN_ENUM_OPTION) 53 | || has(YAFARAY_RESULT_WARNING_PARAM_NOT_SET) 54 | || has(YAFARAY_RESULT_WARNING_OVERWRITTEN); 55 | } 56 | 57 | } //namespace yafaray 58 | 59 | #endif //LIBYAFARAY_RESULT_FLAGS_H 60 | -------------------------------------------------------------------------------- /include/common/sysinfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * sysinfo.h: runtime system information 4 | * This is part of the libYafaRay package 5 | * Copyright (C) 2020 David Bluecame 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free Software 19 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | */ 21 | 22 | #ifndef YAFARAY_SYSINFO_H 23 | #define YAFARAY_SYSINFO_H 24 | 25 | namespace yafaray::sysinfo 26 | { 27 | 28 | int getNumSystemThreads(); 29 | 30 | } //namespace yafaray::sys_info 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /include/common/timer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef YAFARAY_TIMER_H 21 | #define YAFARAY_TIMER_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #ifndef _WIN32 28 | extern "C" struct timeval; 29 | #include 30 | #endif 31 | 32 | namespace yafaray { 33 | 34 | class Timer 35 | { 36 | public: 37 | [[nodiscard]] bool addEvent(const std::string &name); 38 | [[nodiscard]] bool start(const std::string &name); 39 | [[nodiscard]] bool stop(const std::string &name); 40 | [[nodiscard]] bool reset(const std::string &name); 41 | [[nodiscard]] double getTime(const std::string &name) const; 42 | [[nodiscard]] double getTimeNotStopping(const std::string &name) const; 43 | 44 | static void splitTime(double t, double *secs, int *mins = nullptr, int *hours = nullptr, int *days = nullptr); 45 | 46 | protected: 47 | bool includes(const std::string &label) const; 48 | 49 | struct Tdata 50 | { 51 | Tdata(): started_(false), stopped_(false) {}; 52 | clock_t start_, finish_; 53 | #ifndef _WIN32 54 | timeval tvs_, tvf_; 55 | #endif 56 | bool started_, stopped_; 57 | }; 58 | std::map events_; 59 | }; 60 | 61 | } //namespace yafaray 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /include/common/version_build_info.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * 4 | * This is part of the libYafaRay package 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | */ 21 | 22 | #ifndef YAFARAY_VERSION_BUILD_INFO_H 23 | #define YAFARAY_VERSION_BUILD_INFO_H 24 | 25 | #include 26 | #include 27 | 28 | namespace yafaray::buildinfo 29 | { 30 | std::string getVersionString(); 31 | std::string getVersionDescription(); 32 | int getVersionMajor(); 33 | int getVersionMinor(); 34 | int getVersionPatch(); 35 | std::string getVersionPreRelease(); 36 | std::string getVersionPreReleaseDescription(); 37 | std::string getGitDescribe(); 38 | std::string getGitLine(bool long_line); 39 | std::string getGitTag(); 40 | std::string getGitBranch(); 41 | std::string getGitDirty(); 42 | std::string getGitCommit(); 43 | std::string getGitCommitDateTime(); 44 | std::string getCommitsSinceTag(); 45 | std::string getBuildArchitectureBits(); 46 | std::string getBuildCompiler(); 47 | std::string getBuildCompilerVersion(); 48 | std::string getBuildOs(); 49 | std::string getBuildType(); 50 | std::string getBuildTypeSuffix(); 51 | std::string getBuildOptions(); 52 | std::string getBuildFlags(); 53 | std::vector getAllBuildDetails(); 54 | 55 | } //namespace yafaray::buildinfo 56 | 57 | #endif //LIBYAFARAY_VERSION_BUILD_INFO_H 58 | -------------------------------------------------------------------------------- /include/common/visibility.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef YAFARAY_VISIBILITY_H 21 | #define YAFARAY_VISIBILITY_H 22 | 23 | #include "common/enum.h" 24 | #include "common/enum_map.h" 25 | #include 26 | 27 | namespace yafaray { 28 | 29 | struct Visibility : public Enum 30 | { 31 | using Enum::Enum; 32 | enum : ValueType_t { None = 0, Visible = 1 << 0, CastsShadows = 1 << 1, Normal = Visible | CastsShadows }; 33 | inline static const EnumMap map_{{ 34 | {"normal", Normal, ""}, 35 | {"invisible", None, ""}, 36 | {"shadow_only", CastsShadows, ""}, 37 | {"no_shadows", Visible, ""}, 38 | }}; 39 | }; 40 | 41 | } //namespace yafaray 42 | 43 | #endif //YAFARAY_VISIBILITY_H 44 | -------------------------------------------------------------------------------- /include/format/format_exr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * 4 | * imagehandler_exr.h: EXR format handler 5 | * This is part of the libYafaRay package 6 | * Copyright (C) 2010 Rodrigo Placencia Vazquez 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free Software 20 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | 24 | #ifndef LIBYAFARAY_FORMAT_EXR_H 25 | #define LIBYAFARAY_FORMAT_EXR_H 26 | 27 | #include "format/format.h" 28 | 29 | namespace yafaray { 30 | 31 | class ExrFormat final : public Format 32 | { 33 | public: 34 | inline static std::string getClassName() { return "ExrFormat"; } 35 | explicit ExrFormat(Logger &logger, ParamResult ¶m_result, const ParamMap ¶m_map) : Format(logger, param_result, param_map) { } 36 | 37 | private: 38 | [[nodiscard]] Type type() const override { return Type::Exr; } 39 | std::string getFormatName() const override { return "ExrFormat"; } 40 | std::unique_ptr loadFromFile(const std::string &name, const Image::Optimization &optimization, const ColorSpace &color_space, float gamma) override; 41 | bool saveToFile(const std::string &name, const ImageLayer &image_layer, ColorSpace color_space, float gamma, bool alpha_premultiply) override; 42 | bool saveToFileMultiChannel(const std::string &name, const ImageLayers &image_layers, ColorSpace color_space, float gamma, bool alpha_premultiply) override; 43 | bool isHdr() const override { return true; } 44 | bool supportsMultiLayer() const override { return true; } 45 | }; 46 | 47 | } //namespace yafaray 48 | 49 | #endif // LIBYAFARAY_FORMAT_EXR_H -------------------------------------------------------------------------------- /include/format/format_jpg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * 4 | * imagehandler_jpg.h: Joint Photographic Experts Group (JPEG) format handler 5 | * This is part of the libYafaRay package 6 | * Copyright (C) 2010 Rodrigo Placencia Vazquez 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free Software 20 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | 24 | #ifndef LIBYAFARAY_FORMAT_JPG_H 25 | #define LIBYAFARAY_FORMAT_JPG_H 26 | 27 | #include "format/format.h" 28 | 29 | namespace yafaray { 30 | 31 | class JpgFormat final : public Format 32 | { 33 | public: 34 | inline static std::string getClassName() { return "JpgFormat"; } 35 | explicit JpgFormat(Logger &logger, ParamResult ¶m_result, const ParamMap ¶m_map) : Format(logger, param_result, param_map) { } 36 | 37 | private: 38 | [[nodiscard]] Type type() const override { return Type::Jpg; } 39 | std::string getFormatName() const override { return "JpgFormat"; } 40 | std::unique_ptr loadFromFile(const std::string &name, const Image::Optimization &optimization, const ColorSpace &color_space, float gamma) override; 41 | bool saveToFile(const std::string &name, const ImageLayer &image_layer, ColorSpace color_space, float gamma, bool alpha_premultiply) override; 42 | bool supportsAlpha() const override { return false; } 43 | bool saveAlphaChannelOnlyToFile(const std::string &name, const ImageLayer &image_layer) override; 44 | }; 45 | 46 | } //namespace yafaray 47 | 48 | #endif // LIBYAFARAY_FORMAT_JPG_H -------------------------------------------------------------------------------- /include/format/format_tif.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * imagehandler_tiff.h: Tag Image File Format (TIFF) image handler 4 | * This is part of the libYafaRay package 5 | * Copyright (C) 2010 Rodrigo Placencia Vazquez 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free Software 19 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | * 21 | */ 22 | 23 | #ifndef LIBYAFARAY_FORMAT_TIF_H 24 | #define LIBYAFARAY_FORMAT_TIF_H 25 | 26 | #include "format.h" 27 | 28 | namespace yafaray { 29 | 30 | class TifFormat final : public Format 31 | { 32 | public: 33 | inline static std::string getClassName() { return "TifFormat"; } 34 | explicit TifFormat(Logger &logger, ParamResult ¶m_result, const ParamMap ¶m_map) : Format(logger, param_result, param_map) { } 35 | 36 | private: 37 | [[nodiscard]] Type type() const override { return Type::Tif; } 38 | std::string getFormatName() const override { return "TifFormat"; } 39 | std::unique_ptr loadFromFile(const std::string &name, const Image::Optimization &optimization, const ColorSpace &color_space, float gamma) override; 40 | bool saveToFile(const std::string &name, const ImageLayer &image_layer, ColorSpace color_space, float gamma, bool alpha_premultiply) override; 41 | }; 42 | 43 | } //namespace yafaray 44 | 45 | #endif // LIBYAFARAY_FORMAT_TIF_H -------------------------------------------------------------------------------- /include/geometry/axis.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_AXIS_H 21 | #define LIBYAFARAY_AXIS_H 22 | 23 | #include 24 | 25 | namespace yafaray { 26 | 27 | enum class Axis : unsigned char { X = 0, Y, Z, T, None }; 28 | 29 | namespace axis 30 | { 31 | static inline constexpr std::array spatial {Axis::X, Axis::Y, Axis::Z}; 32 | static inline constexpr Axis temporal {Axis::T}; 33 | static inline constexpr Axis getNextSpatial(Axis current_axis) 34 | { 35 | switch(current_axis) 36 | { 37 | case Axis::X: return Axis::Y; 38 | case Axis::Y: return Axis::Z; 39 | case Axis::Z: return Axis::X; 40 | default: return Axis::None; 41 | } 42 | } 43 | static inline constexpr Axis getPrevSpatial(Axis current_axis) 44 | { 45 | switch(current_axis) 46 | { 47 | case Axis::X: return Axis::Z; 48 | case Axis::Y: return Axis::X; 49 | case Axis::Z: return Axis::Y; 50 | default: return Axis::None; 51 | } 52 | } 53 | static inline constexpr unsigned char getId(Axis axis) { return static_cast(axis); } 54 | } 55 | 56 | } //namespace yafaray 57 | 58 | #endif//LIBYAFARAY_AXIS_H 59 | -------------------------------------------------------------------------------- /include/geometry/clip_plane.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef YAFARAY_CLIP_PLANE_H 21 | #define YAFARAY_CLIP_PLANE_H 22 | 23 | #include "geometry/axis.h" 24 | 25 | namespace yafaray { 26 | 27 | struct ClipPlane 28 | { 29 | enum class Pos: unsigned char { None, Lower, Upper }; 30 | explicit ClipPlane(Pos pos = Pos::None) : pos_(pos) { } 31 | ClipPlane(Axis axis, Pos pos) : axis_(axis), pos_(pos) { } 32 | Axis axis_ = Axis::None; 33 | Pos pos_ = Pos::None; 34 | }; 35 | 36 | } //namespace yafaray 37 | 38 | #endif //YAFARAY_CLIP_PLANE_H 39 | -------------------------------------------------------------------------------- /include/geometry/direction_color.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_DIRECTION_COLOR_H 21 | #define LIBYAFARAY_DIRECTION_COLOR_H 22 | 23 | #include "geometry/vector.h" 24 | #include "color/color.h" 25 | #include 26 | 27 | namespace yafaray { 28 | 29 | struct DirectionColor 30 | { 31 | static std::unique_ptr blend(std::unique_ptr direction_color_1, std::unique_ptr direction_color_2, float blend_val); 32 | Vec3f dir_; 33 | Rgb col_; 34 | }; 35 | 36 | } //namespace yafaray 37 | 38 | #endif //LIBYAFARAY_DIRECTION_COLOR_H 39 | -------------------------------------------------------------------------------- /include/geometry/dudv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_DUDV_H 21 | #define LIBYAFARAY_DUDV_H 22 | 23 | namespace yafaray { 24 | 25 | class DuDv final 26 | { 27 | public: 28 | DuDv(float du, float dv) : du_(du), dv_(dv) { } 29 | float getDu() const { return du_; } 30 | float getDv() const { return dv_; } 31 | 32 | private: 33 | float du_ = 0.f; 34 | float dv_ = 0.f; 35 | }; 36 | 37 | } //namespace yafaray 38 | 39 | #endif //LIBYAFARAY_DUDV_H 40 | -------------------------------------------------------------------------------- /include/geometry/plane.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef YAFARAY_PLANE_H 21 | #define YAFARAY_PLANE_H 22 | 23 | #include "geometry/ray.h" 24 | 25 | namespace yafaray { 26 | 27 | class Plane final 28 | { 29 | public: 30 | float rayIntersection(Ray const &ray) const; 31 | 32 | Vec3f p_; 33 | Vec3f n_; 34 | }; 35 | 36 | inline float Plane::rayIntersection(Ray const &ray) const 37 | { 38 | return n_ * (p_ - ray.from_) / (ray.dir_ * n_); 39 | } 40 | 41 | } //namespace yafaray 42 | 43 | #endif // YAFARAY_PLANE_H 44 | -------------------------------------------------------------------------------- /include/geometry/primitive/vertex_indices.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_VERTEX_INDICES_H 21 | #define LIBYAFARAY_VERTEX_INDICES_H 22 | 23 | #include "math/math.h" 24 | 25 | namespace yafaray { 26 | 27 | template 28 | struct VertexIndices 29 | { 30 | IndexType vertex_{math::invalid}; //!< index in point array, referenced in mesh. 31 | IndexType normal_{math::invalid}; //!< index in normal array, if mesh is smoothed.//!< indices in normal array, if mesh is smoothed. 32 | IndexType uv_{math::invalid}; //!< index in uv array, if mesh has explicit uv. 33 | }; 34 | 35 | } //namespace yafaray 36 | 37 | #endif //LIBYAFARAY_VERTEX_INDICES_H 38 | -------------------------------------------------------------------------------- /include/geometry/uv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef YAFARAY_UV_H 21 | #define YAFARAY_UV_H 22 | 23 | #include 24 | 25 | namespace yafaray { 26 | 27 | template 28 | struct Uv 29 | { 30 | T u_; 31 | T v_; 32 | }; 33 | 34 | template 35 | inline Uv operator * (float f, const Uv &uv) 36 | { 37 | return {f * uv.u_, f * uv.v_}; 38 | } 39 | 40 | template 41 | inline Uv operator * (const Uv &uv, float f) 42 | { 43 | return f * uv; 44 | } 45 | 46 | template 47 | inline Uv operator + (const Uv &uv_a, const Uv &uv_b) 48 | { 49 | return {uv_a.u_ + uv_b.u_, uv_a.v_ + uv_b.v_}; 50 | } 51 | 52 | template 53 | inline Uv operator - (const Uv &uv_a, const Uv &uv_b) 54 | { 55 | return {uv_a.u_ - uv_b.u_, uv_a.v_ - uv_b.v_}; 56 | } 57 | 58 | } //namespace yafaray 59 | 60 | #endif //YAFARAY_UV_H 61 | -------------------------------------------------------------------------------- /include/image/image_color.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * 4 | * This is part of the libYafaRay package 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | */ 21 | 22 | #ifndef YAFARAY_IMAGE_COLOR_H 23 | #define YAFARAY_IMAGE_COLOR_H 24 | 25 | #include "image/image.h" 26 | #include "image/image_pixel_types.h" 27 | 28 | namespace yafaray { 29 | 30 | //!< Rgb float image buffer (96 bit/pixel) 31 | class ImageColor final : public Image 32 | { 33 | public: 34 | ImageColor(const Size2i &size) : Image{size}, buffer_{size} { } 35 | 36 | private: 37 | Type getType() const override { return Type::Color; } 38 | Image::Optimization getOptimization() const override { return Image::Optimization::None; } 39 | Rgba getColor(const Point2i &point) const override { return Rgba{buffer_(point)}; } 40 | float getFloat(const Point2i &point) const override { return getColor(point).r_; } 41 | void setColor(const Point2i &point, const Rgba &col) override { buffer_(point) = col; } 42 | void setColor(const Point2i &point, Rgba &&col) override { buffer_(point) = std::move(col); } 43 | void addColor(const Point2i &point, const Rgba &col) override { buffer_(point) += col; } 44 | void setFloat(const Point2i &point, float val) override { setColor(point, Rgba{val}); } 45 | void addFloat(const Point2i &point, float val) override { addColor(point, Rgba{val}); } 46 | void clear() override { buffer_.clear(); } 47 | 48 | Buffer2D buffer_; 49 | }; 50 | 51 | } //namespace yafaray 52 | 53 | #endif //YAFARAY_IMAGE_COLOR_H 54 | -------------------------------------------------------------------------------- /include/image/image_layers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | */ 20 | 21 | #ifndef LIBYAFARAY_IMAGE_LAYERS_H 22 | #define LIBYAFARAY_IMAGE_LAYERS_H 23 | 24 | #include 25 | #include "common/layers.h" 26 | #include "image/image.h" 27 | #include "image_layers.h" 28 | 29 | namespace yafaray { 30 | 31 | class ImageLayer 32 | { 33 | public: 34 | int getWidth() const; 35 | int getHeight() const; 36 | 37 | std::shared_ptr image_; 38 | Layer layer_; 39 | }; 40 | 41 | class ImageLayers final : public Collection //Actual buffer of images in the rendering process, one entry for each enabled layer. 42 | { 43 | public: 44 | void setColor(const Point2i &point, const Rgba &color, LayerDef::Type layer_type); 45 | void setColor(const Point2i &point, Rgba &&color, LayerDef::Type layer_type); 46 | }; 47 | 48 | } //namespace yafaray 49 | 50 | #endif //LIBYAFARAY_IMAGE_LAYERS_H 51 | -------------------------------------------------------------------------------- /include/image/image_manipulation_freetype.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | */ 20 | 21 | #ifndef YAFARAY_IMAGE_MANIPULATION_FREETYPE_H 22 | #define YAFARAY_IMAGE_MANIPULATION_FREETYPE_H 23 | 24 | #include "resource/guifont.h" 25 | 26 | struct FT_Bitmap_; 27 | 28 | namespace yafaray::image_manipulation_freetype 29 | { 30 | 31 | void drawFontBitmap(FT_Bitmap_ *bitmap, Image *badge_image, const Point2i &point); 32 | bool drawTextInImage(Logger &logger, Image *image, const std::string &text_utf_8, float font_size_factor, const std::string &font_path); 33 | 34 | } //namespace yafaray::image_manipulation_freetype 35 | 36 | #endif //YAFARAY_IMAGE_MANIPULATION_FREETYPE_H 37 | -------------------------------------------------------------------------------- /include/image/image_manipulation_opencv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | */ 20 | 21 | #ifndef YAFARAY_IMAGE_MANIPULATION_OPENCV_H 22 | #define YAFARAY_IMAGE_MANIPULATION_OPENCV_H 23 | 24 | namespace yafaray::image_manipulation_opencv 25 | { 26 | 27 | std::unique_ptr getDenoisedLdrImage(Logger &logger, const Image *image, const DenoiseParams &denoise_params); 28 | void generateDebugFacesEdges(int xstart, int width, int ystart, int height, bool drawborder, const EdgeToonParams &edge_params); 29 | void generateDebugFacesEdges(ImageLayers &film_image_layers, int xstart, int width, int ystart, int height, bool drawborder, const EdgeToonParams &edge_params, const Buffer2D &weights); 30 | void generateToonAndDebugObjectEdges(ImageLayers &film_image_layers, int xstart, int width, int ystart, int height, bool drawborder, const EdgeToonParams &edge_params, const Buffer2D &weights); 31 | std::vector> generateMipMaps(Logger &logger, const Image *image); 32 | 33 | } //namespace yafaray::image_manipulation_opencv 34 | 35 | #endif //YAFARAY_IMAGE_MANIPULATION_OPENCV_H 36 | -------------------------------------------------------------------------------- /include/material/material_data.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_MATERIAL_DATA_H 21 | #define LIBYAFARAY_MATERIAL_DATA_H 22 | 23 | #include "material/bsdf.h" 24 | 25 | namespace yafaray { 26 | 27 | class MaterialData 28 | { 29 | public: 30 | MaterialData(BsdfFlags bsdf_flags, size_t number_of_nodes) : bsdf_flags_(bsdf_flags), node_tree_data_(number_of_nodes) { } 31 | MaterialData(BsdfFlags bsdf_flags, NodeTreeData node_tree_data) : bsdf_flags_(bsdf_flags), node_tree_data_{std::move(node_tree_data)} { } 32 | virtual ~MaterialData() = default; 33 | virtual std::unique_ptr clone() const = 0; 34 | BsdfFlags bsdf_flags_; 35 | NodeTreeData node_tree_data_; 36 | }; 37 | 38 | } //namespace yafaray 39 | 40 | #endif //LIBYAFARAY_MATERIAL_DATA_H 41 | -------------------------------------------------------------------------------- /include/material/sample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_SAMPLE_H 21 | #define LIBYAFARAY_SAMPLE_H 22 | 23 | namespace yafaray { 24 | 25 | struct Sample 26 | { 27 | Sample(float s_1, float s_2, BsdfFlags sflags = BsdfFlags::All, bool revrs = false): 28 | s_1_(s_1), s_2_(s_2), pdf_(0.f), flags_(sflags), sampled_flags_(BsdfFlags::None), reverse_(revrs) {} 29 | float s_1_, s_2_; 30 | float pdf_; 31 | BsdfFlags flags_, sampled_flags_; 32 | bool reverse_; //!< if true, the sample method shall return the probability/color for swapped incoming/outgoing dir 33 | float pdf_back_; 34 | Rgb col_back_; 35 | }; 36 | 37 | } //namespace yafaray 38 | 39 | #endif //LIBYAFARAY_SAMPLE_H 40 | -------------------------------------------------------------------------------- /include/material/specular_data.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_SPECULAR_DATA_H 21 | #define LIBYAFARAY_SPECULAR_DATA_H 22 | 23 | namespace yafaray { 24 | 25 | struct DirectionColor; 26 | 27 | struct Specular 28 | { 29 | std::unique_ptr reflect_; 30 | std::unique_ptr refract_; 31 | }; 32 | 33 | } //namespace yafaray 34 | 35 | #endif //LIBYAFARAY_SPECULAR_DATA_H 36 | -------------------------------------------------------------------------------- /include/math/buffer_2d.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * 4 | * This is part of the libYafaRay package 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | */ 21 | 22 | #ifndef LIBYAFARAY_BUFFER_2D_H 23 | #define LIBYAFARAY_BUFFER_2D_H 24 | 25 | #include "math/buffer.h" 26 | #include "geometry/vector.h" 27 | 28 | namespace yafaray { 29 | 30 | template 31 | class Buffer2D final : public Buffer 32 | { 33 | public: 34 | explicit Buffer2D(const Size2i &size) : Buffer{size.getArray()} { } 35 | void set(const Point2i &point, const T &val) { Buffer::set(point.getArray(), val); } 36 | void set(const Point2i &point, T &&val) { Buffer::set(point.getArray(), std::move(val)); } 37 | T get(const Point2i &point) const { return Buffer::get(point.getArray()); } 38 | T &operator()(const Point2i &point) { return Buffer::operator()(point.getArray()); } 39 | const T &operator()(const Point2i &point) const { return Buffer::operator()(point.getArray()); } 40 | void clear() { Buffer::zero(); } 41 | int getWidth() const { return static_cast(Buffer::getDimensions().at(0)); } 42 | int getHeight() const { return static_cast(Buffer::getDimensions().at(1)); } 43 | }; 44 | 45 | } //namespace yafaray 46 | 47 | #endif //LIBYAFARAY_BUFFER_2D_H 48 | -------------------------------------------------------------------------------- /include/noise/generator/noise_blender.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_NOISE_BLENDER_H 21 | #define LIBYAFARAY_NOISE_BLENDER_H 22 | 23 | #include "noise/noise_generator.h" 24 | 25 | namespace yafaray { 26 | 27 | // Blender noise, similar to Perlin's 28 | class BlenderNoiseGenerator final : public NoiseGenerator 29 | { 30 | private: 31 | float operator()(const Point3f &pt) const override; 32 | // offset texture point coordinates by one 33 | Point3f offset(const Point3f &pt) const override { return pt + Point3f{{1.f, 1.f, 1.f}}; } 34 | static const float hashvectf_[768]; 35 | }; 36 | 37 | } //namespace yafaray 38 | 39 | #endif //LIBYAFARAY_NOISE_BLENDER_H 40 | -------------------------------------------------------------------------------- /include/noise/generator/noise_cell.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_NOISE_CELL_H 21 | #define LIBYAFARAY_NOISE_CELL_H 22 | 23 | #include "noise/noise_generator.h" 24 | 25 | namespace yafaray { 26 | 27 | class CellNoiseGenerator final : public NoiseGenerator 28 | { 29 | private: 30 | float operator()(const Point3f &pt) const override; 31 | }; 32 | 33 | } //namespace yafaray 34 | 35 | #endif //LIBYAFARAY_NOISE_CELL_H 36 | -------------------------------------------------------------------------------- /include/noise/generator/noise_perlin_improved.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_NOISE_PERLIN_IMPROVED_H 21 | #define LIBYAFARAY_NOISE_PERLIN_IMPROVED_H 22 | 23 | #include "noise/noise_generator.h" 24 | 25 | namespace yafaray { 26 | 27 | //--------------------------------------------------------------------------- 28 | // Improved Perlin noise, based on Java reference code by Ken Perlin himself. 29 | class NewPerlinNoiseGenerator final : public NoiseGenerator 30 | { 31 | private: 32 | float operator()(const Point3f &pt) const override; 33 | static float fade(float t) { return t * t * t * (t * (t * 6 - 15) + 10); } 34 | static float grad(int hash, float x, float y, float z); 35 | }; 36 | 37 | inline float NewPerlinNoiseGenerator::grad(int hash, float x, float y, float z) 38 | { 39 | int h = hash & 15; // CONVERT LO 4 BITS OF HASH CODE 40 | float u = h < 8 ? x : y, // INTO 12 GRADIENT DIRECTIONS. 41 | v = h < 4 ? y : h == 12 || h == 14 ? x : z; 42 | return ((h & 1) == 0 ? u : -u) + ((h & 2) == 0 ? v : -v); 43 | } 44 | 45 | } //namespace yafaray 46 | 47 | #endif //LIBYAFARAY_NOISE_PERLIN_IMPROVED_H 48 | -------------------------------------------------------------------------------- /include/noise/generator/noise_perlin_standard.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_NOISE_PERLIN_STANDARD_H 21 | #define LIBYAFARAY_NOISE_PERLIN_STANDARD_H 22 | 23 | #include "noise/noise_generator.h" 24 | 25 | namespace yafaray { 26 | 27 | class StdPerlinNoiseGenerator final : public NoiseGenerator 28 | { 29 | private: 30 | float operator()(const Point3f &pt) const override; 31 | static std::pair, std::array> setup(int i, const std::array &vec); 32 | static constexpr inline float stdpAt(float rx, float ry, float rz, const float *q); 33 | static constexpr inline float surve(float t); 34 | static const std::array stdp_p_; 35 | static const float stdp_g_[512 + 2][3]; 36 | }; 37 | 38 | } //namespace yafaray 39 | 40 | #endif //LIBYAFARAY_NOISE_PERLIN_STANDARD_H 41 | -------------------------------------------------------------------------------- /include/noise/musgrave.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_MUSGRAVE_H 21 | #define LIBYAFARAY_MUSGRAVE_H 22 | 23 | #include 24 | 25 | namespace yafaray { 26 | 27 | template class Point; 28 | typedef Point Point3f; 29 | 30 | /* 31 | * The Musgrave code is based on Ken Musgrave's explanations and sample 32 | * source code in the book "Texturing and Modelling: A procedural approach" 33 | */ 34 | 35 | class Musgrave 36 | { 37 | public: 38 | virtual ~Musgrave() = default; 39 | virtual float operator()(const Point3f &pt) const = 0; 40 | }; 41 | 42 | } //namespace yafaray 43 | 44 | #endif //LIBYAFARAY_MUSGRAVE_H 45 | -------------------------------------------------------------------------------- /include/noise/musgrave/musgrave_fbm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_MUSGRAVE_FBM_H 21 | #define LIBYAFARAY_MUSGRAVE_FBM_H 22 | 23 | #include "noise/musgrave.h" 24 | 25 | namespace yafaray { 26 | 27 | class NoiseGenerator; 28 | 29 | class FBmMusgrave final : public Musgrave 30 | { 31 | public: 32 | FBmMusgrave(float h, float lacu, float octs, const NoiseGenerator *n_gen) 33 | : h_(h), lacunarity_(lacu), octaves_(octs), n_gen_(n_gen) {} 34 | 35 | private: 36 | float operator()(const Point3f &pt) const override; 37 | 38 | float h_, lacunarity_, octaves_; 39 | const NoiseGenerator *n_gen_; 40 | }; 41 | 42 | } //namespace yafaray 43 | 44 | #endif //LIBYAFARAY_MUSGRAVE_FBM_H 45 | -------------------------------------------------------------------------------- /include/noise/musgrave/musgrave_hetero_terrain.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_MUSGRAVE_HETERO_TERRAIN_H 21 | #define LIBYAFARAY_MUSGRAVE_HETERO_TERRAIN_H 22 | 23 | #include "noise/musgrave.h" 24 | 25 | namespace yafaray { 26 | 27 | class NoiseGenerator; 28 | 29 | class HeteroTerrainMusgrave final : public Musgrave 30 | { 31 | public: 32 | HeteroTerrainMusgrave(float h, float lacu, float octs, float offs, const NoiseGenerator *n_gen) 33 | : h_(h), lacunarity_(lacu), octaves_(octs), offset_(offs), n_gen_(n_gen) {} 34 | 35 | private: 36 | float operator()(const Point3f &pt) const override; 37 | 38 | float h_, lacunarity_, octaves_, offset_; 39 | const NoiseGenerator *n_gen_; 40 | }; 41 | 42 | } //namespace yafaray 43 | 44 | #endif //LIBYAFARAY_MUSGRAVE_HETERO_TERRAIN_H 45 | -------------------------------------------------------------------------------- /include/noise/musgrave/musgrave_hybrid_mfractal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_MUSGRAVE_HYBRID_MFRACTAL_H 21 | #define LIBYAFARAY_MUSGRAVE_HYBRID_MFRACTAL_H 22 | 23 | #include "noise/musgrave.h" 24 | 25 | namespace yafaray { 26 | 27 | class NoiseGenerator; 28 | 29 | class HybridMFractalMusgrave final : public Musgrave 30 | { 31 | public: 32 | HybridMFractalMusgrave(float h, float lacu, float octs, float offs, float gain, const NoiseGenerator *n_gen) 33 | : h_(h), lacunarity_(lacu), octaves_(octs), offset_(offs), gain_(gain), n_gen_(n_gen) {} 34 | 35 | private: 36 | float operator()(const Point3f &pt) const override; 37 | 38 | float h_, lacunarity_, octaves_, offset_, gain_; 39 | const NoiseGenerator *n_gen_; 40 | }; 41 | 42 | } //namespace yafaray 43 | 44 | #endif //LIBYAFARAY_MUSGRAVE_HYBRID_MFRACTAL_H 45 | -------------------------------------------------------------------------------- /include/noise/musgrave/musgrave_mfractal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_MUSGRAVE_MFRACTAL_H 21 | #define LIBYAFARAY_MUSGRAVE_MFRACTAL_H 22 | 23 | #include "noise/musgrave.h" 24 | 25 | namespace yafaray { 26 | 27 | class NoiseGenerator; 28 | 29 | class MFractalMusgrave final : public Musgrave 30 | { 31 | public: 32 | MFractalMusgrave(float h, float lacu, float octs, const NoiseGenerator *n_gen) 33 | : h_(h), lacunarity_(lacu), octaves_(octs), n_gen_(n_gen) {} 34 | 35 | private: 36 | float operator()(const Point3f &pt) const override; 37 | 38 | float h_, lacunarity_, octaves_; 39 | const NoiseGenerator *n_gen_; 40 | }; 41 | 42 | } //namespace yafaray 43 | 44 | #endif //LIBYAFARAY_MUSGRAVE_MFRACTAL_H 45 | -------------------------------------------------------------------------------- /include/noise/musgrave/musgrave_ridged_mfractal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_MUSGRAVE_RIDGED_MFRACTAL_H 21 | #define LIBYAFARAY_MUSGRAVE_RIDGED_MFRACTAL_H 22 | 23 | #include "noise/musgrave.h" 24 | 25 | namespace yafaray { 26 | 27 | class NoiseGenerator; 28 | 29 | class RidgedMFractalMusgrave final : public Musgrave 30 | { 31 | public: 32 | RidgedMFractalMusgrave(float h, float lacu, float octs, float offs, float gain, const NoiseGenerator *n_gen) 33 | : h_(h), lacunarity_(lacu), octaves_(octs), offset_(offs), gain_(gain), n_gen_(n_gen) {} 34 | 35 | private: 36 | float operator()(const Point3f &pt) const override; 37 | 38 | float h_, lacunarity_, octaves_, offset_, gain_; 39 | const NoiseGenerator *n_gen_; 40 | }; 41 | 42 | } //namespace yafaray 43 | 44 | #endif //LIBYAFARAY_MUSGRAVE_RIDGED_MFRACTAL_H 45 | -------------------------------------------------------------------------------- /include/photon/hashgrid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef YAFARAY_HASHGRID_H 21 | #define YAFARAY_HASHGRID_H 22 | 23 | #include "geometry/bound.h" 24 | #include 25 | #include 26 | 27 | namespace yafaray { 28 | 29 | struct Photon; 30 | struct FoundPhoton; 31 | template class Bound; 32 | template class Point; 33 | typedef Point Point3f; 34 | 35 | 36 | class HashGrid final 37 | { 38 | public: 39 | HashGrid() = default; 40 | HashGrid(double cell_size, unsigned int grid_size, Bound b_box); 41 | void setParm(double cell_size, unsigned int grid_size, Bound b_box); 42 | void clear(); //remove all the photons in the grid; 43 | void updateGrid(); //build the hashgrid 44 | void pushPhoton(Photon &&p); 45 | unsigned int gather(const Point3f &p, FoundPhoton *found, unsigned int k, float sq_radius) const; 46 | 47 | private: 48 | unsigned int hash(const int ix, const int iy, const int iz) const 49 | { 50 | return static_cast((ix * 73856093) ^ (iy * 19349663) ^ (iz * 83492791)) % grid_size_; 51 | } 52 | 53 | public: 54 | double cell_size_, inv_cell_size_; 55 | unsigned int grid_size_; 56 | Bound bounding_box_; 57 | std::vectorphotons_; 58 | std::unique_ptr>[]> hash_grid_; 59 | }; 60 | 61 | } //namespace yafaray 62 | #endif 63 | -------------------------------------------------------------------------------- /include/photon/photon_sample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_PHOTON_SAMPLE_H 21 | #define LIBYAFARAY_PHOTON_SAMPLE_H 22 | 23 | #include "material/sample.h" 24 | 25 | namespace yafaray { 26 | 27 | struct PSample final : Sample 28 | { 29 | PSample(float s_1, float s_2, float s_3, BsdfFlags sflags, const Rgb &l_col, const Rgb &transm = Rgb(1.f)): 30 | Sample(s_1, s_2, sflags), s_3_(s_3), lcol_(l_col), alpha_(transm) {} 31 | float s_3_; 32 | const Rgb lcol_; //!< the photon color from last scattering 33 | const Rgb alpha_; //!< the filter color between last scattering and this hit (not pre-applied to lcol!) 34 | Rgb color_; //!< the new color after scattering, i.e. what will be lcol for next scatter. 35 | }; 36 | 37 | } //namespace yafaray 38 | 39 | #endif //LIBYAFARAY_PHOTON_SAMPLE_H 40 | -------------------------------------------------------------------------------- /include/public_api/yafaray_c_api_utils.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #ifndef LIBYAFARAY_YAFARAY_C_API_UTILS_H 20 | #define LIBYAFARAY_YAFARAY_C_API_UTILS_H 21 | 22 | #include 23 | #include 24 | 25 | inline char *createCharString(const std::string &std_string) 26 | { 27 | auto c_string{new char[std_string.size() + 1]}; 28 | std::strcpy(c_string, std_string.c_str()); 29 | return c_string; 30 | } 31 | 32 | #endif //LIBYAFARAY_YAFARAY_C_API_UTILS_H 33 | -------------------------------------------------------------------------------- /include/render/render_control.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_RENDER_CONTROL_H 21 | #define LIBYAFARAY_RENDER_CONTROL_H 22 | 23 | #include 24 | 25 | namespace yafaray { 26 | 27 | class RenderControl final 28 | { 29 | public: 30 | void setStarted() { flags_ = InProgress; } 31 | void setResumed() { flags_ = InProgress | Resumed; } 32 | void setFinished() { flags_ = Finished; } 33 | void setProgressive() { flags_ |= Progressive; } 34 | void setCanceled() { flags_ = Canceled; } 35 | bool inProgress() const { return flags_ & InProgress; } 36 | bool resumed() const { return flags_ & Resumed; } 37 | bool finished() const { return flags_ & Finished; } 38 | bool progressive() const { return flags_ & Progressive; } 39 | bool canceled() const { return flags_ & Canceled; } 40 | 41 | private: 42 | enum { 43 | InProgress = 1 << 0, 44 | Finished = 1 << 1, 45 | Resumed = 1 << 2, 46 | Progressive = 1 << 3, 47 | Canceled = 1 << 4, 48 | }; 49 | std::atomic flags_{0}; 50 | }; 51 | 52 | } //namespace yafaray 53 | 54 | #endif //LIBYAFARAY_RENDER_CONTROL_H 55 | -------------------------------------------------------------------------------- /include/render/render_data.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_RENDER_DATA_H 21 | #define LIBYAFARAY_RENDER_DATA_H 22 | 23 | namespace yafaray { 24 | 25 | struct RayDivision final 26 | { 27 | int division_{1}; //!< keep track of trajectory splitting 28 | int offset_{0}; //!< keep track of trajectory splitting 29 | float decorrelation_1_{0.f}; //!< used to decorrelate samples from trajectory splitting*/ 30 | float decorrelation_2_{0.f}; //!< used to decorrelate samples from trajectory splitting*/ 31 | }; 32 | 33 | struct PixelSamplingData final 34 | { 35 | PixelSamplingData(int thread_id, int number, unsigned int offset, float aa_light_sample_multiplier, float aa_indirect_sample_multiplier) : 36 | thread_id_{thread_id}, number_{number}, offset_{offset}, 37 | aa_light_sample_multiplier_{aa_light_sample_multiplier}, 38 | aa_indirect_sample_multiplier_{aa_indirect_sample_multiplier} { } 39 | int thread_id_{0}; 40 | int sample_{0}; //!< number of samples inside this pixels so far 41 | int number_{0}; 42 | unsigned int offset_{0}; //!< a "noise-like" pixel offset you may use to decorelate sampling of adjacent pixel. 43 | float aa_light_sample_multiplier_{1.f}; 44 | float aa_indirect_sample_multiplier_{1.f}; 45 | float time_{0.f}; 46 | }; 47 | 48 | } //namespace yafaray 49 | 50 | #endif //LIBYAFARAY_RENDER_DATA_H 51 | -------------------------------------------------------------------------------- /include/shader/mix/shader_node_mix_add.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_SHADER_NODE_MIX_ADD_H 21 | #define LIBYAFARAY_SHADER_NODE_MIX_ADD_H 22 | 23 | #include "shader/shader_node_mix.h" 24 | 25 | namespace yafaray { 26 | 27 | class AddNode: public MixNode 28 | { 29 | public: 30 | AddNode(Logger &logger, ParamResult ¶m_result, const ParamMap ¶m_map) : MixNode{logger, param_result, param_map} { } 31 | void eval(NodeTreeData &node_tree_data, const SurfacePoint &sp, const Camera *camera) const override 32 | { 33 | Inputs inputs = getInputs(node_tree_data); 34 | inputs.in_1_.col_ += inputs.factor_ * inputs.in_2_.col_; 35 | inputs.in_1_.f_ += inputs.factor_ * inputs.in_2_.f_; 36 | node_tree_data[getId()] = std::move(inputs.in_1_); 37 | } 38 | }; 39 | 40 | } //namespace yafaray 41 | 42 | #endif // LIBYAFARAY_SHADER_NODE_MIX_ADD_H 43 | -------------------------------------------------------------------------------- /include/shader/mix/shader_node_mix_dark.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_SHADER_NODE_MIX_DARK_H 21 | #define LIBYAFARAY_SHADER_NODE_MIX_DARK_H 22 | 23 | #include "shader/shader_node_mix.h" 24 | 25 | namespace yafaray { 26 | 27 | class DarkNode: public MixNode 28 | { 29 | public: 30 | DarkNode(Logger &logger, ParamResult ¶m_result, const ParamMap ¶m_map) : MixNode{logger, param_result, param_map} { } 31 | void eval(NodeTreeData &node_tree_data, const SurfacePoint &sp, const Camera *camera) const override 32 | { 33 | Inputs inputs = getInputs(node_tree_data); 34 | inputs.in_2_.col_ *= inputs.factor_; 35 | if(inputs.in_2_.col_.r_ < inputs.in_1_.col_.r_) inputs.in_1_.col_.r_ = inputs.in_2_.col_.r_; 36 | if(inputs.in_2_.col_.g_ < inputs.in_1_.col_.g_) inputs.in_1_.col_.g_ = inputs.in_2_.col_.g_; 37 | if(inputs.in_2_.col_.b_ < inputs.in_1_.col_.b_) inputs.in_1_.col_.b_ = inputs.in_2_.col_.b_; 38 | if(inputs.in_2_.col_.a_ < inputs.in_1_.col_.a_) inputs.in_1_.col_.a_ = inputs.in_2_.col_.a_; 39 | inputs.in_2_.f_ *= inputs.factor_; 40 | if(inputs.in_2_.f_ < inputs.in_1_.f_) inputs.in_1_.f_ = inputs.in_2_.f_; 41 | node_tree_data[getId()] = std::move(inputs.in_1_); 42 | } 43 | }; 44 | 45 | } //namespace yafaray 46 | 47 | #endif // LIBYAFARAY_SHADER_NODE_MIX_DARK_H 48 | -------------------------------------------------------------------------------- /include/shader/mix/shader_node_mix_diff.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_SHADER_NODE_MIX_DIFF_H 21 | #define LIBYAFARAY_SHADER_NODE_MIX_DIFF_H 22 | 23 | #include "shader/shader_node_mix.h" 24 | 25 | namespace yafaray { 26 | 27 | class DiffNode: public MixNode 28 | { 29 | public: 30 | DiffNode(Logger &logger, ParamResult ¶m_result, const ParamMap ¶m_map) : MixNode{logger, param_result, param_map} { } 31 | void eval(NodeTreeData &node_tree_data, const SurfacePoint &sp, const Camera *camera) const override 32 | { 33 | Inputs inputs = getInputs(node_tree_data); 34 | const auto mix_function = [](float val_1, float val_2, float factor) -> float { 35 | return math::lerp(val_1, std::abs(val_1 - val_2), factor); 36 | }; 37 | inputs.in_1_.col_.r_ = mix_function(inputs.in_1_.col_.r_, inputs.in_2_.col_.r_, inputs.factor_); 38 | inputs.in_1_.col_.g_ = mix_function(inputs.in_1_.col_.g_, inputs.in_2_.col_.g_, inputs.factor_); 39 | inputs.in_1_.col_.b_ = mix_function(inputs.in_1_.col_.b_, inputs.in_2_.col_.b_, inputs.factor_); 40 | inputs.in_1_.col_.a_ = mix_function(inputs.in_1_.col_.a_, inputs.in_2_.col_.a_, inputs.factor_); 41 | inputs.in_1_.f_ = mix_function(inputs.in_1_.f_, inputs.in_2_.f_, inputs.factor_); 42 | node_tree_data[getId()] = std::move(inputs.in_1_); 43 | } 44 | }; 45 | 46 | } //namespace yafaray 47 | 48 | #endif // LIBYAFARAY_SHADER_NODE_MIX_DIFF_H 49 | -------------------------------------------------------------------------------- /include/shader/mix/shader_node_mix_light.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_SHADER_NODE_MIX_LIGHT_H 21 | #define LIBYAFARAY_SHADER_NODE_MIX_LIGHT_H 22 | 23 | #include "shader/shader_node_mix.h" 24 | 25 | namespace yafaray { 26 | 27 | class LightNode: public MixNode 28 | { 29 | public: 30 | LightNode(Logger &logger, ParamResult ¶m_result, const ParamMap ¶m_map) : MixNode{logger, param_result, param_map} { } 31 | void eval(NodeTreeData &node_tree_data, const SurfacePoint &sp, const Camera *camera) const override 32 | { 33 | Inputs inputs = getInputs(node_tree_data); 34 | inputs.in_2_.col_ *= inputs.factor_; 35 | if(inputs.in_2_.col_.r_ > inputs.in_1_.col_.r_) inputs.in_1_.col_.r_ = inputs.in_2_.col_.r_; 36 | if(inputs.in_2_.col_.g_ > inputs.in_1_.col_.g_) inputs.in_1_.col_.g_ = inputs.in_2_.col_.g_; 37 | if(inputs.in_2_.col_.b_ > inputs.in_1_.col_.b_) inputs.in_1_.col_.b_ = inputs.in_2_.col_.b_; 38 | if(inputs.in_2_.col_.a_ > inputs.in_1_.col_.a_) inputs.in_1_.col_.a_ = inputs.in_2_.col_.a_; 39 | inputs.in_2_.f_ *= inputs.factor_; 40 | if(inputs.in_2_.f_ > inputs.in_1_.f_) inputs.in_1_.f_ = inputs.in_2_.f_; 41 | node_tree_data[getId()] = std::move(inputs.in_1_); 42 | } 43 | }; 44 | 45 | } //namespace yafaray 46 | 47 | #endif // LIBYAFARAY_SHADER_NODE_MIX_LIGHT_H 48 | -------------------------------------------------------------------------------- /include/shader/mix/shader_node_mix_mult.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_SHADER_NODE_MIX_MULT_H 21 | #define LIBYAFARAY_SHADER_NODE_MIX_MULT_H 22 | 23 | #include "shader/shader_node_mix.h" 24 | #include "math/interpolation.h" 25 | 26 | namespace yafaray { 27 | 28 | class MultNode: public MixNode 29 | { 30 | public: 31 | MultNode(Logger &logger, ParamResult ¶m_result, const ParamMap ¶m_map) : MixNode{logger, param_result, param_map} { } 32 | void eval(NodeTreeData &node_tree_data, const SurfacePoint &sp, const Camera *camera) const override 33 | { 34 | Inputs inputs = getInputs(node_tree_data); 35 | inputs.in_1_.col_ *= math::lerp(Rgba{1.f}, inputs.in_2_.col_, inputs.factor_); 36 | inputs.in_1_.f_ *= math::lerp(1.f, inputs.in_2_.f_, inputs.factor_); 37 | node_tree_data[getId()] = std::move(inputs.in_1_); 38 | } 39 | }; 40 | 41 | } //namespace yafaray 42 | 43 | #endif // LIBYAFARAY_SHADER_NODE_MIX_MULT_H 44 | -------------------------------------------------------------------------------- /include/shader/mix/shader_node_mix_screen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_SHADER_NODE_MIX_SCREEN_H 21 | #define LIBYAFARAY_SHADER_NODE_MIX_SCREEN_H 22 | 23 | #include "shader/shader_node_mix.h" 24 | 25 | namespace yafaray { 26 | 27 | class ScreenNode: public MixNode 28 | { 29 | public: 30 | ScreenNode(Logger &logger, ParamResult ¶m_result, const ParamMap ¶m_map) : MixNode{logger, param_result, param_map} { } 31 | void eval(NodeTreeData &node_tree_data, const SurfacePoint &sp, const Camera *camera) const override 32 | { 33 | Inputs inputs = getInputs(node_tree_data); 34 | const float factor_reversed = 1.f - inputs.factor_; 35 | const Rgba color { Rgba{1.f} - (Rgba{factor_reversed} + inputs.factor_ * (Rgba{1.f} - inputs.in_2_.col_)) * (Rgba{1.f} - inputs.in_1_.col_) }; 36 | const float scalar = 1.f - (factor_reversed + inputs.factor_ * (1.f - inputs.in_2_.f_)) * (1.f - inputs.in_1_.f_); 37 | node_tree_data[getId()] = { color, scalar }; 38 | } 39 | }; 40 | 41 | } //namespace yafaray 42 | 43 | #endif // LIBYAFARAY_SHADER_NODE_MIX_SCREEN_H 44 | -------------------------------------------------------------------------------- /include/shader/mix/shader_node_mix_sub.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_SHADER_NODE_MIX_SUB_H 21 | #define LIBYAFARAY_SHADER_NODE_MIX_SUB_H 22 | 23 | #include "shader/shader_node_mix.h" 24 | 25 | namespace yafaray { 26 | 27 | class SubNode: public MixNode 28 | { 29 | public: 30 | SubNode(Logger &logger, ParamResult ¶m_result, const ParamMap ¶m_map) : MixNode{logger, param_result, param_map} { } 31 | void eval(NodeTreeData &node_tree_data, const SurfacePoint &sp, const Camera *camera) const override 32 | { 33 | Inputs inputs = getInputs(node_tree_data); 34 | inputs.in_1_.col_ -= inputs.factor_ * inputs.in_2_.col_; 35 | inputs.in_1_.f_ -= inputs.factor_ * inputs.in_2_.f_; 36 | node_tree_data[getId()] = std::move(inputs.in_1_); 37 | } 38 | }; 39 | 40 | } //namespace yafaray 41 | 42 | #endif // LIBYAFARAY_SHADER_NODE_MIX_SUB_H 43 | -------------------------------------------------------------------------------- /include/shader/node/node_finder.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_NODE_FINDER_H 21 | #define LIBYAFARAY_NODE_FINDER_H 22 | 23 | #include "common/collection.h" 24 | #include 25 | #include 26 | 27 | namespace yafaray { 28 | 29 | class ShaderNode; 30 | 31 | class NodeFinder final : public Collection 32 | { 33 | public: 34 | explicit NodeFinder(const std::map> &table) { for(const auto &[shader_name, shader] : table) items_[shader_name] = shader.get(); } 35 | }; 36 | 37 | } //namespace yafaray 38 | 39 | #endif //LIBYAFARAY_NODE_FINDER_H 40 | -------------------------------------------------------------------------------- /include/shader/node/node_result.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_NODE_RESULT_H 21 | #define LIBYAFARAY_NODE_RESULT_H 22 | 23 | #include "color/color.h" 24 | 25 | namespace yafaray { 26 | 27 | struct NodeResult final 28 | { 29 | Rgba col_ {0.f}; 30 | float f_ = 0.f; 31 | }; 32 | 33 | } //namespace yafaray 34 | 35 | #endif //LIBYAFARAY_NODE_RESULT_H 36 | -------------------------------------------------------------------------------- /include/shader/node/node_tree_data.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_NODE_TREE_DATA_H 21 | #define LIBYAFARAY_NODE_TREE_DATA_H 22 | 23 | #include "shader/node/node_result.h" 24 | #include 25 | 26 | namespace yafaray { 27 | 28 | class NodeTreeData final 29 | { 30 | public: 31 | NodeTreeData() = default; 32 | NodeTreeData(const NodeTreeData &node_tree_data) = default; 33 | NodeTreeData(NodeTreeData &&node_tree_data) = default; 34 | NodeTreeData &operator=(const NodeTreeData &node_tree_data) = default; 35 | NodeTreeData &operator=(NodeTreeData &&node_tree_data) = default; 36 | explicit NodeTreeData(size_t number_of_nodes) : node_results_(number_of_nodes) { } 37 | const NodeResult &operator()(unsigned int id) const { return node_results_[id]; } 38 | NodeResult &operator[](unsigned int id) { return node_results_[id]; } 39 | private: 40 | std::vector node_results_; 41 | }; 42 | 43 | } //namespace yafaray 44 | 45 | #endif //LIBYAFARAY_NODE_TREE_DATA_H 46 | -------------------------------------------------------------------------------- /include/texture/mipmap_params.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /**************************************************************************** 3 | * This is part of the libYafaRay package 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIBYAFARAY_MIPMAP_PARAMS_H 21 | #define LIBYAFARAY_MIPMAP_PARAMS_H 22 | 23 | namespace yafaray { 24 | 25 | class MipMapParams final 26 | { 27 | public: 28 | explicit MipMapParams(float force_image_level) : force_image_level_(force_image_level) { } 29 | MipMapParams(float dsdx, float dtdx, float dsdy, float dtdy) : ds_dx_(dsdx), dt_dx_(dtdx), ds_dy_(dsdy), dt_dy_(dtdy) { } 30 | 31 | float force_image_level_ = 0.f; 32 | float ds_dx_ = 0.f; 33 | float dt_dx_ = 0.f; 34 | float ds_dy_ = 0.f; 35 | float dt_dy_ = 0.f; 36 | }; 37 | 38 | } //namespace yafaray 39 | 40 | #endif //LIBYAFARAY_MIPMAP_PARAMS_H 41 | -------------------------------------------------------------------------------- /src/accelerator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | accelerator.cc 22 | accelerator_kdtree_original.cc 23 | accelerator_kdtree_multi_thread.cc 24 | accelerator_simple_test.cc 25 | ) -------------------------------------------------------------------------------- /src/background/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | background.cc 22 | background_constant.cc 23 | background_darksky.cc 24 | background_gradient.cc 25 | background_sunsky.cc 26 | background_texture.cc 27 | ) -------------------------------------------------------------------------------- /src/camera/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | camera.cc 22 | camera_angular.cc 23 | camera_architect.cc 24 | camera_equirectangular.cc 25 | camera_orthographic.cc 26 | camera_perspective.cc 27 | ) -------------------------------------------------------------------------------- /src/color/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | color.cc 22 | color_console.cc 23 | color_layers.cc 24 | color_ramp.cc 25 | spectrum.cc 26 | ) -------------------------------------------------------------------------------- /src/color/color.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * color.cc: Color type and operators implementation 4 | * This is part of the libYafaRay package 5 | * Copyright (C) 2002 Alejandro Conty Estévez 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free Software 19 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | * 21 | */ 22 | #include "color/color.h" 23 | #include "math/interpolation.h" 24 | #include 25 | 26 | namespace yafaray { 27 | 28 | std::ostream &operator << (std::ostream &out, const Rgb &c) 29 | { 30 | out << "[" << c.r_ << " " << c.g_ << " " << c.b_ << "]"; 31 | return out; 32 | } 33 | 34 | std::ostream &operator << (std::ostream &out, const Rgba &c) 35 | { 36 | out << "[" << c.r_ << ", " << c.g_ << ", " << c.b_ << ", " << c.a_ << "]"; 37 | return out; 38 | } 39 | 40 | Rgb Rgb::mix(const Rgb &a, const Rgb &b, float point) 41 | { 42 | return math::lerpTruncated(b, a, point); 43 | } 44 | 45 | Rgba Rgba::mix(const Rgba &a, const Rgba &b, float point) 46 | { 47 | return math::lerpTruncated(b, a, point); 48 | } 49 | 50 | } //namespace yafaray 51 | -------------------------------------------------------------------------------- /src/color/color_console.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * color_console.cc: A console coloring utility 3 | * This is part of the libYafaRay package 4 | * Copyright (C) 2010 Rodrigo Placencia Vazquez 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | #include "color/color_console.h" 22 | 23 | #ifdef _WIN32 24 | #include 25 | #endif 26 | 27 | namespace yafaray { 28 | 29 | std::ostream &operator << (std::ostream &o, const ConsoleColor &c) 30 | { 31 | #if !defined(_WIN32) 32 | o << "\033[" << (int)c.intense_; 33 | if(c.fg_col_ != ConsoleColor::Default) o << ';' << c.fg_col_; 34 | if(c.bg_col_ != ConsoleColor::Default) o << ';' << c.bg_col_; 35 | return (o << 'm'); 36 | #else 37 | static WORD origAttr = 0; 38 | 39 | if(origAttr == 0) 40 | { 41 | CONSOLE_SCREEN_BUFFER_INFO info; 42 | if(GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info)) 43 | { 44 | origAttr = info.wAttributes; 45 | } 46 | } 47 | 48 | auto new_fg_col = (c.fg_col_ != ConsoleColor::Default) ? (c.fg_col_ | ((WORD)c.intense_ << 3)) : (origAttr & 0x0F); 49 | auto new_bg_col = (c.bg_col_ != ConsoleColor::Default) ? c.bg_col_ : (origAttr & 0xF0); 50 | 51 | SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), new_bg_col | new_fg_col); 52 | #endif 53 | return o; 54 | } 55 | 56 | } //namespace yafaray 57 | 58 | -------------------------------------------------------------------------------- /src/color/color_layers.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "color/color_layers.h" 20 | 21 | namespace yafaray { 22 | 23 | ColorLayers::ColorLayers(const Layers &layers) 24 | { 25 | for(const auto &[layer_def, layer] : layers) 26 | { 27 | set(layer_def, LayerDef::getDefaultColor(layer_def)); 28 | flags_ |= layer.getFlags(); 29 | } 30 | } 31 | 32 | void ColorLayers::setDefaultColors() 33 | { 34 | for(auto &[layer_def, color] : items_) 35 | { 36 | color = LayerDef::getDefaultColor(layer_def); 37 | } 38 | } 39 | 40 | bool ColorLayers::isDefinedAny(const std::vector &types) const 41 | { 42 | for(const auto &type : types) 43 | { 44 | if(find(type)) return true; 45 | } 46 | return false; 47 | } 48 | 49 | 50 | } //namespace yafaray -------------------------------------------------------------------------------- /src/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | container.cc 22 | file.cc 23 | items.cc 24 | layer_definitions.cc 25 | layer.cc 26 | layers.cc 27 | logger.cc 28 | sysinfo.cc 29 | timer.cc 30 | version_build_info.cc 31 | ) -------------------------------------------------------------------------------- /src/common/layers.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "common/layers.h" 20 | #include "common/logger.h" 21 | #include 22 | 23 | namespace yafaray { 24 | 25 | bool Layers::isDefinedAny(const std::vector &types) const 26 | { 27 | for(const auto &type : types) 28 | { 29 | if(isDefined(type)) return true; 30 | } 31 | return false; 32 | } 33 | 34 | Layers Layers::getLayersWithImages() const 35 | { 36 | Layers result; 37 | for(const auto &[layer_def, layer] : items_) 38 | { 39 | if(layer.hasInternalImage()) result.set(layer_def, layer); 40 | } 41 | return result; 42 | } 43 | 44 | Layers Layers::getLayersWithExportedImages() const 45 | { 46 | Layers result; 47 | for(const auto &[layer_def, layer] : items_) 48 | { 49 | if(layer.isExported()) result.set(layer_def, layer); 50 | } 51 | return result; 52 | } 53 | 54 | std::string Layers::printExportedTable() const 55 | { 56 | std::stringstream ss; 57 | for(const auto &[layer_def, layer] : items_) 58 | { 59 | if(layer.isExported()) 60 | { 61 | ss << layer.getExportedImageName() << '\t' << layer.getTypeName() << '\t' << layer.getExportedImageTypeNameShort() << '\t' << layer.getNumExportedChannels() << '\t' << layer.getExportedImageTypeNameLong() << '\n'; 62 | } 63 | } 64 | return ss.str(); 65 | } 66 | 67 | } //namespace yafaray 68 | -------------------------------------------------------------------------------- /src/common/sysinfo.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * sysinfo.cc: runtime system information 3 | * This is part of the libYafaRay package 4 | * Copyright (C) 2006 Mathias Wein 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | //Threads detection code moved here from scene.cc 22 | 23 | #include "common/sysinfo.h" 24 | 25 | #ifdef __APPLE__ 26 | #include 27 | #elif _WIN32 28 | #include 29 | #endif 30 | 31 | #if !defined(_WIN32) || defined(__MINGW32__) 32 | #include 33 | #endif 34 | 35 | namespace yafaray::sysinfo 36 | { 37 | int getNumSystemThreads() 38 | { 39 | int nthreads = 1; 40 | 41 | #ifdef _WIN32 42 | SYSTEM_INFO info; 43 | GetSystemInfo(&info); 44 | nthreads = static_cast(info.dwNumberOfProcessors); 45 | #else 46 | # ifdef __APPLE__ 47 | int mib[2]; 48 | size_t len; 49 | 50 | mib[0] = CTL_HW; 51 | mib[1] = HW_NCPU; 52 | len = sizeof(int); 53 | sysctl(mib, 2, &nthreads, &len, nullptr, 0); 54 | # elif defined(__sgi) 55 | nthreads = sysconf(_SC_NPROC_ONLN); 56 | # else 57 | nthreads = static_cast(sysconf(_SC_NPROCESSORS_ONLN)); 58 | # endif 59 | #endif 60 | 61 | return nthreads; 62 | } 63 | 64 | } //namespace yafaray::sys_info 65 | -------------------------------------------------------------------------------- /src/geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | poly_double.cc 22 | surface.cc 23 | vector.cc 24 | direction_color.cc 25 | instance.cc 26 | ) 27 | 28 | add_subdirectory(object) 29 | add_subdirectory(primitive) -------------------------------------------------------------------------------- /src/geometry/object/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | object.cc 22 | object_curve.cc 23 | object_mesh.cc 24 | object_primitive.cc 25 | ) 26 | -------------------------------------------------------------------------------- /src/geometry/object/object_primitive.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "geometry/object/object_primitive.h" 20 | #include "geometry/primitive/primitive.h" 21 | 22 | namespace yafaray { 23 | 24 | PrimitiveObject::PrimitiveObject(ParamResult ¶m_result, const ParamMap ¶m_map, const Items &objects, const Items &materials, const Items &lights) : Object{param_result, param_map, objects, materials, lights} 25 | { 26 | //Empty 27 | } 28 | 29 | std::string PrimitiveObject::exportToString(size_t indent_level, yafaray_ContainerExportType container_export_type, bool only_export_non_default_parameters) const 30 | { 31 | std::stringstream ss; 32 | const auto param_map{getAsParamMap(only_export_non_default_parameters)}; 33 | ss << std::string(indent_level, '\t') << "" << std::endl; 34 | ss << std::string(indent_level, '\t') << "" << std::endl; 35 | ss << param_map.exportMap(indent_level + 1, container_export_type, only_export_non_default_parameters, getParamMetaMap(), {"type"}); 36 | ss << std::string(indent_level, '\t') << "" << std::endl; 37 | for(const auto primitive : getPrimitives()) ss << primitive->exportToString(indent_level, container_export_type, only_export_non_default_parameters); 38 | ss << std::string(indent_level, '\t') << "" << std::endl; 39 | return ss.str(); 40 | } 41 | 42 | } //namespace yafaray -------------------------------------------------------------------------------- /src/geometry/primitive/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | primitive.cc 22 | primitive_instance.cc 23 | primitive_sphere.cc 24 | primitive_polygon.cc 25 | ) 26 | -------------------------------------------------------------------------------- /src/geometry/primitive/primitive.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "geometry/primitive/primitive.h" 20 | 21 | namespace yafaray { 22 | 23 | PolyDouble::ClipResultWithBound Primitive::clipToBound(Logger &logger, const std::array &bound, const ClipPlane &clip_plane, const PolyDouble &poly) const 24 | { 25 | return PolyDouble::ClipResultWithBound(PolyDouble::ClipResultWithBound::Code::FatalError); 26 | } 27 | 28 | PolyDouble::ClipResultWithBound Primitive::clipToBound(Logger &logger, const std::array &bound, const ClipPlane &clip_plane, const PolyDouble &poly, const Matrix4f &obj_to_world) const 29 | { 30 | return PolyDouble::ClipResultWithBound(PolyDouble::ClipResultWithBound::Code::FatalError); 31 | } 32 | 33 | } //namespace yafaray 34 | -------------------------------------------------------------------------------- /src/geometry/primitive/primitive_instance.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "geometry/primitive/primitive_instance.h" 20 | #include "geometry/surface.h" 21 | 22 | namespace yafaray { 23 | 24 | std::unique_ptr PrimitiveInstance::getSurface(const RayDifferentials *ray_differentials, const Point3f &hit_point, float time, const Uv &intersect_uv, const Camera *camera) const 25 | { 26 | return base_primitive_.getSurface(ray_differentials, hit_point, time, intersect_uv, camera, base_instance_.getObjToWorldMatrixAtTime(time)); 27 | } 28 | 29 | std::unique_ptr PrimitiveInstance::getSurface(const RayDifferentials *ray_differentials, const Point3f &hit_point, float time, const Uv &intersect_uv, const Camera *camera, const Matrix4f &obj_to_world) const 30 | { 31 | return base_primitive_.getSurface(ray_differentials, hit_point, time, intersect_uv, camera, obj_to_world * base_instance_.getObjToWorldMatrixAtTime(time)); 32 | } 33 | 34 | } //namespace yafaray 35 | -------------------------------------------------------------------------------- /src/geometry/vector.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * vector3d.cc: Vector 3d and point manipulation implementation 4 | * This is part of the libYafaRay package 5 | * Copyright (C) 2002 Alejandro Conty Estévez 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free Software 19 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | * 21 | */ 22 | 23 | #include "geometry/vector.h" 24 | #include "geometry/matrix.h" 25 | 26 | namespace yafaray { 27 | 28 | template 29 | Vec Vec::discreteVectorCone(const Vec &dir, T cos_angle, int sample, int square) 30 | { 31 | const T r_1{static_cast(sample / square) / static_cast(square)}; 32 | const T r_2{static_cast(sample % square) / static_cast(square)}; 33 | const T tt{math::mult_pi_by_2 * r_1}; 34 | const T ss{math::acos(T{1} - (T{1} - cos_angle) * r_2)}; 35 | const Vec vx(math::cos(ss), math::sin(ss) * math::cos(tt), math::sin(ss) * math::sin(tt)); 36 | const Vec i(T{1}, T{0}, T{0}); 37 | Matrix4f m(T{1}); 38 | if((std::abs(dir.array_[1]) > T{0}) || (std::abs(dir.array_[2]) > T{0})) 39 | { 40 | m[0][0] = dir.array_[0]; 41 | m[1][0] = dir.array_[1]; 42 | m[2][0] = dir.array_[2]; 43 | Vec c{i ^ dir}; 44 | c.normalize(); 45 | m[0][1] = c.array_[0]; 46 | m[1][1] = c.array_[1]; 47 | m[2][1] = c.array_[2]; 48 | c = dir ^ c; 49 | c.normalize(); 50 | m[0][2] = c.array_[0]; 51 | m[1][2] = c.array_[1]; 52 | m[2][2] = c.array_[2]; 53 | } 54 | else if(dir.array_[0] < T{0}) m[0][0] = T{-1}; 55 | return m * vx; 56 | } 57 | 58 | } //namespace yafaray 59 | -------------------------------------------------------------------------------- /src/image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | badge.cc 22 | image.cc 23 | image_layers.cc 24 | image_output.cc 25 | image_manipulation.cc 26 | ) 27 | 28 | message_boolean("Using FreeType" YAFARAY_WITH_FREETYPE "yes" "no") 29 | if(YAFARAY_WITH_FREETYPE) 30 | find_package(Freetype REQUIRED) 31 | target_sources(libyafaray4 32 | PRIVATE 33 | image_manipulation_freetype.cc 34 | ) 35 | list(APPEND YAF_IMAGE_DEFINITIONS "HAVE_FREETYPE") 36 | target_link_libraries(libyafaray4 PRIVATE Freetype::Freetype) 37 | endif() 38 | 39 | message_boolean("Using OpenCV" YAFARAY_WITH_OPENCV "yes" "no") 40 | if(YAFARAY_WITH_OPENCV) 41 | FIND_PACKAGE(OpenCV COMPONENTS core imgproc photo REQUIRED) 42 | target_sources(libyafaray4 43 | PRIVATE 44 | image_manipulation_opencv.cc 45 | ) 46 | list(APPEND YAF_IMAGE_DEFINITIONS "HAVE_OPENCV") 47 | target_link_libraries(libyafaray4 PRIVATE opencv_core opencv_imgproc opencv_photo) 48 | endif() 49 | 50 | set_source_files_properties( 51 | image_manipulation.cc 52 | TARGET_DIRECTORY libyafaray4 53 | PROPERTIES COMPILE_DEFINITIONS 54 | "${YAF_IMAGE_DEFINITIONS}") -------------------------------------------------------------------------------- /src/image/image_layers.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "image/image_layers.h" 20 | 21 | namespace yafaray { 22 | 23 | int ImageLayer::getWidth() const 24 | { 25 | if(!image_) return 0; 26 | else return image_->getWidth(); 27 | } 28 | 29 | int ImageLayer::getHeight() const 30 | { 31 | if(!image_) return 0; 32 | else return image_->getHeight(); 33 | } 34 | 35 | void ImageLayers::setColor(const Point2i &point, const Rgba &color, LayerDef::Type layer_type) 36 | { 37 | ImageLayer *image_layer = find(layer_type); 38 | if(image_layer) image_layer->image_->setColor(point, color); 39 | } 40 | 41 | void ImageLayers::setColor(const Point2i &point, Rgba &&color, LayerDef::Type layer_type) 42 | { 43 | ImageLayer *image_layer = find(layer_type); 44 | if(image_layer) image_layer->image_->setColor(point, std::move(color)); 45 | } 46 | 47 | } //namespace yafaray 48 | -------------------------------------------------------------------------------- /src/integrator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_subdirectory(surface) 20 | add_subdirectory(volume) -------------------------------------------------------------------------------- /src/integrator/surface/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | integrator_surface.cc 22 | integrator_bidirectional.cc 23 | integrator_debug.cc 24 | integrator_direct_light.cc 25 | integrator_montecarlo.cc 26 | integrator_photon_caustic.cc 27 | integrator_path_tracer.cc 28 | integrator_photon_mapping.cc 29 | integrator_sppm.cc 30 | integrator_tiled.cc 31 | ) -------------------------------------------------------------------------------- /src/integrator/volume/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | integrator_volume.cc 22 | integrator_emission.cc 23 | integrator_single_scatter.cc 24 | integrator_sky.cc 25 | ) -------------------------------------------------------------------------------- /src/interface/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | interface.cc 22 | ) 23 | 24 | add_subdirectory(export) -------------------------------------------------------------------------------- /src/interface/export/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | export_xml.cc 22 | export_c.cc 23 | export_python.cc 24 | ) -------------------------------------------------------------------------------- /src/light/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | light.cc 22 | light_area.cc 23 | light_background.cc 24 | light_background_portal.cc 25 | light_directional.cc 26 | light_ies.cc 27 | light_object_light.cc 28 | light_point.cc 29 | light_sphere.cc 30 | light_spot.cc 31 | light_sun.cc 32 | ) -------------------------------------------------------------------------------- /src/material/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | material.cc 22 | material_blend.cc 23 | material_coated_glossy.cc 24 | material_glass.cc 25 | material_glossy.cc 26 | material_mask.cc 27 | material_node.cc 28 | material_rough_glass.cc 29 | material_shiny_diffuse.cc 30 | material_light.cc 31 | material_mirror.cc 32 | material_null.cc 33 | ) -------------------------------------------------------------------------------- /src/noise/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | noise_generator.cc 22 | ) 23 | 24 | add_subdirectory(generator) 25 | add_subdirectory(musgrave) -------------------------------------------------------------------------------- /src/noise/generator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | noise_blender.cc 22 | noise_cell.cc 23 | noise_perlin_improved.cc 24 | noise_perlin_standard.cc 25 | noise_voronoi.cc 26 | ) -------------------------------------------------------------------------------- /src/noise/generator/noise_cell.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "noise/generator/noise_cell.h" 20 | 21 | namespace yafaray { 22 | 23 | float CellNoiseGenerator::operator()(const Point3f &pt) const 24 | { 25 | const int xi = static_cast(std::floor(pt[Axis::X])); 26 | const int yi = static_cast(std::floor(pt[Axis::Y])); 27 | const int zi = static_cast(std::floor(pt[Axis::Z])); 28 | unsigned int n = xi + yi * 1301 + zi * 314159; 29 | n ^= (n << 13); 30 | return (static_cast(n * (n * n * 15731 + 789221) + 1376312589) / 4294967296.0); 31 | } 32 | 33 | } //namespace yafaray 34 | -------------------------------------------------------------------------------- /src/noise/musgrave/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | musgrave_fbm.cc 22 | musgrave_hetero_terrain.cc 23 | musgrave_hybrid_mfractal.cc 24 | musgrave_mfractal.cc 25 | musgrave_ridged_mfractal.cc 26 | ) -------------------------------------------------------------------------------- /src/noise/musgrave/musgrave_fbm.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "noise/musgrave/musgrave_fbm.h" 20 | #include "math/math.h" 21 | #include "noise/noise_generator.h" 22 | 23 | namespace yafaray { 24 | /* 25 | * Procedural fBm evaluated at "point"; returns value stored in "value". 26 | * 27 | * Parameters: 28 | * ``H'' is the fractal increment parameter 29 | * ``lacunarity'' is the gap between successive frequencies 30 | * ``octaves'' is the number of frequencies in the fBm 31 | */ 32 | 33 | float FBmMusgrave::operator()(const Point3f &pt) const 34 | { 35 | float value = 0, pwr = 1, pw_hl = math::pow(lacunarity_, -h_); 36 | Point3f tp(pt); 37 | for(int i = 0; i < (int)octaves_; i++) 38 | { 39 | value += NoiseGenerator::getSignedNoise(n_gen_, tp) * pwr; 40 | pwr *= pw_hl; 41 | tp *= lacunarity_; 42 | } 43 | float rmd = octaves_ - std::floor(octaves_); 44 | if(rmd != 0.f) value += rmd * NoiseGenerator::getSignedNoise(n_gen_, tp) * pwr; 45 | return value; 46 | } 47 | 48 | } //namespace yafaray 49 | 50 | -------------------------------------------------------------------------------- /src/noise/musgrave/musgrave_hybrid_mfractal.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "noise/musgrave/musgrave_hybrid_mfractal.h" 20 | #include "math/math.h" 21 | #include "noise/noise_generator.h" 22 | 23 | namespace yafaray { 24 | 25 | /* Hybrid additive/multiplicative multifractal terrain model. 26 | * 27 | * Some good parameter values to start with: 28 | * 29 | * H: 0.25 30 | * offset: 0.7 31 | */ 32 | float HybridMFractalMusgrave::operator()(const Point3f &pt) const 33 | { 34 | float pw_hl = math::pow(lacunarity_, -h_); 35 | float pwr = pw_hl; // starts with i=1 instead of 0 36 | Point3f tp(pt); 37 | 38 | float result = NoiseGenerator::getSignedNoise(n_gen_, tp) + offset_; 39 | float weight = gain_ * result; 40 | tp *= lacunarity_; 41 | 42 | for(int i = 1; (weight > (float)0.001) && (i < (int)octaves_); i++) 43 | { 44 | if(weight > (float)1.0) weight = (float)1.0; 45 | float signal = (NoiseGenerator::getSignedNoise(n_gen_, tp) + offset_) * pwr; 46 | pwr *= pw_hl; 47 | result += weight * signal; 48 | weight *= gain_ * signal; 49 | tp *= lacunarity_; 50 | } 51 | 52 | float rmd = octaves_ - std::floor(octaves_); 53 | if(rmd != (float)0.0) result += rmd * ((NoiseGenerator::getSignedNoise(n_gen_, tp) + offset_) * pwr); 54 | 55 | return result; 56 | 57 | } 58 | 59 | } //namespace yafaray 60 | -------------------------------------------------------------------------------- /src/noise/musgrave/musgrave_mfractal.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "noise/musgrave/musgrave_mfractal.h" 20 | #include "math/math.h" 21 | #include "noise/noise_generator.h" 22 | 23 | namespace yafaray { 24 | 25 | /* 26 | * Procedural multifractal evaluated at "point"; 27 | * returns value stored in "value". 28 | * 29 | * Parameters: 30 | * ``H'' determines the highest fractal dimension 31 | * ``lacunarity'' is gap between successive frequencies 32 | * ``octaves'' is the number of frequencies in the fBm 33 | * ``offset'' is the zero offset, which determines multifractality (NOT USED??) 34 | */ 35 | /* this one is in fact rather confusing, 36 | * there seem to be errors in the original source code (in all three versions of proc.text&mod), 37 | * I modified it to something that made sense to me, so it might be wrong... */ 38 | float MFractalMusgrave::operator()(const Point3f &pt) const 39 | { 40 | float value = 1, pwr = 1, pw_hl = math::pow(lacunarity_, -h_); 41 | Point3f tp(pt); 42 | for(int i = 0; i < (int)octaves_; i++) 43 | { 44 | value *= (pwr * NoiseGenerator::getSignedNoise(n_gen_, tp) + (float)1.0); 45 | pwr *= pw_hl; 46 | tp *= lacunarity_; 47 | } 48 | float rmd = octaves_ - std::floor(octaves_); 49 | if(rmd != (float)0.0) value *= (rmd * NoiseGenerator::getSignedNoise(n_gen_, tp) * pwr + (float)1.0); 50 | return value; 51 | } 52 | 53 | } //namespace yafaray -------------------------------------------------------------------------------- /src/noise/musgrave/musgrave_ridged_mfractal.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "noise/musgrave/musgrave_ridged_mfractal.h" 20 | #include "math/math.h" 21 | #include "noise/noise_generator.h" 22 | 23 | namespace yafaray { 24 | 25 | /* Ridged multifractal terrain model. 26 | * 27 | * Some good parameter values to start with: 28 | * 29 | * H: 1.0 30 | * offset: 1.0 31 | * gain: 2.0 32 | */ 33 | float RidgedMFractalMusgrave::operator()(const Point3f &pt) const 34 | { 35 | float pw_hl = math::pow(lacunarity_, -h_); 36 | float pwr = pw_hl; // starts with i=1 instead of 0 37 | Point3f tp(pt); 38 | 39 | float signal = offset_ - std::abs(NoiseGenerator::getSignedNoise(n_gen_, tp)); 40 | signal *= signal; 41 | float result = signal; 42 | float weight = 1.0; 43 | 44 | for(int i = 1; i < (int)octaves_; i++) 45 | { 46 | tp *= lacunarity_; 47 | weight = signal * gain_; 48 | if(weight > (float)1.0) weight = (float)1.0; else if(weight < (float)0.0) weight = (float)0.0; 49 | signal = offset_ - std::abs(NoiseGenerator::getSignedNoise(n_gen_, tp)); 50 | signal *= signal; 51 | signal *= weight; 52 | result += signal * pwr; 53 | pwr *= pw_hl; 54 | } 55 | return result; 56 | } 57 | 58 | } //namespace yafaray 59 | -------------------------------------------------------------------------------- /src/param/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | param.cc 22 | ) -------------------------------------------------------------------------------- /src/photon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | hashgrid.cc 22 | photon.cc 23 | ) -------------------------------------------------------------------------------- /src/public_api/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | yafaray_c_api_container.cc 22 | yafaray_c_api_film.cc 23 | yafaray_c_api_general.cc 24 | yafaray_c_api_logger.cc 25 | yafaray_c_api_param_map.cc 26 | yafaray_c_api_param_map_list.cc 27 | yafaray_c_api_render_control.cc 28 | yafaray_c_api_render_monitor.cc 29 | yafaray_c_api_scene.cc 30 | yafaray_c_api_surface_integrator.cc 31 | ) -------------------------------------------------------------------------------- /src/public_api/yafaray_c_api_param_map_list.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "public_api/yafaray_c_api.h" 20 | #include "param/param.h" 21 | #include 22 | 23 | yafaray_ParamMapList *yafaray_createParamMapList() 24 | { 25 | auto param_map_list{new std::list()}; 26 | return reinterpret_cast(param_map_list); 27 | } 28 | 29 | void yafaray_addParamMapToList(yafaray_ParamMapList *param_map_list, const yafaray_ParamMap *param_map) 30 | { 31 | if(!param_map_list || !param_map) return; 32 | reinterpret_cast *>(param_map_list)->emplace_back(*reinterpret_cast(param_map)); 33 | } 34 | 35 | void yafaray_clearParamMapList(yafaray_ParamMapList *param_map_list) 36 | { 37 | if(!param_map_list) return; 38 | reinterpret_cast *>(param_map_list)->clear(); 39 | } 40 | 41 | void yafaray_destroyParamMapList(yafaray_ParamMapList *param_map_list) 42 | { 43 | delete reinterpret_cast *>(param_map_list); 44 | } 45 | -------------------------------------------------------------------------------- /src/public_api/yafaray_c_api_render_control.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "public_api/yafaray_c_api.h" 20 | #include "render/render_control.h" 21 | 22 | yafaray_RenderControl *yafaray_createRenderControl() 23 | { 24 | auto render_control{new yafaray::RenderControl()}; 25 | return reinterpret_cast(render_control); 26 | } 27 | 28 | void yafaray_destroyRenderControl(yafaray_RenderControl *render_control) 29 | { 30 | delete reinterpret_cast(render_control); 31 | } 32 | 33 | void yafaray_setRenderControlForNormalStart(yafaray_RenderControl *render_control) 34 | { 35 | if(!render_control) return; 36 | reinterpret_cast(render_control)->setStarted(); 37 | } 38 | 39 | void yafaray_setRenderControlForProgressiveStart(yafaray_RenderControl *render_control) 40 | { 41 | if(!render_control) return; 42 | reinterpret_cast(render_control)->setStarted(); 43 | reinterpret_cast(render_control)->setProgressive(); 44 | } 45 | 46 | void yafaray_setRenderControlForResuming(yafaray_RenderControl *render_control) 47 | { 48 | if(!render_control) return; 49 | reinterpret_cast(render_control)->setResumed(); 50 | } 51 | 52 | void yafaray_cancelRendering(yafaray_RenderControl *render_control) 53 | { 54 | if(!render_control) return; 55 | reinterpret_cast(render_control)->setCanceled(); 56 | } 57 | -------------------------------------------------------------------------------- /src/public_api/yafaray_c_api_render_monitor.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This is part of the libYafaRay package 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "public_api/yafaray_c_api.h" 20 | #include "render/render_monitor.h" 21 | #include "render/progress_bar.h" 22 | 23 | yafaray_RenderMonitor *yafaray_createRenderMonitor(yafaray_ProgressBarCallback monitor_callback, void *callback_data, yafaray_DisplayConsole progress_bar_display_console) 24 | { 25 | auto render_monitor{new yafaray::RenderMonitor()}; 26 | std::unique_ptr progress_bar; 27 | if(progress_bar_display_console == YAFARAY_DISPLAY_CONSOLE_NORMAL) progress_bar = std::make_unique(80, monitor_callback, callback_data); 28 | else progress_bar = std::make_unique(monitor_callback, callback_data); 29 | render_monitor->setProgressBar(std::move(progress_bar)); 30 | return reinterpret_cast(render_monitor); 31 | } 32 | 33 | void yafaray_destroyRenderMonitor(yafaray_RenderMonitor *render_monitor) 34 | { 35 | delete reinterpret_cast(render_monitor); 36 | } 37 | -------------------------------------------------------------------------------- /src/render/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | imagefilm.cc 22 | imagesplitter.cc 23 | progress_bar.cc 24 | render_monitor.cc 25 | ) -------------------------------------------------------------------------------- /src/sampler/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | halton.cc 22 | ) -------------------------------------------------------------------------------- /src/scene/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | scene.cc 22 | ) -------------------------------------------------------------------------------- /src/shader/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | shader_node.cc 22 | shader_node_layer.cc 23 | shader_node_texture.cc 24 | shader_node_mix.cc 25 | shader_node_value.cc 26 | ) -------------------------------------------------------------------------------- /src/texture/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | texture.cc 22 | texture_image.cc 23 | texture_blend.cc 24 | texture_distorted_noise.cc 25 | texture_marble.cc 26 | texture_musgrave.cc 27 | texture_rgb_cube.cc 28 | texture_voronoi.cc 29 | texture_wood.cc 30 | texture_clouds.cc 31 | ) -------------------------------------------------------------------------------- /src/volume/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_subdirectory(region) 20 | add_subdirectory(handler) -------------------------------------------------------------------------------- /src/volume/handler/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | volume_handler_beer.cc 22 | volume_handler_sss.cc 23 | volume_handler.cc 24 | ) -------------------------------------------------------------------------------- /src/volume/region/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | volume_region.cc 22 | volume_uniform.cc 23 | volume_sky.cc 24 | ) 25 | 26 | add_subdirectory(density) -------------------------------------------------------------------------------- /src/volume/region/density/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | target_sources(libyafaray4 20 | PRIVATE 21 | volume_exp_density.cc 22 | volume_grid.cc 23 | volume_noise.cc 24 | volume_region_density.cc 25 | ) -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_subdirectory(test00) 20 | add_subdirectory(test01) 21 | add_subdirectory(test02) 22 | add_subdirectory(test03) 23 | #add_subdirectory(test04) 24 | #add_subdirectory(test05) 25 | #add_subdirectory(test06) 26 | #add_subdirectory(test07) 27 | #add_subdirectory(test08) 28 | add_subdirectory(test09) 29 | add_subdirectory(test10) 30 | -------------------------------------------------------------------------------- /tests/test00/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_executable(yafaray_test00 test00.c) 20 | set_target_properties(yafaray_test00 PROPERTIES C_STANDARD 90 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF) 21 | target_link_libraries(yafaray_test00 PRIVATE libyafaray4) 22 | target_include_directories(yafaray_test00 PRIVATE ${PROJECT_BINARY_DIR}/include) 23 | 24 | # To check strict ANSI C89/C90 API compliance 25 | if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") 26 | target_compile_options(yafaray_test00 PRIVATE /W4 /wd4100) # /WX would turn warnings as errors 27 | else() 28 | target_compile_options(yafaray_test00 PRIVATE -Wall -Wextra -Wpedantic -pedantic -Wno-unused-parameter) 29 | endif() 30 | 31 | install(TARGETS yafaray_test00 32 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 33 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 34 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 35 | ) 36 | #set_target_properties(yafaray_test00 PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH "@executable_path/;@executable_path/../../src") 37 | -------------------------------------------------------------------------------- /tests/test00/tex.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test00/tex.tga -------------------------------------------------------------------------------- /tests/test01/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_executable(yafaray_test01 test01.c) 20 | set_target_properties(yafaray_test01 PROPERTIES C_STANDARD 90 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF) 21 | target_link_libraries(yafaray_test01 PRIVATE libyafaray4) 22 | target_include_directories(yafaray_test01 PRIVATE ${PROJECT_BINARY_DIR}/include) 23 | 24 | install(TARGETS yafaray_test01 25 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 26 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 27 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 28 | ) 29 | #set_target_properties(yafaray_test01 PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH "@executable_path/;@executable_path/../../src") 30 | -------------------------------------------------------------------------------- /tests/test01/tex.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test01/tex.exr -------------------------------------------------------------------------------- /tests/test01/tex.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test01/tex.hdr -------------------------------------------------------------------------------- /tests/test01/tex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test01/tex.jpg -------------------------------------------------------------------------------- /tests/test01/tex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test01/tex.png -------------------------------------------------------------------------------- /tests/test01/tex.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test01/tex.tga -------------------------------------------------------------------------------- /tests/test01/tex.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test01/tex.tif -------------------------------------------------------------------------------- /tests/test02/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_executable(yafaray_test02 test02.c) 20 | set_target_properties(yafaray_test02 PROPERTIES C_STANDARD 90 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF) 21 | target_link_libraries(yafaray_test02 PRIVATE libyafaray4) 22 | target_include_directories(yafaray_test02 PRIVATE ${PROJECT_BINARY_DIR}/include) 23 | 24 | install(TARGETS yafaray_test02 25 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 26 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 27 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 28 | ) 29 | #set_target_properties(yafaray_test02 PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH "@executable_path/;@executable_path/../../src") 30 | -------------------------------------------------------------------------------- /tests/test03/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_executable(yafaray_test03 test03.c) 20 | set_target_properties(yafaray_test03 PROPERTIES C_STANDARD 90 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF) 21 | target_link_libraries(yafaray_test03 PRIVATE libyafaray4) 22 | target_include_directories(yafaray_test03 PRIVATE ${PROJECT_BINARY_DIR}/include) 23 | 24 | install(TARGETS yafaray_test03 25 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 26 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 27 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 28 | ) 29 | #set_target_properties(yafaray_test03 PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH "@executable_path/;@executable_path/../../src") 30 | -------------------------------------------------------------------------------- /tests/test03/pixels_texture.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test03/pixels_texture.tga -------------------------------------------------------------------------------- /tests/test03/tex.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test03/tex.exr -------------------------------------------------------------------------------- /tests/test03/tex.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test03/tex.hdr -------------------------------------------------------------------------------- /tests/test03/tex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test03/tex.jpg -------------------------------------------------------------------------------- /tests/test03/tex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test03/tex.png -------------------------------------------------------------------------------- /tests/test03/tex.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test03/tex.tga -------------------------------------------------------------------------------- /tests/test03/tex.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test03/tex.tif -------------------------------------------------------------------------------- /tests/test04/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_executable(yafaray_test04 test04.c) 20 | set_target_properties(yafaray_test04 PROPERTIES C_STANDARD 90 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF) 21 | target_link_libraries(yafaray_test04 PRIVATE libyafaray4) 22 | target_include_directories(yafaray_test04 PRIVATE ${PROJECT_BINARY_DIR}/include) 23 | 24 | install(TARGETS yafaray_test04 25 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 26 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 27 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 28 | ) 29 | #set_target_properties(yafaray_test04 PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH "@executable_path/;@executable_path/../../src") 30 | -------------------------------------------------------------------------------- /tests/test04/tex.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test04/tex.hdr -------------------------------------------------------------------------------- /tests/test04/tex.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test04/tex.tga -------------------------------------------------------------------------------- /tests/test05/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_executable(yafaray_test05 test05.c) 20 | set_target_properties(yafaray_test05 PROPERTIES C_STANDARD 90 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF) 21 | target_link_libraries(yafaray_test05 PRIVATE libyafaray4) 22 | target_include_directories(yafaray_test05 PRIVATE ${PROJECT_BINARY_DIR}/include) 23 | 24 | install(TARGETS yafaray_test05 25 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 26 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 27 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 28 | ) 29 | #set_target_properties(yafaray_test05 PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH "@executable_path/;@executable_path/../../src") 30 | -------------------------------------------------------------------------------- /tests/test05/tex.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test05/tex.hdr -------------------------------------------------------------------------------- /tests/test05/tex.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test05/tex.tga -------------------------------------------------------------------------------- /tests/test06/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_executable(yafaray_test06 test06.c) 20 | set_target_properties(yafaray_test06 PROPERTIES C_STANDARD 90 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF) 21 | target_link_libraries(yafaray_test06 PRIVATE libyafaray4) 22 | target_include_directories(yafaray_test06 PRIVATE ${PROJECT_BINARY_DIR}/include) 23 | 24 | install(TARGETS yafaray_test06 25 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 26 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 27 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 28 | ) 29 | #set_target_properties(yafaray_test06 PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH "@executable_path/;@executable_path/../../src") 30 | -------------------------------------------------------------------------------- /tests/test06/tex.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test06/tex.hdr -------------------------------------------------------------------------------- /tests/test06/tex.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test06/tex.tga -------------------------------------------------------------------------------- /tests/test07/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_executable(yafaray_test07 test07.c) 20 | set_target_properties(yafaray_test07 PROPERTIES C_STANDARD 90 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF) 21 | target_link_libraries(yafaray_test07 PRIVATE libyafaray4) 22 | target_include_directories(yafaray_test07 PRIVATE ${PROJECT_BINARY_DIR}/include) 23 | 24 | install(TARGETS yafaray_test07 25 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 26 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 27 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 28 | ) 29 | #set_target_properties(yafaray_test07 PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH "@executable_path/;@executable_path/../../src") 30 | -------------------------------------------------------------------------------- /tests/test07/tex.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test07/tex.hdr -------------------------------------------------------------------------------- /tests/test07/tex.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test07/tex.tga -------------------------------------------------------------------------------- /tests/test08/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_executable(yafaray_test08 test08.c) 20 | set_target_properties(yafaray_test08 PROPERTIES C_STANDARD 90 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF) 21 | target_link_libraries(yafaray_test08 PRIVATE libyafaray4) 22 | target_include_directories(yafaray_test08 PRIVATE ${PROJECT_BINARY_DIR}/include) 23 | 24 | install(TARGETS yafaray_test08 25 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 26 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 27 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 28 | ) 29 | #set_target_properties(yafaray_test08 PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH "@executable_path/;@executable_path/../../src") 30 | -------------------------------------------------------------------------------- /tests/test08/tex.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test08/tex.hdr -------------------------------------------------------------------------------- /tests/test08/tex.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test08/tex.tga -------------------------------------------------------------------------------- /tests/test09/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_executable(yafaray_test09 test09.c) 20 | set_target_properties(yafaray_test09 PROPERTIES C_STANDARD 90 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF) 21 | target_link_libraries(yafaray_test09 PRIVATE libyafaray4) 22 | target_include_directories(yafaray_test09 PRIVATE ${PROJECT_BINARY_DIR}/include) 23 | 24 | install(TARGETS yafaray_test09 25 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 26 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 27 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 28 | ) 29 | #set_target_properties(yafaray_test09 PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH "@executable_path/;@executable_path/../../src") 30 | -------------------------------------------------------------------------------- /tests/test09/tex.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test09/tex.exr -------------------------------------------------------------------------------- /tests/test09/tex.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test09/tex.hdr -------------------------------------------------------------------------------- /tests/test09/tex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test09/tex.jpg -------------------------------------------------------------------------------- /tests/test09/tex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test09/tex.png -------------------------------------------------------------------------------- /tests/test09/tex.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test09/tex.tga -------------------------------------------------------------------------------- /tests/test09/tex.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test09/tex.tif -------------------------------------------------------------------------------- /tests/test10/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #**************************************************************************** 2 | # This is part of the libYafaRay package 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | # Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | # 18 | 19 | add_executable(yafaray_test10 test10.c) 20 | set_target_properties(yafaray_test10 PROPERTIES C_STANDARD 90 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF) 21 | target_link_libraries(yafaray_test10 PRIVATE libyafaray4) 22 | target_include_directories(yafaray_test10 PRIVATE ${PROJECT_BINARY_DIR}/include) 23 | 24 | install(TARGETS yafaray_test10 25 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 26 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 27 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 28 | ) 29 | #set_target_properties(yafaray_test10 PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH "@executable_path/;@executable_path/../../src") 30 | -------------------------------------------------------------------------------- /tests/test10/tex.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test10/tex.exr -------------------------------------------------------------------------------- /tests/test10/tex.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test10/tex.hdr -------------------------------------------------------------------------------- /tests/test10/tex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test10/tex.jpg -------------------------------------------------------------------------------- /tests/test10/tex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test10/tex.png -------------------------------------------------------------------------------- /tests/test10/tex.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test10/tex.tga -------------------------------------------------------------------------------- /tests/test10/tex.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YafaRay/libYafaRay/8f4906ae88f8a527bbce37991a95e3e3857cb9ac/tests/test10/tex.tif --------------------------------------------------------------------------------