solstice_args.h.in (6047B)
1 /* Copyright (C) 2018-2026 |Meso|Star> (contact@meso-star.com) 2 * Copyright (C) 2016-2018 CNRS 3 * 4 * This program is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * This program 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 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 16 17 #ifndef SOLSTICE_ARGS_H 18 #define SOLSTICE_ARGS_H 19 20 #include "score.h" 21 22 #include <solstice/ssol.h> 23 #include <rsys/math.h> 24 25 struct solstice_args_spherical { 26 double azimuth; /* In radians */ 27 double elevation; /* In radians */ 28 }; 29 30 enum solstice_args_dump_format { 31 SOLSTICE_ARGS_DUMP_OBJ, 32 SOLSTICE_ARGS_DUMP_NONE 33 }; 34 35 enum solstice_args_dump_split_mode { 36 SOLSTICE_ARGS_DUMP_SPLIT_GEOMETRY, 37 SOLSTICE_ARGS_DUMP_SPLIT_NONE, 38 SOLSTICE_ARGS_DUMP_SPLIT_OBJECT 39 }; 40 41 enum solstice_args_render_mode { 42 SOLSTICE_ARGS_RENDER_DRAFT, 43 SOLSTICE_ARGS_RENDER_PATH_TRACING 44 }; 45 46 struct solstice_args { 47 const char* output_filename; 48 const char* input_filename; /* May be NULL <=> read data from stdin */ 49 const char* receivers_filename; 50 unsigned long nexperiments; /* #experiments */ 51 unsigned nthreads; /* #threads */ 52 53 /* List of sun directions */ 54 struct solstice_args_spherical* sun_dirs; 55 size_t nsun_dirs; 56 57 struct { 58 double pos[3]; 59 double tgt[3]; 60 double up[3]; 61 double fov_x; /* In degrees */ 62 int auto_look_at; 63 } camera; 64 65 struct { 66 unsigned long width; 67 unsigned long height; 68 unsigned spp; /* Samples per pixel */ 69 } img; 70 71 enum solstice_args_render_mode render_mode; 72 73 /* Dump geometry mode */ 74 enum solstice_args_dump_format dump_format; 75 enum solstice_args_dump_split_mode dump_split_mode; 76 77 /* Dump radiative paths options. */ 78 double sun_ray_length; /* Length of the sun rays. */ 79 double infinite_ray_length; /* Length of the rays going to infinity. */ 80 81 /* RNG options */ 82 char* rng_state_input_filename; 83 char* rng_state_output_filename; 84 85 int force_overwriting; 86 int dump_paths; /* Dump radiative paths */ 87 int rendering; 88 int quiet; 89 int quit; /* Quit the application */ 90 int verbose; 91 }; 92 93 #define SOLSTICE_ARGS_NULL__ {0} 94 static const struct solstice_args SOLSTICE_ARGS_NULL = SOLSTICE_ARGS_NULL__; 95 96 #define SOLSTICE_ARGS_DEFAULT__ { \ 97 NULL, /* output_filename */ \ 98 NULL, /* input_filename */ \ 99 NULL, /* receivers_filename */ \ 100 @SOLSTICE_ARGS_DEFAULT_NREALISATIONS@, \ 101 SSOL_NTHREADS_DEFAULT, \ 102 \ 103 NULL, /* sun_dirs */ \ 104 0, /* # nsun_dirs */ \ 105 \ 106 { /* Camera */ \ 107 { @SOLSTICE_ARGS_DEFAULT_CAMERA_POS@ }, \ 108 { @SOLSTICE_ARGS_DEFAULT_CAMERA_TGT@ }, \ 109 { @SOLSTICE_ARGS_DEFAULT_CAMERA_UP@ }, \ 110 @SOLSTICE_ARGS_DEFAULT_CAMERA_FOV@, \ 111 1, \ 112 }, \ 113 \ 114 { /* Image */ \ 115 @SOLSTICE_ARGS_DEFAULT_IMG_WIDTH@, \ 116 @SOLSTICE_ARGS_DEFAULT_IMG_HEIGHT@, \ 117 @SOLSTICE_ARGS_DEFAULT_IMG_SPP@ \ 118 }, \ 119 \ 120 SOLSTICE_ARGS_RENDER_DRAFT, /* Render mode */ \ 121 \ 122 SOLSTICE_ARGS_DUMP_NONE, /* Dump format */ \ 123 SOLSTICE_ARGS_DUMP_SPLIT_NONE, /* Dump split mode */ \ 124 \ 125 -1, /* Sun ray length */ \ 126 -1, /* Infinite ray length */ \ 127 \ 128 NULL, /* RNG state input filename */ \ 129 NULL, /* RNG state output filename */ \ 130 \ 131 0, /* Force overwriting */ \ 132 0, /* Dump radiative paths */ \ 133 0, /* Rendering */ \ 134 0, /* Quiet */ \ 135 0, /* Quit */ \ 136 0 /* Verbose */ \ 137 } 138 static const struct solstice_args SOLSTICE_ARGS_DEFAULT = 139 SOLSTICE_ARGS_DEFAULT__; 140 141 #endif /* SOLSTICE_ARGS_H */ 142