htrdr_ran_wlen_cie_xyz.h (2882B)
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_RAN_WLEN_CIE_XYZ_H 25 #define HTRDR_RAN_WLEN_CIE_XYZ_H 26 27 #include "core/htrdr.h" 28 #include <rsys/rsys.h> 29 30 /* Wavelength boundaries of the CIE XYZ color space in nanometers */ 31 #define HTRDR_RAN_WLEN_CIE_XYZ_RANGE_DEFAULT__ {380, 780} 32 static const double HTRDR_RAN_WLEN_CIE_XYZ_RANGE_DEFAULT[2] = 33 HTRDR_RAN_WLEN_CIE_XYZ_RANGE_DEFAULT__; 34 35 /* Forward declarations */ 36 struct htrdr; 37 struct htrdr_ran_wlen_cie_xyz; 38 39 BEGIN_DECLS 40 41 HTRDR_API res_T 42 htrdr_ran_wlen_cie_xyz_create 43 (struct htrdr* htrdr, 44 const double range[2], /* Must be included in [380, 780] nanometers */ 45 const size_t nbands, /* # bands used to discretize the CIE tristimulus */ 46 struct htrdr_ran_wlen_cie_xyz** cie); 47 48 HTRDR_API void 49 htrdr_ran_wlen_cie_xyz_ref_get 50 (struct htrdr_ran_wlen_cie_xyz* cie); 51 52 HTRDR_API void 53 htrdr_ran_wlen_cie_xyz_ref_put 54 (struct htrdr_ran_wlen_cie_xyz* cie); 55 56 /* Return a wavelength in nanometer */ 57 HTRDR_API double 58 htrdr_ran_wlen_cie_xyz_sample_X 59 (struct htrdr_ran_wlen_cie_xyz* cie, 60 const double r0, const double r1, /* Canonical numbers in [0, 1[ */ 61 double* pdf); /* In nm^-1. May be NULL */ 62 63 /* Return a wavelength in nanometer */ 64 HTRDR_API double 65 htrdr_ran_wlen_cie_xyz_sample_Y 66 (struct htrdr_ran_wlen_cie_xyz* cie, 67 const double r0, const double r1, /* Canonical number in [0, 1[ */ 68 double* pdf); /* In nm^-1. May be NULL */ 69 70 /* Return a wavelength in nanometer */ 71 HTRDR_API double 72 htrdr_ran_wlen_cie_xyz_sample_Z 73 (struct htrdr_ran_wlen_cie_xyz* cie, 74 const double r0, const double r1, /* Canonical number in [0, 1[ */ 75 double* pdf); /* In nm^-1. May be NULL */ 76 77 END_DECLS 78 79 #endif /* HTRDR_RAN_WLEN_CIE_XYZ_H */ 80