| 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 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1390 pSrcPixel = pSrcLine + (int)(src_x * orig_Not8Bpp); | 1390 pSrcPixel = pSrcLine + (int)(src_x * orig_Not8Bpp); |
| 1391 } | 1391 } |
| 1392 FX_LPBYTE pDestPixel = dest_scan + i * dest_Bpp; | 1392 FX_LPBYTE pDestPixel = dest_scan + i * dest_Bpp; |
| 1393 FX_ARGB argb; | 1393 FX_ARGB argb; |
| 1394 if (src_x == last_src_x) { | 1394 if (src_x == last_src_x) { |
| 1395 argb = last_argb; | 1395 argb = last_argb; |
| 1396 } else { | 1396 } else { |
| 1397 if (m_pColorSpace) { | 1397 if (m_pColorSpace) { |
| 1398 FX_BYTE color[4]; | 1398 FX_BYTE color[4]; |
| 1399 if (!m_bDefaultDecode) { | 1399 if (!m_bDefaultDecode) { |
| 1400 for (int i = 0; i < orig_Bpp; i ++) { | 1400 for (int i = 0; i < m_nComponents; i ++) { |
| 1401 int color_value = (int)((m_pCompData[i].m_DecodeMin
+ m_pCompData[i].m_DecodeStep * (FX_FLOAT)pSrcPixel[i]) * 255.0f + 0.5f); | 1401 int color_value = (int)((m_pCompData[i].m_DecodeMin
+ m_pCompData[i].m_DecodeStep * (FX_FLOAT)pSrcPixel[i]) * 255.0f + 0.5f); |
| 1402 temp[i] = color_value > 255 ? 255 : (color_value < 0
? 0 : color_value); | 1402 temp[i] = color_value > 255 ? 255 : (color_value < 0
? 0 : color_value); |
| 1403 } | 1403 } |
| 1404 m_pColorSpace->TranslateImageLine(color, temp, 1, 0, 0,
m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK
); | 1404 m_pColorSpace->TranslateImageLine(color, temp, 1, 0, 0,
m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK
); |
| 1405 } else { | 1405 } else { |
| 1406 if (bpc < 8) { | 1406 if (bpc < 8) { |
| 1407 int src_bit_pos = 0; | 1407 int src_bit_pos = 0; |
| 1408 if (src_x % 2) { | 1408 if (src_x % 2) { |
| 1409 src_bit_pos = 4; | 1409 src_bit_pos = 4; |
| 1410 } | 1410 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1555 if (!m_bCached) { | 1555 if (!m_bCached) { |
| 1556 if (m_pBitmap) { | 1556 if (m_pBitmap) { |
| 1557 delete m_pBitmap; | 1557 delete m_pBitmap; |
| 1558 m_pBitmap = NULL; | 1558 m_pBitmap = NULL; |
| 1559 } | 1559 } |
| 1560 if (m_pMask) { | 1560 if (m_pMask) { |
| 1561 delete m_pMask; | 1561 delete m_pMask; |
| 1562 } | 1562 } |
| 1563 } | 1563 } |
| 1564 } | 1564 } |
| OLD | NEW |