You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Apply suggestions from code review
Applying suggestions from @jonoomph
This commit is contained in:
@@ -968,13 +968,13 @@ cv::Mat Frame::GetImageCV()
|
||||
|
||||
std::shared_ptr<QImage> Frame::Mat2Qimage(cv::Mat img){
|
||||
cv::cvtColor(img, img, cv::COLOR_BGR2RGB);
|
||||
QImage qimg((uchar*) img.data, img.cols, img.rows, img.step, QImage::Format_RGB888);
|
||||
QImage qimg((uchar*) img.data, img.cols, img.rows, img.step, QImage::Format_RGBA8888_Premultiplied);
|
||||
|
||||
std::shared_ptr<QImage> imgIn = std::make_shared<QImage>(qimg.copy());
|
||||
|
||||
// Always convert to RGBA8888 (if different)
|
||||
if (imgIn->format() != QImage::Format_RGBA8888)
|
||||
*imgIn = imgIn->convertToFormat(QImage::Format_RGBA8888);
|
||||
if (imgIn->format() != QImage::Format_RGBA8888_Premultiplied)
|
||||
*imgIn = imgIn->convertToFormat(QImage::Format_RGBA8888_Premultiplied);
|
||||
|
||||
return imgIn;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user