diff --git a/Src/Video/cffmpeg_decode.cpp b/Src/Video/cffmpeg_decode.cpp index e782825..ebd601a 100644 --- a/Src/Video/cffmpeg_decode.cpp +++ b/Src/Video/cffmpeg_decode.cpp @@ -145,9 +145,6 @@ bool Cffmpeg_decode::open_input_file() { decoderCtx->height, // AV_PIX_FMT_RGB32, // SWS_BICUBIC, NULL, NULL, NULL); - // 颜色空间调整(可选) - // sws_setColorspaceDetails(swsCtx, sws_getCoefficients(SWS_CS_DEFAULT), 0, - // sws_getCoefficients(SWS_CS_DEFAULT), 0, 0, 0, 0); numBytes = av_image_get_buffer_size(AV_PIX_FMT_RGB32, // decoderCtx->width, // decoderCtx->height, // diff --git a/Src/Video/ffmpegvideodlg.cpp b/Src/Video/ffmpegvideodlg.cpp index dfcee90..c6dce82 100644 --- a/Src/Video/ffmpegvideodlg.cpp +++ b/Src/Video/ffmpegvideodlg.cpp @@ -77,6 +77,8 @@ void ffmpegvideoDlg::stop() { // 绘图事件 void ffmpegvideoDlg::paintEvent(QPaintEvent *) { QPainter painter(this); + // 开启抗锯齿 + painter.setRenderHint(QPainter::Antialiasing, true); painter.drawImage(m_ax, m_ay, img); } @@ -105,7 +107,8 @@ void ffmpegvideoDlg::receiveQImage(const QImage &rImg) { // img = rImg.scaled(this->size()); QSize imgsize(m_setVideoAreaWidth, m_setVideoAreaHeight); - img = rImg.scaled(imgsize); + // 使用平滑缩放模式来减少图像模糊 + img = rImg.scaled(imgsize, Qt::KeepAspectRatio, Qt::SmoothTransformation); update(); } // 显示不同提示消息