我有原始图像缓冲区。我正在使用以下代码将其转换为 jpeg:
height = 240;
width = 320;
raw_image=capture(width, height);//(c code uvc capture)
QImage tmpImage = QImage(raw_image, width, height, QImage::Format_RGB32 ); //image.format=RGB888
QByteArray im;
QBuffer bufferJpeg(&im);
bufferJpeg.open(QIODevice::WriteOnly);
tmpImage.save(&bufferJpeg, "JPG");
tmpImage.save("image1.jpg","JPG");
它正在捕获并将其转换为 jpeg。但是捕获的图像不正确。我附上了图片以供参考
对于 QImage tmpImage = QImage(raw_image, width, height, QImage::Format_RGB16 ); 图像是
对于 QImage tmpImage = QImage(raw_image, width, height, QImage::Format_RGB444);
我怎样才能得到正确的图像?提前致谢。