2#ifndef _TINYPBRT_TEXTURE_HPP_
3#define _TINYPBRT_TEXTURE_HPP_
44 default:
return "UNKNOWN";
52 struct texture_handle : detail::wrapper<texture_handle, tpbrt_texture_handle_t>,
53 detail::with_variant<texture_handle, texture_idx_t, spectrum> {
55 using wrapper::wrapper;
73 [[nodiscard]]
constexpr std::optional<texture_idx_t>
as_texture_idx() const noexcept {
75 return _native->as.texture_idx;
79 [[nodiscard]]
constexpr std::optional<spectrum>
as_spectrum() const noexcept {
81 return _native->as.spectrum;
85 [[nodiscard]]
constexpr variant_type
to_variant() const noexcept {
89 case SPECTRUM:
return _native->as.spectrum;
122 case FLOAT:
return "float";
125 default:
return "UNKNOWN";
173 case BILERP:
return "bilerp";
177 case DOTS:
return "dots";
178 case FBM:
return "fbm";
180 case MARBLE:
return "marble";
181 case MIX:
return "mix";
182 case PTEX:
return "ptex";
183 case SCALE:
return "scale";
184 case WINDY:
return "windy";
187 default:
return "UNKNOWN";
197 using wrapper::wrapper;
212 [[nodiscard]]
constexpr auto reflect() const noexcept {
return std::make_tuple(
v00(),
v01(),
v10(),
v11()); }
221 using wrapper::wrapper;
230 [[nodiscard]]
constexpr uint_t dimension() const noexcept {
return _native->dimension; }
242 using wrapper::wrapper;
248 [[nodiscard]]
constexpr auto reflect() const noexcept {
return std::make_tuple(
value()); }
257 using wrapper::wrapper;
266 [[nodiscard]]
constexpr vec dir() const noexcept {
return _native->dir; }
269 [[nodiscard]]
constexpr auto reflect() const noexcept {
return std::make_tuple(
tex1(),
tex2(),
dir()); }
278 using wrapper::wrapper;
297 template<texture_
class Class>
306 [[nodiscard]]
constexpr uint_t octaves() const noexcept {
return this->_native->octaves; }
309 [[nodiscard]]
constexpr float_t roughness() const noexcept {
return this->_native->roughness; }
360 case REPEAT:
return "repeat";
361 case BLACK:
return "black";
362 case CLAMP:
return "clamp";
364 default:
return "UNKNOWN";
395 case EWA:
return "ewa";
397 case POINT:
return "point";
399 default:
return "UNKNOWN";
427 case SRGB:
return "sRGB";
428 case LINEAR:
return "linear";
429 case GAMMA:
return "gamma";
431 default:
return "UNKNOWN";
441 using wrapper::wrapper;
444 [[nodiscard]]
constexpr string file_name() const noexcept {
return _native->file_name; }
450 [[nodiscard]]
constexpr float_t scale() const noexcept {
return _native->scale; }
453 [[nodiscard]]
constexpr opt_float gamma() const noexcept {
return _native->gamma; }
467 [[nodiscard]]
constexpr bool_t invert() const noexcept {
return _native->invert; }
470 [[nodiscard]]
constexpr auto reflect() const noexcept {
481 using wrapper::wrapper;
484 [[nodiscard]]
constexpr uint_t octaves() const noexcept {
return _native->octaves; }
490 [[nodiscard]]
constexpr float_t scale() const noexcept {
return _native->scale; }
496 [[nodiscard]]
constexpr auto reflect() const noexcept {
507 using wrapper::wrapper;
528 using wrapper::wrapper;
531 [[nodiscard]]
constexpr opt_float gamma() const noexcept {
return _native->gamma; }
534 [[nodiscard]]
constexpr string file_name() const noexcept {
return _native->file_name; }
537 [[nodiscard]]
constexpr float_t scale() const noexcept {
return _native->scale; }
545 [[nodiscard]]
constexpr auto reflect() const noexcept {
556 using wrapper::wrapper;
565 [[nodiscard]]
constexpr auto reflect() const noexcept {
return std::make_tuple(
tex(),
scale()); }
594 case UV:
return "uv";
597 case PLANAR:
return "planar";
599 default:
return "UNKNOWN";
609 using wrapper::wrapper;
612 [[nodiscard]]
constexpr float_t u_scale() const noexcept {
return _native->u_scale; }
615 [[nodiscard]]
constexpr float_t v_scale() const noexcept {
return _native->v_scale; }
618 [[nodiscard]]
constexpr float_t u_delta() const noexcept {
return _native->u_delta; }
621 [[nodiscard]]
constexpr float_t v_delta() const noexcept {
return _native->v_delta; }
624 [[nodiscard]]
constexpr auto reflect() const noexcept {
635 template<texture_mapping Mapping>
637 : detail::wrapper<texture_mapping_transform_params<Mapping>, tpbrt_texture_mapping_spherical_params_t> {
648 [[nodiscard]]
constexpr auto reflect() const noexcept {
return std::make_tuple(
transform()); }
670 using wrapper::wrapper;
673 [[nodiscard]]
constexpr float_t u_delta() const noexcept {
return _native->u_delta; }
676 [[nodiscard]]
constexpr float_t v_delta() const noexcept {
return _native->v_delta; }
679 [[nodiscard]]
constexpr vec v1() const noexcept {
return _native->v1; }
682 [[nodiscard]]
constexpr vec v2() const noexcept {
return _native->v2; }
693 : detail::wrapper<texture, tpbrt_texture_t>,
694 detail::with_variant<texture, texture_bilerp_params, texture_checkerboard_params, texture_constant_params,
695 texture_direction_mix_params, texture_dots_params, texture_fbm_params, texture_wrinkled_params, texture_windy_params,
696 texture_image_map_params, texture_marble_params, texture_mix_params, texture_ptex_params, texture_scale_params> {
702 using wrapper::wrapper;
708 [[nodiscard]]
constexpr string name() const noexcept {
return _native->name; }
758 [[nodiscard]]
constexpr std::optional<texture_bilerp_params>
as_bilerp() const noexcept {
759 if (!
is_bilerp()) {
return std::nullopt; }
760 return _native->as.bilerp;
764 [[nodiscard]]
constexpr std::optional<texture_checkerboard_params>
as_checkerboard() const noexcept {
766 return _native->as.checkerboard;
770 [[nodiscard]]
constexpr std::optional<texture_constant_params>
as_constant() const noexcept {
772 return _native->as.constant;
776 [[nodiscard]]
constexpr std::optional<texture_direction_mix_params>
as_direction_mix() const noexcept {
778 return _native->as.direction_mix;
782 [[nodiscard]]
constexpr std::optional<texture_dots_params>
as_dots() const noexcept {
783 if (!
is_dots()) {
return std::nullopt; }
784 return _native->as.dots;
788 [[nodiscard]]
constexpr std::optional<texture_fbm_params>
as_fbm() const noexcept {
789 if (!
is_fbm()) {
return std::nullopt; }
790 return _native->as.fbm;
794 [[nodiscard]]
constexpr std::optional<texture_wrinkled_params>
as_wrinkled() const noexcept {
796 return _native->as.wrinkled;
800 [[nodiscard]]
constexpr std::optional<texture_windy_params>
as_windy() const noexcept {
801 if (!
is_windy()) {
return std::nullopt; }
802 return _native->as.windy;
806 [[nodiscard]]
constexpr std::optional<texture_image_map_params>
as_image_map() const noexcept {
808 return _native->as.image_map;
812 [[nodiscard]]
constexpr std::optional<texture_marble_params>
as_marble() const noexcept {
813 if (!
is_marble()) {
return std::nullopt; }
814 return _native->as.marble;
818 [[nodiscard]]
constexpr std::optional<texture_mix_params>
as_mix() const noexcept {
819 if (!
is_mix()) {
return std::nullopt; }
820 return _native->as.mix;
824 [[nodiscard]]
constexpr std::optional<texture_ptex_params>
as_ptex() const noexcept {
825 if (!
is_ptex()) {
return std::nullopt; }
826 return _native->as.ptex;
830 [[nodiscard]]
constexpr std::optional<texture_scale_params>
as_scale() const noexcept {
831 if (!
is_scale()) {
return std::nullopt; }
832 return _native->as.scale;
836 [[nodiscard]]
constexpr variant_type
to_variant() const noexcept {
839 case BILERP:
return _native->as.bilerp;
841 case CONSTANT:
return _native->as.constant;
843 case DOTS:
return _native->as.dots;
847 case IMAGE_MAP:
return _native->as.image_map;
848 case MARBLE:
return _native->as.marble;
849 case MIX:
return _native->as.mix;
850 case PTEX:
return _native->as.ptex;
851 case SCALE:
return _native->as.scale;
878 [[nodiscard]]
constexpr std::optional<texture_mapping_uv_params>
mapping_as_uv() const noexcept {
880 return _native->mapping_as.uv;
884 [[nodiscard]]
constexpr std::optional<texture_mapping_spherical_params>
mapping_as_spherical() const noexcept {
886 return _native->mapping_as.spherical;
892 return _native->mapping_as.cylindrical;
896 [[nodiscard]]
constexpr std::optional<texture_mapping_planar_params>
mapping_as_planar() const noexcept {
898 return _native->mapping_as.planar;
905 case UV:
return _native->mapping_as.uv;
908 case PLANAR:
return _native->mapping_as.planar;
916 template<
class Visitor>
922 [[nodiscard]]
constexpr auto reflect() const noexcept {
941 using array::operator[];
951 detail::to_native_string(name));
969 return list.at(handle);
980 return list.at(name);
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.
@ SPHERICAL
Spherical camera.
@ CONSTANT
Spectrum defined as single constant float value.
@ SRGB
The venerable sRGB color space; it has the smallest gamut of pbrt-v4's color spaces,...
tpbrt_uchar_t uchar_t
Unsigned char type.
Definition fwd.hpp:34
@ POINT
Point light source.
tpbrt_uint_t uint_t
Unsigned int type.
Definition fwd.hpp:92
bool bool_t
Bool type.
Definition fwd.hpp:82
tpbrt_float_t float_t
Float type.
Definition fwd.hpp:97
tpbrt_texture_idx_t texture_idx_t
Texture index type.
Definition fwd.hpp:254
texture_encoding
Texture encoding types.
Definition texture.hpp:407
texture_noise_params< texture_class::FBM > texture_fbm_params
C++ wrapper for tpbrt_texture_fbm_params_t.
Definition texture.hpp:322
texture_noise_params< texture_class::WRINKLED > texture_wrinkled_params
C++ wrapper for tpbrt_texture_wrinkled_params_t.
Definition texture.hpp:328
result< texture > get_texture(const textures_list list, const texture_handle handle) noexcept
Returns texture to which handle is provided.
Definition texture.hpp:968
texture_class
Texture classes.
Definition texture.hpp:133
texture_handle_value_type
Texture handle value types.
Definition texture.hpp:23
texture_mapping
Texture mapping types.
Definition texture.hpp:572
texture_type
Textures types.
Definition texture.hpp:104
texture_wrap
Texture wrap types.
Definition texture.hpp:340
texture_filter
Texture filter types.
Definition texture.hpp:372
texture_mapping_transform_params< texture_mapping::CYLINDRICAL > texture_mapping_cylindrical_params
C++ wrapper for tpbrt_texture_mapping_cylindrical_params_t.
Definition texture.hpp:661
texture_noise_params< texture_class::WINDY > texture_windy_params
C++ wrapper for tpbrt_texture_windy_params_t.
Definition texture.hpp:334
texture_mapping_transform_params< texture_mapping::SPHERICAL > texture_mapping_spherical_params
C++ wrapper for tpbrt_texture_mapping_spherical_params_t.
Definition texture.hpp:655
@ GAMMA
Applies a gamma correction curve with the specified exponent.
@ LINEAR
Directly maps them, dividing their values by 255.
@ IMAGE_MAP
Image map texture.
@ WRINKLED
Wrinkled texture.
@ DIRECTION_MIX
Direction mix texture.
@ CHECKER_BOARD
Checker board texture.
@ CONSTANT
Constant texture.
@ TEXTURE_IDX
Texture index.
@ SPHERICAL
Spherical mapping.
@ UV
Based on the surface's (u,v) parameterization.
@ CYLINDRICAL
Cylindrical mapping.
@ BLACK
Returns black when outside the legal range.
@ REPEAT
Simply tiles the texture.
@ CLAMP
Always returns the nearest border texel.
@ TRILINEAR
Does trilinear interpolation between two MIP levels.
@ BILINEAR
Does bilinear sampling of a single MIP level.
@ EWA
Uses the high quality but much slower elliptically weighted average algorithm.
tpbrt_error_t tpbrt_get_texture_by_name(const tpbrt_textures_list_t *textures, tpbrt_string_t name, const tpbrt_texture_t **texture)
Returns pointer to texture with given name.
tpbrt_error_t tpbrt_get_texture_by_handle(const tpbrt_textures_list_t *textures, const tpbrt_texture_handle_t *handle, const tpbrt_texture_t **texture)
Returns pointer to texture to which handle is provided.
@ TPBRT_TEXTURE_WRAP_MAX_NUM
Count of available texture wrap types.
Definition texture.h:197
@ TPBRT_TEXTURE_WRAP_REPEAT
Simply tiles the texture.
Definition texture.h:191
@ TPBRT_TEXTURE_WRAP_BLACK
Returns black when outside the legal range.
Definition texture.h:193
@ TPBRT_TEXTURE_WRAP_CLAMP
Always returns the nearest border texel.
Definition texture.h:195
@ TPBRT_TEXTURE_TYPE_FLOAT
Float texture.
Definition texture.h:58
@ TPBRT_TEXTURE_TYPE_MAX_NUM
Count of available texture types.
Definition texture.h:62
@ TPBRT_TEXTURE_TYPE_SPECTRUM
Spectrum texture.
Definition texture.h:60
@ TPBRT_TEXTURE_FILTER_BILINEAR
Does bilinear sampling of a single MIP level.
Definition texture.h:206
@ TPBRT_TEXTURE_FILTER_TRILINEAR
Does trilinear interpolation between two MIP levels.
Definition texture.h:210
@ TPBRT_TEXTURE_FILTER_EWA
Uses the high quality but much slower elliptically weighted average algorithm.
Definition texture.h:208
@ TPBRT_TEXTURE_FILTER_POINT
Point sampling.
Definition texture.h:212
@ TPBRT_TEXTURE_FILTER_MAX_NUM
Count of available texture filter types.
Definition texture.h:214
@ TPBRT_TEXTURE_ENCODING_MAX_NUM
Count of available texture encoding types.
Definition texture.h:229
@ TPBRT_TEXTURE_ENCODING_SRGB
Applies the sRGB nonlinear mapping.
Definition texture.h:223
@ TPBRT_TEXTURE_ENCODING_GAMMA
Applies a gamma correction curve with the specified exponent.
Definition texture.h:227
@ TPBRT_TEXTURE_ENCODING_LINEAR
Directly maps them, dividing their values by 255.
Definition texture.h:225
@ TPBRT_TEXTURE_CLASS_WRINKLED
Wrinkled texture.
Definition texture.h:95
@ TPBRT_TEXTURE_CLASS_CONSTANT
Constant texture.
Definition texture.h:75
@ TPBRT_TEXTURE_CLASS_MIX
Mix texture.
Definition texture.h:87
@ TPBRT_TEXTURE_CLASS_BILERP
Bilerp texture.
Definition texture.h:71
@ TPBRT_TEXTURE_CLASS_PTEX
PTEX texture.
Definition texture.h:89
@ TPBRT_TEXTURE_CLASS_MAX_NUM
Count of available texture classes.
Definition texture.h:97
@ TPBRT_TEXTURE_CLASS_DOTS
Dots texture.
Definition texture.h:79
@ TPBRT_TEXTURE_CLASS_SCALE
Scale texture.
Definition texture.h:91
@ TPBRT_TEXTURE_CLASS_FBM
FBM texture.
Definition texture.h:81
@ TPBRT_TEXTURE_CLASS_WINDY
Windy texture.
Definition texture.h:93
@ TPBRT_TEXTURE_CLASS_MARBLE
Marble texture.
Definition texture.h:85
@ TPBRT_TEXTURE_CLASS_DIRECTION_MIX
Direction mix texture.
Definition texture.h:77
@ TPBRT_TEXTURE_CLASS_IMAGE_MAP
Image map texture.
Definition texture.h:83
@ TPBRT_TEXTURE_CLASS_CHECKER_BOARD
Checker board texture.
Definition texture.h:73
@ TPBRT_TEXTURE_MAPPING_UV
Based on the surface's (u,v) parameterization.
Definition texture.h:315
@ TPBRT_TEXTURE_MAPPING_SPHERICAL
Spherical mapping.
Definition texture.h:317
@ TPBRT_TEXTURE_MAPPING_PLANAR
Planar mapping.
Definition texture.h:321
@ TPBRT_TEXTURE_MAPPING_CYLINDRICAL
Cylindrical mapping.
Definition texture.h:319
@ TPBRT_TEXTURE_MAPPING_MAX_NUM
Count of available texture mapping types.
Definition texture.h:323
@ TPBRT_TEXTURE_HANDLE_VALUE_TYPE_SPECTRUM
Spectrum.
Definition texture.h:30
@ TPBRT_TEXTURE_HANDLE_VALUE_TYPE_MAX_NUM
Count of available texture handle value types.
Definition texture.h:32
@ TPBRT_TEXTURE_HANDLE_VALUE_TYPE_TEXTURE_IDX
Texture index.
Definition texture.h:28
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
constexpr result< element_type > at(const size_t index) const noexcept
Returns element on given index or error::INDEX_OUT_OF_RANGE.
Definition common.hpp:519
C++ wrapper for tpbrt_filter_t.
Definition filter.hpp:108
C++ wrapper for tpbrt_opt_float_t.
Definition math.hpp:24
Result of an operation: either a value or an error code (similar to C++23 std::expected).
Definition error.hpp:165
C++ wrapper for tpbrt_texture_bilerp_params_t.
Definition texture.hpp:195
constexpr texture_handle v00() const noexcept
Returns v00 value.
Definition texture.hpp:200
constexpr texture_handle v11() const noexcept
Returns v11 value.
Definition texture.hpp:209
constexpr texture_handle v10() const noexcept
Returns v10 value.
Definition texture.hpp:206
constexpr texture_handle v01() const noexcept
Returns v01 value.
Definition texture.hpp:203
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:212
C++ wrapper for tpbrt_texture_checkerboard_params_t.
Definition texture.hpp:219
constexpr uint_t dimension() const noexcept
Returns dimension value.
Definition texture.hpp:230
constexpr texture_handle tex2() const noexcept
Returns tex2 value.
Definition texture.hpp:227
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:233
constexpr texture_handle tex1() const noexcept
Returns tex1 value.
Definition texture.hpp:224
C++ wrapper for tpbrt_texture_constant_params_t.
Definition texture.hpp:240
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:248
constexpr texture_handle value() const noexcept
Returns value value.
Definition texture.hpp:245
C++ wrapper for tpbrt_texture_direction_mix_params_t.
Definition texture.hpp:255
constexpr texture_handle tex1() const noexcept
Returns tex1 value.
Definition texture.hpp:260
constexpr texture_handle tex2() const noexcept
Returns tex2 value.
Definition texture.hpp:263
constexpr vec dir() const noexcept
Returns dir value.
Definition texture.hpp:266
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:269
C++ wrapper for tpbrt_texture_dots_params_t.
Definition texture.hpp:276
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:287
constexpr texture_handle outside() const noexcept
Returns outside value.
Definition texture.hpp:284
constexpr texture_handle inside() const noexcept
Returns inside value.
Definition texture.hpp:281
C++ wrapper for tpbrt_texture_handle_t.
Definition texture.hpp:53
constexpr variant_type to_variant() const noexcept
Conversion to variant.
Definition texture.hpp:85
constexpr bool_t is_texture_idx() const noexcept
Returns true if type is texture_idx.
Definition texture.hpp:63
constexpr bool_t is_spectrum() const noexcept
Returns true if type is spectrum.
Definition texture.hpp:68
constexpr std::optional< spectrum > as_spectrum() const noexcept
Returns texture handle value as spectrum.
Definition texture.hpp:79
constexpr std::optional< texture_idx_t > as_texture_idx() const noexcept
Returns texture handle value as texture_idx.
Definition texture.hpp:73
constexpr texture_handle_value_type value_type() const noexcept
Returns value_type value.
Definition texture.hpp:58
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:97
C++ wrapper for tpbrt_texture_image_map_params_t.
Definition texture.hpp:439
constexpr opt_float gamma() const noexcept
Returns gamma value.
Definition texture.hpp:453
constexpr float_t max_anisotropy() const noexcept
Returns max_anisotropy value.
Definition texture.hpp:447
constexpr texture_wrap wrap() const noexcept
Returns wrap value.
Definition texture.hpp:456
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:470
constexpr texture_filter filter() const noexcept
Returns filter value.
Definition texture.hpp:459
constexpr float_t scale() const noexcept
Returns scale value.
Definition texture.hpp:450
constexpr texture_encoding encoding() const noexcept
Returns encoding value.
Definition texture.hpp:462
constexpr bool_t invert() const noexcept
Returns invert value.
Definition texture.hpp:467
constexpr string file_name() const noexcept
Returns file_name value.
Definition texture.hpp:444
C++ wrapper for tpbrt_texture_mapping_planar_params_t.
Definition texture.hpp:668
constexpr vec v1() const noexcept
Returns v1 value.
Definition texture.hpp:679
constexpr float_t u_delta() const noexcept
Returns u_delta value.
Definition texture.hpp:673
constexpr float_t v_delta() const noexcept
Returns v_delta value.
Definition texture.hpp:676
constexpr vec v2() const noexcept
Returns v2 value.
Definition texture.hpp:682
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:685
C++ wrapper for tpbrt_texture_mapping_spherical_params_t, shared by the spherical and cylindrical map...
Definition texture.hpp:637
static constexpr texture_mapping TextureMapping
Mapping described by these parameters.
Definition texture.hpp:639
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:648
constexpr transform_handle transform() const noexcept
Returns transform value.
Definition texture.hpp:645
C++ wrapper for tpbrt_texture_mapping_uv_params_t.
Definition texture.hpp:607
constexpr float_t v_delta() const noexcept
Returns v_delta value.
Definition texture.hpp:621
constexpr float_t u_scale() const noexcept
Returns u_scale value.
Definition texture.hpp:612
constexpr float_t v_scale() const noexcept
Returns v_scale value.
Definition texture.hpp:615
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:624
constexpr float_t u_delta() const noexcept
Returns u_delta value.
Definition texture.hpp:618
C++ wrapper for tpbrt_texture_marble_params_t.
Definition texture.hpp:479
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:496
constexpr float_t roughness() const noexcept
Returns roughness value.
Definition texture.hpp:487
constexpr float_t scale() const noexcept
Returns scale value.
Definition texture.hpp:490
constexpr uint_t octaves() const noexcept
Returns octaves value.
Definition texture.hpp:484
constexpr float_t variation() const noexcept
Returns variation value.
Definition texture.hpp:493
C++ wrapper for tpbrt_texture_mix_params_t.
Definition texture.hpp:505
constexpr texture_handle tex1() const noexcept
Returns tex1 value.
Definition texture.hpp:510
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:519
constexpr texture_handle amount() const noexcept
Returns amount value.
Definition texture.hpp:516
constexpr texture_handle tex2() const noexcept
Returns tex2 value.
Definition texture.hpp:513
C++ wrapper for tpbrt_texture_fbm_params_t, shared by the fbm, wrinkled and windy textures.
Definition texture.hpp:298
constexpr transform_handle transform() const noexcept
Returns transform value.
Definition texture.hpp:312
static constexpr texture_class TextureClass
Texture class described by these parameters.
Definition texture.hpp:300
constexpr float_t roughness() const noexcept
Returns roughness value.
Definition texture.hpp:309
constexpr uint_t octaves() const noexcept
Returns octaves value.
Definition texture.hpp:306
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:315
C++ wrapper for tpbrt_texture_ptex_params_t.
Definition texture.hpp:526
constexpr opt_float gamma() const noexcept
Returns gamma value.
Definition texture.hpp:531
constexpr float_t scale() const noexcept
Returns scale value.
Definition texture.hpp:537
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:545
constexpr string file_name() const noexcept
Returns file_name value.
Definition texture.hpp:534
constexpr texture_encoding encoding() const noexcept
Returns encoding value.
Definition texture.hpp:540
C++ wrapper for tpbrt_texture_scale_params_t.
Definition texture.hpp:554
constexpr texture_handle scale() const noexcept
Returns scale value.
Definition texture.hpp:562
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:565
constexpr texture_handle tex() const noexcept
Returns tex value.
Definition texture.hpp:559
C++ wrapper for tpbrt_texture_t.
Definition texture.hpp:696
constexpr std::optional< texture_windy_params > as_windy() const noexcept
Returns texture parameters as windy.
Definition texture.hpp:800
constexpr std::optional< texture_mapping_spherical_params > mapping_as_spherical() const noexcept
Returns texture mapping parameters as spherical.
Definition texture.hpp:884
constexpr std::optional< texture_bilerp_params > as_bilerp() const noexcept
Returns texture parameters as bilerp.
Definition texture.hpp:758
constexpr std::optional< texture_ptex_params > as_ptex() const noexcept
Returns texture parameters as ptex.
Definition texture.hpp:824
constexpr bool_t is_checkerboard() const noexcept
Returns true if type is checkerboard.
Definition texture.hpp:722
constexpr bool_t is_mix() const noexcept
Returns true if type is mix.
Definition texture.hpp:749
constexpr bool_t is_marble() const noexcept
Returns true if type is marble.
Definition texture.hpp:746
constexpr bool_t is_wrinkled() const noexcept
Returns true if type is wrinkled.
Definition texture.hpp:737
constexpr bool_t is_scale() const noexcept
Returns true if type is scale.
Definition texture.hpp:755
constexpr std::optional< texture_mapping_uv_params > mapping_as_uv() const noexcept
Returns texture mapping parameters as uv.
Definition texture.hpp:878
constexpr bool_t is_mapping_cylindrical() const noexcept
Returns true if type is cylindrical.
Definition texture.hpp:870
constexpr bool_t is_dots() const noexcept
Returns true if type is dots.
Definition texture.hpp:731
constexpr std::optional< texture_constant_params > as_constant() const noexcept
Returns texture parameters as constant.
Definition texture.hpp:770
constexpr string name() const noexcept
Returns name value.
Definition texture.hpp:708
constexpr bool_t is_windy() const noexcept
Returns true if type is windy.
Definition texture.hpp:740
constexpr bool_t is_image_map() const noexcept
Returns true if type is image_map.
Definition texture.hpp:743
constexpr std::optional< texture_mapping_planar_params > mapping_as_planar() const noexcept
Returns texture mapping parameters as planar.
Definition texture.hpp:896
constexpr bool_t is_mapping_planar() const noexcept
Returns true if type is planar.
Definition texture.hpp:875
constexpr variant_type to_variant() const noexcept
Conversion to variant.
Definition texture.hpp:836
constexpr bool_t is_bilerp() const noexcept
Returns true if type is bilerp.
Definition texture.hpp:719
constexpr bool_t is_direction_mix() const noexcept
Returns true if type is direction_mix.
Definition texture.hpp:728
constexpr bool_t is_mapping_uv() const noexcept
Returns true if type is uv.
Definition texture.hpp:864
constexpr std::optional< texture_fbm_params > as_fbm() const noexcept
Returns texture parameters as fbm.
Definition texture.hpp:788
constexpr std::optional< texture_mix_params > as_mix() const noexcept
Returns texture parameters as mix.
Definition texture.hpp:818
constexpr bool_t is_mapping_spherical() const noexcept
Returns true if type is spherical.
Definition texture.hpp:867
constexpr texture_mapping mapping() const noexcept
Returns mapping value.
Definition texture.hpp:859
constexpr texture_type type() const noexcept
Returns type value.
Definition texture.hpp:711
constexpr std::optional< texture_wrinkled_params > as_wrinkled() const noexcept
Returns texture parameters as wrinkled.
Definition texture.hpp:794
constexpr bool_t is_constant() const noexcept
Returns true if type is constant.
Definition texture.hpp:725
detail::optional_variant< texture_mapping_uv_params, texture_mapping_spherical_params, texture_mapping_cylindrical_params, texture_mapping_planar_params > mapping_variant_type
Type used for better reading mapping tagged union of parameters.
Definition texture.hpp:699
constexpr std::optional< texture_checkerboard_params > as_checkerboard() const noexcept
Returns texture parameters as checkerboard.
Definition texture.hpp:764
constexpr bool_t is_ptex() const noexcept
Returns true if type is ptex.
Definition texture.hpp:752
constexpr std::optional< texture_mapping_cylindrical_params > mapping_as_cylindrical() const noexcept
Returns texture mapping parameters as cylindrical.
Definition texture.hpp:890
constexpr texture_idx_t idx() const noexcept
Returns idx value.
Definition texture.hpp:705
constexpr std::optional< texture_marble_params > as_marble() const noexcept
Returns texture parameters as marble.
Definition texture.hpp:812
constexpr std::optional< texture_scale_params > as_scale() const noexcept
Returns texture parameters as scale.
Definition texture.hpp:830
constexpr std::optional< texture_direction_mix_params > as_direction_mix() const noexcept
Returns texture parameters as direction_mix.
Definition texture.hpp:776
constexpr texture_class tex_class() const noexcept
Returns tex_class value.
Definition texture.hpp:714
constexpr auto visit_mapping(Visitor &&visitor) const
Visits mapping parameters.
Definition texture.hpp:917
constexpr bool_t is_fbm() const noexcept
Returns true if type is fbm.
Definition texture.hpp:734
constexpr mapping_variant_type mapping_to_variant() const noexcept
Conversion to variant.
Definition texture.hpp:902
constexpr std::optional< texture_image_map_params > as_image_map() const noexcept
Returns texture parameters as image_map.
Definition texture.hpp:806
constexpr std::optional< texture_dots_params > as_dots() const noexcept
Returns texture parameters as dots.
Definition texture.hpp:782
constexpr auto reflect() const noexcept
Conversion to tuple.
Definition texture.hpp:922
C++ wrapper for tpbrt_textures_list_t.
Definition texture.hpp:933
result< element_type > operator[](const std::string_view name) const noexcept
Returns texture with given name.
Definition texture.hpp:958
result< element_type > at(const texture_handle handle) const noexcept
Returns texture pointed by given handle.
Definition texture.hpp:944
result< element_type > operator[](const texture_handle handle) const noexcept
Returns texture pointed by given handle.
Definition texture.hpp:955
result< element_type > at(const std::string_view name) const noexcept
Returns texture with given name.
Definition texture.hpp:949
C++ wrapper for tpbrt_vec3_t.
Definition math.hpp:132
FBM texture parameters.
Definition texture.h:165
Spherical texture mapping parameters.
Definition texture.h:345