Ignore:
Timestamp:
Aug 27, 2010, 11:00:52 AM (11 years ago)
Author:
Silvan Scherrer
Message:

poppler update to 0.14.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/poppler/mypoppler/poppler/GfxState.cc

    r290 r461  
    673673  g = xyzrgb[1][0] * X + xyzrgb[1][1] * Y + xyzrgb[1][2] * Z;
    674674  b = xyzrgb[2][0] * X + xyzrgb[2][1] * Y + xyzrgb[2][2] * Z;
    675   rgb->r = dblToCol(pow(clip01(r * kr), 0.5));
    676   rgb->g = dblToCol(pow(clip01(g * kg), 0.5));
    677   rgb->b = dblToCol(pow(clip01(b * kb), 0.5));
    678   rgb->r = rgb->g = rgb->b = clip01(color->c[0]);
     675  rgb->r = dblToCol(sqrt(clip01(r * kr)));
     676  rgb->g = dblToCol(sqrt(clip01(g * kg)));
     677  rgb->b = dblToCol(sqrt(clip01(b * kb)));
    679678}
    680679
     
    910909  double A, B, C;
    911910
    912   A = colToDbl(color->c[0]);
    913   B = colToDbl(color->c[1]);
    914   C = colToDbl(color->c[2]);
    915   *pX = mat[0]*pow(A,gammaR)+mat[3]*pow(B,gammaG)+mat[6]*pow(C,gammaB);
    916   *pY = mat[1]*pow(A,gammaR)+mat[4]*pow(B,gammaG)+mat[7]*pow(C,gammaB);
    917   *pZ = mat[2]*pow(A,gammaR)+mat[5]*pow(B,gammaG)+mat[8]*pow(C,gammaB);
     911  A = pow(colToDbl(color->c[0]), gammaR);
     912  B = pow(colToDbl(color->c[1]), gammaG);
     913  C = pow(colToDbl(color->c[2]), gammaB);
     914  *pX = mat[0] * A + mat[3] * B + mat[6] * C;
     915  *pY = mat[1] * A + mat[4] * B + mat[7] * C;
     916  *pZ = mat[2] * A + mat[5] * B + mat[8] * C;
    918917}
    919918
     
    966965  g = xyzrgb[1][0] * X + xyzrgb[1][1] * Y + xyzrgb[1][2] * Z;
    967966  b = xyzrgb[2][0] * X + xyzrgb[2][1] * Y + xyzrgb[2][2] * Z;
    968   rgb->r = dblToCol(pow(clip01(r), 0.5));
    969   rgb->g = dblToCol(pow(clip01(g), 0.5));
    970   rgb->b = dblToCol(pow(clip01(b), 0.5));
     967  rgb->r = dblToCol(sqrt(clip01(r)));
     968  rgb->g = dblToCol(sqrt(clip01(g)));
     969  rgb->b = dblToCol(sqrt(clip01(b)));
    971970}
    972971
     
    12471246  g = xyzrgb[1][0] * X + xyzrgb[1][1] * Y + xyzrgb[1][2] * Z;
    12481247  b = xyzrgb[2][0] * X + xyzrgb[2][1] * Y + xyzrgb[2][2] * Z;
    1249   rgb->r = dblToCol(pow(clip01(r * kr), 0.5));
    1250   rgb->g = dblToCol(pow(clip01(g * kg), 0.5));
    1251   rgb->b = dblToCol(pow(clip01(b * kb), 0.5));
     1248  rgb->r = dblToCol(sqrt(clip01(r * kr)));
     1249  rgb->g = dblToCol(sqrt(clip01(g * kg)));
     1250  rgb->b = dblToCol(sqrt(clip01(b * kb)));
    12521251}
    12531252
     
    14661465  if (dict->lookup("Range", &obj2)->isArray() &&
    14671466      obj2.arrayGetLength() == 2 * nCompsA) {
     1467    Object obj4;
    14681468    for (i = 0; i < nCompsA; ++i) {
    14691469      obj2.arrayGet(2*i, &obj3);
    1470       cs->rangeMin[i] = obj3.getNum();
     1470      obj2.arrayGet(2*i+1, &obj4);
     1471      if (obj3.isNum() && obj4.isNum()) {
     1472        cs->rangeMin[i] = obj3.getNum();
     1473        cs->rangeMax[i] = obj4.getNum();
     1474      }
    14711475      obj3.free();
    1472       obj2.arrayGet(2*i+1, &obj3);
    1473       cs->rangeMax[i] = obj3.getNum();
    1474       obj3.free();
     1476      obj4.free();
    14751477    }
    14761478  }
     
    47814783void GfxState::setCTM(double a, double b, double c,
    47824784                      double d, double e, double f) {
    4783   int i;
    4784 
    47854785  ctm[0] = a;
    47864786  ctm[1] = b;
     
    47894789  ctm[4] = e;
    47904790  ctm[5] = f;
    4791 
    4792   // avoid FP exceptions on badly messed up PDF files
    4793   for (i = 0; i < 6; ++i) {
    4794     if (ctm[i] > 1e10) {
    4795       ctm[i] = 1e10;
    4796     } else if (ctm[i] < -1e10) {
    4797       ctm[i] = -1e10;
    4798     }
    4799   }
    48004791}
    48014792
     
    48064797  double c1 = ctm[2];
    48074798  double d1 = ctm[3];
    4808   int i;
    48094799
    48104800  ctm[0] = a * a1 + b * c1;
     
    48144804  ctm[4] = e * a1 + f * c1 + ctm[4];
    48154805  ctm[5] = e * b1 + f * d1 + ctm[5];
    4816 
    4817   // avoid FP exceptions on badly messed up PDF files
    4818   for (i = 0; i < 6; ++i) {
    4819     if (ctm[i] > 1e10) {
    4820       ctm[i] = 1e10;
    4821     } else if (ctm[i] < -1e10) {
    4822       ctm[i] = -1e10;
    4823     }
    4824   }
    48254806}
    48264807
Note: See TracChangeset for help on using the changeset viewer.