#ifndef SPROUT_DARKROOM_MATERIALS_MATERIAL_HPP #define SPROUT_DARKROOM_MATERIALS_MATERIAL_HPP #include #include #include #include #include namespace sprout { namespace darkroom { namespace materials { // // color // reflection // template SPROUT_CONSTEXPR auto color( T&& t ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<0>(sprout::forward(t))) { return sprout::darkroom::access::get<0>(sprout::forward(t)); } template SPROUT_CONSTEXPR auto reflection( T&& t ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<1>(sprout::forward(t))) { return sprout::darkroom::access::get<1>(sprout::forward(t)); } // // calc_color // calc_reflection // template SPROUT_CONSTEXPR auto calc_color(Image&& t, Position const&, Normal const&) SPROUT_NOEXCEPT -> decltype(t) { return t; } template SPROUT_CONSTEXPR auto calc_reflection(Image&& t, Position const&, Normal const&) SPROUT_NOEXCEPT -> decltype(t) { return t; } // // calc_material // template SPROUT_CONSTEXPR auto calc_material(Material const& mat, Position const& pos, Normal const& nor) -> decltype(sprout::tuples::make_tuple( sprout::darkroom::materials::calc_color(sprout::darkroom::materials::color(mat), pos, nor), sprout::darkroom::materials::calc_reflection(sprout::darkroom::materials::reflection(mat), pos, nor) )) { return sprout::tuples::make_tuple( sprout::darkroom::materials::calc_color(sprout::darkroom::materials::color(mat), pos, nor), sprout::darkroom::materials::calc_reflection(sprout::darkroom::materials::reflection(mat), pos, nor) ); } // // make_material_image // template SPROUT_CONSTEXPR sprout::tuples::tuple make_material_image(ColorImage const& col, ReflectionImage const& ref) { return sprout::tuples::make_tuple(col, ref); } // // material // typedef sprout::tuples::tuple material; } // namespace materials } // namespace darkroom } // namespace sprout #endif // #ifndef SPROUT_DARKROOM_MATERIALS_MATERIAL_HPP