MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / Mat2Qimage

Method Mat2Qimage

src/Frame.cpp:908–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906}
907
908std::shared_ptr<QImage> Frame::Mat2Qimage(cv::Mat img){
909 cv::cvtColor(img, img, cv::COLOR_BGR2RGB);
910 QImage qimg((uchar*) img.data, img.cols, img.rows, img.step, QImage::Format_RGB888);
911
912 std::shared_ptr<QImage> imgIn = std::make_shared<QImage>(qimg.copy());
913
914 // Always convert to RGBA8888 (if different)
915 if (imgIn->format() != QImage::Format_RGBA8888_Premultiplied)
916 *imgIn = imgIn->convertToFormat(QImage::Format_RGBA8888_Premultiplied);
917
918 return imgIn;
919}
920
921// Set pointer to OpenCV image object
922void Frame::SetImageCV(cv::Mat _image)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected