OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/include/fxcodec/fx_codec.h" | 7 #include "core/include/fxcodec/fx_codec.h" |
8 #include "core/src/fxcodec/codec/codec_int.h" | 8 #include "core/src/fxcodec/codec/codec_int.h" |
9 #include "third_party/lcms2-2.6/include/lcms2.h" | 9 #include "third_party/lcms2-2.6/include/lcms2.h" |
10 | 10 |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 return NULL; | 417 return NULL; |
418 case Icc_PARAMTYPE_BUFFER: | 418 case Icc_PARAMTYPE_BUFFER: |
419 MD5ComputeID(pIccParam->pProfileData, pIccParam->dwProfileSize, ID); | 419 MD5ComputeID(pIccParam->pProfileData, pIccParam->dwProfileSize, ID); |
420 break; | 420 break; |
421 case Icc_PARAMTYPE_PARAM: | 421 case Icc_PARAMTYPE_PARAM: |
422 FXSYS_memset(ID, 0, 16); | 422 FXSYS_memset(ID, 0, 16); |
423 switch (pIccParam->ColorSpace) { | 423 switch (pIccParam->ColorSpace) { |
424 case IccCS_Gray: | 424 case IccCS_Gray: |
425 text.Format("%lf", pIccParam->Gamma); | 425 text.Format("%lf", pIccParam->Gamma); |
426 break; | 426 break; |
427 default:; | 427 default: |
| 428 break; |
428 } | 429 } |
429 MD5ComputeID(text.GetBuffer(0), text.GetLength(), ID); | 430 MD5ComputeID(text.GetBuffer(0), text.GetLength(), ID); |
430 break; | 431 break; |
431 default:; | 432 default: |
| 433 break; |
432 } | 434 } |
433 key.AppendBlock(ID, 16); | 435 key.AppendBlock(ID, 16); |
434 CFX_ByteString ProfileKey(key.GetBuffer(), key.GetSize()); | 436 CFX_ByteString ProfileKey(key.GetBuffer(), key.GetSize()); |
435 ASSERT(pTransformKey); | 437 ASSERT(pTransformKey); |
436 pTransformKey->AppendBlock(ProfileKey.GetBuffer(0), ProfileKey.GetLength()); | 438 pTransformKey->AppendBlock(ProfileKey.GetBuffer(0), ProfileKey.GetLength()); |
437 auto it = m_MapProfile.find(ProfileKey); | 439 auto it = m_MapProfile.find(ProfileKey); |
438 if (it == m_MapProfile.end()) { | 440 if (it == m_MapProfile.end()) { |
439 pCache = new CFX_IccProfileCache; | 441 pCache = new CFX_IccProfileCache; |
440 switch (pIccParam->dwProfileType) { | 442 switch (pIccParam->dwProfileType) { |
441 case Icc_PARAMTYPE_BUFFER: | 443 case Icc_PARAMTYPE_BUFFER: |
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1971 uint8_t c1 = FXSYS_round(c * 255); | 1973 uint8_t c1 = FXSYS_round(c * 255); |
1972 uint8_t m1 = FXSYS_round(m * 255); | 1974 uint8_t m1 = FXSYS_round(m * 255); |
1973 uint8_t y1 = FXSYS_round(y * 255); | 1975 uint8_t y1 = FXSYS_round(y * 255); |
1974 uint8_t k1 = FXSYS_round(k * 255); | 1976 uint8_t k1 = FXSYS_round(k * 255); |
1975 uint8_t r, g, b; | 1977 uint8_t r, g, b; |
1976 AdobeCMYK_to_sRGB1(c1, m1, y1, k1, r, g, b); | 1978 AdobeCMYK_to_sRGB1(c1, m1, y1, k1, r, g, b); |
1977 R = 1.0f * r / 255; | 1979 R = 1.0f * r / 255; |
1978 G = 1.0f * g / 255; | 1980 G = 1.0f * g / 255; |
1979 B = 1.0f * b / 255; | 1981 B = 1.0f * b / 255; |
1980 } | 1982 } |
OLD | NEW |