| 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/fxge/fx_ge.h" | 7 #include "../../../include/fxge/fx_ge.h" |
| 8 #include "../../../include/fxcodec/fx_codec.h" | 8 #include "../../../include/fxcodec/fx_codec.h" |
| 9 #include "../../../include/fpdfapi/fpdf_module.h" | 9 #include "../../../include/fpdfapi/fpdf_module.h" |
| 10 #include "../../../include/fpdfapi/fpdf_render.h" | 10 #include "../../../include/fpdfapi/fpdf_render.h" |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 if (m_bpc * m_nComponents == 1) { | 862 if (m_bpc * m_nComponents == 1) { |
| 863 if (m_bDefaultDecode && (m_Family == PDFCS_DEVICEGRAY || m_Family == PDF
CS_DEVICERGB)) { | 863 if (m_bDefaultDecode && (m_Family == PDFCS_DEVICEGRAY || m_Family == PDF
CS_DEVICERGB)) { |
| 864 return; | 864 return; |
| 865 } | 865 } |
| 866 if (m_pColorSpace->CountComponents() > 3) { | 866 if (m_pColorSpace->CountComponents() > 3) { |
| 867 return; | 867 return; |
| 868 } | 868 } |
| 869 FX_FLOAT color_values[3]; | 869 FX_FLOAT color_values[3]; |
| 870 color_values[0] = m_pCompData[0].m_DecodeMin; | 870 color_values[0] = m_pCompData[0].m_DecodeMin; |
| 871 color_values[1] = color_values[2] = color_values[0]; | 871 color_values[1] = color_values[2] = color_values[0]; |
| 872 FX_FLOAT R, G, B; | 872 FX_FLOAT R=0.0f, G=0.0f, B=0.0f; |
| 873 m_pColorSpace->GetRGB(color_values, R, G, B); | 873 m_pColorSpace->GetRGB(color_values, R, G, B); |
| 874 FX_ARGB argb0 = ArgbEncode(255, FXSYS_round(R * 255), FXSYS_round(G * 25
5), FXSYS_round(B * 255)); | 874 FX_ARGB argb0 = ArgbEncode(255, FXSYS_round(R * 255), FXSYS_round(G * 25
5), FXSYS_round(B * 255)); |
| 875 color_values[0] += m_pCompData[0].m_DecodeStep; | 875 color_values[0] += m_pCompData[0].m_DecodeStep; |
| 876 color_values[1] += m_pCompData[0].m_DecodeStep; | 876 color_values[1] += m_pCompData[0].m_DecodeStep; |
| 877 color_values[2] += m_pCompData[0].m_DecodeStep; | 877 color_values[2] += m_pCompData[0].m_DecodeStep; |
| 878 m_pColorSpace->GetRGB(color_values, R, G, B); | 878 m_pColorSpace->GetRGB(color_values, R, G, B); |
| 879 FX_ARGB argb1 = ArgbEncode(255, FXSYS_round(R * 255), FXSYS_round(G * 25
5), FXSYS_round(B * 255)); | 879 FX_ARGB argb1 = ArgbEncode(255, FXSYS_round(R * 255), FXSYS_round(G * 25
5), FXSYS_round(B * 255)); |
| 880 if (argb0 != 0xFF000000 || argb1 != 0xFFFFFFFF) { | 880 if (argb0 != 0xFF000000 || argb1 != 0xFFFFFFFF) { |
| 881 SetPaletteArgb(0, argb0); | 881 SetPaletteArgb(0, argb0); |
| 882 SetPaletteArgb(1, argb1); | 882 SetPaletteArgb(1, argb1); |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1507 if (!m_bCached) { | 1507 if (!m_bCached) { |
| 1508 if (m_pBitmap) { | 1508 if (m_pBitmap) { |
| 1509 delete m_pBitmap; | 1509 delete m_pBitmap; |
| 1510 m_pBitmap = NULL; | 1510 m_pBitmap = NULL; |
| 1511 } | 1511 } |
| 1512 if (m_pMask) { | 1512 if (m_pMask) { |
| 1513 delete m_pMask; | 1513 delete m_pMask; |
| 1514 } | 1514 } |
| 1515 } | 1515 } |
| 1516 } | 1516 } |
| OLD | NEW |