[poppler] poppler/GfxState.cc
Carlos Garcia Campos
carlosgc at kemper.freedesktop.org
Mon Jun 21 08:25:03 PDT 2010
poppler/GfxState.cc | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 65c14073a3b1035ca5fe3bd6667abd315272841e
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date: Mon Jun 21 17:19:22 2010 +0200
Reduce pow operations in GfxCalRGBColorSpace::getXYZ()
We were doing the same pow operation 3 times!. It makes document
attached to bug #28591 render a little faster.
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 76cb010..61dac24 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -909,12 +909,12 @@ void GfxCalRGBColorSpace::getXYZ(GfxColor *color,
double *pX, double *pY, double *pZ) {
double A, B, C;
- A = colToDbl(color->c[0]);
- B = colToDbl(color->c[1]);
- C = colToDbl(color->c[2]);
- *pX = mat[0]*pow(A,gammaR)+mat[3]*pow(B,gammaG)+mat[6]*pow(C,gammaB);
- *pY = mat[1]*pow(A,gammaR)+mat[4]*pow(B,gammaG)+mat[7]*pow(C,gammaB);
- *pZ = mat[2]*pow(A,gammaR)+mat[5]*pow(B,gammaG)+mat[8]*pow(C,gammaB);
+ A = pow(colToDbl(color->c[0]), gammaR);
+ B = pow(colToDbl(color->c[1]), gammaG);
+ C = pow(colToDbl(color->c[2]), gammaB);
+ *pX = mat[0] * A + mat[3] * B + mat[6] * C;
+ *pY = mat[1] * A + mat[4] * B + mat[7] * C;
+ *pZ = mat[2] * A + mat[5] * B + mat[8] * C;
}
void GfxCalRGBColorSpace::getGray(GfxColor *color, GfxGray *gray) {
More information about the poppler
mailing list