1.增加取图后默认保存图像,YUV和JPG各保存一张; 2.修复出现QTcpSocket对象的问题和QTcpSocket对象导致的线程安全问题

This commit is contained in:
2024-09-04 11:32:19 +08:00
parent c6e16094b9
commit 4bd2d7eab5
265 changed files with 226409 additions and 1611 deletions

View File

@@ -154,7 +154,10 @@ QImage convertYUV420ToQImage(const QByteArray& yuv420Data, int width, int height
void DataHandler::showPic(QSize labelSize, int lens_n,
int width, int height, int format, const QByteArray* valData)
{
//QByteArray yuvData = valData.mid(6);
qDebug() << "lens_n = " << lens_n;
qDebug() << "format = " << format;
qDebug() << "width = " << width;
qDebug() << "height = " << height;
qDebug() << "yuvData size = " << valData->size();
QImage image;
@@ -169,12 +172,10 @@ void DataHandler::showPic(QSize labelSize, int lens_n,
return;
}
// 旋转图像90度
QTransform transform;
transform.rotate(90); // 可以调整旋转角度
QImage rotatedImage = image.transformed(transform);
QImage scaledImage = rotatedImage.scaled(labelSize, Qt::KeepAspectRatio);
QImage scaledImage = rotatedImage.scaled(labelSize, Qt::KeepAspectRatio);
QPixmap pixmap = QPixmap::fromImage(scaledImage);
if (lens_n == 0) {
//leftLens_m_imageLabel->setPixmap(QPixmap::fromImage(scaledImage));