From 2a67a0698ba93303823fb3a337ff864342e4a1e2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 May 2016 17:47:41 +0530 Subject: [PATCH] A small speedup --- src/calibre/utils/imageops/imageops.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/calibre/utils/imageops/imageops.cpp b/src/calibre/utils/imageops/imageops.cpp index 788fd23a69..5d56d6bce3 100644 --- a/src/calibre/utils/imageops/imageops.cpp +++ b/src/calibre/utils/imageops/imageops.cpp @@ -7,7 +7,6 @@ #include #include "imageops.h" -#include #include #include @@ -140,7 +139,7 @@ QImage grayscale(const QImage &image) { // {{{ row = reinterpret_cast(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;