[poppler] Question about code

Albert Astals Cid aacid at kde.org
Tue Jun 22 13:19:04 PDT 2010


Hi Koji, in 
http://cgit.freedesktop.org/poppler/poppler/commit/?id=140b8ed97416f9c2ec02eb749ca45ca50bd651a8 
you added

+  X *= whiteX;
+  Y *= whiteY;
+  Z *= whiteZ;
+  // convert XYZ to RGB, including gamut mapping and gamma correction
+  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 * kr), 0.5));
+  rgb->g = dblToCol(pow(clip01(g * kg), 0.5));
+  rgb->b = dblToCol(pow(clip01(b * kb), 0.5));
+  rgb->r = rgb->g = rgb->b = clip01(color->c[0]);

to GfxCalGrayColorSpace::getRGB

I was having a look and it seems the
+  rgb->r = dblToCol(pow(clip01(r * kr), 0.5));
+  rgb->g = dblToCol(pow(clip01(g * kg), 0.5));
+  rgb->b = dblToCol(pow(clip01(b * kb), 0.5));
calls are not really needed since we overwrite the values with 
+  rgb->r = rgb->g = rgb->b = clip01(color->c[0]);
at the end, right?

Can i safely remove those lines or there is something i'm missing?

Thanks,
  Albert


More information about the poppler mailing list