htrdr_materials.h (2356B)
1 /* Copyright (C) 2018-2019, 2022-2025 Centre National de la Recherche Scientifique 2 * Copyright (C) 2020-2022 Institut Mines Télécom Albi-Carmaux 3 * Copyright (C) 2022-2025 Institut Pierre-Simon Laplace 4 * Copyright (C) 2022-2025 Institut de Physique du Globe de Paris 5 * Copyright (C) 2018-2025 |Méso|Star> (contact@meso-star.com) 6 * Copyright (C) 2022-2025 Observatoire de Paris 7 * Copyright (C) 2022-2025 Université de Reims Champagne-Ardenne 8 * Copyright (C) 2022-2025 Université de Versaille Saint-Quentin 9 * Copyright (C) 2018-2019, 2022-2025 Université Paul Sabatier 10 * 11 * This program is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation, either version 3 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 23 24 #ifndef HTRDR_MATERIALS_H 25 #define HTRDR_MATERIALS_H 26 27 #include "core/htrdr.h" 28 #include <rsys/rsys.h> 29 30 /* Forward declarations */ 31 struct htrdr_materials; 32 struct mrumtl; 33 struct s3d_hit; 34 struct ssf_bsdf; 35 struct ssp_rng; 36 37 struct htrdr_mtl { 38 const char* name; 39 const struct mrumtl* mrumtl; 40 double temperature; 41 }; 42 #define HTRDR_MTL_NULL__ {NULL, NULL, 0} 43 static const struct htrdr_mtl HTRDR_MTL_NULL = HTRDR_MTL_NULL__; 44 45 BEGIN_DECLS 46 47 HTRDR_API res_T 48 htrdr_materials_create 49 (struct htrdr* htrdr, 50 const char* filename, 51 struct htrdr_materials** mats); 52 53 HTRDR_API void 54 htrdr_materials_ref_get 55 (struct htrdr_materials* mats); 56 57 HTRDR_API void 58 htrdr_materials_ref_put 59 (struct htrdr_materials* mats); 60 61 /* Return 1 if the material exist and 0 otherwise */ 62 HTRDR_API int 63 htrdr_materials_find_mtl 64 (struct htrdr_materials* mats, 65 const char* mtl_name, 66 struct htrdr_mtl* mtl); 67 68 HTRDR_API res_T 69 htrdr_mtl_create_bsdf 70 (struct htrdr* htrdr, 71 const struct htrdr_mtl* mtl, 72 const size_t ithread, 73 const double wavelength, 74 struct ssp_rng* rng, 75 struct ssf_bsdf** bsdf); 76 77 END_DECLS 78 79 #endif /* HTRDR_MATERIALS_H */ 80