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/page/cpdf_colorspace.h" | 7 #include "core/fpdfapi/page/cpdf_colorspace.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 return std::unique_ptr<CPDF_ColorSpace>( | 338 return std::unique_ptr<CPDF_ColorSpace>( |
339 ColorspaceFromName(pObj->GetString())); | 339 ColorspaceFromName(pObj->GetString())); |
340 } | 340 } |
341 if (CPDF_Stream* pStream = pObj->AsStream()) { | 341 if (CPDF_Stream* pStream = pObj->AsStream()) { |
342 CPDF_Dictionary* pDict = pStream->GetDict(); | 342 CPDF_Dictionary* pDict = pStream->GetDict(); |
343 if (!pDict) | 343 if (!pDict) |
344 return nullptr; | 344 return nullptr; |
345 | 345 |
346 for (const auto& it : *pDict) { | 346 for (const auto& it : *pDict) { |
347 std::unique_ptr<CPDF_ColorSpace> pRet; | 347 std::unique_ptr<CPDF_ColorSpace> pRet; |
348 CPDF_Object* pValue = it.second; | 348 CPDF_Object* pValue = it.second.get(); |
349 if (ToName(pValue)) | 349 if (ToName(pValue)) |
350 pRet.reset(ColorspaceFromName(pValue->GetString())); | 350 pRet.reset(ColorspaceFromName(pValue->GetString())); |
351 if (pRet) | 351 if (pRet) |
352 return pRet; | 352 return pRet; |
353 } | 353 } |
354 return nullptr; | 354 return nullptr; |
355 } | 355 } |
356 | 356 |
357 CPDF_Array* pArray = pObj->AsArray(); | 357 CPDF_Array* pArray = pObj->AsArray(); |
358 if (!pArray || pArray->IsEmpty()) | 358 if (!pArray || pArray->IsEmpty()) |
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 | 1268 |
1269 return m_pAltCS->GetRGB(results, R, G, B); | 1269 return m_pAltCS->GetRGB(results, R, G, B); |
1270 } | 1270 } |
1271 | 1271 |
1272 void CPDF_DeviceNCS::EnableStdConversion(bool bEnabled) { | 1272 void CPDF_DeviceNCS::EnableStdConversion(bool bEnabled) { |
1273 CPDF_ColorSpace::EnableStdConversion(bEnabled); | 1273 CPDF_ColorSpace::EnableStdConversion(bEnabled); |
1274 if (m_pAltCS) { | 1274 if (m_pAltCS) { |
1275 m_pAltCS->EnableStdConversion(bEnabled); | 1275 m_pAltCS->EnableStdConversion(bEnabled); |
1276 } | 1276 } |
1277 } | 1277 } |
OLD | NEW |