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 "render_int.h" | 7 #include "render_int.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1466 } else { | 1466 } else { |
1467 CFX_FixedBufGrow<uint8_t, 128> extracted_components(m_nComponents); | 1467 CFX_FixedBufGrow<uint8_t, 128> extracted_components(m_nComponents); |
1468 if (m_bpc % 8 != 0) { | 1468 if (m_bpc % 8 != 0) { |
1469 uint64_t src_bit_pos = bit_offset; | 1469 uint64_t src_bit_pos = bit_offset; |
1470 for (FX_DWORD j = 0; j < m_nComponents; ++j) { | 1470 for (FX_DWORD j = 0; j < m_nComponents; ++j) { |
1471 extracted_components[j] = static_cast<uint8_t>( | 1471 extracted_components[j] = static_cast<uint8_t>( |
1472 GetBits8(pSrcPixel, src_bit_pos, m_bpc) * unit_To8Bpc); | 1472 GetBits8(pSrcPixel, src_bit_pos, m_bpc) * unit_To8Bpc); |
1473 src_bit_pos += m_bpc; | 1473 src_bit_pos += m_bpc; |
1474 } | 1474 } |
1475 pSrcPixel = extracted_components; | 1475 pSrcPixel = extracted_components; |
| 1476 } else if (m_bpc == 16) { |
| 1477 for (FX_DWORD j = 0; j < m_nComponents; ++j) { |
| 1478 extracted_components[j] = pSrcPixel[j * 2]; |
| 1479 } |
| 1480 pSrcPixel = extracted_components; |
1476 } | 1481 } |
1477 | 1482 |
1478 if (m_pColorSpace) { | 1483 if (m_pColorSpace) { |
1479 uint8_t color[4]; | 1484 uint8_t color[4]; |
1480 const FX_BOOL bTransMask = TransMask(); | 1485 const FX_BOOL bTransMask = TransMask(); |
1481 if (m_bDefaultDecode) { | 1486 if (m_bDefaultDecode) { |
1482 m_pColorSpace->TranslateImageLine(color, pSrcPixel, 1, 0, 0, | 1487 m_pColorSpace->TranslateImageLine(color, pSrcPixel, 1, 0, 0, |
1483 bTransMask); | 1488 bTransMask); |
1484 } else { | 1489 } else { |
1485 for (FX_DWORD j = 0; j < m_nComponents; ++j) { | 1490 for (FX_DWORD j = 0; j < m_nComponents; ++j) { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1641 IFX_Pause* pPause) { | 1646 IFX_Pause* pPause) { |
1642 return LoadHandle->Continue(pPause); | 1647 return LoadHandle->Continue(pPause); |
1643 } | 1648 } |
1644 | 1649 |
1645 CPDF_ImageLoader::~CPDF_ImageLoader() { | 1650 CPDF_ImageLoader::~CPDF_ImageLoader() { |
1646 if (!m_bCached) { | 1651 if (!m_bCached) { |
1647 delete m_pBitmap; | 1652 delete m_pBitmap; |
1648 delete m_pMask; | 1653 delete m_pMask; |
1649 } | 1654 } |
1650 } | 1655 } |
OLD | NEW |