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

posterize_node.hpp
Go to the documentation of this file.
1 #ifndef OGLPLUS_TEXGEN_POSTERIZE_NODE_HPP
9 #define OGLPLUS_TEXGEN_POSTERIZE_NODE_HPP
10 
11 #include "base_node.hpp"
12 #include "fallback_input.hpp"
13 
14 namespace eagine::oglp::texgen {
15 
16 class posterize_output : public base_output {
17 public:
18  input_with_const_default<float[4]> input;
19  input_with_const_default<float[4]> levels;
20 
21  posterize_output(node_intf& parent);
22 
23  string_view type_name() override;
24 
25  slot_data_type value_type() override;
26 
27  std::ostream& definitions(std::ostream& out, compile_context& ctxt) override;
28 };
29 
30 class posterize_node
31  : public binary_single_output_node<
32  posterize_output,
33  decltype(posterize_output::input),
34  &posterize_output::input,
35  decltype(posterize_output::levels),
36  &posterize_output::levels> {
37 public:
38  posterize_node& set_levels(float r, float g, float b, float a) {
39  _output.levels.fallback().set(r, g, b, a);
40  return *this;
41  }
42 };
43 
44 } // namespace eagine::oglp::texgen
45 
46 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
47 #include <oglplus/texgen/posterize_node.inl>
48 #endif
49 
50 #endif // OGLPLUS_TEXGEN_POSTERIZE_NODE_HPP
value_type
Value tree value element data type enumeration.
Definition: interface.hpp:27
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

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