OGLplus  (0.59.0) a C++ wrapper for rendering APIs

mix_node.hpp
Go to the documentation of this file.
1 #ifndef OGLPLUS_TEXGEN_MIX_NODE_HPP
9 #define OGLPLUS_TEXGEN_MIX_NODE_HPP
10 
11 #include "base_node.hpp"
12 #include "fallback_input.hpp"
13 
14 namespace eagine::oglp::texgen {
15 
16 class mix_output : public base_output {
17 public:
18  input_with_const_default<float[4]> zero;
19  input_with_const_default<float[4]> one;
20  input_with_const_default<float[1]> value;
21 
22  mix_output(node_intf& parent);
23 
24  string_view type_name() override;
25 
26  slot_data_type value_type() override;
27 
28  std::ostream& definitions(std::ostream& out, compile_context& ctxt) override;
29 };
30 
31 class mix_node : public single_output_node<mix_output> {
32 public:
33  mix_node& set_zero(float x, float y, float z, float w) {
34  _output.zero.fallback().set(x, y, z, w);
35  return *this;
36  }
37 
38  mix_node& set_one(float x, float y, float z, float w) {
39  _output.one.fallback().set(x, y, z, w);
40  return *this;
41  }
42 
43  mix_node& set_value(float v) {
44  _output.value.fallback().set(v);
45  return *this;
46  }
47 
48  span_size_t input_count() override;
49 
50  input_intf& input(span_size_t index) override;
51 };
52 
53 } // namespace eagine::oglp::texgen
54 
55 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
56 #include <oglplus/texgen/mix_node.inl>
57 #endif
58 
59 #endif // OGLPLUS_TEXGEN_MIX_NODE_HPP
value_type
Value tree value element data type enumeration.
Definition: interface.hpp:27
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
static auto type_name(const T &) noexcept -> std::string
Returns the demangled name for type T.
Definition: type_name.hpp:24
static auto zero(basic_span< T, P, S > spn) -> std::enable_if_t< std::is_integral_v< T >||std::is_floating_point_v< T >, basic_span< T, P, S >>
Fills a span with zero value of type T.
Definition: span_algo.hpp:548

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).