| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/fpdfapi/fpdf_page/include/cpdf_colorspace.h" | 7 #include "core/fpdfapi/fpdf_page/include/cpdf_colorspace.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_page/pageint.h" | 9 #include "core/fpdfapi/fpdf_page/pageint.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 FX_BOOL CPDF_ICCBasedCS::GetRGB(FX_FLOAT* pBuf, | 856 FX_BOOL CPDF_ICCBasedCS::GetRGB(FX_FLOAT* pBuf, |
| 857 FX_FLOAT& R, | 857 FX_FLOAT& R, |
| 858 FX_FLOAT& G, | 858 FX_FLOAT& G, |
| 859 FX_FLOAT& B) const { | 859 FX_FLOAT& B) const { |
| 860 if (m_pProfile && m_pProfile->m_bsRGB) { | 860 if (m_pProfile && m_pProfile->m_bsRGB) { |
| 861 R = pBuf[0]; | 861 R = pBuf[0]; |
| 862 G = pBuf[1]; | 862 G = pBuf[1]; |
| 863 B = pBuf[2]; | 863 B = pBuf[2]; |
| 864 return TRUE; | 864 return TRUE; |
| 865 } | 865 } |
| 866 ICodec_IccModule* pIccModule = CPDF_ModuleMgr::Get()->GetIccModule(); | 866 CCodec_IccModule* pIccModule = CPDF_ModuleMgr::Get()->GetIccModule(); |
| 867 if (!m_pProfile->m_pTransform || !pIccModule) { | 867 if (!m_pProfile->m_pTransform || !pIccModule) { |
| 868 if (m_pAlterCS) { | 868 if (m_pAlterCS) |
| 869 return m_pAlterCS->GetRGB(pBuf, R, G, B); | 869 return m_pAlterCS->GetRGB(pBuf, R, G, B); |
| 870 } | 870 |
| 871 R = G = B = 0.0f; | 871 R = 0.0f; |
| 872 G = 0.0f; |
| 873 B = 0.0f; |
| 872 return TRUE; | 874 return TRUE; |
| 873 } | 875 } |
| 874 FX_FLOAT rgb[3]; | 876 FX_FLOAT rgb[3]; |
| 875 pIccModule->SetComponents(m_nComponents); | 877 pIccModule->SetComponents(m_nComponents); |
| 876 pIccModule->Translate(m_pProfile->m_pTransform, pBuf, rgb); | 878 pIccModule->Translate(m_pProfile->m_pTransform, pBuf, rgb); |
| 877 R = rgb[0]; | 879 R = rgb[0]; |
| 878 G = rgb[1]; | 880 G = rgb[1]; |
| 879 B = rgb[2]; | 881 B = rgb[2]; |
| 880 return TRUE; | 882 return TRUE; |
| 881 } | 883 } |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1244 } | 1246 } |
| 1245 return m_pAltCS->GetRGB(results, R, G, B); | 1247 return m_pAltCS->GetRGB(results, R, G, B); |
| 1246 } | 1248 } |
| 1247 | 1249 |
| 1248 void CPDF_DeviceNCS::EnableStdConversion(FX_BOOL bEnabled) { | 1250 void CPDF_DeviceNCS::EnableStdConversion(FX_BOOL bEnabled) { |
| 1249 CPDF_ColorSpace::EnableStdConversion(bEnabled); | 1251 CPDF_ColorSpace::EnableStdConversion(bEnabled); |
| 1250 if (m_pAltCS) { | 1252 if (m_pAltCS) { |
| 1251 m_pAltCS->EnableStdConversion(bEnabled); | 1253 m_pAltCS->EnableStdConversion(bEnabled); |
| 1252 } | 1254 } |
| 1253 } | 1255 } |
| OLD | NEW |