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
Co-authored-by: Frank Dana <ferdnyc@gmail.com>
This commit is contained in:
committed by
GitHub
parent
1fa4e878ca
commit
73bf7390e9
@@ -943,7 +943,7 @@ std::shared_ptr<QImage> Frame::GetImage()
|
||||
// Convert Qimage to Mat
|
||||
cv::Mat Frame::Qimage2mat( std::shared_ptr<QImage>& qimage) {
|
||||
|
||||
cv::Mat mat = cv::Mat(qimage->height(), qimage->width(), CV_8UC4, (uchar*)qimage->bits(), qimage->bytesPerLine()).clone();
|
||||
cv::Mat mat = cv::Mat(qimage->height(), qimage->width(), CV_8UC4, (const uchar*)qimage->constbits(), qimage->bytesPerLine()).clone();
|
||||
cv::Mat mat2 = cv::Mat(mat.rows, mat.cols, CV_8UC3 );
|
||||
int from_to[] = { 0,0, 1,1, 2,2 };
|
||||
cv::mixChannels( &mat, 1, &mat2, 1, from_to, 3 );
|
||||
|
||||
Reference in New Issue
Block a user