commit 8fb0f4712440b7a672994954be6ded65e9eceda2
parent 5cd3f32da1fa95c40e87922e9c47cde14e49c271
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 28 Jul 2021 15:02:30 +0200
Upd the documentation of the camera parameters
Diffstat:
5 files changed, 60 insertions(+), 21 deletions(-)
diff --git a/cmake/core/CMakeLists.txt b/cmake/core/CMakeLists.txt
@@ -55,6 +55,8 @@ include_directories(
################################################################################
# Generate files
################################################################################
+set(HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MIN "0.0" CACHE INTERNAL "")
+set(HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MAX "180.0" CACHE INTERNAL "")
set(HTRDR_ARGS_DEFAULT_CAMERA_POS "0,0,0" CACHE INTERNAL "")
set(HTRDR_ARGS_DEFAULT_CAMERA_TGT "0,1,0" CACHE INTERNAL "")
set(HTRDR_ARGS_DEFAULT_CAMERA_UP "0,0,1" CACHE INTERNAL "")
diff --git a/doc/htrdr-atmosphere.1.txt.in b/doc/htrdr-atmosphere.1.txt.in
@@ -82,7 +82,7 @@ W/sr/m^2 excepted for monochromatic computations where the computed spectral
radiance is defined in W/sr/m^2/nm. The flux densities are saved in W/m^2. The
results are written to the output file if the *-o* option is defined and the
standard output otherwise. The output image is a list of raw ASCII data
-formatted with respect to the *htrdr-image*(5) file format.
+formatted with respect to the *htrdr-image*(5) file format.
*htrdr-atmosphere* supports shared memory parallelism and relies on the Message
Passing Interface specification [4] to parallelise its computations in a
@@ -101,14 +101,31 @@ OPTIONS
are taken into account.
*-C* <__camera-parameter__:...>::
- Define the rendering point of view. Available camera parameters are:
+ Define the camera. Available parameters are:
+
+ **focal-dst**=**_dst_**;;
+ Distance to focus on with a thin lens camera, that is, a camera whose
+ *lens-radius* is not zero. The default focal distance is
+ @HTRDR_ARGS_DEFAULT_CAMERA_FOCAL_DST@ meter.
+
+ **focal-length**=**_length_**;;
+ Focal length of a camera lens. It is another way to control the field of
+ view of a thin lens camera. Be default, the field of view is directly set
+ through the **fov** parameter.
**fov**=**_angle_**;;
- Vertical field of view of the camera in [30, 120] degrees. By default
- _angle_ is set to @HTRDR_ARGS_DEFAULT_CAMERA_FOV@ degrees.
+ Vertical field of view of the camera in
+ ]@HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MIN@,
+ @HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MAX@[ degrees. By default _angle_ is set to
+ @HTRDR_ARGS_DEFAULT_CAMERA_FOV@ degrees.
+
+ **lens-radius**=**_radius_**;;
+ Radius of the camera lens. A non-zero radius means that the camera is a
+ thin lens camera while a zero radius defines a pinhole camera. By default
+ the lens radius is @HTRDR_ARGS_DEFAULT_CAMERA_LENS_RADIUS@.
**pos**=**_x_**,**_y_**,**_z_**;;
- Position of the camera. By default it is set to
+ Camera lens position. By default it is set to
{@HTRDR_ARGS_DEFAULT_CAMERA_POS@}.
**tgt**=**_x_**,**_y_**,**_z_**;;
@@ -290,7 +307,7 @@ integrated radiance in W/sr/m^2 for the X, Y, and Z components of the CIE
1931 XYZ color space. The first value of each pair is the expected value of the
average radiance of the pixel. The second value is its associated standard
deviation. The fourth and final pair records the microsecond estimate of the
-computation time per radiative path and its standard error.
+computation time per radiative path and its standard error.
Longwave image
~~~~~~~~~~~~~~
@@ -304,7 +321,7 @@ spectral radiance in W/sr/m^2/nm depending on whether this radiance was
calculated for a spectral range or at a single wavelength. The fifth and sixth
pixel components are not used. Finally, the last 2 components of the pixel
record the estimate in microseconds of the computation time per radiative path
-and its standard error.
+and its standard error.
Shortwave image
~~~~~~~~~~~~~~~
diff --git a/doc/htrdr-combustion.1.txt.in b/doc/htrdr-combustion.1.txt.in
@@ -79,14 +79,31 @@ OPTIONS
-------
*-C* <__camera-parameter__:...>::
- Define the rendering point of view. Available camera parameters are:
+ Define the camera. Available parameters are:
+
+ **focal-dst**=**_dst_**;;
+ Distance to focus on with a thin lens camera, that is, a camera whose
+ *lens-radius* is not zero. The default focal distance is
+ @HTRDR_ARGS_DEFAULT_CAMERA_FOCAL_DST@ meter.
+
+ **focal-length**=**_length_**;;
+ Focal length of a camera lens. It is another way to control the field of
+ view of a thin lens camera. Be default, the field of view is directly set
+ through the **fov** parameter.
**fov**=**_angle_**;;
- Vertical field of view of the camera in [30, 120] degrees. By default
- _angle_ is set to @HTRDR_ARGS_DEFAULT_CAMERA_FOV@ degrees.
+ Vertical field of view of the camera in
+ ]@HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MIN@,
+ @HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MAX@[ degrees. By default _angle_ is set to
+ @HTRDR_ARGS_DEFAULT_CAMERA_FOV@ degrees.
+
+ **lens-radius**=**_radius_**;;
+ Radius of the camera lens. A non-zero radius means that the camera is a
+ thin lens camera while a zero radius defines a pinhole camera. By default
+ the lens radius is @HTRDR_ARGS_DEFAULT_CAMERA_LENS_RADIUS@.
**pos**=**_x_**,**_y_**,**_z_**;;
- Position of the camera. By default it is set to
+ Camera lens position. By default it is set to
{@HTRDR_ARGS_DEFAULT_CAMERA_POS@}.
**tgt**=**_x_**,**_y_**,**_z_**;;
@@ -306,7 +323,7 @@ EXAMPLES
Make htrdr-combustion verbose (option *-v*) and render an image of a combustion
medium whose tetrahedral mesh is stored in *tetra.sth* and its associated
-thermodynamic properties are saved in *thermprops.atrtp*. The spectrally
+thermodynamic properties are saved in *thermprops.atrtp*. The spectrally
varying indices of the medium are listed in the *refract_ids.atrri* file. The
center of the laser surface emission is positioned at the origin and its
direction is aligned to the Y axis. The definition of the rendered image is
diff --git a/src/core/htrdr_args.c b/src/core/htrdr_args.c
@@ -29,9 +29,6 @@
#include <string.h>
-#define FOV_EXCLUSIVE_MIN 0.0 /* In degrees */
-#define FOV_EXCLUSIVE_MAX 180.0 /* In degrees */
-
/*******************************************************************************
* Helper functions
******************************************************************************/
@@ -71,9 +68,10 @@ parse_fov(const char* str, double* out_fov)
fprintf(stderr, "Invalid field of view `%s'.\n", str);
return RES_BAD_ARG;
}
- if(fov <= FOV_EXCLUSIVE_MIN || fov >= FOV_EXCLUSIVE_MAX) {
- fprintf(stderr, "The field of view %g is not in ]%g, %g[.\n",
- fov, FOV_EXCLUSIVE_MIN, FOV_EXCLUSIVE_MAX);
+ if(fov <= HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MIN
+ || fov >= HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MAX) {
+ fprintf(stderr, "The field of view %g is not in ]%g, %g[.\n", fov,
+ HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MIN, HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MAX);
return RES_BAD_ARG;
}
*out_fov = fov;
@@ -506,15 +504,16 @@ htrdr_args_camera_parse(struct htrdr_args_camera* cam, const char* str)
goto error;
}
cam->fov_y = MRAD2DEG(cam->fov_y);
- if(cam->fov_y <= FOV_EXCLUSIVE_MIN || cam->fov_y >= FOV_EXCLUSIVE_MAX) {
+ if(cam->fov_y <= HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MIN
+ || cam->fov_y >= HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MAX) {
fprintf(stderr,
"Invalid focal length %g regarding the lens radius %g. "
"The corresponding field of view %g is not in ]%g, %g[ degrees.\n",
cam->focal_length,
cam->lens_radius,
cam->fov_y,
- FOV_EXCLUSIVE_MIN,
- FOV_EXCLUSIVE_MAX);
+ HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MIN,
+ HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MAX);
res = RES_BAD_ARG;
goto error;
}
diff --git a/src/core/htrdr_args.h.in b/src/core/htrdr_args.h.in
@@ -23,6 +23,10 @@
#include <rsys/rsys.h>
+/* Exclusive bounds of the camera field of view (degrees) */
+#define HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MIN @HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MIN@
+#define HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MAX @HTRDR_ARGS_CAMERA_FOV_EXCLUSIVE_MAX@
+
/* Arguments of a pinhole camera sensor */
struct htrdr_args_camera {
double position[3]; /* Lens position */