finished moving field data retrieving to row
This commit is contained in:
@@ -27,54 +27,42 @@
|
||||
CornerPinEffect::CornerPinEffect(Clip* c, const EffectMeta *em) : Effect(c, em) {
|
||||
SetFlags(Effect::CoordsFlag | Effect::ShaderFlag);
|
||||
|
||||
EffectRow* top_left = new EffectRow(this, tr("Top Left"));
|
||||
top_left_x = new DoubleField(top_left, "topleftx");
|
||||
top_left_y = new DoubleField(top_left, "toplefty");
|
||||
top_left = new Vec2Input(this, "topleft", tr("Top Left"));
|
||||
|
||||
EffectRow* top_right = new EffectRow(this, tr("Top Right"));
|
||||
top_right_x = new DoubleField(top_right, "toprightx");
|
||||
top_right_y = new DoubleField(top_right, "toprighty");
|
||||
top_right = new Vec2Input(this, "topright", tr("Top Right"));
|
||||
|
||||
EffectRow* bottom_left = new EffectRow(this, tr("Bottom Left"));
|
||||
bottom_left_x = new DoubleField(bottom_left, "bottomleftx");
|
||||
bottom_left_y = new DoubleField(bottom_left, "bottomlefty");
|
||||
bottom_left = new Vec2Input(this, "bottomleft", tr("Bottom Left"));
|
||||
|
||||
EffectRow* bottom_right = new EffectRow(this, tr("Bottom Right"));
|
||||
bottom_right_x = new DoubleField(bottom_right, "bottomrightx");
|
||||
bottom_right_y = new DoubleField(bottom_right, "bottomrighty");
|
||||
bottom_right = new Vec2Input(this, "bottomright", tr("Bottom Right"));
|
||||
|
||||
EffectRow* perspective_row = new EffectRow(this, tr("Perspective"));
|
||||
perspective = new BoolField(perspective_row, "perspective");
|
||||
perspective = new BoolInput(this, "perspective", tr("Perspective"));
|
||||
perspective->SetValueAt(0, true);
|
||||
|
||||
top_left_gizmo = add_gizmo(GIZMO_TYPE_DOT);
|
||||
top_left_gizmo->x_field1 = top_left_x;
|
||||
top_left_gizmo->y_field1 = top_left_y;
|
||||
top_left_gizmo->x_field1 = static_cast<DoubleField*>(top_left->Field(0));
|
||||
top_left_gizmo->y_field1 = static_cast<DoubleField*>(top_left->Field(1));
|
||||
|
||||
top_right_gizmo = add_gizmo(GIZMO_TYPE_DOT);
|
||||
top_right_gizmo->x_field1 = top_right_x;
|
||||
top_right_gizmo->y_field1 = top_right_y;
|
||||
top_right_gizmo->x_field1 = static_cast<DoubleField*>(top_right->Field(0));
|
||||
top_right_gizmo->y_field1 = static_cast<DoubleField*>(top_right->Field(1));
|
||||
|
||||
bottom_left_gizmo = add_gizmo(GIZMO_TYPE_DOT);
|
||||
bottom_left_gizmo->x_field1 = bottom_left_x;
|
||||
bottom_left_gizmo->y_field1 = bottom_left_y;
|
||||
bottom_left_gizmo->x_field1 = static_cast<DoubleField*>(bottom_left->Field(0));
|
||||
bottom_left_gizmo->y_field1 = static_cast<DoubleField*>(bottom_left->Field(1));
|
||||
|
||||
bottom_right_gizmo = add_gizmo(GIZMO_TYPE_DOT);
|
||||
bottom_right_gizmo->x_field1 = bottom_right_x;
|
||||
bottom_right_gizmo->y_field1 = bottom_right_y;
|
||||
bottom_right_gizmo->x_field1 = static_cast<DoubleField*>(bottom_right->Field(0));
|
||||
bottom_right_gizmo->y_field1 = static_cast<DoubleField*>(bottom_right->Field(1));
|
||||
|
||||
shader_vert_path_ = "cornerpin.vert";
|
||||
shader_frag_path_ = "cornerpin.frag";
|
||||
}
|
||||
|
||||
void CornerPinEffect::process_coords(double timecode, GLTextureCoords &coords, int) {
|
||||
coords.vertex_top_left += QVector3D(top_left_x->GetDoubleAt(timecode), top_left_y->GetDoubleAt(timecode), 0.0f);
|
||||
|
||||
coords.vertex_top_right += QVector3D(top_right_x->GetDoubleAt(timecode), top_right_y->GetDoubleAt(timecode), 0.0f);
|
||||
|
||||
coords.vertex_bottom_left += QVector3D(bottom_left_x->GetDoubleAt(timecode), bottom_left_y->GetDoubleAt(timecode), 0.0f);
|
||||
|
||||
coords.vertex_bottom_right += QVector3D(bottom_right_x->GetDoubleAt(timecode), bottom_right_y->GetDoubleAt(timecode), 0.0f);
|
||||
coords.vertex_top_left += top_left->GetVector2DAt(timecode);
|
||||
coords.vertex_top_right += top_right->GetVector2DAt(timecode);
|
||||
coords.vertex_bottom_left += bottom_left->GetVector2DAt(timecode);
|
||||
coords.vertex_bottom_right += bottom_right->GetVector2DAt(timecode);
|
||||
}
|
||||
|
||||
void CornerPinEffect::process_shader(double timecode, GLTextureCoords &coords, int) {
|
||||
|
||||
Reference in New Issue
Block a user