我必须在QtGui中显示从相机捕获的图像。我正在从相机中读取图像并将其存储在unsigned char数组中。使用QImage我正在GUI中构建图像。图像采用bayers格式。如何在qt中将bayer转换为rgb格式?
代码 *加载数据并显示*
QImage image((const unsigned char*)data,imageWidth,imageHeight,QImage::Format_Indexed8);
this->scene->addPixmap((QPixmap::fromImage(image)).scaled(QSize((int)scene->width(),(int)scene->height()),Qt::IgnoreAspectRatio,Qt::SmoothTransformation));