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 "../../../include/fpdfapi/fpdf_page.h" | 7 #include "../../../include/fpdfapi/fpdf_page.h" |
8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
9 #include "../../../include/fxcodec/fx_codec.h" | 9 #include "../../../include/fxcodec/fx_codec.h" |
10 #include "pageint.h" | 10 #include "pageint.h" |
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 if (pvalue->m_pPattern && pvalue->m_pPattern->m_pDocument) { | 1355 if (pvalue->m_pPattern && pvalue->m_pPattern->m_pDocument) { |
1356 pvalue->m_pPattern = pvalue->m_pPattern->m_pDocument->GetPageData()-
>GetPattern(pvalue->m_pPattern->m_pPatternObj, FALSE, &pvalue->m_pPattern->m_Par
entMatrix); | 1356 pvalue->m_pPattern = pvalue->m_pPattern->m_pDocument->GetPageData()-
>GetPattern(pvalue->m_pPattern->m_pPatternObj, FALSE, &pvalue->m_pPattern->m_Par
entMatrix); |
1357 } | 1357 } |
1358 } | 1358 } |
1359 } | 1359 } |
1360 FX_BOOL CPDF_Color::GetRGB(int& R, int& G, int& B) const | 1360 FX_BOOL CPDF_Color::GetRGB(int& R, int& G, int& B) const |
1361 { | 1361 { |
1362 if (m_pCS == NULL || m_pBuffer == NULL) { | 1362 if (m_pCS == NULL || m_pBuffer == NULL) { |
1363 return FALSE; | 1363 return FALSE; |
1364 } | 1364 } |
1365 FX_FLOAT r, g, b; | 1365 FX_FLOAT r=0.0f, g=0.0f, b=0.0f; |
1366 if (!m_pCS->GetRGB(m_pBuffer, r, g, b)) { | 1366 if (!m_pCS->GetRGB(m_pBuffer, r, g, b)) { |
1367 return FALSE; | 1367 return FALSE; |
1368 } | 1368 } |
1369 R = (FX_INT32)(r * 255 + 0.5f); | 1369 R = (FX_INT32)(r * 255 + 0.5f); |
1370 G = (FX_INT32)(g * 255 + 0.5f); | 1370 G = (FX_INT32)(g * 255 + 0.5f); |
1371 B = (FX_INT32)(b * 255 + 0.5f); | 1371 B = (FX_INT32)(b * 255 + 0.5f); |
1372 return TRUE; | 1372 return TRUE; |
1373 } | 1373 } |
1374 CPDF_Pattern* CPDF_Color::GetPattern() const | 1374 CPDF_Pattern* CPDF_Color::GetPattern() const |
1375 { | 1375 { |
(...skipping 18 matching lines...) Expand all Loading... |
1394 PatternValue* pvalue = (PatternValue*)m_pBuffer; | 1394 PatternValue* pvalue = (PatternValue*)m_pBuffer; |
1395 return pvalue->m_nComps ? pvalue->m_Comps : NULL; | 1395 return pvalue->m_nComps ? pvalue->m_Comps : NULL; |
1396 } | 1396 } |
1397 FX_BOOL CPDF_Color::IsEqual(const CPDF_Color& other) const | 1397 FX_BOOL CPDF_Color::IsEqual(const CPDF_Color& other) const |
1398 { | 1398 { |
1399 if (m_pCS != other.m_pCS || m_pCS == NULL) { | 1399 if (m_pCS != other.m_pCS || m_pCS == NULL) { |
1400 return FALSE; | 1400 return FALSE; |
1401 } | 1401 } |
1402 return FXSYS_memcmp32(m_pBuffer, other.m_pBuffer, m_pCS->GetBufSize()) == 0; | 1402 return FXSYS_memcmp32(m_pBuffer, other.m_pBuffer, m_pCS->GetBufSize()) == 0; |
1403 } | 1403 } |
OLD | NEW |