My current code follows this: Drive> bytearray> QImage (or QPixmap)> Painter
QFile file("/path/to/file");
file.open(QIODevice::ReadOnly);
QByteArray blob = file.readAll();
file.close();
this->mRenderImg = new QImage();
this->mRenderImg->loadFromData(blob, "JPG");
QPainter p(this);
QRect target;
p.drawImage(target, *(this->mRenderImg));
Step 1 takes 0.5 s.
Step 2 takes 3.0s - decoding jpeg - the slowest step
Step 3 takes 0.1 s
Decrypting jpeg data seems to be the slowest step. How to make it faster?
Is there a third-party library that can convert bytearray from jpeg data to bytearray from ppm, which can be loaded into QImage faster?
Btw, Using QPixmap, the same time is executed as QImage.
source
share