mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
A small speedup
This commit is contained in:
parent
73a872b237
commit
2a67a0698b
@ -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…
x
Reference in New Issue
Block a user