#include "effects.h" #include #include #include #include "project/clip.h" #include "project/sequence.h" #define SMPTE_BARS 7 #define SMPTE_STRIP_COUNT 3 #define SMPTE_LOWER_BARS 4 bool solid = false; SolidEffect::SolidEffect(Clip* c) : Effect(c, EFFECT_TYPE_VIDEO, VIDEO_SOLID_EFFECT), texture(NULL) { update_texture(); } void SolidEffect::update_texture() { QImage img(parent_clip->sequence->width, parent_clip->sequence->height, QImage::Format_RGB888); if (solid) { img.fill(Qt::red); } else { // draw smpte bars img.fill(Qt::black); QPainter p(&img); int bar_width = qCeil((double) parent_clip->sequence->width / 7.0); int first_bar_height = qCeil((double) parent_clip->sequence->height / 3.0 * 2.0); int second_bar_height = qCeil((double) parent_clip->sequence->height / 12.5); int third_bar_y = first_bar_height + second_bar_height; int third_bar_height = parent_clip->sequence->height - third_bar_y; int third_bar_width = 0; int bar_x, strip_width; QColor first_color, second_color, third_color; for (int i=0;idestroy(); texture->setData(img); } field_changed(); } void SolidEffect::post_gl() { if (texture != NULL) { texture->bind(); int half_width = parent_clip->sequence->width/2; int half_height = parent_clip->sequence->height/2; glBegin(GL_QUADS); glTexCoord2f(0.0, 0.0); glVertex2f(-half_width, -half_height); glTexCoord2f(1.0, 0.0); glVertex2f(half_width, -half_height); glTexCoord2f(1.0, 1.0); glVertex2f(half_width, half_height); glTexCoord2f(0.0, 1.0); glVertex2f(-half_width, half_height); glEnd(); texture->release(); } }