![]() ![]() I expect an even better performance improvement. You may use other libraries like opencv to make the grayscale conversion and then build the Qimage from an opencv buffer.You already get an important performance boost just by inverting the loops. ![]() GreaterThan(QT_MAJOR_VERSION, 4): QT += widgets Testimage.cpp file: #include "testimage.h" ********* Finished testing of TestImage ********* PLEASE NOTE: Colors may different from what you see on screen due to monitor calibration settings, printout settings and material type. *rgbpixel = QColor(gray, gray, gray).rgba() Ī quick test with an 3585 x 2386 image gave ********* Start testing of TestImage *********Ĭonfig: Using QTest library 4.7.4, Qt 4.7.4ģ90 msecs per iteration (total: 390, iterations: 1)ġ25 msecs per iteration (total: 125, iterations: 1) Which gives : for (int ii = 0 ii (scan + jj*depth) Finally always put the x coordinate in the inner loop. Assuming you have a 32 bpp image, you can use QRgb to iterate over the scan. Pixels on a scan (horizontal line ) are consecutive. Rather than using the slow functions QImage::pixel and QImage::setPixel, use ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |