Olive
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
renderfunctions.h
Go to the documentation of this file.
1 /***
2 
3  Olive - Non-Linear Video Editor
4  Copyright (C) 2019 Olive Team
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 ***/
20 
21 #ifndef RENDERFUNCTIONS_H
22 #define RENDERFUNCTIONS_H
23 
24 #include <QOpenGLContext>
25 #include <QVector>
26 #include <QOpenGLShaderProgram>
27 
28 #include "timeline/sequence.h"
29 #include "effects/effect.h"
30 #include "panels/viewer.h"
31 
38 
45 
53  QOpenGLContext* ctx;
54 
62 
69  QVector<Clip*> nests;
70 
76  bool video;
77 
84 
106 
122 
131 
143  QOpenGLShaderProgram* blend_mode_program;
144 
155  QOpenGLShaderProgram* premultiply_program;
156 
164  GLuint main_buffer;
165 
174 
182 
190 
198 
206 
210  QOpenGLShaderProgram* ocio_shader;
211 
216 };
217 
218 namespace olive {
219 namespace rendering {
243 
267 void compose_audio(Viewer* viewer, Sequence *seq, int playback_speed, bool wait_for_mutexes);
268 }
269 }
270 
292 long rescale_frame_number(long framenumber, double source_frame_rate, double target_frame_rate);
293 
312 double get_timecode(Clip *c, long playhead);
313 
332 long playhead_to_clip_frame(Clip* c, long playhead);
333 
353 double playhead_to_clip_seconds(Clip *c, long playhead);
354 
373 int64_t seconds_to_timestamp(Clip* c, double seconds);
374 
393 int64_t playhead_to_timestamp(Clip *c, long playhead);
394 
407 
408 #endif // RENDERFUNCTIONS_H
GLuint main_buffer
The OpenGL framebuffer object that the final texture to be shown is rendered to.
Definition: renderfunctions.h:164
GLuint backend_attachment2
Backend OpenGL framebuffer 2&#39;s texture attachment.
Definition: renderfunctions.h:205
void compose_audio(Viewer *viewer, Sequence *seq, int playback_speed, bool wait_for_mutexes)
Convenience wrapper function for compose_sequence() to render audio.
Definition: renderfunctions.cpp:663
Viewer * viewer
Reference to the Viewer class that&#39;s calling compose_sequence()
Definition: renderfunctions.h:44
QOpenGLShaderProgram * premultiply_program
Premultiply alpha shader.
Definition: renderfunctions.h:155
double playhead_to_clip_seconds(Clip *c, long playhead)
Converts the playhead to clip seconds.
Definition: renderfunctions.cpp:688
The ComposeSequenceParams struct.
Definition: renderfunctions.h:37
QOpenGLShaderProgram * blend_mode_program
Blending mode shader.
Definition: renderfunctions.h:143
Definition: viewer.h:44
bool wait_for_mutexes
Run all cachers in the same thread that compose_sequence() is in.
Definition: renderfunctions.h:121
long rescale_frame_number(long framenumber, double source_frame_rate, double target_frame_rate)
Rescale a frame number between two frame rates.
Definition: renderfunctions.cpp:676
GLuint ocio_lut_texture
OpenGL texture containing LUT obtained form OpenColorIO.
Definition: renderfunctions.h:215
Effect * gizmos
Set to the Effect whose gizmos were chosen to be drawn on screen.
Definition: renderfunctions.h:83
GLuint backend_buffer1
Backend OpenGL framebuffer 1 used for further processing before rendering to main_buffer.
Definition: renderfunctions.h:181
int64_t playhead_to_timestamp(Clip *c, long playhead)
Convert Timeline playhead to FFmpeg timestamp.
Definition: renderfunctions.cpp:708
Definition: clip.h:56
int playback_speed
Set the current playback speed (adjusted with Shuttle Left/Right)
Definition: renderfunctions.h:130
bool video
Set compose mode to video or audio.
Definition: renderfunctions.h:76
QOpenGLShaderProgram * ocio_shader
OpenGL shader containing OpenColorIO shader information.
Definition: renderfunctions.h:210
double get_timecode(Clip *c, long playhead)
Get timecode.
Definition: renderfunctions.cpp:680
QOpenGLContext * ctx
The OpenGL context to use while rendering.
Definition: renderfunctions.h:53
int64_t seconds_to_timestamp(Clip *c, double seconds)
Convert seconds to FFmpeg timestamp.
Definition: renderfunctions.cpp:704
Sequence * seq
The sequence to compose.
Definition: renderfunctions.h:61
QVector< Clip * > nests
Array to store the nested sequence hierarchy.
Definition: renderfunctions.h:69
GLuint backend_buffer2
Backend OpenGL framebuffer 2 used for further processing before rendering to main_buffer.
Definition: renderfunctions.h:197
GLuint compose_sequence(ComposeSequenceParams &params)
Compose a frame of a given sequence.
Definition: renderfunctions.cpp:165
long playhead_to_clip_frame(Clip *c, long playhead)
Convert playhead frame number to a clip frame number.
Definition: renderfunctions.cpp:684
Definition: sequence.h:31
GLuint main_attachment
The attachment to the framebuffer in main_buffer.
Definition: renderfunctions.h:173
void close_active_clips(Sequence *s)
Close all open clips in a Sequence.
Definition: renderfunctions.cpp:712
GLuint backend_attachment1
Backend OpenGL framebuffer 1&#39;s texture attachment.
Definition: renderfunctions.h:189
Definition: effect.h:136
bool texture_failed
A variable that compose_sequence() will set to TRUE if any of the clips couldn&#39;t be shown...
Definition: renderfunctions.h:105