#include <QApplication>
#include <QImage>
#include <QPainter>
#include <QTime>
#include <QDebug>
int main(int argc, char **argv)
{
frame.fill(Qt::white);
tex.fill(Qt::green);
timer.start();
for (int i = 0; i < 1000000; ++i) {
p.begin(&frame);
p.
drawImage(QRectF(100,
100,
128,
128), tex,
QRectF(128,
128,
128,
128), Qt
::AutoColor);
p.end();
}
// Copied 128x128x1000000 == 16,384,000,000 pixels, about 6500 milliseconds on my machine
qDebug() << "Done in" << timer.elapsed() << "msec";
frame.save("frame.png");
return 0;
}
#include <QApplication>
#include <QImage>
#include <QPainter>
#include <QTime>
#include <QDebug>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QImage frame(1024, 768, QImage::Format_RGB32);
frame.fill(Qt::white);
QImage tex(256, 256, QImage::Format_RGB32);
tex.fill(Qt::green);
QPainter p;
QTime timer;
timer.start();
for (int i = 0; i < 1000000; ++i) {
p.begin(&frame);
p.drawImage(QRectF(100, 100, 128, 128), tex, QRectF(128, 128, 128, 128), Qt::AutoColor);
p.end();
}
// Copied 128x128x1000000 == 16,384,000,000 pixels, about 6500 milliseconds on my machine
qDebug() << "Done in" << timer.elapsed() << "msec";
frame.save("frame.png");
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks