Lumiera  0.pre.03
»edit your freedom«
procnode.hpp
Go to the documentation of this file.
1 /*
2  PROCNODE.hpp - Key abstraction of the Render Engine: a Processing Node
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
40 #ifndef ENGINE_PROCNODE_H
41 #define ENGINE_PROCNODE_H
42 
43 #include "lib/error.hpp"
44 #include "steam/common.hpp"
45 #include "steam/state.hpp"
46 #include "steam/asset/proc.hpp"
49 #include "lib/frameid.hpp"
50 #include "lib/ref-array.hpp"
51 
52 #include <vector>
53 
54 
55 
56 namespace steam {
57 namespace engine {
58 
59  using std::vector;
61  using lumiera::NodeID;
62 
63  class ProcNode;
64  typedef ProcNode* PNode;
65 
66 
79  {
80  public: /* === public information record describing the node graph === */
81  uint nrO;
82  uint nrI;
83 
86 
87  typedef asset::Proc::ProcFunc ProcFunc;
88 
89  ProcFunc* procFunction;
90 
91  NodeID const& nodeID;
92 
93  virtual ~WiringDescriptor() {}
94 
95  protected:
98  ProcFunc pFunc, NodeID const& nID)
99  : out(o), in(i),
100  procFunction(pFunc),
101  nodeID(nID)
102  {
103  nrO = out.size();
104  nrI = in.size();
105  }
106 
107 
108  /* ==== strategy API for configuring the node operation ==== */
109 
110  friend class ProcNode;
111 
117  virtual BuffHandle
118  callDown (State& currentProcess, uint requiredOutputNr) const =0;
119 
120  };
121 
122 
123 
124 
135  class ProcNode
137  {
139  vector<Param> params;
140 
141  const WiringDescriptor& wiringConfig_;
142 
143  public:
144  ProcNode (WiringDescriptor const& wd)
145  : wiringConfig_(wd)
146  { }
147 
148  virtual ~ProcNode() {};
149 
150 
151  public:
152  bool isValid() const;
153 
155  uint nrO() { return wiringConfig_.nrO; }
156 
157 
170  BuffHandle
171  pull (State& currentProcess, uint requestedOutputNr=0) const
172  {
173  return this->wiringConfig_.callDown (currentProcess, requestedOutputNr);
174  }
175 
176  };
177 
178 
179  inline bool
180  ProcNode::isValid() const
181  {
182  UNIMPLEMENTED ("ProcNode validity self-check");
183  return false;
184  }
185 
186 
187 }} // namespace steam::engine
188 #endif
Abstraction to access the state of a currently ongoing render/calculation process, as it is tied to the supporting facilities of the vault layer.
Definition: state.hpp:59
Abstraction: Array of const references.
Definition: ref-array.hpp:48
Basic set of definitions and includes commonly used together.
Access point to an ongoing render&#39;s processing state.
Marker tuple to identify a specific frame.
uint nrO()
output channel count
Definition: procnode.hpp:155
Any copy and copy construction prohibited.
Definition: nocopy.hpp:46
Descriptor and access object for a plugin parameter.
Definition: parameter.hpp:49
Steam-Layer implementation namespace root.
Data processing Plugins and Codecs can be treated as a specific Kind of Asset.
Abstraction interface: array-like access by subscript.
Lumiera error handling (C++ interface).
Handle for a buffer for processing data, abstracting away the actual implementation.
Definition: buffhandle.hpp:115
Key abstraction of the Render Engine: A Data processing Node.
Definition: procnode.hpp:135
Identification tuple for denoting render nodes unambiguously.
Definition: frameid.hpp:51
Representation of the Media type of a data channel used within the engine.
Core abstraction: parameter to be controlled and possibly automated.
BuffHandle pull(State &currentProcess, uint requestedOutputNr=0) const
Engine Core operation: render and pull output from this node.
Definition: procnode.hpp:171
Interface: Description of the input and output ports, processing function and predecessor nodes for a...
Definition: procnode.hpp:78
virtual BuffHandle callDown(State &currentProcess, uint requiredOutputNr) const =0
the wiring-dependent part of the node operation.