Node.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00031
00032
00033 #ifndef _NODEOV_H
00034 #define _NODEOV_H
00035
00036 #include <openvideo/openVideo.h>
00037
00038 #include <vector>
00039 #include <string>
00040
00041 #include <openvideo/PixelFormat.h>
00042
00043 namespace openvideo {
00044 class State;
00051 class OPENVIDEO_API Node
00052 {
00053 public:
00057 Node();
00058
00062 virtual ~Node();
00063
00067 virtual void initPixelFormats()=0;
00068
00072 virtual bool validateCurrentPixelFormat();
00073
00077 virtual const char* getName();
00078
00083 virtual void init();
00084
00085
00090 virtual void start();
00091
00096 virtual void stop();
00097
00102 virtual void process();
00103
00108 virtual void postProcess();
00109
00114 virtual void preProcess();
00115
00122 virtual bool setParameter(std::string key, std::string value);
00123
00127 openvideo::State* getState();
00128
00129
00134 void addOutput( openvideo::Node * output);
00135
00141 void addInput( openvideo::Node * output);
00142
00146 std::vector<openvideo::Node*>* getOutputs();
00147
00151 std::vector<openvideo::Node*>* getInputs();
00152
00156 int getInDegree();
00157
00164 int getCurInDegree();
00165
00172 void decCurInDegree();
00173
00177 int getOutDegree();
00178
00184 int getCurOutDegree();
00185
00191 void decCurOutDegree();
00192
00196 void resetCurInOutDegree();
00197
00201 const char* getDefName();
00202
00203
00204 virtual const std::string& getTypeName() const { return typeName; }
00205
00206
00207 protected:
00211 std::vector<openvideo::Node*> outputs;
00212
00216 std::vector<openvideo::Node*> inputs;
00217
00221 openvideo::State *state;
00222
00228 int curInDegree;
00229
00235 int curOutDegree;
00236
00240 std::string name;
00241
00243 std::string typeName;
00244
00245
00249 std::string defName;
00250
00254 std::vector<PIXEL_FORMAT> pixelFormats;
00255
00256 PIXEL_FORMAT curPixelFormat;
00257 };
00258 }
00259
00260 #endif