mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-21 17:22:57 +02:00
A small speedup
This commit is contained in:
parent
73a872b237
commit
2a67a0698b
1 changed files with 1 additions and 2 deletions
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include <stdexcept>
|
||||
#include "imageops.h"
|
||||
#include <QColor>
|
||||
#include <QVector>
|
||||
#include <cmath>
|
||||
|
||||
|
|
@ -140,7 +139,7 @@ QImage grayscale(const QImage &image) { // {{{
|
|||
row = reinterpret_cast<QRgb*>(img.scanLine(r));
|
||||
for (pixel = row; pixel < row + width; pixel++) {
|
||||
gray = qGray(*pixel);
|
||||
*pixel = QColor(gray, gray, gray).rgba();
|
||||
*pixel = qRgb(gray, gray, gray);
|
||||
}
|
||||
}
|
||||
return img;
|
||||
|
|
|
|||
Loading…
Reference in a new issue