1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

add sprout/numeric/dft.wave.hpp

fix constexpr -> inline constexpr
This commit is contained in:
bolero-MURAKAMI 2012-07-15 16:04:05 +09:00
parent e4a4d17207
commit f9d4b475b4
69 changed files with 420 additions and 378 deletions

View file

@ -15,17 +15,15 @@ namespace sprout {
// reflection
//
template<typename T>
SPROUT_CONSTEXPR auto color(
T&& t
) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(sprout::forward<T>(t))))
inline SPROUT_CONSTEXPR auto color(T&& t)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(sprout::forward<T>(t))))
-> decltype(sprout::darkroom::access::get<0>(sprout::forward<T>(t)))
{
return sprout::darkroom::access::get<0>(sprout::forward<T>(t));
}
template<typename T>
SPROUT_CONSTEXPR auto reflection(
T&& t
) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(sprout::forward<T>(t))))
inline SPROUT_CONSTEXPR auto reflection(T&& t)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(sprout::forward<T>(t))))
-> decltype(sprout::darkroom::access::get<1>(sprout::forward<T>(t)))
{
return sprout::darkroom::access::get<1>(sprout::forward<T>(t));
@ -36,13 +34,13 @@ namespace sprout {
// calc_reflection
//
template<typename Image, typename Unit>
SPROUT_CONSTEXPR auto calc_color(Image&& t, Unit const& u, Unit const& v) SPROUT_NOEXCEPT
inline SPROUT_CONSTEXPR auto calc_color(Image&& t, Unit const& u, Unit const& v) SPROUT_NOEXCEPT
-> decltype(sprout::forward<Image>(t).template operator()(u, v))
{
return sprout::forward<Image>(t).template operator()(u, v);
}
template<typename Image, typename Unit>
SPROUT_CONSTEXPR auto calc_reflection(Image&& t, Unit const& u, Unit const& v) SPROUT_NOEXCEPT
inline SPROUT_CONSTEXPR auto calc_reflection(Image&& t, Unit const& u, Unit const& v) SPROUT_NOEXCEPT
-> decltype(sprout::forward<Image>(t).template operator()(u, v))
{
return sprout::forward<Image>(t).template operator()(u, v);
@ -52,7 +50,7 @@ namespace sprout {
// calc_material
//
template<typename Material, typename Unit>
SPROUT_CONSTEXPR auto calc_material(Material const& mat, Unit const& u, Unit const& v)
inline SPROUT_CONSTEXPR auto calc_material(Material const& mat, Unit const& u, Unit const& v)
-> decltype(sprout::tuples::make_tuple(
sprout::darkroom::materials::calc_color(sprout::darkroom::materials::color(mat), u, v),
sprout::darkroom::materials::calc_reflection(sprout::darkroom::materials::reflection(mat), u, v)
@ -68,7 +66,7 @@ namespace sprout {
// make_material_image
//
template<typename ColorImage, typename ReflectionImage>
SPROUT_CONSTEXPR sprout::tuples::tuple<ColorImage, ReflectionImage>
inline SPROUT_CONSTEXPR sprout::tuples::tuple<ColorImage, ReflectionImage>
make_material_image(ColorImage const& col, ReflectionImage const& ref) {
return sprout::tuples::make_tuple(col, ref);
}