[poppler] Branch 'poppler-0.14' - poppler/GfxState.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Jun 21 11:25:31 PDT 2010


 poppler/GfxState.cc |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 34bed828d9165a6b21db9e00591c170d4700506e
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Jun 21 19:24:20 2010 +0100

    sqrt is much faster than pow 0.5

diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 61dac24..4f83e61 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -965,9 +965,9 @@ void GfxCalRGBColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
   r = xyzrgb[0][0] * X + xyzrgb[0][1] * Y + xyzrgb[0][2] * Z;
   g = xyzrgb[1][0] * X + xyzrgb[1][1] * Y + xyzrgb[1][2] * Z;
   b = xyzrgb[2][0] * X + xyzrgb[2][1] * Y + xyzrgb[2][2] * Z;
-  rgb->r = dblToCol(pow(clip01(r), 0.5));
-  rgb->g = dblToCol(pow(clip01(g), 0.5));
-  rgb->b = dblToCol(pow(clip01(b), 0.5));
+  rgb->r = dblToCol(sqrt(clip01(r)));
+  rgb->g = dblToCol(sqrt(clip01(g)));
+  rgb->b = dblToCol(sqrt(clip01(b)));
 }
 
 void GfxCalRGBColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {


More information about the poppler mailing list