2#ifndef _TINYPBRT_CAMERA_HPP_
3#define _TINYPBRT_CAMERA_HPP_
52 default:
return "UNKNOWN";
65 using wrapper::wrapper;
80 [[nodiscard]]
constexpr auto reflect() const noexcept {
94 using wrapper::wrapper;
109 [[nodiscard]]
constexpr float_t fov() const noexcept {
return _native->fov; }
112 [[nodiscard]]
constexpr auto reflect() const noexcept {
142 default:
return "UNKNOWN";
152 using wrapper::wrapper;
160 [[nodiscard]]
constexpr auto reflect() const noexcept {
return std::make_tuple(
mapping()); }
186 case BUILTIN:
return "builtin";
188 default:
return "UNKNOWN";
222 case SQUARE:
return "square";
224 case STAR:
return "star";
226 default:
return "UNKNOWN";
235 : detail::wrapper<camera_realistic_aperture, tpbrt_camera_realistic_aperture_t>,
236 detail::with_variant<camera_realistic_aperture, camera_realistic_aperture_builtin, string> {
238 using wrapper::wrapper;
254 [[nodiscard]]
constexpr std::optional<string>
as_file_name() const noexcept {
256 return _native->as.file_name;
260 [[nodiscard]]
constexpr std::optional<camera_realistic_aperture_builtin>
as_builtin() const noexcept {
266 [[nodiscard]]
constexpr variant_type
to_variant() const noexcept {
269 case FILE_NAME:
return _native->as.file_name;
287 using wrapper::wrapper;
290 [[nodiscard]]
constexpr string lens_file() const noexcept {
return _native->lens_file; }
302 [[nodiscard]]
constexpr auto reflect() const noexcept {
311 struct camera : detail::wrapper<camera, tpbrt_camera_t>,
312 detail::with_variant<camera, camera_orthographic_params, camera_perspective_params, camera_spherical_params,
313 camera_realistic_params> {
315 using wrapper::wrapper;
348 [[nodiscard]]
constexpr std::optional<camera_orthographic_params>
as_orthographic() const noexcept {
350 return _native->as.orthographic;
354 [[nodiscard]]
constexpr std::optional<camera_perspective_params>
as_perspective() const noexcept {
356 return _native->as.perspective;
360 [[nodiscard]]
constexpr std::optional<camera_spherical_params>
as_spherical() const noexcept {
362 return _native->as.spherical;
366 [[nodiscard]]
constexpr std::optional<camera_realistic_params>
as_realistic() const noexcept {
368 return _native->as.realistic;
372 [[nodiscard]]
constexpr variant_type
to_variant() const noexcept {
377 case SPHERICAL:
return _native->as.spherical;
378 case REALISTIC:
return _native->as.realistic;
386 [[nodiscard]]
constexpr auto reflect() const noexcept {
constexpr std::string_view to_string(const accelerator_type type) noexcept
Converts accelerator_type enum value to string.
Definition accelerator.hpp:39
@ MAX_NUM
Count of available accelerator types.
camera_type
Used to declare camera type.
Definition camera.hpp:25
camera_realistic_aperture_builtin
Realistic camera aperture builtin type.
Definition camera.hpp:196
camera_spherical_mapping
Spherical camera mapping.
Definition camera.hpp:121
camera_realistic_aperture_type
Realistic camera aperture value type.
Definition camera.hpp:167
@ ORTHOGRAPHIC
Orthographic camera.
@ REALISTIC
Realistic camera.
@ SPHERICAL
Spherical camera.
@ PERSPECTIVE
Perspective camera.
@ GAUSSIAN
Gaussian aperture shape.
@ SQUARE
Square aperture shape.
@ STAR
Star aperture shape.
@ CIRCULAR
Circular aperture shape.
@ PENTAGON
Pentagon aperture shape.
@ EQUAL_AREA
An area-preserving mapping based on an octahedral encoding of the unit sphere is used.
@ EQUI_RECTANGULAR
An equirectangular mapping.
@ FILE_NAME
Aperture will be read from given file specifying an image to be used to specify the shape.
@ BUILTIN
Aperture value is a builtin aperture.
@ TPBRT_CAMERA_SPHERICAL_MAPPING_EQUI_RECTANGULAR
An equirectangular mapping.
Definition camera.h:77
@ TPBRT_CAMERA_SPHERICAL_MAPPING_EQUAL_AREA
An area-preserving mapping based on an octahedral encoding of the unit sphere is used.
Definition camera.h:75
@ TPBRT_CAMERA_SPHERICAL_MAPPING_MAX_NUM
Count of available spherical camera mappings.
Definition camera.h:79
@ TPBRT_CAMERA_REALISTIC_APERTURE_TYPE_BUILTIN
Aperture value is a builtin aperture.
Definition camera.h:99
@ TPBRT_CAMERA_REALISTIC_APERTURE_TYPE_MAX_NUM
Count of available realistic camera apertures.
Definition camera.h:101
@ TPBRT_CAMERA_REALISTIC_APERTURE_TYPE_FILE_NAME
Aperture will be read from given file specifying an image to be used to specify the shape.
Definition camera.h:97
@ TPBRT_CAMERA_REALISTIC_APERTURE_BUILTIN_GAUSSIAN
Gaussian aperture shape.
Definition camera.h:112
@ TPBRT_CAMERA_REALISTIC_APERTURE_BUILTIN_CIRCULAR
Circular aperture shape.
Definition camera.h:110
@ TPBRT_CAMERA_REALISTIC_APERTURE_BUILTIN_MAX_NUM
Count of available realistic camera builtin apertures.
Definition camera.h:120
@ TPBRT_CAMERA_REALISTIC_APERTURE_BUILTIN_SQUARE
Square aperture shape.
Definition camera.h:114
@ TPBRT_CAMERA_REALISTIC_APERTURE_BUILTIN_PENTAGON
Pentagon aperture shape.
Definition camera.h:116
@ TPBRT_CAMERA_REALISTIC_APERTURE_BUILTIN_STAR
Star aperture shape.
Definition camera.h:118
@ TPBRT_CAMERA_TYPE_PERSPECTIVE
Perspective camera.
Definition camera.h:28
@ TPBRT_CAMERA_TYPE_MAX_NUM
Count of available camera types.
Definition camera.h:34
@ TPBRT_CAMERA_TYPE_SPHERICAL
Spherical camera.
Definition camera.h:32
@ TPBRT_CAMERA_TYPE_REALISTIC
Realistic camera.
Definition camera.h:30
@ TPBRT_CAMERA_TYPE_ORTHOGRAPHIC
Orthographic camera.
Definition camera.h:26
tpbrt_uchar_t uchar_t
Unsigned char type.
Definition fwd.hpp:34
bool bool_t
Bool type.
Definition fwd.hpp:82
tpbrt_float_t float_t
Float type.
Definition fwd.hpp:97
Definition accelerator.hpp:14
Generic C++ array view with type conversion (a non owning view on memory owned by the C library).
Definition common.hpp:448
C++ wrapper for tpbrt_camera_orthographic_params_t.
Definition camera.hpp:60
constexpr float_t focal_distance() const noexcept
Returns focal_distance value.
Definition camera.hpp:77
constexpr screen_window_array_type screen_window() const noexcept
Returns screen_window value.
Definition camera.hpp:71
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition camera.hpp:80
constexpr float_t frame_aspect_ratio() const noexcept
Returns frame_aspect_ratio value.
Definition camera.hpp:68
constexpr float_t lens_radius() const noexcept
Returns lens_radius value.
Definition camera.hpp:74
C++ wrapper for tpbrt_camera_perspective_params_t.
Definition camera.hpp:89
constexpr float_t focal_distance() const noexcept
Returns focal_distance value.
Definition camera.hpp:106
constexpr screen_window_array_type screen_window() const noexcept
Returns screen_window value.
Definition camera.hpp:100
constexpr float_t lens_radius() const noexcept
Returns lens_radius value.
Definition camera.hpp:103
constexpr float_t fov() const noexcept
Returns fov value.
Definition camera.hpp:109
constexpr float_t frame_aspect_ratio() const noexcept
Returns frame_aspect_ratio value.
Definition camera.hpp:97
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition camera.hpp:112
C++ wrapper for tpbrt_camera_realistic_aperture_t.
Definition camera.hpp:236
constexpr bool_t is_builtin() const noexcept
Returns true if type is builtin.
Definition camera.hpp:251
constexpr std::optional< string > as_file_name() const noexcept
Returns camera realistic aperture as file name.
Definition camera.hpp:254
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition camera.hpp:278
constexpr camera_realistic_aperture_type type() const noexcept
Returns type value.
Definition camera.hpp:241
constexpr bool_t is_file_name() const noexcept
Returns true if type is file name.
Definition camera.hpp:246
constexpr std::optional< camera_realistic_aperture_builtin > as_builtin() const noexcept
Returns camera realistic aperture as builtin.
Definition camera.hpp:260
constexpr variant_type to_variant() const noexcept
Conversion to variant.
Definition camera.hpp:266
C++ wrapper for tpbrt_camera_realistic_params_t.
Definition camera.hpp:285
constexpr string lens_file() const noexcept
Returns lens_file value.
Definition camera.hpp:290
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition camera.hpp:302
constexpr float_t aperture_diameter() const noexcept
Returns aperture_diameter value.
Definition camera.hpp:293
constexpr float_t focus_distance() const noexcept
Returns focus_distance value.
Definition camera.hpp:296
constexpr camera_realistic_aperture aperture() const noexcept
Returns aperture value.
Definition camera.hpp:299
C++ wrapper for tpbrt_camera_spherical_params_t.
Definition camera.hpp:150
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition camera.hpp:160
constexpr camera_spherical_mapping mapping() const noexcept
Returns mapping value.
Definition camera.hpp:155
C++ wrapper for tpbrt_camera_t.
Definition camera.hpp:313
constexpr transform_animated transform() const noexcept
Returns transform value.
Definition camera.hpp:324
constexpr media_handle interior_media_handle() const noexcept
Returns interior_media_handle value.
Definition camera.hpp:327
constexpr float_t shutter_close() const noexcept
Returns shutter_close value.
Definition camera.hpp:321
constexpr bool_t is_orthographic() const noexcept
Returns true if type is orthographic.
Definition camera.hpp:336
constexpr bool_t is_realistic() const noexcept
Returns true if type is realistic.
Definition camera.hpp:345
constexpr camera_type type() const noexcept
Returns type value.
Definition camera.hpp:333
constexpr std::optional< camera_spherical_params > as_spherical() const noexcept
Returns camera parameters as spherical.
Definition camera.hpp:360
constexpr std::optional< camera_orthographic_params > as_orthographic() const noexcept
Returns camera parameters as orthographic.
Definition camera.hpp:348
constexpr std::optional< camera_perspective_params > as_perspective() const noexcept
Returns camera parameters as perspective.
Definition camera.hpp:354
constexpr std::optional< camera_realistic_params > as_realistic() const noexcept
Returns camera parameters as realistic.
Definition camera.hpp:366
constexpr bool_t is_spherical() const noexcept
Returns true if type is spherical.
Definition camera.hpp:342
constexpr float_t shutter_open() const noexcept
Returns shutter_open value.
Definition camera.hpp:318
constexpr media_handle exterior_media_handle() const noexcept
Returns exterior_media_handle value.
Definition camera.hpp:330
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition camera.hpp:386
constexpr variant_type to_variant() const noexcept
Conversion to variant.
Definition camera.hpp:372
constexpr bool_t is_perspective() const noexcept
Returns true if type is perspective.
Definition camera.hpp:339