mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
fix darkroom: fix template operator() member-function call -> calcurate() free-function
This commit is contained in:
parent
3cb882ce91
commit
dfcb6bcf31
25 changed files with 494 additions and 129 deletions
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/tuple/functions.hpp>
|
||||
#include <sprout/type_traits/identity.hpp>
|
||||
#include <sprout/darkroom/colors/rgb.hpp>
|
||||
#include <sprout/darkroom/coords/vector.hpp>
|
||||
|
||||
|
@ -83,6 +84,35 @@ namespace sprout {
|
|||
make_uniform_color(Color const& color) {
|
||||
return sprout::darkroom::renderers::uniform_color<Color>(color);
|
||||
}
|
||||
|
||||
//
|
||||
// infinity_result
|
||||
//
|
||||
template<typename Color, typename InfinityColor, typename Vector>
|
||||
struct infinity_result
|
||||
: public sprout::identity<Color>
|
||||
{};
|
||||
template<typename Color, typename InfinityColor, typename Vector>
|
||||
struct infinity_result<Color, InfinityColor const, Vector>
|
||||
: public sprout::darkroom::renderers::infinity_result<Color, InfinityColor, Vector>
|
||||
{};
|
||||
template<typename Color, typename InfinityColor, typename Vector>
|
||||
struct infinity_result<Color, InfinityColor volatile, Vector>
|
||||
: public sprout::darkroom::renderers::infinity_result<Color, InfinityColor, Vector>
|
||||
{};
|
||||
template<typename Color, typename InfinityColor, typename Vector>
|
||||
struct infinity_result<Color, InfinityColor const volatile, Vector>
|
||||
: public sprout::darkroom::renderers::infinity_result<Color, InfinityColor, Vector>
|
||||
{};
|
||||
|
||||
//
|
||||
// calculate_infinity
|
||||
//
|
||||
template<typename Color, typename InfinityColor, typename Vector>
|
||||
inline SPROUT_CONSTEXPR typename sprout::darkroom::renderers::infinity_result<Color, InfinityColor, Vector>::type
|
||||
calculate_infinity(InfinityColor const& infinity_color, Vector const& dir) {
|
||||
return infinity_color.template operator()<Color>(dir);
|
||||
}
|
||||
} // namespace renderers
|
||||
} // namespace darkroom
|
||||
} // namespace sprout
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue