Skip to content

Commit

Permalink
Fixing regression with Waveform generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonoomph committed Feb 18, 2021
1 parent 66eb3d5 commit 563c8fd
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/Frame.cpp
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 563c8fd

Please sign in to comment.