format: reformatting files

This commit is contained in:
2026-07-13 15:30:43 +08:00
parent 7522543c48
commit e5eeaddf2f
511 changed files with 274803 additions and 207140 deletions
+2 -2
View File
@@ -20,6 +20,6 @@ add_subdirectory(vectorscope)
add_subdirectory(waveform)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
${OLIVE_SOURCES}
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
widget/scope/histogram/histogram.h
widget/scope/histogram/histogram.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
widget/scope/histogram/histogram.h
widget/scope/histogram/histogram.cpp
PARENT_SCOPE
)
+4 -3
View File
@@ -190,7 +190,8 @@ void HistogramScope::DrawScopeSoftware(QPainter &p, const QImage &image)
max_count = qMax(max_count, b_counts[i]);
}
auto draw_channel = [&](const std::array<int, 256> &counts, const QColor &color) {
auto draw_channel = [&](const std::array<int, 256> &counts,
const QColor &color) {
QPen pen(color);
pen.setWidth(2);
p.setPen(pen);
@@ -198,8 +199,8 @@ void HistogramScope::DrawScopeSoftware(QPainter &p, const QImage &image)
QVector<QPointF> points;
points.reserve(256);
for (int i = 0; i < 256; ++i) {
float x = histogram_start_dim_x +
(float(i) / 255.0f) * histogram_dim_x;
float x =
histogram_start_dim_x + (float(i) / 255.0f) * histogram_dim_x;
float normalized = float(counts[i]) / float(max_count);
float y = histogram_start_dim_y +
histogram_dim_y *
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
widget/scope/scopebase/scopebase.h
widget/scope/scopebase/scopebase.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
widget/scope/scopebase/scopebase.h
widget/scope/scopebase/scopebase.cpp
PARENT_SCOPE
)
+9 -9
View File
@@ -96,16 +96,16 @@ void ScopeBase::UpdateSoftwareImage()
const int texture_width = static_cast<int>(width() * devicePixelRatioF());
const int texture_height = static_cast<int>(height() * devicePixelRatioF());
const VideoParams offscreen_params(
texture_width, texture_height, PixelFormat::U8,
VideoParams::kRGBAChannelCount);
const VideoParams offscreen_params(texture_width, texture_height,
PixelFormat::U8,
VideoParams::kRGBAChannelCount);
if (!software_tex_ || software_tex_->params() != offscreen_params) {
software_tex_ = renderer()->CreateTexture(offscreen_params);
software_buffer_.resize(
texture_width * texture_height *
VideoParams::GetBytesPerPixel(PixelFormat::U8,
VideoParams::kRGBAChannelCount));
VideoParams::kRGBAChannelCount));
}
if (!software_tex_ || software_tex_->IsDummy()) {
@@ -122,15 +122,15 @@ void ScopeBase::UpdateSoftwareImage()
job.SetForceOpaque(true);
renderer()->BlitColorManaged(job, software_tex_.get());
renderer()->DownloadFromTexture(software_tex_->id(), software_tex_->params(),
software_buffer_.data(), 0);
renderer()->DownloadFromTexture(software_tex_->id(),
software_tex_->params(),
software_buffer_.data(), 0);
software_image_ = QImage(
reinterpret_cast<const uchar *>(software_buffer_.constData()),
texture_width, texture_height,
texture_width *
VideoParams::GetBytesPerPixel(PixelFormat::U8,
VideoParams::kRGBAChannelCount),
texture_width * VideoParams::GetBytesPerPixel(
PixelFormat::U8, VideoParams::kRGBAChannelCount),
QImage::Format_RGBA8888_Premultiplied);
software_image_.setDevicePixelRatio(devicePixelRatioF());
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
widget/scope/vectorscope/vectorscope.h
widget/scope/vectorscope/vectorscope.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
widget/scope/vectorscope/vectorscope.h
widget/scope/vectorscope/vectorscope.cpp
PARENT_SCOPE
)
+4 -5
View File
@@ -160,14 +160,13 @@ void VectorscopeScope::DrawScopeSoftware(QPainter &p, const QImage &image)
float g = src[1] / 255.0f;
float b = src[2] / 255.0f;
float y = r * luma_coeffs[0] + g * luma_coeffs[1] +
b * luma_coeffs[2];
float y =
r * luma_coeffs[0] + g * luma_coeffs[1] + b * luma_coeffs[2];
float cb = (b - y) / qMax(2.0f * (1.0f - luma_coeffs[2]), 0.0001f);
float cr = (r - y) / qMax(2.0f * (1.0f - luma_coeffs[0]), 0.0001f);
QPointF point = center +
QPointF(cr * vectorscope_gain * radius,
-cb * vectorscope_gain * radius);
QPointF point = center + QPointF(cr * vectorscope_gain * radius,
-cb * vectorscope_gain * radius);
int px = qRound(point.x());
int py = qRound(point.y());
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
widget/scope/waveform/waveform.h
widget/scope/waveform/waveform.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
widget/scope/waveform/waveform.h
widget/scope/waveform/waveform.cpp
PARENT_SCOPE
)
+4 -3
View File
@@ -157,13 +157,14 @@ void WaveformScope::DrawScopeSoftware(QPainter &p, const QImage &image)
}
auto mark = [&](float value, int add_r, int add_g, int add_b) {
int scope_y = waveform_start_dim_y +
int((1.0f - value) * waveform_dim_y);
int scope_y =
waveform_start_dim_y + int((1.0f - value) * waveform_dim_y);
if (scope_y < waveform_start_dim_y ||
scope_y >= waveform_start_dim_y + waveform_dim_y) {
return;
}
QRgb *dst_line = reinterpret_cast<QRgb *>(buf.scanLine(scope_y));
QRgb *dst_line =
reinterpret_cast<QRgb *>(buf.scanLine(scope_y));
QRgb cur = dst_line[scope_x];
int nr = qMin(255, qRed(cur) + add_r);
int ng = qMin(255, qGreen(cur) + add_g);