You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Fixing regression with Waveform generation.
This commit is contained in:
@@ -203,16 +203,8 @@ std::shared_ptr<QImage> Frame::GetWaveform(int width, int height, int Red, int G
|
||||
float value = samples[sample] * 100.0;
|
||||
|
||||
// Append a line segment for each sample
|
||||
if (value != 0.0) {
|
||||
// LINE
|
||||
lines.push_back(QPointF(X,Y));
|
||||
lines.push_back(QPointF(X,Y-value));
|
||||
}
|
||||
else {
|
||||
// DOT
|
||||
lines.push_back(QPointF(X,Y));
|
||||
lines.push_back(QPointF(X,Y));
|
||||
}
|
||||
lines.push_back(QPointF(X,Y+1.0));
|
||||
lines.push_back(QPointF(X,(Y-value)+1.0));
|
||||
}
|
||||
|
||||
// Add Channel Label Coordinate
|
||||
@@ -235,7 +227,7 @@ std::shared_ptr<QImage> Frame::GetWaveform(int width, int height, int Red, int G
|
||||
QPen pen;
|
||||
pen.setColor(QColor(Red, Green, Blue, Alpha));
|
||||
pen.setWidthF(1.0);
|
||||
pen.setStyle(Qt::NoPen);
|
||||
pen.setStyle(Qt::SolidLine);
|
||||
painter.setPen(pen);
|
||||
|
||||
// Draw the waveform
|
||||
@@ -244,7 +236,7 @@ std::shared_ptr<QImage> Frame::GetWaveform(int width, int height, int Red, int G
|
||||
|
||||
// Resize Image (if requested)
|
||||
if (width != total_width || height != total_height) {
|
||||
QImage scaled_wave_image = wave_image->scaled(width, height, Qt::IgnoreAspectRatio, Qt::FastTransformation);
|
||||
QImage scaled_wave_image = wave_image->scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||
wave_image = std::make_shared<QImage>(scaled_wave_image);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user