added perspective option to corner pin

This commit is contained in:
itsmattkc
2018-11-13 02:39:15 +11:00
parent f9685d5913
commit 6495c5768d
57 changed files with 416 additions and 80 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef AUDIONOISEEFFECT_H
#define AUDIONOISEEFFECT_H
#include "../effect.h"
#include "project/effect.h"
class AudioNoiseEffect : public Effect {
public:
+21 -1
View File
@@ -1,7 +1,12 @@
#include "cornerpineffect.h"
#include "io/path.h"
#include "project/clip.h"
#include "debug.h"
CornerPinEffect::CornerPinEffect(Clip *c, const EffectMeta *em) : Effect(c, em) {
enable_coords = true;
enable_shader = true;
EffectRow* top_left = add_row("Top Left:");
top_left_x = top_left->add_field(EFFECT_FIELD_DOUBLE);
@@ -27,6 +32,9 @@ CornerPinEffect::CornerPinEffect(Clip *c, const EffectMeta *em) : Effect(c, em)
bottom_right_y = bottom_right->add_field(EFFECT_FIELD_DOUBLE);
bottom_right_y->id = "bottomrighty";
perspective = add_row("Perspective:")->add_field(EFFECT_FIELD_BOOL);
perspective->set_bool_value(false);
connect(top_left_x, SIGNAL(changed()), this, SLOT(field_changed()));
connect(top_left_y, SIGNAL(changed()), this, SLOT(field_changed()));
connect(top_right_x, SIGNAL(changed()), this, SLOT(field_changed()));
@@ -35,6 +43,10 @@ CornerPinEffect::CornerPinEffect(Clip *c, const EffectMeta *em) : Effect(c, em)
connect(bottom_left_y, SIGNAL(changed()), this, SLOT(field_changed()));
connect(bottom_right_x, SIGNAL(changed()), this, SLOT(field_changed()));
connect(bottom_right_y, SIGNAL(changed()), this, SLOT(field_changed()));
connect(perspective, SIGNAL(changed()), this, SLOT(field_changed()));
vertPath = "cornerpin.vert";
fragPath = "cornerpin.frag";
}
void CornerPinEffect::process_coords(double timecode, GLTextureCoords &coords) {
@@ -48,5 +60,13 @@ void CornerPinEffect::process_coords(double timecode, GLTextureCoords &coords) {
coords.vertexBottomLeftY += bottom_left_y->get_double_value(timecode);
coords.vertexBottomRightX += bottom_right_x->get_double_value(timecode);
coords.vertexBottomRightY += bottom_right_y->get_double_value(timecode);
coords.vertexBottomRightY += bottom_right_y->get_double_value(timecode);
}
void CornerPinEffect::process_shader(double timecode, GLTextureCoords &coords) {
glslProgram->setUniformValue("p0", (GLfloat) coords.vertexBottomLeftX, (GLfloat) coords.vertexBottomLeftY);
glslProgram->setUniformValue("p1", (GLfloat) coords.vertexBottomRightX, (GLfloat) coords.vertexBottomRightY);
glslProgram->setUniformValue("p2", (GLfloat) coords.vertexTopLeftX, (GLfloat) coords.vertexTopLeftY);
glslProgram->setUniformValue("p3", (GLfloat) coords.vertexTopRightX, (GLfloat) coords.vertexTopRightY);
glslProgram->setUniformValue("perspective", perspective->get_bool_value(timecode));
}
+4 -2
View File
@@ -1,13 +1,14 @@
#ifndef CORNERPINEFFECT_H
#define CORNERPINEFFECT_H
#include "../effect.h"
#include "project/effect.h"
class CornerPinEffect : public Effect {
Q_OBJECT
public:
CornerPinEffect(Clip* c, const EffectMeta* em);
void process_coords(double timecode, GLTextureCoords& coords);
void process_coords(double timecode, GLTextureCoords& coords);
void process_shader(double timecode, GLTextureCoords& coords);
private:
EffectField* top_left_x;
EffectField* top_left_y;
@@ -17,6 +18,7 @@ private:
EffectField* bottom_left_y;
EffectField* bottom_right_x;
EffectField* bottom_right_y;
EffectField* perspective;
};
#endif // CORNERPINEFFECT_H
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef CROSSDISSOLVETRANSITION_H
#define CROSSDISSOLVETRANSITION_H
#include "../effect.h"
#include "project/effect.h"
class CrossDissolveTransition : public Effect {
public:
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef EXPONENTIALFADETRANSITION_H
#define EXPONENTIALFADETRANSITION_H
#include "../effect.h"
#include "project/effect.h"
class ExponentialFadeTransition : public Effect {
public:
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef LINEARFADETRANSITION_H
#define LINEARFADETRANSITION_H
#include "../effect.h"
#include "project/effect.h"
class LinearFadeTransition : public Effect {
public:
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef LOGARITHMICFADETRANSITION_H
#define LOGARITHMICFADETRANSITION_H
#include "../effect.h"
#include "project/effect.h"
class LogarithmicFadeTransition : public Effect {
public:
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef PANEFFECT_H
#define PANEFFECT_H
#include "../effect.h"
#include "project/effect.h"
class PanEffect : public Effect {
public:
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef SHAKEEFFECT_H
#define SHAKEEFFECT_H
#include "../effect.h"
#include "project/effect.h"
#define RANDOM_VAL_SIZE 30
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef SOLIDEFFECT_H
#define SOLIDEFFECT_H
#include "../effect.h"
#include "project/effect.h"
class QOpenGLTexture;
#include <QImage>
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef TEXTEFFECT_H
#define TEXTEFFECT_H
#include "../effect.h"
#include "project/effect.h"
#include <QFont>
#include <QImage>
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef TONEEFFECT_H
#define TONEEFFECT_H
#include "../effect.h"
#include "project/effect.h"
class ToneEffect : public Effect {
public:
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef TRANSFORMEFFECT_H
#define TRANSFORMEFFECT_H
#include "../effect.h"
#include "project/effect.h"
class TransformEffect : public Effect {
Q_OBJECT
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef VOLUMEEFFECT_H
#define VOLUMEEFFECT_H
#include "../effect.h"
#include "project/effect.h"
class VolumeEffect : public Effect {
public: