/*============================================================================= Copyright (c) 2011-2013 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #ifndef SPROUT_DARKROOM_MATERIALS_UNIFORM_HPP #define SPROUT_DARKROOM_MATERIALS_UNIFORM_HPP #include #include namespace sprout { namespace darkroom { namespace materials { // // uniform_element // template class uniform_element { public: typedef Element result_type; private: result_type elem_; public: explicit SPROUT_CONSTEXPR uniform_element(result_type const& elem) : elem_(elem) {} template SPROUT_CONSTEXPR result_type operator()(Unit const&, Unit const&) const { return elem_; } }; // // make_uniform // template inline SPROUT_CONSTEXPR sprout::darkroom::materials::uniform_element make_uniform(Element const& elem) { return sprout::darkroom::materials::uniform_element(elem); } // // make_uniform_material_image // template inline SPROUT_CONSTEXPR sprout::tuples::tuple< sprout::darkroom::materials::uniform_element, sprout::darkroom::materials::uniform_element > make_uniform_material_image(Color const& col, Reflection const& ref) { return sprout::tuples::make_tuple( sprout::darkroom::materials::make_uniform(col), sprout::darkroom::materials::make_uniform(ref) ); } } // namespace materials } // namespace darkroom } // namespace sprout #endif // #ifndef SPROUT_DARKROOM_MATERIALS_UNIFORM_HPP