First set of 50 GPL attribution for CV-Contributors added
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / virtualvnode.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * Copyright (C) 2003-2016 Cinelerra CV contributors
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  *
21  */
22
23 #ifndef VIRTUALVNODE_H
24 #define VIRTUALVNODE_H
25
26 #include "fadeengine.inc"
27 #include "maskengine.inc"
28 #include "plugin.inc"
29 #include "renderengine.inc"
30 #include "vframe.inc"
31 #include "virtualnode.h"
32 #include "vrender.inc"
33
34 class VirtualVNode : public VirtualNode
35 {
36 public:
37 // construct as a module or a plugin
38         VirtualVNode(RenderEngine *renderengine,
39                 VirtualConsole *vconsole,
40                 Module *real_module,
41                 Plugin *real_plugin,
42                 Track *track,
43                 VirtualNode *parent_module);
44
45         ~VirtualVNode();
46
47 // expansions
48         VirtualNode* create_module(Plugin *real_plugin,
49                                                         Module *real_module,
50                                                         Track *track);
51         VirtualNode* create_plugin(Plugin *real_plugin);
52         void arm_attachmentpoint();
53
54 // Called by VirtualVConsole::process_buffer to process exit nodes.
55 // start_position - end of frame if reverse.  start of frame if forward.
56 // frame_rate - rate start_position is relative to
57 // use_opengl - if opengl is available for this step
58         int render(VFrame *output_temp,
59                 int64_t start_position,
60                 double frame_rate,
61                 int use_opengl);
62
63 // Read data from what comes before this node.
64         int read_data(VFrame *output_temp,
65                 int64_t start_position,
66                 double frame_rate,
67                 int use_opengl);
68
69 private:
70         int render_as_module(VFrame *video_out,
71                 VFrame *output_temp,
72                 int64_t start_position,
73                 double frame_rate,
74                 int use_opengl);
75         void render_as_plugin(VFrame *output_temp,
76                 int64_t start_position,
77                 double frame_rate,
78                 int use_opengl);
79
80         int render_projector(VFrame *input,
81                         VFrame *output,
82                         int64_t start_position,  // Start of input fragment in project if forward.  End of input fragment if reverse.
83                         double frame_rate,
84                         int use_opengl);
85
86         int render_fade(VFrame *output,        // start of output fragment
87                         int64_t start_position,  // start of input fragment in project if forward / end of input fragment if reverse
88                         double frame_rate,
89                         Autos *autos,
90                         int direction,
91                         int use_opengl);
92
93         void render_mask(VFrame *output_temp,
94                 int64_t start_position_project,
95                 double frame_rate,
96                 int use_opengl);
97
98         float alpha;
99 //      FadeEngine *fader;
100         MaskEngine *masker;
101 };
102
103
104 #endif